1736 Commits

Author SHA1 Message Date
Cosimo Lupo
2eb59f163f [Tests] add tests for unicodedata.script function 2017-11-17 19:21:45 +00:00
Cosimo Lupo
fdab63f0b6 [feaLib.ast] add __str__ to all AST elements
which calls the asFea() method,
so one can e.g. print(doc.statements[0])
2017-11-16 15:40:52 +00:00
Cosimo Lupo
99aa8b0c66 [feaLib.parser] keep supporting (deprecated) glyphMap argument
so we don't break backward compatibility if user code has Parser(path, glyphMap=...)
2017-11-16 14:25:43 +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
Miguel Sousa
62df8ba108 [varLib_test] update expected results
The STAT table is now beginning to be generated after
8af430997d
2017-11-13 23:33:55 -08:00
Cosimo Lupo
bb60cc4e2b
Merge pull request #1097 from anthrotype/py23-redirect-stream
[py23] Add backports for redirect_stdout/stderr context managers
2017-11-07 12:35:49 +00:00
Cosimo Lupo
d3251241be [py23] Add backports for redirect_stdout/stderr context managers 2017-11-07 11:54:28 +00:00
Cosimo Lupo
f100754ffb
Merge pull request #1093 from silnrsi/graphite
Fix small graphite round trip bugs
2017-11-07 09:53:36 +00:00
Cosimo Lupo
d91faeaf1a
Merge pull request #1091 from readroberts/master
[CFF2] Fixes for writing PrivateDict BlueValues and Subrs to XML.
2017-11-06 10:13:57 +00:00
Cosimo Lupo
34f06f41a9
Merge pull request #1094 from anthrotype/apple-kern
fix compilation of AAT kern tables
2017-11-04 16:41:53 +00:00
Cosimo Lupo
a12bfa160a [_k_e_r_n_test] test toXML/fromXML for unknown formats 2017-11-04 12:02:57 +00:00
Cosimo Lupo
d715575794 [_k_e_r_n] fix order of format/coverage bytes
In OT kern subtable header, the format is the high byte of 'coverage'
bit mask (bits 8-15), and the low byte (bits 0-7) is the actual coverage
bits.

In AAT kern, it's the opposite: the coverage flags are the high byte,
whereas the subtable format is the low byte.

Also adjusted the test data, and set coverage to 1 for OT kern subtable
(which means the usual horizontal kerning).
2017-11-04 10:56:07 +00:00
Cosimo Lupo
5d16828031 fixup
had removed that fixture and squashed.. should have re-run the test
before pushing :-/
2017-11-03 20:07:09 +00:00
Cosimo Lupo
a2a4f45ef2 [_k_e_r_n_test] decompile/compile tests for unknown formats 2017-11-03 20:00:04 +00:00
Martin Hosken
4a009d1eea Fix tests 2017-11-04 00:34:47 +07:00
Cosimo Lupo
5f2177a990 [_k_e_r_n_test] Add tests for OT and AAT kern format 0 subtable 2017-11-03 16:08:37 +00:00
justvanrossum
4e8295920a return None if no unicode cmap subtables were found 2017-11-03 16:19:48 +01:00
justvanrossum
113f9cc498 add (0, 4) to default cmaps to search for; add getBestCmap() to TTFont as well; added test for the latter 2017-11-03 16:01:45 +01:00
justvanrossum
baf2fbf87d added tests for cmap.getBestCmap() 2017-11-03 15:10:06 +01:00
ReadRoberts
212168f192 [CFF2] Update the test file C_F_F__2.ttx to match the change in the CFF2 output for XML 2017-11-02 12:09:04 -07:00
Cosimo Lupo
240ef765a8 [_k_e_r_n_test] rewrite as pytest-style; fix indentation 2017-11-02 10:37:56 +00:00
Sascha Brawer
d54f14e0a2 [morx] Cosmetic renaming of ligAction to action
Beyond composing ligatures, AAT finite-state transducers can also
execute insertion actions without rewriting existing glyphs. The
corresponding actions have almost the same structure as ligature
actions, so we can share a lot of the plumbing within fonttools.

This renaming is in preparation of a larger change to support `morx`
ables with insertions.
2017-10-31 16:25:41 +01:00
Sascha Brawer
5f03a64a57 [morx] Implement InsertionMorphAction 2017-10-31 14:34:12 +01:00
Sascha Brawer
17e627e366 [morx] Add test case for unrecognized lookup types 2017-10-31 12:50:46 +01:00
Sascha Brawer
a0b9854ef0 [morx] Emit more meaningful subtable flags
Before this change, we were emitting XML with numeric values for `morx`
coverage flags. Now, we emit XML that makes more sense to human readers.
XML files from previous versions of fonttools can still be parsed.
2017-10-31 12:50:46 +01:00
Khaled Hosny
534326bd1d [feaLib] Fix writing back nested glyph classes
Before this change, the following glyph class:

  @Vowels = [@Vowels.lc @Vowels.uc y Y];

Would be written back as:

  @Vowels = [@Vowels.lc = [a e i o u]; @Vowels.uc = [A E I O U]; y Y];

