Automatic Languagesystems to be smarter

I was writing OpenType code and wrote # for Javascript comment as comment (I was making coding ligatures in a monospaced font). Then this line was picked up by Languagesystems which added languagesystem comment dflt;. It means the algorithm merely looks for whatever mention of script and the following word. This is annoying, and could cause more errors in the future.

Experimenting further, I added a glyph named “script” to the font and used it in a feature code. The algorithm highlighted that glyph name and gave me a syntax error (happens with “language” too). It also generates a Languagesystem by the same logic as above. At this point, you can crash the app by editing the feature code in a certain way.

Could the logic be more sensitive to the actual OpenType syntax?

I’ll fix the first issue.
The second is kindof a limitation of the fea syntax. makeOTF has a problem with glyph names like “anchor”, too. But we should be able to fix that.

I just added the backslash-escaping mechanism as seen in the spec. Please check with the next update.

While the spec mentions glyph names only, in Glyphs this should work for all kinds of names, be it glyph names, lookup names etc., so you can have code like this:

lookup \mark {
} \mark;

sub \script' lookup \mark;

We’ll think about how not to rely on the backslash that much, but for now, please use that: it’s the low-level solution that should give you no ambiguity, and it’s also part of the spec, so it should work outside of Glyphs, too.