92 Commits

Author SHA1 Message Date
Cosimo Lupo
6ea99e4569
feaLib/builder_test: use CapturingLogHandler instead of assertLogs 2019-06-11 13:14:47 +01:00
Khaled Hosny
41c7760be3 [feaLib] don’t write None in ast.ValueRecord.asFea()
The code tries to write the short format when some values as None, but
when writing the long format it would write any None value as is which
is invalid, use 0 for None values instead.
2019-05-03 00:53:09 +02:00
Cosimo Lupo
b1d055b133
Merge pull request #1539 from silnrsi/bugfix3
Compress type 1 GPOS tables better
2019-04-15 09:34:37 +01:00
Miguel Sousa
ddff29cb5d Fix DeprecationWarning: invalid escape sequence 2019-04-01 14:04:14 -07:00
Khaled Hosny
45861a15ca [feaLib] Reject invalid lookupflag without a value
Fixes https://github.com/fonttools/fonttools/issues/1538
2019-03-15 14:13:46 +02:00
Khaled Hosny
250eac4cae [feaLib] Correctly handle lookupflag 0 in asFea()
Part of https://github.com/fonttools/fonttools/issues/1538
2019-03-15 14:13:46 +02:00
Martin Hosken
27d8d1bda0 Update tests 2019-03-15 11:16:51 +07:00
justvanrossum
e22453c933 followup to #1531 2019-03-06 16:47:16 +01:00
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