4868 Commits

Author SHA1 Message Date
Chris Simpkins
0f49e20675 [Snippets/checksum.py] adds checksum.py script for SHA1 hash checksum list generation from font binaries or ttx XML OT table dumps from font files, and checksum testing against valid checksum files 2018-02-24 21:43:59 -05:00
Miguel Sousa
efca91e7f1 [_n_a_m_e_test] ensure that struct format string is native str
https://github.com/fonttools/fonttools/pull/1193#issuecomment-367769342
2018-02-23 03:02:06 -08:00
Miguel Sousa
d401b2522b [cffLib_test] Test setting topDict.Encoding
#1177
2018-02-23 03:02:06 -08:00
Miguel Sousa
299dbcbe14 [cffLib_test] use boilerplate class; change class and method names 2018-02-23 03:02:06 -08:00
Miguel Sousa
432d9b4034 [misc.testTools] boilerplate unittest classes 2018-02-23 03:02:06 -08:00
Miguel Sousa
603e942f4c [misc.testTools] tabs to spaces 2018-02-23 03:02:06 -08:00
Miguel Sousa
dd5b52404c [misc.testTools] minor 2018-02-23 03:02:06 -08:00
Cosimo Lupo
2bed5e79d6
Merge pull request #1187 from derwind/fix-lazy-load
[cffLib] save file position against lazy-load of charset
2018-02-22 17:33:23 +00:00
derwind
66be456e62 [cffLib] restore try... finally... block 2018-02-23 02:22:57 +09:00
derwind
e5985ab63e [cffLib] reimplement SimpleConverter which is ready for lazy-loads and now all Converters are derived from it. 2018-02-23 02:01:35 +09:00
derwind
b9eb1b235f [cffLib] another implementation: prevent *Converter.read from changing file positions 2018-02-23 01:03:37 +09:00
Miguel Sousa
bf6852a7f6 [ttx_test] Test for split tables (-s) option
#1188
2018-02-22 07:38:25 -08:00
derwind
91fc3c5c41 [cffLib] prevent *Converter.read from changing file positions 2018-02-22 22:46:46 +09:00
Behdad Esfahbod
e299650f9f [varStore] In OnlikeVarStoreBuilder, dedup items
While we optimize VarStore later, just deduping here reduces amount
of data we have to work with later by 8x in NotoSans-VF.ttf test
case.  It's a cheap optimization, so do it.
2018-02-21 15:12:20 -08:00
Behdad Esfahbod
88343d2367 [varLib.mutator] Fix comment 2018-02-21 14:54:27 -08:00
Cosimo Lupo
97375135c4
lexer_test: catch IncludedFeaNotFound explicitly 2018-02-21 18:02:55 +00:00
Cosimo Lupo
77f038ce5a
Merge pull request #1189 from chrissimpkins/bugfix-ttlib-ttfont-xmlwriter-import
[ttFont] fixes xmlWriter import error in _saveXML method with ttx split tables request
2018-02-21 17:54:42 +00:00
Chris Simpkins
5f36f03311 [ttFont] fixes xmlWriter import error in _saveXML method with ttx split tables requests 2018-02-21 12:33:01 -05:00
Cosimo Lupo
ea5980b6ba
Merge pull request #1186 from anthrotype/included-not-found
feaLib: add IncludedFeaNotFound error
2018-02-21 17:12:27 +00:00
derwind
d0b4c4b360 [cffLib] save file position against lazy-load of charset 2018-02-22 02:00:09 +09:00
Cosimo Lupo
7d7212b01f
feaLib: add IncludedFeaNotFound error
subclass of FeatureLibError, only raised if IOError.errno == ENOENT (i.e. FileNotFoundError)

https://github.com/googlei18n/fontmake/issues/157#issuecomment-367380471

Will be useful in ufo2ft to detect when an included feature file doesn't exist and print a nicer error message
explaining that includes must be relative to the UFO itself, and not relative to the embedded features.fea file.

https://github.com/unified-font-object/ufo-spec/issues/55
2018-02-21 16:41:11 +00:00
Cosimo Lupo
767b9311eb
[varStore] don't import unicode_literals
Tests were failing on python 2.7.6 because array module doesn't accept
unicode strings (fixed in later 2.7.x releases).