Which is clearly invalid. It seems for GlyphClass.asFea() to work
correctly here we should be using GlyphClassName not GlyphClass
for the nested classes (similar to the code at the beginning of
parse_glyphclass_()).
2017-10-27 23:27:07 +03:00
Cosimo Lupo
26a2616286 [varLib_test] upldate expected results
We pass the fvar axis order to VariationModel after
645b7a8355
2017-10-26 11:25:06 +01:00
Behdad Esfahbod
3fbc4688eb [varLib.mutator] Drop GDEF is nothing left in it
Part of fixing https://github.com/fonttools/fonttools/pull/1079#issuecomment-338710803
2017-10-25 11:58:44 -04:00
Sascha Brawer
1ac4a020ec [morx] Handle morx ligature substitution rules 2017-10-25 15:35:56 +02:00
Sascha Brawer
b6317ce60a [morx] Handle the ligature list components sub-table 2017-10-25 15:35:56 +02:00
Sascha Brawer
d7d94d7b02 [morx] Fix broken unit tests for morx subtables 2017-10-25 15:35:56 +02:00
Sascha Brawer
86454e79de [morx] Compile ligature actions subtable for AAT ligatures
Tests fail because other subtables still need to be implemented.
2017-10-25 15:35:56 +02:00
Sascha Brawer
04f01f245b [morx] Use the same value for testing as in specification comments
The hexdump in the specification is wrong, but the correct value
is in the comments. Before this change, the finite-state transducer
in our test data could be decompiled but would not implement the
behavior explained in the AAT specification.
2017-10-25 15:35:56 +02:00
Sascha Brawer
d373808341 [AAT] Decode the morx ligature actions table 2017-10-25 15:35:56 +02:00
Sascha Brawer
a7ddb0b609 [AAT] Decode morx tables with ligature substitutions
Only handling those parts that are shared with other substitution types.
The actualy ligature actions are not implemented yet.
2017-10-25 15:35:56 +02:00
Cosimo Lupo
faedfacbae [reverseContourPen_test] fix expected result for ReverseContourPointPen
This test is not normally run. It is skipped when ufoLib is not importable,
as it's the case from the test runner's virtual environment.

The only reason it exists is so that I could check that the
ReverseContourPen I was writing behaves the same as using ufoLib's
ReverseContourPointPen when the latter is run through the
SegmentToPointPen and PointToSegmentPen converters.

The two methods for reversing contours now diverge since
https://github.com/fonttools/fonttools/pull/1080,
but only nominally because both produce effectively the same results.
The only difference is that, when using the point pens with
outputImpliedClosingLine=True, the closing lineTo is always there even
when it's redundant. In our implmentation, we only output the closing
lineTo when it is the same as moveTo (this was necessary in order to
fix https://github.com/googlei18n/cu2qu/issues/51)
Nevertheless, the total number of points is the same in both cases.

Maybe this test should not be here, as it's testing functionalities
from a different package.

Closes https://github.com/fonttools/fonttools/issues/1081
2017-10-25 11:18:35 +01:00
Cosimo Lupo
1ef034c385 use outputImpliedClosingLine=True with ReverseContourPointPen
One way to work around https://github.com/googlei18n/cu2qu/issues/51
when using the ufoLib's ReverseConturPointPen via the converter pens
would be to pass the outputImpliedClosingLine=True argument
(False by default) to the PointToSegmentPen.

This way, all the final lineTos are explicitly outputted, even when
they are redundant and could be implied (i.e. when they are not
duplicate points).

Note that this test is skipped by the CI, because ufoLib is not a
dependency of fonttools; you can run locally if you wish.
2017-10-24 19:20:44 +01:00
Cosimo Lupo
0a22639ed3 [reverseContourPen_test] add test case from cu2qu#51
https://github.com/googlei18n/cu2qu/issues/51#issue-179370514a
2017-10-24 19:04:38 +01:00
Cosimo Lupo
d316ebebbb [reverseContourPen_test] keep duplicate point in expected result 2017-10-24 18:14:22 +01:00
Jens Kutilek
eb3e4e56c9 Update comments in gvar test data 2017-10-22 17:56:12 -04:00
Jens Kutilek
3245553abc Fixing one test at a time ... 2017-10-22 17:56:12 -04:00
Jens Kutilek
8a4619788d Adapt test data 2017-10-22 17:56:12 -04:00
Jens Kutilek
35febd302e Fix some more compile calls 2017-10-22 17:56:12 -04:00
Cosimo Lupo
5de673c424 [Tests] adjust GDEF expected data 2017-10-20 20:13:14 -04:00
Behdad Esfahbod
5fabd3eb32 [varLib] Fix build expectation after MVAR support in mutator
Looks right to me...
2017-10-20 20:13:14 -04:00
Cosimo Lupo
b4f0986d2e Merge pull request #1071 from anthrotype/reverse-pen
add ReverseContourPen
2017-10-12 12:03:01 +01:00
Jens Kutilek
a25a401fd2 Merging TT hinting (#1069)
Merge cvts; copy fpgm, prep, glyf programs from base master if compatible.
2017-10-12 10:40:40 +02:00
Cosimo Lupo
3bbba21f1f [reverseContourPen_test] unit tests for ReverseContourPen
For comparison, I also include tests for the ufoLib pen.
They are skipped if ufoLib is not importable.
2017-10-11 21:13:23 +01:00
Jens Kutilek
55cda3901c Only emit a cvar tuple if any delta is not zero. 2017-10-09 17:30:27 +02:00
Jens Kutilek
f7c4995413 Set correct expected control value 2017-10-09 13:22:33 +02:00