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

[instancer, L4] unexpected weight jumps if VF default is repositioned, when VF contains partial/support/sparse sources #3139

Closed
arrowtype opened this issue May 29, 2023 · 4 comments · Fixed by #3140

Comments

@arrowtype
Copy link

arrowtype commented May 29, 2023

Level 4 of the Instancer is described as the following in the docs:

L4
moving the default location of an axis, by specifying (min,defalt,max) values:
font = instancer.instantiateVariableFont(varfont, {“wght”: (100, 300, 700)})

It seems to work very well for most fonts, but I’ve noticed what seems to a case in which it doesn’t quite work as expected.

In my project Name Sans, there are several sparse masters / support sources, for glyphs which need a little extra contrast control in lighter weights. Name Sans has a default source of 700 (Bold), plus full sources at wght=1 and wght=1000. It has sparse sources at weights 100, 200, 500, and 800. I would like to add a default of 400 to the desktop fonts, where it would help the fonts work more intuitively for users (and probably just generally better in some apps).

Setting this new default seems to work at first... but it has an unintended consequence: there is a weight "jump" at wght=200 in all glyphs that have a support at that location (G a e n b and quite a few more). There is also a very subtle jump at wght=460, in glyphs with a support at 500 (there are fewer, but it includes a e s w). I can’t see other jumps, so far.

Here’s a video showing before/after:

Screen.Recording.2023-05-29.at.5.42.48.PM.mov

I am using the instancer with this script: https://gist.github.com/arrowtype/9fefe9633cae500bbaf0000230f6a3ed

I’m using FontTools 4.39.4 to instance the font (and to build it, with FontMake).

Here are two variable fonts, one before the instancer, and one after. They have a limited/trial glyphset, so I can share them here, and folks are welcome to use them for testing purposes / inspecting internal font data:
namesans-variable-trial-fonttools_issue_3139.zip

I’m happy to send more sources, etc, if that might be helpful!

@behdad
Copy link
Member

behdad commented May 29, 2023

Oops! I'll take a look. Thanks.

@arrowtype
Copy link
Author

Well, as usual, I’m not sure whether it’s my error or something in FontTools. But, it seems to only happen after running the instancer, so I think it might be a bug? In any case, thank you so much for taking a look!

behdad added a commit that referenced this issue May 29, 2023
@behdad
Copy link
Member

behdad commented May 29, 2023

Fix in #3140
@arrowtype please test.

behdad added a commit that referenced this issue May 29, 2023
behdad added a commit that referenced this issue May 29, 2023
@arrowtype
Copy link
Author

Wow, you are blazing fast!

It seems to work perfectly in #3140. Here is a new before/after:

Screen.Recording.2023-05-29.at.9.07.37.PM.mov

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

Successfully merging a pull request may close this issue.

2 participants