4845 Commits

Author SHA1 Message Date
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
Behdad Esfahbod
21cbab8ce9 Fix read/write of VarIdxMap to use glyph names
Was relying on glyph IDs. Ouch.
2018-02-18 22:33:32 -08:00
Behdad Esfahbod
eb6af2da72 [varLib] Fix pruning of HVAR 2018-02-18 21:49:39 -08:00
Behdad Esfahbod
23d373caac [varLib] Comment 2018-02-18 21:45:27 -08:00
Behdad Esfahbod
e0f2848ef5 [subset] Subset Regions when subsetting VarStore
Part of https://github.com/fonttools/fonttools/issues/1179
2018-02-18 19:45:57 -08:00
Behdad Esfahbod
d5c480aabd [subset] If a table is dropped because we don't know it, warn, not log 2018-02-18 19:30:39 -08:00
Behdad Esfahbod
67814fd3b3 [subset] Prune GDEF VarStore
Mostly fixes https://github.com/fonttools/fonttools/issues/1179
2018-02-18 19:20:00 -08:00
Behdad Esfahbod
e5f9674da6 Fixup for previous commit to make tests happy 2018-02-18 15:37:07 -08:00
Behdad Esfahbod
fde3cf6560 [merge] Ignore duplicate glyphs if they render the same
Fixes https://github.com/fonttools/fonttools/issues/1057
2018-02-18 14:44:10 -08:00
Behdad Esfahbod
a07a6f85f7 [cffLib.specializer] Try keeping type of args
41445b8449 (commitcomment-22260340)
2018-02-18 11:48:22 -08:00
Cosimo Lupo
e7494cba5b
[sfnt] restore backward compat with 'numFonts' on SFNTReader instance
Fixes #1181
2018-02-16 18:15:52 +00:00
Cosimo Lupo
18bd9603a9
[Tests] fixup for new subset default --name-IDs
25d3822275c04169ba380393b1d41c7605c61d58
2018-02-16 18:11:59 +00:00
Cosimo Lupo
5682693a3e
[ttCollection] don't seek(0) when writing to possibly unseekable strems
see 0daed6eb59 (r27608260)
2018-02-16 18:02:05 +00:00
Cosimo Lupo
d2298be083
[subset] modify --name-IDs help message to match new defaults 2018-02-16 17:58:14 +00:00
Behdad Esfahbod
25d3822275 [subset] Fixup for previous commit 2018-02-16 09:54:32 -08:00
Behdad Esfahbod
6eac96b2f5 [subset] Add nameIDs 0 and 5 as well and fix docstring
Fixes https://github.com/fonttools/fonttools/issues/1170
2018-02-16 09:32:29 -08:00
Denis Moyogo Jacquerye
fff01237de [merge] Support merging LangSysRecords 2018-02-14 16:12:12 -08:00
Behdad Esfahbod
007a72ac29 [subset] Change indentation to tabs 2018-02-14 01:32:54 -08:00
Behdad Esfahbod
3c717c7867 [subset] Starting to implement pruning VarStores
Part of https://github.com/fonttools/fonttools/issues/1179
2018-02-14 01:19:03 -08:00
Behdad Esfahbod
2d57c87a67 [merge] Minor 2018-02-14 01:11:31 -08:00
justvanrossum
ce639f0064 increase the width of the length and offset fields by one, to accommodate sizes and offsets in the 10s of megabytes. 2018-02-13 11:21:16 -08:00
Miguel Sousa
5eebad29df [subset_test] Include nameIDs 3, 4, 6 in results 2018-02-11 18:00:34 -08:00
Behdad Esfahbod
948361f981 [cffLib.width] Fix for py3 2018-02-10 16:27:25 -06:00
Behdad Esfahbod
43ea974329 [subset] Include nameIDs 3, 4, 6 by default
Fixes https://github.com/fonttools/fonttools/issues/1170
2018-02-10 13:01:59 -06:00