Skip to content

Fix non-standard usWeightClass on interpolated instances (#57) - #78

Open
srijavuppala wants to merge 1 commit into
RedHatOfficial:masterfrom
srijavuppala:fix/instance-weightclass-axis-mapping
Open

Fix non-standard usWeightClass on interpolated instances (#57)#78
srijavuppala wants to merge 1 commit into
RedHatOfficial:masterfrom
srijavuppala:fix/instance-weightclass-axis-mapping

Conversation

@srijavuppala

Copy link
Copy Markdown

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 each A = B; entry as userspace A → design B, so 547 = 500 meant 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 into usWeightClass:

  • Display: Medium 596, SemiBold 707, Bold 799, ExtraBold 849
  • Text / Mono: Medium 565, SemiBold 632

Adobe groups a family by usWeightClass and 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:

  • Static usWeightClass is now 300/400/500/600/700/800/900 across Display, Text, and Mono.
  • Static glyf outlines and hmtx advance widths are byte-identical to the pre-fix build for every style (design coordinates are unchanged).
  • Variable fonts: glyf, gvar, hmtx, HVAR, MVAR are byte-identical; the only tables that change are avar (the mapping) and fvar (named-instance positions now land on 300/400/500/600/700/800/900). head differs 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.

…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>
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.

The weights for some glyphs are not correctly recognized in Photoshop versions 25 and higher.

1 participant