304 Commits

Author SHA1 Message Date
Cosimo Lupo
bbcb3776ac [Tests/subset] adjust expected test results 2017-11-27 19:37:56 +00:00
Jens Kutilek
e51293f3f0
Merge pull request #1113 from fonttools/varlib-sharedpoints-fix-test
Don't share points in cvar by default
2017-11-27 18:01:48 +01:00
justvanrossum
74faedf848 completed a comment 2017-11-24 20:02:47 +01:00
justvanrossum
6ee901cc81 added some simple tests for afmLib 2017-11-24 19:59:27 +01:00
Jens Kutilek
cb6676f93e Don't share points in cvar by default (fails in Chrome), adjust tests to test both shared and private points in cvar 2017-11-24 19:06:36 +01:00
Cosimo Lupo
bd030f61c6 more whitespace 2017-11-23 19:05:05 +01:00
Cosimo Lupo
f2a8c787b1 minor whitespace 2017-11-23 18:39:11 +01:00
Cosimo Lupo
17b89d9dde
Merge pull request #1035 from bamidei/split_g_l_y_f_to_one_per_file
Add ability to split glyphs to 1 glyph per ttx file.  Issue #153
2017-11-23 18:30:54 +01:00
Bill Amidei
818a4a2d1e Review comment update: Updated white-space and removed unused test data 2017-11-23 07:51:05 -08:00
Bill Amidei
de94613e08 Updates based upon review feedback for glyf to individual files; include table name in contentOnly file; Remove unnecessary parameters from toXML - leaving only the splitGlyphs optional additional parameter 2017-11-23 07:17:35 -08:00
Cosimo Lupo
99ea0a3986 [unicodedata] add script_code func and 'default' fallback arg
`script_code` does the reverse of `script_name`: it takes a long
script name and returns a 4-letter script code.

Both `script_name` and `script_code` raise KeyError by default,
but can optionally return a default value instead.
2017-11-22 17:46:44 +01:00
Cosimo Lupo
afd2490a6c [unicodedata] add script_name function
Converts four-letter script codes to human-readable long names
2017-11-22 17:41:23 +01:00
Cosimo Lupo
012688ac20 [Tests] adjust unicodedata_test to expect short script codes 2017-11-22 17:41:23 +01:00
Cosimo Lupo
4dfea00356 [feaLib] report error with multiple runs of marked ' glyphs
As Martin Hosken reported in https://github.com/fonttools/fonttools/pull/1096,
feaLib currently incorrectly handles the case where a marked input
glyph sequence in a contextual chaining sub/pos rule is split into
multiple runs, rather than being a single continuous run of ' marked
glyphs.

The consensus there was to raise a syntax error like makeotf instead of
second-guessing and silently fixing it like fontforge does.
2017-11-21 11:42:28 +01:00
Cosimo Lupo
99719a8ccc [Tests] add tests for block and script_extension funcs 2017-11-20 18:17:10 +01:00
Cosimo Lupo
6d8813c00a [Tests] move unicodedata/scripts_test to unicodedata_test 2017-11-20 18:09:56 +01:00
Cosimo Lupo
a50967d79b [Tests] add tests for 'Unknown' script 2017-11-20 15:39:07 +01:00
Cosimo Lupo
09f5f91769 [Tests] remove tests for old script impl 2017-11-20 13:40:25 +01:00
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