2142 Commits

Author SHA1 Message Date
Sascha Brawer
a3783e1095 [feaLib] Reject language and script within feature aalt and size 2015-09-08 12:18:03 +02:00
Sascha Brawer
792a958d6c [feaLib] Implement parser for multiple substitutions (GSUB LookupType 2)
Actually building the GSUB table is not implemented yet, since this
will probably need changes to otTables.
2015-09-08 12:05:44 +02:00
Sascha Brawer
683a8f5dbc [feaLib] Reject duplicate languagesystem declarations 2015-09-08 10:56:07 +02:00
Sascha Brawer
b0bbce88b1 [feaLib] Implement Single Substitution (GSUB lookup type 1) 2015-09-08 10:33:07 +02:00
Sascha Brawer
86004df3b0 [feaLib] Reject script dflt and language DFLT
These are invalid casing variants of the frequently used
`script DFLT` and `language dflt`. Adobe's makeotf tool
does a similar check.
2015-09-08 09:26:24 +02:00
Sascha Brawer
20392fb491 [feaLib] Fix test failures caused by an earlier bug fix
An earlier change made sure that language tags would always be
four characters in length, even when ending in whitespace.
This made a few test cases in parser_test.py fail. By accident,
I had only run builder_test (instead of all unittest in fonttools)
before committing that change.
2015-09-07 22:05:10 +02:00
Sascha Brawer
c1ba66c2ea [feaLib] Write LangSysRecords to GSUB and GPOS tables 2015-09-07 22:03:50 +02:00
Sascha Brawer
6140a4ec2b [feaLib] Build ScriptList subtable
Also, fixed a bug that caused language tags to be sometimes stripped.
Added an assertion to verify that language tags are always 4 chars.
2015-09-07 21:34:10 +02:00
Sascha Brawer
d3c743bb27 [feaLib] Build feature tables 2015-09-07 17:22:37 +02:00
Sascha Brawer
2537a4da29 [feaLib] Enforce uniform lookup types inside named lookup blocks 2015-09-07 16:27:12 +02:00
Sascha Brawer
0963673d58 [feaLib] Rename a test case, for consistency with other test cases 2015-09-07 16:13:34 +02:00
Sascha Brawer
80de401c09 [feaLib] Implement ligature substitutions 2015-09-07 16:10:13 +02:00
Sascha Brawer
8e8a0d68c7 [feaLib] Prohibit script and language statements within named lookups 2015-09-07 13:33:44 +02:00
Sascha Brawer
5f2e55d5fc [feaLib] Emit lookups for alternate substitutions 2015-09-07 11:39:09 +02:00
Sascha Brawer
102c0e0e56 [feaLib] Handle languagesystem, script and languaguage statements
Currently, the compiler uses them to figure out which set of
languagesystems would apply for the current scope. However, this
information is not yet used for anything.
2015-09-07 11:39:09 +02:00
Sascha Brawer
701c72116d [feaLib] Make feaLib compliant with the PEP8 style guide
After this change, pep8 v1.6.2 reports no style guide violations.
2015-09-07 11:39:09 +02:00
Sascha Brawer
4f27ce3585 [feaLib] Ensure that "languagesystem DFLT dflt;" comes first
According the to the OpenType Feature File specification,
"languagesystem DFLT dflt;" must be the first languagesystem
statement in a file.
2015-09-07 11:39:09 +02:00
Sascha Brawer
df740092d9 [feaLib] Basic test framework for building OpenType features 2015-09-07 11:39:09 +02:00
Sascha Brawer
b54c04f1d4 [feaLib] Enforce language "dflt" for script "DFLT"
Also add ';' to some langaugesystem test cases. This makes the
snippets syntactically valid. The parser is still expected to
reject them for other reasons, just as before this change.
2015-09-07 11:39:09 +02:00
Sascha Brawer
9ddd313577 [feaLib] Merged LexerError and ParserError
This simplifies the public API to the library.  For clients, it does
not matter which exact component was detecting an error.  And we will
soon have more components; there would be little point in declaring
CompilerError, TableBuilderError, and so forth.
2015-09-07 11:39:09 +02:00
Sascha Brawer
f38cc9f821 Write XML for alternate glyphs (GSUB lookup type 3) in deterministic order
Before this change, the XML output for GSUB lookups of type 3
was not deterministic; multiple runs of TTX on the same font
could therefore emit the alternates in a different order.

Since alternate glyphs are sets, this change makes no semantic
difference to the output. However, a deterministic ordering
is needed for tests that compare GSUB tables in TTX format.
2015-09-07 11:21:17 +02:00
Sascha Brawer
07458f62dd Support non-BMP characters for synthetic glyph names
When a font supplies no glyph names in its 'post' table, fontTools
builds synthetic glyph names by reversing the 'cmap' table.
After this change, the library looks at all 'cmap' subtables for
Unicode, irrespective of format or platform. For example, glyph #4
in NotoSansOldItalic-Regular.ttf gets now named "u10300" instead of
"glyph00004".

