technically we are tweaking the original example from the spec but it keeps the spirit, so that the product of glyph classes produces the same representation in the font as if the sequences were manually enumerated (while keeping the declaration order)
If a variable scalar does not vary (i.e. all values are the same), we
can simplify it and use a simple value instead. Arguably users shouldn’t
be using variable scalar in this case, but it helps when the feature
code is auto generated so each feaLib users doesn’t have to do the
check done here themselves.
This is a GlyphsApp extension, (partially) documented [here][1], but it is a
useful one as it allows concise glyph insertion using decomposition
without having to maintain the list of glyphs in two places. E.g.
```fea
@upper = [A-Z];
lookup insert {
sub @upper by @upper connector;
} insert;
feature ccmp {
sub @upper' lookup insert x;
} ccmp;
```
As apposed to:
```fea
@upper = [A-Z];
lookup insert {
sub A by A connector;
sub B by B connector;
sub C by C connector;
sub D by D connector;
sub E by E connector;
sub F by F connector;
sub G by G connector;
sub H by H connector;
sub I by I connector;
sub J by J connector;
sub K by K connector;
sub L by L connector;
sub M by M connector;
sub N by N connector;
sub O by O connector;
sub P by P connector;
sub R by R connector;
sub S by S connector;
sub T by T connector;
sub U by U connector;
sub V by V connector;
sub W by W connector;
sub X by X connector;
sub Y by Y connector;
sub Z by Z connector;
} insert;
feature ccmp {
sub @upper' lookup insert x;
} ccmp;
```
1. http://handbook.glyphsapp.com/en/layout/multiple-substitution-with-classes/
Fixes https://github.com/fonttools/fonttools/issues/2949
- If there are no marked glyphs in an "ignore" statement, issue a
warning. The spec disallows this but makeotf allows it. It is most
likely a typo, so a warning is warranted.
- Mark the first glyph not all the glyphs, this matches makeotf.
- In asFea() always mark the input glyph.
- Udpate the tests.
In what I presume was error, this test case included a space on the line
immediately following the <ttFont> element; this space is not present in
any other ttx files.
For reasons that are unclear to me, and likely not worth investigating,
the presence (or absence) of this space does not influence the passing
or failure of this test case; however it *does* cause a failure in my
feature compiler, which is reusing this test suite, and so I would like
to fix it here, and simplify my own life somewhat.
This patch ensures that feaLib always produces a name table with entries
sorted in the order proscribed by the spec: platform id, encoding id,
language id, name id.
This breaks some tests, and so I have manually updated the test data to
match the new outputs.
This makes the directory to search for included files explicit.
Also use Python 3's FileNotFoundError to catch non-existant files instead of a workaround for Python 2.
This allows for more than one "lookup ..." chaining statements at each glyph position in a chaining contextual substitution or positioning rule: e.g.
sub a b c' lookup lookup1 lookup lookup2 d;
The corresponding change in the Adobe OpenType Feature File Specification (and implementation in makeotf) happened in adobe-type-tools/afdko#1132.
Support was added in db49f20d6b2629e1ba25c4afd3fb60817387f3d6, but there
was only a parser test and no builder test, fix the build and add a
builder test based on the existing parser one.
Fixes https://github.com/fonttools/fonttools/issues/1901
Setting script that is the same as current language system should make
no effect. This is not documented in the spec, but it is what makeotf
does. This as the effect of preserving lookupflag when set before such a
script statement.
Fixes https://github.com/fonttools/fonttools/issues/1824