Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser correctly parses glyph classes in rules, but not single glyphs #8

Open
simoncozens opened this issue Jul 12, 2021 · 0 comments

Comments

@simoncozens
Copy link

Given:

@test = [ a b ];
@test2 = [ c d ];
feature rlig { sub @test by @test2; } rlig;
feature liga { sub f i by f_i; } liga;

parser_test responds:

NamedGlyphClass(
    NamedGlyphClass {
        name: GlyphClassName("@test"),
        glyph_class: GlyphClass(
            [
                Single(
                    GlyphRef(name = "a"),
                ),
                Single(
                    GlyphRef(name = "b"),
                ),
            ],
        ),
    },
)

NamedGlyphClass(
    NamedGlyphClass {
        name: GlyphClassName("@test2"),
        glyph_class: GlyphClass(
            [
                Single(
                    GlyphRef(name = "c"),
                ),
                Single(
                    GlyphRef(name = "d"),
                ),
            ],
        ),
    },
)

FeatureDefinition(
    FeatureDefinition {
        tag: FeatureTag("rlig"),
        statements: [
            Substitute(
                Single(
                    Single {
                        prefix: [],
                        glyph_class: GlyphClass(
                            [
                                ClassRef(
                                    GlyphClassName("@test"),
                                ),
                            ],
                        ),
                        suffix: [],
                        replacement: GlyphClass(
                            [
                                ClassRef(
                                    GlyphClassName("@test2"),
                                ),
                            ],
                        ),
                        force_chain: false,
                    },
                ),
            ),
        ],
    },
)

FeatureDefinition(
    FeatureDefinition {
        tag: FeatureTag("liga"),
        statements: [
            Substitute(
                Single(
                    Single {
                        prefix: [],
                        glyph_class: GlyphClass(
                            [],
                        ),
                        suffix: [],
                        replacement: GlyphClass(
                            [],
                        ),
                        force_chain: false,
                    },
                ),
            ),
        ],
    },
)

The rlig rule and the class definitions look good! The liga rule did not seem to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant