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
Support TrueType hinting, 4th try #654
Conversation
# Conflicts: # Lib/ufo2ft/constants.py
This reverts commit ae0800a.
@anthrotype What do you recommend for InstructionCompiler in the end? Mixin, functions, merge into OutlineTTFCompiler? |
# Conflicts: # Lib/ufo2ft/constants.py
Thank you @anthrotype! I will check take a look as soon as possible, hopefully this afternoon. Yes, it does support variable fonts. In my usage scenario, all master UFOs contain identical fpgm, prep, and glyf programs. The cvts are usually different in each master, of course. fontTools.varLib will build a cvar from the different cvts, and copy the fpgm, prep and glyf programs when that's the case. It should also be enough if the default master contains the fpgm, prep, and glyf programs, but I need to check again. |
I see, thanks for confirming. If we don't have one already, we should add a test that compiles a VF with hinting and confirms that varLib generates the cvar deltas |
Confirmed. I've run the latest version on a couple of fonts, and the resulting fonts are identical. Haven't looked at the code yet. |
c.flags &= ~USE_MY_METRICS | ||
else: | ||
c.flags &= ~USE_MY_METRICS | ||
lib_contains_use_my_metrics_key |= TRUETYPE_METRICS_KEY in component_lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib_contains_use_my_metrics_key |= TRUETYPE_METRICS_KEY in component_lib | |
if TRUETYPE_METRICS_KEY in component_lib: | |
lib_contains_use_my_metrics_key = True |
I realize this is equivalent, but I had to stop and think when I saw this line 😬
Co-authored-by: Nikolaus Waxweiler <nikolaus.waxweiler@daltonmaag.com>
It's tested in fontTools.varLib when building from TTF masters (fonttools/fonttools#1069). Or do you mean we should a test here for building from UFO? |
@anthrotype I've had a look at your changes. LGTM. |
yeah we could/should add a test here as well as a sort of integration test for variable+hinted builds |
I've added TrueType data to the integration test. I stumbled over fonttools/fonttools#3036 while preparing the expected ttx data, but I fixed it for now by converting the input to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Sorry it took me so long to get this in. Many thanks to @jenskutilek for not giving up :)
Continued from #577