An alternative fix would have been to cast array(str('h'), [...]) but
that seemed a bit too much, especially since varStore module doesn't
really do heavy text manipulation (there aren't other string literals).

We cannot use unicode_literals unconditionally, because of this and
similar issues in the stdlib. We should use it only when it makes sense
and reduces the frequency of u"".
2018-02-21 12:11:59 +00:00
Cosimo Lupo
58d3818b4f
make tests less verbose to avoid incurring in Travis log limit 2018-02-21 12:11:36 +00:00
Behdad Esfahbod
d46d40dc9e [varLib] Actually remove duplicates while optimizing VarStore!
Ouch!  Shrinks NotoSans-VF.ttf GDEF VarStore further down.
Original was 1016278 bytes. Before this change it was optimizing
to 256145 bytes. With this change, it goes down to a mere 57127
bytes!!!
2018-02-21 01:27:58 -08:00
Behdad Esfahbod
e910309952 [varLib] Optimize HVAR VarStore and indirection 2018-02-21 01:22:59 -08:00
Behdad Esfahbod
1adf7fd2c0 [varLib] Update tests for VarStore optimization
Also, don't emit GDEF if VarStore is empty.
2018-02-21 01:10:36 -08:00
Behdad Esfahbod
398f7169c8 [varLib] Optimize MVAR VarStore 2018-02-21 00:55:39 -08:00
Behdad Esfahbod
7aef5c8072 [varLib] Optimize GDEF VarStore when generating varfonts
Sweet...
2018-02-21 00:22:14 -08:00
Behdad Esfahbod
4e31921634 [varLib] Remove nonsensical code
GSUB has no positioning, so cannot have any Device tables with variations.
2018-02-21 00:19:54 -08:00
Behdad Esfahbod
3c4203d985 [varLib.varStore] Implement VarStore optimizer
On NotoSans-VF.ttf (a 5MB font), saves 15% total size by optimizing
GDEF VarStore and resulting GPOS shrinkage.
2018-02-21 00:18:55 -08:00
Behdad Esfahbod
073227bbb0 [varLib.varStore] Start implementing a VarStore optimizer
Commandline takes varfont and optimizes its GDEF VarStore.
2018-02-20 20:58:18 -08:00
Behdad Esfahbod
d5efd2b7ee [varLib] When optimizing NumShorts, drop zero columns
Related to https://github.com/fonttools/fonttools/issues/1184
2018-02-20 20:51:56 -08:00
Behdad Esfahbod
38a0ffb815 Accept old version of HVAR XML
21cbab8ce9 (commitcomment-27649836)
2018-02-20 17:42:49 -08:00
Cosimo Lupo
2cc182ce58
Revert "Revert "t2CharStringPen: specializeCommands expects command args to be list, not tuples""
This reverts commit fe2e897d13aab383d03b7759a15787ed2db99c77.

ufo2ft tests are failing with fonttools master with this error:

fontTools/cffLib/specializer.py:497:
>   commands[i-1] = (new_op, args1+args2)
    TypeError: can only concatenate list (not "tuple") to list
2018-02-20 17:35:10 +00:00
Behdad Esfahbod
323783d41c [varLib] Allow excluding arbitrary tables 2018-02-19 19:16:35 -08:00
Behdad Esfahbod
ba52a32fed [varStore] Refactor code around 2018-02-19 19:07:22 -08:00
Behdad Esfahbod
7657f0c899 [varStore] Minor 2018-02-19 18:59:12 -08:00
Behdad Esfahbod
64834d079d [varStore] Add subset_varidxes as method on VarStore 2018-02-19 18:57:09 -08:00
Behdad Esfahbod
ca7cd85731 [varLib] Add a couple of commandline options 2018-02-19 17:18:27 -08:00
Behdad Esfahbod
2ca6cc2dc3 [varLib] Handle overflow in OnlineVarStoreBuilder 2018-02-19 16:42:51 -08:00
Cosimo Lupo
fe2e897d13
Revert "t2CharStringPen: specializeCommands expects command args to be list, not tuples"
This reverts commit 41445b8449733ade6117b3ae834da518e5623ef8.

41445b8449 (commitcomment-27640426)
2018-02-19 14:57:18 +00:00
Behdad Esfahbod
f01c86ca9b [subset] Handle direct mapping in HVAR/VVAR
Untested. Sigh...

Last part of https://github.com/fonttools/fonttools/issues/1179
2018-02-18 23:25:42 -08:00
Behdad Esfahbod
200268846a [subset] Fold prune_post into subset for HVAR/VVAR
Need to finish direct mapping.
2018-02-18 23:18:34 -08:00
Behdad Esfahbod
3cfc4a4be2 [subset] Move code around 2018-02-18 23:16:00 -08:00
Behdad Esfahbod
e33ba6ddd6 [subset] Assert HVAR/VVAR case we do NOT handle
For now fixes https://github.com/fonttools/fonttools/issues/1179
2018-02-18 23:08:46 -08:00
Behdad Esfahbod
788a306e4a [subset] Prune HVAR/VVAR
Part of https://github.com/fonttools/fonttools/issues/1179
2018-02-18 23:06:21 -08:00
Behdad Esfahbod
ef5c9cb2ab Fix pruning of HVAR pre-write 2018-02-18 22:59:43 -08:00
Behdad Esfahbod
48125e9812 [varLib] Fix HVAR generation
We cannot tail-optimize there.
2018-02-18 22:58:47 -08:00
Behdad Esfahbod
d1b335505c [subset] Implement basic HVAR/VVAR support
Needs more work.

Part of https://github.com/fonttools/fonttools/issues/1179
2018-02-18 22:41:11 -08:00
Behdad Esfahbod
f3def2ea5a [subset] Fix pruning of GDEF VarStore 2018-02-18 22:37:44 -08:00