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

Dropping codepoint for a glyph already in ufo1 included by codepoint & excluded by name #28

Closed
RickyDaMa opened this issue Aug 21, 2024 · 0 comments

Comments

@RickyDaMa
Copy link
Contributor

RickyDaMa commented Aug 21, 2024

This looks really contrived, but I happened across it trying to implement exclude_glyphs for gftools' add-ds-subsets: googlefonts/gftools#1020. In the real world, the list of codepoints is typically far longer.

Reproducing snippet:

def test_repro(helpers):
    ufo1 = helpers.create_ufo(["A", "B"])
    b1 = ufo1["B"]
    b1.height = 100
    b1.unicodes = [0x42]

    ufo2 = helpers.create_ufo(["B", "C"])
    b2 = ufo2["B"]
    b2.height = 200
    b2.unicodes = [0x42]

    merge_ufos(
        ufo1,
        ufo2,
        exclude_glyphs=["B"],
        codepoints=[0x42],
    )

    assert "B" in ufo1
    assert ufo1["B"].height == 100
    assert ufo1["B"].unicode == 0x42  # fails

Expectation: /B retains its codepoint

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