Skip to content

Remove the "last gid" hack from encoder implementation #108

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

Open
garretrieger opened this issue Mar 5, 2025 · 1 comment
Open

Remove the "last gid" hack from encoder implementation #108

garretrieger opened this issue Mar 5, 2025 · 1 comment

Comments

@garretrieger
Copy link
Contributor

Context: https://github.com/w3c/ift-encoder/blob/main/ift/encoder/encoder.cc#L219

When producing mixed encodings we need to ensure at each level of invalidating extension the loca/gvar/CFF/CFF2 offset arrays are large enough to accomadate any glyphs that may be added by any reachable glyph patches. This is currently handled using a crude hack of including the last gid of the original font in the initial subset (so that loca/gvar/CFF/CFF2 offset arrays are always at their maximum size).

As currently implemented this is sub optimal and will also conflict with producing a true desiccated font (#104). Instead at each level of invalidating extension we should determine what the maximum reachable glyph id is and ensure the loca/gvar/CFF/CFF2 offsets arrays are large enough to accomadate.

@garretrieger
Copy link
Contributor Author

This will also likely require some additional functionality to be added to harfbuzz: add a way to retain glyph ids greater than the maximum glyph in the subset definition.

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