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

fix InfoCompiler overwriting the default master's codepage range bits #897

Merged
merged 5 commits into from
Feb 14, 2025

Conversation

anthrotype
Copy link
Member

When a designspace <variable-font> contains a public.fontInfo lib key with overrides for the default master's fontinfo.plist to be applied on the VF binary font, and this does not define explicit openTypeOS2CodePageRanges, the way the InfoCompiler works (as a sublcass of the BaseOutlineCompiler) means that the codepage range bits computed on its empty temporary TTFont (without any glyphs nor cmap) will overwrite the good codepage bits that were previously computed on the default master TTFont.

This PR will make sure that this doesn't happen. Also we can use the calcCodePageRanges function that is in fonttools now (added by @khaledhosny last year) instead of keeping our own duplicate in ufo2ft.util.

…less we have a 'cmap'

Fixes #897

The temp font in InfoCompiler doesn't have a 'cmap' table so, unless the
info dict defines explicit openTypeOS2CodePageRanges, the existing
ulCodePageRange1/2 won't be overwritten.
we now use the same copy in fonttools OS/2 table module
so not to break external code which might rely on the old function which we removed
@anthrotype
Copy link
Member Author

i'm going to merge this as i'm confident it's the right fix, but Khaled feel free to review later if you want

@anthrotype anthrotype merged commit 16ed156 into main Feb 14, 2025
9 checks passed
@anthrotype anthrotype deleted the fix-info-compiler-codepage-ranges branch February 14, 2025 16:32
@khaledhosny
Copy link
Collaborator

LGTM, thanks Cosimo.

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

Successfully merging this pull request may close these issues.

2 participants