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.

[designspaceLib] "Recursive" linkedUserValue valid?

See original GitHub issue

I noticed that Adobe seems to link upright and italic VFs “recursively”, i.e. on the Italic axis, the upright has linkedUserValue=“1”, and the italic has linkedUserValue=“0”. As seen in Source Code Variable:

Bildschirmfoto 2022-10-18 um 11 37 04

Such configuration can not be built with designspaceLib, it throws a RecursionError.

Should it be possible to build such fonts? Or is that kind of linking disallowed? The ital axis spec doesn’t say anything about linkedUserValue.

Reproducer: linkeduservalue.zip

Traceback (most recent call last):
  File "/Users/kuti/Code/variable-fonts/Test/test.py", line 12, in <module>
    names = getStatNames(ds, loc)
  File "/Users/kuti/Quellen/fonttools-github/Lib/fontTools/designspaceLib/statNames.py", line 126, in getStatNames
    regularStatNames = getStatNames(doc, regularUserLocation)
  File "/Users/kuti/Quellen/fonttools-github/Lib/fontTools/designspaceLib/statNames.py", line 126, in getStatNames
    regularStatNames = getStatNames(doc, regularUserLocation)
  File "/Users/kuti/Quellen/fonttools-github/Lib/fontTools/designspaceLib/statNames.py", line 126, in getStatNames
    regularStatNames = getStatNames(doc, regularUserLocation)
  [Previous line repeated 987 more times]
  File "/Users/kuti/Quellen/fonttools-github/Lib/fontTools/designspaceLib/statNames.py", line 66, in getStatNames
    defaultSource: Optional[SourceDescriptor] = doc.findDefault()
  File "/Users/kuti/Quellen/fonttools-github/Lib/fontTools/designspaceLib/__init__.py", line 2768, in findDefault
    print(sourceDescriptor)
  File "/Users/kuti/Quellen/fonttools-github/Lib/fontTools/designspaceLib/__init__.py", line 116, in __repr__
    attrs = indent('\n'.join(attrs), '    ')
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/textwrap.py", line 488, in indent
    return ''.join(prefixed_lines())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/textwrap.py", line 487, in prefixed_lines
    yield (prefix + line if predicate(line) else line)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/textwrap.py", line 483, in predicate
    return line.strip()
RecursionError: maximum recursion depth exceeded while calling a Python object

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jenskutilekcommented, Oct 18, 2022

Thanks! I think the problem is here:

https://github.com/fonttools/fonttools/blob/bc03f0932208c71ecb1bca40a348fdf0170f5abe/Lib/fontTools/designspaceLib/statNames.py#L200-L225

The comparison urpright_label.linkedUserValue == userLocation[axis.name] is true for both locations on the italic axis.

1reaction
belluzjcommented, Oct 18, 2022

Ah right, sorry I forgot about that issue. I’ll push a PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

[designspacelib] discrete axis, 2 fonts, how to set ... - GitHub
I'm struggling with a STAT issue and I want to solve it using ds5 and fontmake. It is a typeface with an interpolating...
Read more >
Generator for `ActionView::TestHelper` - Shopify/Tapioca - IssueHint
[designspaceLib] "Recursive" linkedUserValue valid? 9, 2022-10-18, 2022-11-13. 为什么使用ERNIE-SAT声音克隆,从中文生成的英文语音完全听不懂?
Read more >
FontTools fonttools Issues - Giters
Empty name entry generated if elidable="true" in Designspace v5 `label` element ... [designspaceLib] "Recursive" linkedUserValue valid?
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