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.

Unable to add "linkedValue" with otlLib.builder buildStatTable()

See original GitHub issue

Scenario:

  • I have a variable font
  • I am adding a STAT table with this add-STAT.py script
  • My script includes this entry for the Regular weight: dict(nominalValue=400, rangeMinValue=350.00001, rangeMaxValue=450, name="Regular", flags=0x2, linkedValue=700)
  • When I use ttx -t STAT -o- "fontfamily.ttf" to view the result, there is most of the stat table, but the Regular entry has no <LinkedValue> entry
  • FontBakery is telling that 700 is an expected and missing linked value for Regular

I’ve triple-checked my syntax and spelling and I think I’m doing everything correctly, though of course I might be missing something.

I’m on FontTools version 4.37.1, though a test of the same process on 4.35.0 yields the same result (not surprising, as I think this function has been stable or awhile). I have also tested dropping the table (ttx -x), checking that is was gone, then re-running the script… and got the same result.

Could something be getting in the way of adding this value? Is FontBakery incorrect in saying that Regular should have a linkedValue of 700?

Thank you so much for any insights here!

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
anthrotypecommented, Sep 7, 2022

Ditto what Jany says. Maybe buildStatTable should raise an error explaining this when both a range and a linkedValue is requested.

2reactions
belluzjcommented, Sep 7, 2022

I think it’s because there is no STAT format for your Regular entry, that has both a range and a linked value, it’s either format 2 for the range or format 3 for the linkedValue.

There’s a little recap table in the designspace docs: https://fonttools.readthedocs.io/en/latest/designspaceLib/xml.html#label-element-axis

image

OT Spec: https://docs.microsoft.com/en-us/typography/opentype/spec/stat#axis-value-table-format-1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · fonttools/fonttools - GitHub
Contribute to fonttools/fonttools development by creating an account on GitHub. ... Unable to add "linkedValue" with otlLib.builder buildStatTable().
Read more >
Source code for fontTools.otlLib.builder - Read the Docs
otlLib.error import OpenTypeLibError from functools import reduce import logging import ... canAdd(glyphs): return None classdefbuilder.add(glyphs) return ...
Read more >
Diff - platform/external/fonttools - Google Git
Builder` class can add features to an existing +font file. ... otlLib.builder import buildStatTable + buildStatTable(self.font, axes, locations, ...
Read more >
Fonttools Fonttools Issues - IssueHint
Unable to add "linkedValue" with otlLib.builder buildStatTable(), open, 5, 2022-09-06, 2022-11-25. [COLRv1] Drop DeltaSetIndexMap when not needed, closed ...
Read more >
FontTools fonttools Issues - Giters
[ttLib] removeOverlaps pathops fails with glyphSet argument. Closed 18 days ago 4 ... Unable to add "linkedValue" with otlLib.builder buildStatTable().
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