Glyphs additions to AFDKO feature syntax

AFAIK, Glyphs 3 extends the feature syntax in some areas. Are these extensions documented somewhere? I’d like to see if I can make feaLib support (some of) them.

2 Likes

Yes, feature code extensions are documented in the Handbook.

You can have at look at the preview of the web handbook for the latest information. It’s layout is not quiet ready for prime time, but the information is up-to-date:

The extensions are described in the sections from Tokens until Multiple Substitution With Classes.

1 Like

@FlorianPircher On the index page, the word “ready” in the first line should be “read”.

Thanks!

in Font Info: Features: Multiple Substitution With Classes — Glyphs Handbook, the following syntax is not documented but seems to be supported:

sub @Symbol by @SymbolLeft a-glyph;

(a-glyph will be repeated for as many number of glyphs in the class)

This is also supported:

sub @Symbol by @SymbolLeft [a-glyph];

Treated the same as the code above, but I think it should be an error since if a class is given it ought to be of the same length. Especially since a class of any length other than 1 will cause an error if it does not match the length as the target class.

1 Like

You are right, there are still parts to be added before the official publication. I’ll report back when that has been done. And thank you for looking into this!

1 Like

One more thing that we need to add to the docs:

standalone lookup test {
	sub a by b;
};

sub a' lookup test x;

That standalone skips the lookup from the feature. So you can write the lookups that are used in chaining subs directly next to the lookup that uses it (inside the feature block).

2 Likes

I take that back, it seems consistent of how feature syntax handles the similar situation in single substitution.

I submitted a PR against AFDKO to document this syntax and implemented it in feaLib (PR 1 and PR 2 followup).