question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[varLib instancer] should set up italic style linking as an option

See original GitHub issue

When slicing a VF with ital or slant axis, varLib instancer could set up proper italic style bits + italic angle + caret slope if italic != 0 and if slant != 0. For example with and additional argument like --is-italic followed by an integer for italic angle.

For example when running: fonttools varLib.instancer "../fonts/variable/Nunito[ital,wght].ttf" ital=1 wght=200:1000 -o "../fonts/variable/Nunito-Italic[wght].ttf"

Then we have to patch this kind of metadata:

for font_path in glob.glob("../fonts/variable/*Italic*.ttf"):
        with open(font_path, "rb") as f:
            print("Fix italic style linking in {}".format(font_path))
            ttFont = TTFont(f)
            ttFont["head"].macStyle = MacStyle.ITALIC
            ttFont["post"].italicAngle = -9
            ttFont["hhea"].caretSlopeRise = 1000
            ttFont["hhea"].caretSlopeRun = 158
            ttFont.save(font_path)

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:26 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
RosaWagnercommented, Nov 14, 2022

Is this documented anywhere, and is there a fontbakery check for it?

There are several links and conversation in this issue: https://github.com/googlefonts/gftools/issues/297. Our last testing about this is from this summer 2022, didn’t check if CC23 has fixed it yet. Fontbakery’s related issue is still opened.

1reaction
RosaWagnercommented, Jul 20, 2022

Hi, sorry I was on holidays.

The PR did fixed the style linking issue but I still see 2 things that would influence user experience:

  • italic angle is still 0
  • caretSlopeRise and caretSlopeRun are still 1 and 0 respectively. They can be calculated from the italic angle.
Read more comments on GitHub >

github_iconTop Results From Across the Web

[varLib.mutator] Does not mutate weight/width/italicAngle · Issue ...
[varLib.mutator] Does not mutate weight/width/italicAngle #1264 ... [varLib instancer] should set up italic style linking as an option #2613.
Read more >
instancer — fontTools Documentation - Read the Docs
The module exports an instantiateVariableFont function and CLI that allow to create full instances (i.e. static fonts) from variable fonts, as well as...
Read more >
What is expected of style linking for variable fonts?
In variable fonts, italics are most likely to be treated as a binary pairing, implemented in a separate font.
Read more >
Variable font naming for italic face (conflict with regular) - Glyphs
I have 2 variable font glyphs files for upright (regular) and italic that have the same family name, style linking and 9 export...
Read more >
python-fontbro - PyPI
friendly font operations on top of fontTools. ... pip install python-fontbro ... Creates a new Font instance reading the same binary file.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found