Fix broken test fixtures: Bold instances missing weightClass#1963
Merged
anthrotype merged 1 commit intomainfrom Apr 16, 2026
Merged
Fix broken test fixtures: Bold instances missing weightClass#1963anthrotype merged 1 commit intomainfrom
anthrotype merged 1 commit intomainfrom
Conversation
Several test fixtures have Bold instances with `isBold = 1` but no
explicit `weightClass`. Without it, the heuristic in Instance::new
defaults the wght user-space value to 400 — same as Regular — so both
instances claim the same user coordinate. This makes the fonts
malformed: fontmake/glyphsLib produce degenerate output for them too
(e.g. wght axis collapses to min=max=400, Bold master effectively
discarded). fontc's `add_if_new` happened to mask the problem by
silently dropping the conflicting entry.
Add the correct weightClass to all affected Bold instances:
- WghtVar_Instances.glyphs (g2, g3, g2-pkg, g3-pkg)
- InstancePostscript.glyphs (g2, g3)
- InstanceNoPostscript.glyphs (g3)
Also fix IntermediateLayer.glyphs where "Tall Caps Black" had
interpolationWidth=700 (wght design) but weightClass=Black (wght
user=900), conflicting with "Black" which maps user=900→design=900.
glyphsLib overwrites the mapping to {900: 700}, breaking the axis.
Changed to interpolationWidth=900 for consistency.
cmyr
approved these changes
Apr 16, 2026
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.
Several test fixtures have Bold instances with
isBold = 1but no explicitweightClass. Without it, the heuristic inInstance::newdefaults the wght user-space value to 400 — same as Regular — so both instances claim the same user coordinate. However, when building these with fontmake/glyphsLib the fonts are malformed with the wght axis collapsing to min=max=400, and the Bold master effectively discarded.fontc's
add_if_newhappens to mask the problem by silently dropping the conflicting entry, but that's not how fontmake and glyphsLib do.I noticed this while working on a fix for #1866.
The fix I am working on (where I match glyphsLib's last-win overwrite semantics) surfaces these malformed test fonts, and I wanted to fix these separately to make the diff less noisy in the next PR.
To recap the changes:
Added the correct weightClass to all affected Bold instances in:
Also fixed IntermediateLayer.glyphs where "Tall Caps Black" had interpolationWidth=700 (wght design) but weightClass=Black (wght user=900), conflicting with "Black" which also maps user=900 -> design=900. glyphsLib would overwrite the mapping to {900: 700}, breaking the axis. Changed to interpolationWidth=900 for consistency.