Skip to content

Do not scale openTypeOS2WeightClass with other font info#5

Merged
ryanbugden merged 3 commits intoryanbugden:mainfrom
arrowtype:patch-1
Feb 13, 2026
Merged

Do not scale openTypeOS2WeightClass with other font info#5
ryanbugden merged 3 commits intoryanbugden:mainfrom
arrowtype:patch-1

Conversation

@arrowtype
Copy link
Copy Markdown
Contributor

@arrowtype arrowtype commented Feb 11, 2026

First, this extension is super nicely done – thank you, Ryan! So much is done so well, here. I love the option to scale by cap-height, etc.

This PR fixes one small glitch I’ve encountered: the current extension scales the openTypeOS2WeightClass, which it probably shouldn’t, as scaling a font shouldn’t affect its overall design.

Example: currently, a font with openTypeOS2WeightClass of 900, if scaled up from a UPM of 1000 to 4000, will get a new Weight Class value of 3600. This is out of spec, and will fail to build if run through FontMake, due to ufoLib2’s _validate_weight_class validator.

Todo:

  • I need to test this before declaring it definitely works. But, the code is simple enough, and I think it will. Okay, yeah, testing it, it seems to fix the problem.

@ryanbugden
Copy link
Copy Markdown
Owner

Good catch, thanks Stephen!

I'm now questioning the following. What do you think?

I think these work together to describe italic angle, correct? So we probably don't need to scale them.

openTypeHheaCaretSlopeRise
openTypeHheaCaretSlopeRun
openTypeVheaCaretSlopeRise
openTypeVheaCaretSlopeRun

Angle, not units

postscriptSlantAngle

Recommended pixels per em maybe shouldn't change as long as an em represents the same design.

openTypeHeadLowestRecPPEM

Probably don't want to scale hinting tolerances/thresholds by default. Could lead to unexpected results.

postscriptBlueFuzz
postscriptBlueShift

Any others we can ditch?

@arrowtype
Copy link
Copy Markdown
Contributor Author

Hey Ryan, thanks!

Good points on most of those – I think you’re right that anything to do with slant angles should remain untouched, along with the openTypeHeadLowestRecPPEM.

As for ps hinting, I think we should not scale Blue Scale, as that is tied to font sizes in use (and indeed, that is not currently in the list).

However, I believe we should scale Blue Fuzz and Blue Shift, because those are tied to the UPM granularity and internal font measurements.

If Blue Shift is set to 4 units to suppress “serif cups” at 1000UPM, then the font is scaled up 4x to 4000UPM, the Blue Shift now needs to be 20 units to suppress those same serif cup details.

If Blue Fuzz is set to 1 to give some wiggle room for snapping points to alignment zones, it should scale up with the UPM to preserve that relative wiggle room, as outlines scale.

https://glyphsapp.com/learn/hinting-postscript-autohinting

Looking at the list, I don’t see anything else needing changes.

@arrowtype
Copy link
Copy Markdown
Contributor Author

Okay @ryanbugden, I formatted the list for a bit more clarity, and then I removed items that I agree should be removed. See new commits for details.

Cheers!

@ryanbugden ryanbugden merged commit 800781d into ryanbugden:main Feb 13, 2026
@ryanbugden
Copy link
Copy Markdown
Owner

Amazing, thank you very much for this PR @arrowtype !

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