184 Commits

Author SHA1 Message Date
Khaled Hosny
c82fb8fa13 [feaLib] Support Python < 3.5 in previous commits 2019-03-01 01:48:48 +02:00
Khaled Hosny
7d03e93e67 [feaLib] Make unsupported "subtable" a warning
AFDKO’s makeotf warns and ignores the statement, so do the same. I’m
abusing FeatureLibError() as a lazy way to keep reporting the location.
2019-03-01 01:48:48 +02:00
Khaled Hosny
226f5518b7 [feaLib] "subtable" in single substitutions 2019-03-01 01:48:48 +02:00
Khaled Hosny
d9893ab05a [feaLib] "subtable" in multiple substitutions 2019-03-01 01:48:48 +02:00
Khaled Hosny
c87e5cf4ad [feaLib] "subtable" in alternate lookups 2019-03-01 01:48:48 +02:00
Khaled Hosny
7454a3eb48 [feaLib] "subtable" in ligature lookups 2019-03-01 01:48:48 +02:00
Khaled Hosny
cc1b6baff7 [feaLib] "subtable" in contextual positioning 2019-03-01 01:48:48 +02:00
Khaled Hosny
47d30499a5 [feaLib] "subtable" in contextual substitution 2019-03-01 01:48:48 +02:00
Khaled Hosny
6bb0545655 [feaLib] Don’t hard-code "subtable" support
Allow for making more lookups support subtabe breaks. Although AFDKO’s
makeotf supports subtable breaks only in pair pos lookups, I believe
that is an implementation limit that we don’t have to follow; all
OpenType lookups has subtables and it should be possible to code that in
the feature files.
2019-03-01 01:48:48 +02:00
Khaled Hosny
1a0aec4c56 [feaLib] Add forceChain to MultipleSubstStatement
For consistency with other substitution statements.
2019-02-19 18:59:58 +02:00
punchcutter
da5b1500b9 Read special case of contextual positioning. 2019-02-12 12:35:34 -08:00
Khaled Hosny
c3f3606c59 [feaLib] Allow hyphen in glyph class names
Matches AFDKO’s makeotf behaviour.
2019-02-10 14:31:37 +02:00
Khaled Hosny
b68596cc80 [feaLib] Add an ast test for the previous commit 2019-02-05 13:10:33 +02:00
Khaled Hosny
354b89c068 [feaLib] Implement ValueRecord.asFea()
ValueRecord had a makeString() method that takes an optional “vertical”
argument, but no code outside the tests sets this argument. Renamed it
to asFea() and dropped the “vertical”, so that it consistent with the
rest of feaLib.ast classes.
2019-01-28 11:52:36 +02:00
Khaled Hosny
e974ea3871 [feaLib] Add tests for ValueRecordDefinition.asFea()
Currently fail as it calls ValueRecord.asFea() which is not implemented.
2019-01-28 11:52:36 +02:00
Khaled Hosny
f48f4cc6b4 [feaLib] Round-trip useExtension keyword 2019-01-27 12:16:35 +02:00
Cosimo Lupo
baf11f64f4
feaLib/builder_test: add test for #1459 2019-01-19 12:17:38 +00:00
Cosimo Lupo
091b05296d
[feaLib] distinguish missing value and explicit '<NULL>' for PairPos2 format A
Fixes #1459
2019-01-19 11:46:05 +00:00
Khaled Hosny
baf4f560bb [feaLib] Skip noop class PairPos subtables
If Coverage is None then the subtable is a noop that does nothing and
there is no point in building it. As a bonus, it makes OTS happy since
it will reject subtables where coverageOffset is NULL (0) and the spec
does not say whether this is allowed or not.
2018-09-16 12:23:34 +02:00
Cosimo Lupo
9536541aba
feaLib: demote warning about redefined kern pairs to debug message
https://github.com/fonttools/fonttools/issues/1147#issuecomment-421539956
2018-09-15 10:09:49 +02:00
Martin Hosken
fecf163d79 Revert spec4h2.fea 2018-09-07 15:46:29 +07:00
Martin Hosken
e048c3772c Revert comment changes to spec4h1.fea 2018-09-07 15:43:53 +07:00
Martin Hosken
59a4e934ee Get the fix we want 2018-09-07 15:37:33 +07:00
Martin Hosken
299ae2fb0b Fix tests 2018-08-17 11:51:05 +07:00
Cosimo Lupo
83f9156f8d
Merge pull request #1302 from moyogo/fix-subtable-break
Fix subtable break
2018-07-26 11:16:58 +01:00
Denis Moyogo Jacquerye
fdf96904b3 feaLib tests: update PairPos subtable tests
The subtable break is being forced after every pos, it shouldn’t.
2018-07-26 11:06:17 +01:00
Cosimo Lupo
68951b7c3d
feaLib: when name table not selected, skip building featureNames blocks
ufo2ft feature writer calls feaLib builder with tables=[GSUB] first, to run closure
over glyph substitutions; if the GSUB features contains 'featureNames' blocks, then
an AssertionError will be raised; in this case, we can simply skip building the
FeatureParams tables as we haven't build the name records they point to.
2018-07-26 10:51:37 +01:00
Cosimo Lupo
33084b74cf
Tests: add tests for 'subtable' breaks 2018-07-24 17:14:39 +01:00
Cosimo Lupo
d3229d5777
feaLib: ensure languagesystems using 'DFLT' script tag precede all others
https://github.com/fonttools/fonttools/pull/1292#issuecomment-407427544

