Fix variable font weight selection on Linux - #127
Open
teoulas wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wght=200) originOS/2.usWeightClassmatchesfvar's defaultFixes #120.
Background
The variable fonts use an ExtraLight master as their Variable Font Origin, so their
fvarweight default is 200. The exported TTFs instead reportedOS/2.usWeightClass=400.Fontconfig assumes that
usWeightClassdescribes the default variable instance. The mismatch causes it to expose ExtraLight as Regular and shift the remaining named weights, so applications such as Firefox select ExtraLight for CSS weights through 500.This change keeps the existing ExtraLight origin and sets the export weight class to 200, matching the approach already used by the Google Fonts build.
Verification
MonaSansVF[wdth,wght,opsz,ital].ttfon Arch Linux with Fontconfig 2.18.2fc-scansuccessfully on every variable TTFOS/2and the checksum-relatedheadtableI could not regenerate the fonts with Glyphs.app because it is macOS-only and requires a paid license. The checked-in TTFs were patched and tested directly; the corresponding
weightClass=200source setting should be confirmed during the maintainers' next Glyphs export.