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

[Glyphs3] support alternate layers #715

Open
RosaWagner opened this issue Sep 3, 2021 · 16 comments
Open

[Glyphs3] support alternate layers #715

RosaWagner opened this issue Sep 3, 2021 · 16 comments

Comments

@RosaWagner
Copy link

RosaWagner commented Sep 3, 2021

Font doesn't build if has alternate layers.

Easy to go back to format 2 using intermediate layers, but not for alternate ones.
I'll try to find a test case in Google Fonts and link it here.

@RosaWagner
Copy link
Author

RosaWagner commented Sep 6, 2021

Update: using this branch, I confirm it works with intermediate layers (build+interpolation). I can't confirm for alternate ones.

@RosaWagner RosaWagner changed the title [Glyphs3] support special layers [Glyphs3] support alternate layers Sep 13, 2021
@RosaWagner
Copy link
Author

Update: when using format 3 and this main branch of GlyphsLib, I confirm the font builds if it has alternate layers, but the interpolation of the said glyphs (with alternate layers) don't work.

@RosaWagner
Copy link
Author

This is a test case for @simoncozens.
Bold style should be a square (like when exporting with Glyphs), but with fontmake, it is still a circle.
alternate.zip

@simoncozens
Copy link
Collaborator

Thank you!

@RosaWagner
Copy link
Author

RosaWagner commented Jan 6, 2022

(It may be possible to have alternate layers on other axes than the first without too much trouble, but I deliberately want to do this in fairly small steps.) (#729)

My branch of Literata has sources with alternate layers for next step:

  • alternate layers for 2 axes
  • min or max value only on each axis

This is a minimal test-case:
alt-2axes-test.zip

A: no layers
B: alternate layers with location axis0: min, 120, axis1: min, 600
C: alternate layers with location axis0: 120, max, axis1: 600, max
D: alternate layers with location axis0: min, 120, axis1: 600, max

@simoncozens
Copy link
Collaborator

OK. Thanks for this; that's perfect for working on. Now I have to work on it...

@madig @belluzj, as you know, my interest is in using glyphsLib for font compilation, for which we don't need round-tripping between UFO and Glyphs. I am happy to provide a PR which implements multi-axis alternate layers for G3. I am not interested, at this stage, in making that round-trip from UFO to Glyphs; it isn't something I need, and things are going to be mind-bendingly complicated enough without having to worry about doing it all again backwards.

So: Do you need G3 alternate layer round-tripping? If so, are you prepared to implement it? Will you approve a PR which provides G3->UFO alternate layers but not the other way around?

(This is basically another symptom of #680.)

@anthrotype
Copy link
Member

I think it's fine if at least initially we only support these when glyphs -> UFO.

@madig
Copy link
Collaborator

madig commented Jan 14, 2022

Ok with me, we can add more support later.

@simoncozens
Copy link
Collaborator

simoncozens commented Jan 14, 2022

I have something which works for everything apart from D. The problem is that we split the bracket rules into separate buckets for forward and reverse rules, and D is a forward rule in parts and a reverse rule in parts. I think the solution is to get rid of the concept of "reverse brackets" - I guess that doing that would probably also help us be able to implement rules which have both a min and a max range - but I am not really sure whether knocking down that wall will make the whole building collapse.

Draft PR at #767.

@schriftgestalt
Copy link
Collaborator

I removed the backwards bracket layer rules in Glyphs 3. Too complicated. What I do now in cases where one would use a backwards bracket (]100]) in Glyphs 2, I add the rule to the master layer and have an empty rule in the alternate.

@emmamarichal
Copy link

Hello!

I have a file where some glyphs have three values in the alternate layer.
Capture d’écran 2022-04-22 à 11 34 31
Even if I simplify it and remove extreme values, this is not supported yet and the export did not work.

So I tried to find another solution, by adding alternate glyphs and make the substitution directly with the rvrn feature. But now I have this error message:

ufo/features.fea:4:1: Expected glyph class definition or statement: got NAME condition.

Adding a "name" block in the feature from Glyphs had no impact, but maybe I do something wrong, any idea?

Here is the test file:
Playfair test.zip

Thanks!

@vv-monsalve
Copy link

vv-monsalve commented Jan 31, 2023

An error is reported when building a font with Alternate layers.

Error reported: ValueError: Alternate rules on non-first axis not yet supported
Axis using the bracket layers: CRSV. (Originally was second axis, moved it to be the first one, but didn't work)
Command used: fontmake -g filename.glyphs -o variable

Alternate layers are used here to receive the Cursive shapes (two-stories a -> schoolbook a) instead rvrn and rlig since the Glyphs specific variable feature syntax is not supported yet #800

Test file (a and ã have the bracket applied):
Geo-bracket-test.glyphs.zip

@emmamarichal
Copy link

@vv-monsalve @simoncozens

I have it also:

raise ValueError("Alternate rules on non-first axis not yet supported")
ValueError: Alternate rules on non-first axis not yet supported

the weird thing is that I already managed to export once, the error only appeared recently

Files: https://github.com/emmamarichal/Playfair/tree/master/sources

I'll dig a bit more to see if I didn't do any mistakes

@schriftgestalt
Copy link
Collaborator

Glyphs 3 supports alternate rules for all axes. So this is a remnant from Glyphs 2 times.

@simoncozens
Copy link
Collaborator

ValueError: Alternate rules on non-first axis not yet supported

I fixed this in November. Problem is, the last glyphsLib release was in October.

@anthrotype
Copy link
Member

we shall make a new release soon (by end of this week)

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

No branches or pull requests

7 participants