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

[variations] Support multiple axes with same tag #1673

Closed
behdad opened this issue Apr 18, 2019 · 11 comments · Fixed by #3068
Closed

[variations] Support multiple axes with same tag #1673

behdad opened this issue Apr 18, 2019 · 11 comments · Fixed by #3068
Assignees

Comments

@behdad
Copy link
Member

behdad commented Apr 18, 2019

Currently doesn't work.

@behdad behdad self-assigned this Apr 18, 2019
@behdad
Copy link
Member Author

behdad commented Apr 18, 2019

Needs no API change though.

@jfkthame
Copy link
Collaborator

Do renderers actually support fonts having multiple axes with the same tag? I guess I've always assumed axis tags needed to be distinct, though now that you mention it, I don't know that the spec says anything about this.

@behdad
Copy link
Member Author

behdad commented Apr 18, 2019

Do renderers actually support fonts having multiple axes with the same tag? I guess I've always assumed axis tags needed to be distinct, though now that you mention it, I don't know that the spec says anything about this.

The geniuses that discovered this trick claim that it works in Firefox and Chrome. Which might mean just CoreText, or CoreText and FreeType. cc @drott @lemzwerg FYI. We should check FreeType.

But yeah, this would allow higher-order polynomial interpolations. I'm going to recommend that spec allow this as long as at most one axis per tag is non-HIDDEN.

@lemzwerg
Copy link
Contributor

Is there a sample font for this?

@behdad
Copy link
Member Author

behdad commented Apr 18, 2019

Is there a sample font for this?

I'll send you privately.

@justvanrossum
Copy link
Contributor

Fwiw, this is a nice write-up, and links to a test font: https://bungeman.github.io/hoi.html

@lemzwerg
Copy link
Contributor

Indeed, thanks! And the demo font seems to exhibit a problem with FreeType: If you test with ftmulti (from current git), there is a jump of the point glyph at 'Weight' value 450...

@justvanrossum
Copy link
Contributor

I also see the jump with FreeType 2.10.2.

@lemzwerg
Copy link
Contributor

It' an artifact of the font, I guess – if you manually enter value 450 into Samsa, you see exactly the same jump. @bungeman, can you have a look, please?

@bungeman
Copy link
Collaborator

Yes, the example font purposely has the 'bad' way to encode multiple curves into a single contour on the 'negative' side of the axes. In fact that's why it has that strange range on the negative side, so that the most viewers would actually hit the discontinuity (it's really easy to make a font which doesn't show the discontinuity in most viewers since the viewer may not be able to exactly hit the point).

That discontinuity is the motivation for the 'second attempt' which is demonstrated on the 'positive' side of the axes which doesn't have any discontinuity between curves on the contour. So yes, this jump is expected. Maybe should be more explicit about that in the 'example' text.

@lemzwerg
Copy link
Contributor

Thanks!

behdad added a commit that referenced this issue Jul 22, 2021
behdad added a commit that referenced this issue Jul 22, 2021
behdad added a commit that referenced this issue Jul 23, 2021
The axes in fvar are in arbitrary order, NOT sorted. Hence have to
lsearch all entries.

Fixes #1673
Fixes #2743

Test from https://github.com/ctrlcctrlv/FontForge-Higher-Order-Interpolation
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.

5 participants