Fix non-standard usWeightClass on interpolated instances (#57) - #78
Open
srijavuppala wants to merge 1 commit into
Open
Fix non-standard usWeightClass on interpolated instances (#57)#78srijavuppala wants to merge 1 commit into
srijavuppala wants to merge 1 commit into
Conversation
…ial#57) The 'Axis Mappings' custom parameter had its userspace/design pairs inverted. glyphsLib reads each 'A = B;' entry as userspace=A, design=B, so '547 = 500' meant userspace 547 -> design 500. Because the instances sit at design coordinates (Medium = 547) that are not mapping outputs, the build interpolated their userspace positions to non-standard values, which flowed into OS/2.usWeightClass: Display: Medium 596, SemiBold 707, Bold 799, ExtraBold 849 Text/Mono: Medium 565, SemiBold 632 Adobe apps group a family by usWeightClass and expect standard values (300/400/500/600/700/800/900), so the weights were not recognized correctly (issue RedHatOfficial#57). Swapping each pair to 'user = design' (e.g. '500 = 547') makes the named instances resolve to the intended userspace weights. Verified with a fontmake rebuild of all three families: - static usWeightClass now 300/400/500/600/700/800/900 - static glyf outlines and hmtx advance widths are byte-identical to the previous build (design coordinates unchanged) - variable fonts: glyf/gvar/hmtx/HVAR/MVAR byte-identical; only avar and the fvar named-instance positions change Fonts binaries should be regenerated from these sources on the next release build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Fixes #57 — the Medium/SemiBold/Bold/ExtraBold static instances ship with a non-standard
OS/2.usWeightClass, so Adobe apps (Photoshop 25+) don't recognize the weights.Root cause: the
"Axis Mappings"custom parameter has its userspace/design pairs inverted. glyphsLib reads eachA = B;entry as userspace A → design B, so547 = 500meant userspace 547 → design 500. Because the instances sit at design coordinates (e.g. Display Medium = 547) that aren't mapping outputs, the build interpolates their userspace position to non-standard values, which flow intousWeightClass:Adobe groups a family by
usWeightClassand expects standard values (300/400/500/600/700/800/900), so the weights aren't recognized correctly. (Details in my comment on #57.)Fix: swap each pair to
user = design(e.g.500 = 547) in all six sources, so the named instances resolve to the intended userspace weights. This does not move any instance in design space.Verification
Rebuilt all three families with fontmake (3.12.1 / fontTools 4.61.1) before and after the change:
usWeightClassis now 300/400/500/600/700/800/900 across Display, Text, and Mono.glyfoutlines andhmtxadvance widths are byte-identical to the pre-fix build for every style (design coordinates are unchanged).glyf,gvar,hmtx,HVAR,MVARare byte-identical; the only tables that change areavar(the mapping) andfvar(named-instance positions now land on 300/400/500/600/700/800/900).headdiffers only in the timestamp.So this corrects the userspace weight labeling with no change to any glyph outline.
This PR touches sources only; the font binaries should be regenerated from these sources on the next release build.