this is to match makeotf's behavior

https://github.com/adobe-type-tools/afdko/pull/498/files#diff-17824930b3cdfb707ae56e1f42bccec6R2305
2018-07-24 16:17:23 +01:00
Martin Hosken
17de50c172 Add DFLT script languagesystem test 2018-07-09 20:11:57 +01:00
Martin Hosken
6d6b9c69d4 Fix tests 2018-07-09 17:02:48 +01:00
Martin Hosken
29d67a90c5 Update tests to not require removed assertion 2018-06-20 09:57:07 +01:00
Denis Moyogo Jacquerye
632192804f Add PairPosSubtable test 2018-06-15 11:10:49 +01:00
Cosimo Lupo
f0b73e3f0d
[lexer_test] fix macOS CI failues when tmpdir is a symlink
https://travis-ci.org/fonttools/fonttools/jobs/347725568#L364
2018-03-01 20:50:42 +00:00
Miguel Sousa
6ea8c184d9
[feaLib] Add test-fea2fea comments 2018-03-01 10:25:24 +00:00
Miguel Sousa
a7fcde030e
[feaLib] cvXX feature test 2018-03-01 10:25:23 +00:00
Miguel Sousa
a4c055c18a
[feaLib] Generalize FeatureNamesBlock 2018-03-01 10:22:09 +00:00
Cosimo Lupo
d98fe0f1be
[lexer_test] test absolute include, relative to cwd, and
featurefilepath=None
2018-02-28 19:40:36 +00:00
Cosimo Lupo
e5c0bdd5df
[feaLib.ast] make location=None by default
This would make it easier to construct feaLib AST from code,
where the location is not defined and thus should be None.
Also, we can make other arguments as kwargs with a default
value, now that the first parameter is no longer 'location'.
2018-02-27 19:00:08 +00:00
Cosimo Lupo
97375135c4
lexer_test: catch IncludedFeaNotFound explicitly 2018-02-21 18:02:55 +00:00
Cosimo Lupo
241384ab21
[feaLib] allow to build from pre-parsed ast.FeatureFile object 2018-01-25 09:53:42 -08:00
Cosimo Lupo
b1a67bd812
Merge pull request #1159 from anthrotype/feaLib-build-some-tables
[feaLib] add `tables` argument to only build some tables (e.g. GSUB)
2018-01-25 00:42:12 +01:00
Cosimo Lupo
596ad14526
Merge pull request #1157 from moyogo/feaLib-multiple_by_multiple_error
feaLib.parser: raise meaningful error for substitution of multiple glyphs by multiple glyphs
2018-01-25 00:09:07 +01: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
Denis Moyogo Jacquerye
94b51e7344 feaLib.parser: raise meaningful error for substitution of multiple glyphs by multiple glyphs 2018-01-24 11:40:07 +00:00
Jany Belluz
89979dea04 [feaLib.parser] Add option to not follow includes
Currently, the feature file parser always resolves included files,
parses their content and inserts it in the resulting AST. The original
`include` statement is lost.

This commit introduces an option to not follow inclusions. Instead, the
output AST will contain an `include` statement. This allows to process a
feature file on its own, and allows to round-trip it.

For example in glyphsLib, when going from a UFO to a .glyphs file, a
UFO feature file will be sliced up into Glyphs.app classes (e.g. a
GSFeaturePrefix with code `include(../family.fea);`) and when going back
from .glyphs to UFO, the feature file will be patched back together.
2018-01-23 11:07:16 +00:00
Jany Belluz
d6a5a489c0 [feaLib.parser] Parse a feature file with only comments 2018-01-22 17:07:28 +00:00
Cosimo Lupo
a4e1d4a2bf
[builder_test] test_pairPos_redefinition_warning 2018-01-15 18:45:42 +00:00
Khaled Hosny
5e23b0545b [feaLib] Test mixed single/multiple substitutions 2017-12-22 16:30:34 +02:00