Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smith shortcircuit produces incorrect axis values #75

Open
jvgaultney opened this issue Aug 17, 2022 · 4 comments
Open

Smith shortcircuit produces incorrect axis values #75

jvgaultney opened this issue Aug 17, 2022 · 4 comments
Labels

Comments

@jvgaultney
Copy link
Contributor

Smith currently ‘shortcircuits’ the generation of fonts that have the same weight name as masters, but this skips the step where the axis mapping is applied. For example in Lisu Bosa the ExtraLight and Black weight values are incorrect. We've had to work around this but turning off shortcircuit (shortcircuit=false in the designspace), however that slows down builds.

The shortcircuit mechanism needs a redesign for axis-based fonts, as matching via weight name is no longer valid. Either the matching algorithm needs to be improved (effectively reducing the number of situations in which shortcircuit is applied), or shortcircuit needs to hack the shortcircuited fonts to fix the metadata.

@jvgaultney
Copy link
Contributor Author

A thorough way to test this would be to take a couple of our axis-based projects (Lisu Bosa, Namdhinggo) and build them with and without shortcircuit=False. Then compare and fix Smith as needed until the resulting fonts are identical in all metadata values.

@devosb
Copy link
Contributor

devosb commented Aug 17, 2022

Dai Banna SIL is another good project to test with. It requires shortcircuit = False, otherwise there are some issues

  • Italic bits in the font are not set for the Light style (but they are for other styles) in OS/2 fsSelection and head.
  • The Bold (and BoldItalic) instances have output weights, not input weights.

If shortcircuit = False is specified, all instances are created using psfcreateinstances. If the shortcircuit statement removed then the light (and italic) and bold (and italic) weights are not created using psfcreateinstances, they are created directly from the UFO masters using psfufo2ttf. I think this explains why the above two issues occur. So I think there is one issue in the hadling of italic for the light weights in psfufo2ttf for @DavidRaymond and another issue, as @jvgaultney mentioned for @mhosken with the shortcircuit logic for the bold style weight values.

Possibly there is no issue with psfufo2ttf since the shortcircuit logic is calling psfufo2ttf when it really should be calling psfcreateinstances. At one point, in addition to the issue with the italic bits, both light styles had name ID 17 set but not ID 16. I cannot reproduce the issue with the name IDs at this time.

The font manifest is not generated unless the shortcircuit statement removed.

@mhosken
Copy link
Contributor

mhosken commented Aug 19, 2022

Much of this has been fixed with sorting out axes. But it does expose a bug in psfufo2ttf (well in ufo2ft) whereby a style of Light Italic gets mapped to a font name of Light Italic and style Regular, rather than a font name of Light and style of Italic. Perhaps this can be fixed in the UFO?

@mhosken
Copy link
Contributor

mhosken commented Aug 19, 2022

I was able to get shortcircuit results to fit with non shortcircuit results by setting the familyName to SIL Dai Banna Light and styleName to Regular/Italic while leaving the openTypePreferredNames as they were.

Ugly but it works. Alternatively set shortcircuit=False for anything with Light in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants