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

.designspace axis with discrete values panics #836

Open
jenskutilek opened this issue May 30, 2024 · 5 comments
Open

.designspace axis with discrete values panics #836

jenskutilek opened this issue May 30, 2024 · 5 comments

Comments

@jenskutilek
Copy link

I have a designspace that contains an Italic axis with discrete values, as should be pretty common:

<axis tag="ital" name="Italic" default="0" values="0 1">
  <labels ordering="2">
    <label uservalue="0" name="Upright" elidable="true" linkeduservalue="1"/>
    <label uservalue="1" name="Italic"/>
  </labels>
</axis>

Result:

fontc --keep-direction MyVar.designspace
thread 'main' panicked at ufo2fontir/src/toir.rs:117:43:
called `Option::unwrap()` on a `None` value

It seems that the code doesn't work when an axis doesn't have the minimum and maximum attributes, even though they are not required for a discrete axis.

@anthrotype
Copy link
Member

anthrotype commented May 30, 2024

fontc currently does not support discrete axes or any of the features introduced with designspace version 5, it expects that there is a 1:1 correspondence between a single input .designspace file and one output VF. With discrete axes there can be 1:N.
We are prioritizing stuff that is actually being used in the GF collection and didn't find much evidence of discrete axes and other DSv5 features. However we do plan to add support for them, it's being tracked here #837

@anthrotype
Copy link
Member

anthrotype commented May 30, 2024

I think fonttools designspaceLib can split that DSv5 into individual DSv4-compatible designspaces, I suggest you try doing that for the time being, until we implement full support for this in fontc.

https://github.com/fonttools/fonttools/blob/4193aeaa266c2675f1c3c0dda477e0697c990ec9/Lib/fontTools/designspaceLib/split.py#L158-L172

@jenskutilek
Copy link
Author

Thanks for your explanation. I couldn't find any specific info about which DS version is supported, so I assumed v5 would be fine. But it's true that you won't get to see any v5 designspace in a workflow starting from Glyphs files.

@anthrotype
Copy link
Member

it's true that you won't get to see any v5 designspace in a workflow starting from Glyphs files.

actually if you use multiple Variable Font export settings (in the old instances tab of font info), then glyphsLib will add multiple <variable-font> elements to the exported DS which is also a v5 only feature, the ability to produce multiple VFs from a single DS source file

@jenskutilek
Copy link
Author

Interesting, didn't know that

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

No branches or pull requests

2 participants