Moved the code for building a reversed 'cmap' table into the cmap class,
for easier testing.
2015-09-04 12:20:54 +02:00
Behdad Esfahbod
58f86f318a 3.0 2015-08-31 18:57:15 +01:00
Behdad Esfahbod
e02ea3f28d [setup] Remove obsolete version check 2015-08-31 18:55:34 +01:00
Behdad Esfahbod
9cbfede2a2 [subset] Minor: move pruning to right place 2015-08-24 12:48:47 +01:00
Behdad Esfahbod
6519752913 [subset] Speedup GSUB/GPOS.prune_pre_subset()
Instead of remapping used lookups, just nuke unused ones, as
subset_glyphs() does a remapping of used lookups already.
2015-08-24 12:45:29 +01:00
Behdad Esfahbod
8cc69ab2ed [subset] Remove no-op Lookup.prune_pre_subset() and deps 2015-08-24 12:08:27 +01:00
Behdad Esfahbod
80966aa7e3 Revert "[travis] compile Brotli using build_ext --libraries=stdc++ on pypy3"
This reverts commit 76dbfef6d4bb11eb4c796f26ebebe1045b6dbbf8.

We don't support pypy3 anymore, until it's updated to 3.3, which shouldn't need
this fix.
2015-08-24 11:48:07 +01:00
Behdad Esfahbod
a3f3da4aa9 [Travis] Disable pypy3 until Travis updates it to >= 3.3 2015-08-24 11:47:21 +01:00
Behdad Esfahbod
89f0c0ce7f Speed up hdmx loading by using custom glyphnamed-list
The data-structure can be used in more places, but it's most beneficial in
this table since hdmx tables can have tens of ppem's, each having a dictionary
keyed by glyphnames...
2015-08-23 20:40:51 +01:00
Behdad Esfahbod
46840d2d32 [subset] Speed up subsetting of dictionaries
Speeds things up for the tables affected.  But more importantly, allows for
lazy-loading of hdmx using custom data-structure coming in next patch.
2015-08-23 20:39:34 +01:00
Cosimo Lupo
59a8fad45d Merge pull request #341 from anthrotype/pypy3
[travis] compile Brotli using `build_ext --libraries=stdc++` on pypy3
2015-08-21 01:41:03 +02:00
Cosimo Lupo
76dbfef6d4 [travis] compile Brotli using build_ext --libraries=stdc++ on pypy3
Fixes https://github.com/behdad/fonttools/issues/339
2015-08-21 01:31:28 +02:00
Behdad Esfahbod
b7e2391e66 [Snippets] Add script for cmap subtable format conversion
Fixes https://github.com/behdad/fonttools/issues/340
2015-08-20 13:24:02 +01:00
Behdad Esfahbod
b23d7cba8c [Snippets] Add layout-features.py that prints GSUB/GPOS features 2015-08-20 12:36:19 +01:00
Behdad Esfahbod
587c0cd142 Revert "Revert "[run-test.sh] echo selected python interpreter version""
This reverts commit 551f9506b308697bea8d2c5597e1a853fac151f6.

Nice thing to have
2015-08-20 11:36:09 +01:00
Behdad Esfahbod
41dcb5a2cc Minor 2015-08-20 11:13:54 +01:00
Cosimo Lupo
7ef718b9c5 Revert "[travis] try python -c 'import brotli' to debug pypy3 build failing"
This reverts commit ecba74224a13b5d3bf9c0ca0829e63357086d19c.
2015-08-20 01:27:31 +01:00
Cosimo Lupo
551f9506b3 Revert "[run-test.sh] echo selected python interpreter version"
This reverts commit 8135df3fe9afc7eca6f9c75fbd271aec9ff24213.
2015-08-20 01:26:37 +01:00
Cosimo Lupo
ecba74224a [travis] try python -c 'import brotli' to debug pypy3 build failing 2015-08-19 23:58:18 +01:00
Cosimo Lupo
8135df3fe9 [run-test.sh] echo selected python interpreter version 2015-08-19 23:46:27 +01:00
Cosimo Lupo
ef71757a42 [woff2] cache reconstructed glyf data if requested to reconstruct loca before glyf 2015-08-19 22:58:17 +01:00
Cosimo Lupo
ef7310a293 [woff2_test] assert glyf isn't reconstructed twice if loca is accessed before 2015-08-19 22:55:24 +01:00
Cosimo Lupo
18d02aece9 [ttLib] convert KeyView object to list for py23 compatibility 2015-08-19 17:57:37 +01:00
Cosimo Lupo
3142e3319e add reordersTables() method to SFNTWriter and WOFF2Writer (return True for the latter) 2015-08-19 17:56:46 +01:00
Cosimo Lupo
1a34f0bd38 [woff2_test] no need to reorder tables when saving test WOFF2 fonts
the WOFF2 encoder currently must reorder them alphabetically in any case (for compatibility with the legacy OTS), so we don't need to do it twice
2015-08-19 17:00:43 +01:00
Cosimo Lupo
ebb64da7c0 [woff2_test] fix test failing in py3 2015-08-19 16:40:45 +01:00
Cosimo Lupo
4c8960bb9a [woff2_test] use OrderedDict like sfnt module 2015-08-19 16:36:32 +01:00
Cosimo Lupo
f083209590 [woff2] use OrderedDict like sfnt module 2015-08-19 16:36:03 +01:00
Cosimo Lupo
4fe88a41f3 [TTFont] fix reorderTable logic 2015-08-19 15:47:07 +01:00