18 Commits

Author SHA1 Message Date
Cosimo Lupo
241384ab21
[feaLib] allow to build from pre-parsed ast.FeatureFile object 2018-01-25 09:53:42 -08:00
Cosimo Lupo
803530b281
[feaLib] assert all requested tables are supported
better than just warn
2018-01-24 15:07:34 -08:00
Cosimo Lupo
b2da85cffd
[feaLib] add tables argument to only build some tables (e.g. GSUB)
`tables=None` by default will build all supported tables;
To build only some of these and ignore the others, one can pass a
subset of supported tables tags: .e.g. `tables={'GSUB'}` will only
build the GSUB, even if the feature file may contain e.g. GPOS
related features.
2018-01-24 15:07:34 -08:00
Cosimo Lupo
a4e1d4a2bf
[builder_test] test_pairPos_redefinition_warning 2018-01-15 18:45:42 +00:00
Cosimo Lupo
e8535f2280 [feaLib.parser] make Parser accept glyphNames iterable...
... instead of a glyphMap dict.

The parser does not actually need a reverse glyph order mapping as
it is not interested in knowing the glyphID from the glyph name,
but only whether a glyph is in the font or not.

This makes it easier for client code (e.g. ufo2ft feature compiler)
to use the feaLib Parser, without having to first construct and pass
it a glyphMap argument.
2017-11-16 13:46:27 +00:00
Adrien Tétar
3e3ff0051e builder: throw when a mark is defined in multiple mark classes
(within the same lookup)

See #453.
2017-05-01 13:14:38 +02:00
Sascha Brawer
bc0670f53f [feaLib] Simplify parser API by removing the ignore_comments option
https://github.com/fonttools/fonttools/pull/879#discussion_r104947968
https://github.com/fonttools/fonttools/issues/829
2017-03-09 22:17:58 +08:00
Martin Hosken
5906b5358a Final changes to follow vagueries 2017-03-08 16:54:11 +00:00
Martin Hosken
450d2b939e Add support for comments to parser 2017-03-08 13:50:06 +00:00
Sascha Brawer
dc7bf89648 [feaLib] Test compiling zero values for SinglePos in vertical context
https://github.com/fonttools/fonttools/issues/633
2017-02-17 14:19:54 +01:00
Sascha Brawer
45c266441e [feaLib] Add tests for zero values in contextual positioning
Specifically, contextual positioning statements with in-line single
positioning rules, in horizontal and in vertical contexts. For these
test cases, feaLib and makeotf produce the exact same output.

https://github.com/fonttools/fonttools/issues/633
2017-02-17 13:49:32 +01:00
Sascha Brawer
a2e7d96cf4 [feaLib] Merge SinglePos chain targets
Fixes https://github.com/fonttools/fonttools/issues/514.
2017-02-17 12:49:12 +01:00
Sascha Brawer
fa69c64466 [feaLib] Add test case for class-based pair kerning with zero values
https://github.com/fonttools/fonttools/issues/633
2017-02-16 17:38:47 +01:00
Sascha Brawer
7c67e4a63d [feaLib] Compile zero values to different formats based on context
If a zero value appears in a SinglePos statement, feaLib continues to
produce ValueRecords of format 0. But if a zero value appears in a
PairPos statement inside a horizontal compilation context, feaLib now
produces ValueRecords of format 4. Likewise, if a zero value appears
in a PairPos statement inside a vertical compilation context, feaLib
now produces ValueRecords of format 8.

The OpenType Feature Syntax specification is completely silent about this,
but the new behavior matches that of makeotf.

https://github.com/fonttools/fonttools/issues/633
2017-02-16 15:37:40 +01:00
Sascha Brawer
790c93d5cf [feaLib] Test compilation of zero values in SinglePos statements
In context of SinglePos, makeotf compiles zero values to value records
of format 0. feaLib already does the same, but it's good to have tests
to make sure that this doesn't accidentally change.

https://github.com/fonttools/fonttools/issues/633
2017-02-16 13:59:53 +01:00
Sascha Brawer
b31ed09421 Support glyph names with dashes
The OpenType Feature File Syntax has been changed to support dashes:
https://github.com/adobe-type-tools/afdko/issues/152

Resolves https://github.com/fonttools/fonttools/issues/559.
Needed for https://github.com/googlei18n/fontmake/issues/249.
2017-02-11 15:57:17 +01:00
Cosimo Lupo
3cdc800873
[Tests] rename all 'testdata' folders to simply 'data'
as it's now obvious what kind of data they are
2017-01-17 13:33:46 +00:00
Cosimo Lupo
78ad48eaf3
Move all *_test.py modules and test data to external Tests/ folder 2017-01-16 09:14:12 +00:00