5027 Commits

Author SHA1 Message Date
Chris Simpkins
3e7b33c22f fix invalid path in ttx test 2018-05-14 17:15:28 -04:00
Chris Simpkins
1404624f3c ttx tests: add tests for Options, ttCompile, ttList, main 2018-05-14 16:39:23 -04:00
Chris Simpkins
cf5b31e9c6 add zopfli to tox testing dependencies 2018-05-14 07:51:20 -04:00
ReadRoberts
4da8f43eeb
[varLib] Fix bug in varLib.build() for CFF2.
The logic should attempt to build a cvar table only if there is a glyf table. This stack dumps when the font is a CFF2 font.
2018-05-10 10:12:28 +01:00
Behdad Esfahbod
f3c06fba3f Revert "[subset] Set to None empty Coverage tables in MarkGlyphSets"
This reverts commit 02616ab9b39d2e9618baebc4e051ae0a85200751.

Make OTS happy. Phew.
https://github.com/khaledhosny/ots/issues/172
2018-05-08 16:28:17 -07:00
Behdad Esfahbod
2ab38f9ba4 [subset] Handle None coverages in MarkGlyphSets 2018-05-08 15:24:36 -07:00
Cosimo Lupo
ca92b172f5
ttFont: allow to build glyph order without post nor cmap, just maxp.numGlyphs
could be useful to read in incomplete sfnt fonts e.g. containing only GPOS or GSUB tables
and a bare maxp table with the numGlyphs
2018-05-06 15:33:18 +01:00
Jens Kutilek
ae4472860f No need to use .keys() 2018-05-04 13:37:59 +02:00
Jens Kutilek
4a16d1839d Add __len__ method to TTFont._TTGlyphSet 2018-05-04 13:12:18 +02:00
Cosimo Lupo
a2f21a2155
Bump version: 3.26.0 → 3.26.1.dev0 2018-05-03 16:10:00 +01:00
Cosimo Lupo
e7e2bb9312
Release 3.26.0 2018-05-03 16:09:59 +01:00
Cosimo Lupo
7508aab346
Update changelog 2018-05-03 16:07:37 +01:00
Cosimo Lupo
28bd06a8de
README.rst: place gitter badge at the top next to the others
[ci skip]
2018-05-03 14:23:21 +01:00
Cosimo Lupo
1a42fa9e8a
Merge pull request #1256 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.rst
2018-05-03 14:21:04 +01:00
The Gitter Badger
e899eab92b Add Gitter badge 2018-05-03 13:19:14 +00:00
Cosimo Lupo
f82ef7a410
[Doc/designspaceLib] mention list of 'subs' in RuleDescriptor 2018-05-03 12:27:50 +01:00
Cosimo Lupo
23af3227b7
[Doc/designspaceLib] mark rule 'name' as optional 2018-05-03 11:51:18 +01:00
Cosimo Lupo
162ad1c842
Merge pull request #1254 from fonttools/designspacelib-conditionset-spec
designspaceLib: This adds conditionsets to the rule element.
2018-05-03 11:35:14 +01:00
Erik van Blokland
6958481eb0
Merge pull request #1253 from fonttools/designspacelib-layer-spec
Designspacelib layer spec
2018-05-03 10:32:57 +02:00
Erik van Blokland
c79a4326ac Remove old test. 2018-05-03 10:04:07 +02:00
Erik van Blokland
066a9c9061 This adds conditionsets to the rule element. 2018-04-29 12:23:19 +02:00
Erik van Blokland
1fededb376 Changed sourceDescriptor object attribute to layerName.
Changed non-standard axis name to all caps.
2018-04-28 13:01:25 +02:00
Behdad Esfahbod
0ecf5c5c94 [varLib.models] Refine modeling one last time
In a523a697164a4 I changed the model such that when computing master
supports and we hit another master, cut the box in one dimension only,
to avoid interferring with other master.  The axis to cut against was
chosen as axis that minimizes volume loss.  That was fine in a sense,
but missed a great amount of information resulting from relative
positioning of the two masters.  As such, it could not distinguish
between the following two situations:

behdad:fonttools 0 (master*)$ ./fonttools varLib.models 0,0 0,1 1,0 1,1 .5,.5 .55,.75
Sorted locations:
[{},
 {'A': 1.0},
 {'B': 1.0},
 {'A': 1.0, 'B': 1.0},
 {'A': 0.5, 'B': 0.5},
 {'A': 0.55, 'B': 0.75}]
Supports:
[{},
 {'A': (0, 1.0, 1.0)},
 {'B': (0, 1.0, 1.0)},
 {'A': (0, 1.0, 1.0), 'B': (0, 1.0, 1.0)},
 {'A': (0, 0.5, 1.0), 'B': (0, 0.5, 1.0)},
 {'A': (0, 0.55, 1.0), 'B': (0.5, 0.75, 1.0)}]
behdad:fonttools 0 (02616ab...)$ ./fonttools varLib.models 0,0 0,1 1,0 1,1 .5,.5 .75,.55
Sorted locations:
[{},
 {'A': 1.0},
 {'B': 1.0},
 {'A': 1.0, 'B': 1.0},
 {'A': 0.5, 'B': 0.5},
 {'A': 0.75, 'B': 0.55}]
Supports:
[{},
 {'A': (0, 1.0, 1.0)},
 {'B': (0, 1.0, 1.0)},
 {'A': (0, 1.0, 1.0), 'B': (0, 1.0, 1.0)},
 {'A': (0, 0.5, 1.0), 'B': (0, 0.5, 1.0)},
 {'A': (0, 0.75, 1.0), 'B': (0.5, 0.55, 1.0)}]

Check the last line. In both cases the box was cut against the second axis.
After this change, we get:

behdad:fonttools 0 (master)$ ./fonttools varLib.models 0,0 0,1 1,0 1,1 .5,.5 .55,.75
Sorted locations:
[{},
 {'A': 1.0},
 {'B': 1.0},
 {'A': 1.0, 'B': 1.0},
 {'A': 0.5, 'B': 0.5},
 {'A': 0.55, 'B': 0.75}]
Supports:
[{},
 {'A': (0, 1.0, 1.0)},
 {'B': (0, 1.0, 1.0)},
 {'A': (0, 1.0, 1.0), 'B': (0, 1.0, 1.0)},
 {'A': (0, 0.5, 1.0), 'B': (0, 0.5, 1.0)},
 {'A': (0, 0.55, 1.0), 'B': (0.5, 0.75, 1.0)}]
behdad:fonttools 0 (master)$ ./fonttools varLib.models 0,0 0,1 1,0 1,1 .5,.5 .75,.55
Sorted locations:
[{},
 {'A': 1.0},
 {'B': 1.0},
 {'A': 1.0, 'B': 1.0},
 {'A': 0.5, 'B': 0.5},
 {'A': 0.75, 'B': 0.55}]
Supports:
[{},
 {'A': (0, 1.0, 1.0)},
 {'B': (0, 1.0, 1.0)},
 {'A': (0, 1.0, 1.0), 'B': (0, 1.0, 1.0)},
 {'A': (0, 0.5, 1.0), 'B': (0, 0.5, 1.0)},
 {'A': (0.5, 0.75, 1.0), 'B': (0, 0.55, 1.0)}]

Just draw the boxes on a piece of napkin and convince yourself that this
is a good change.

If the ratios are equal, we cut against the first axis in the axisOrder:

behdad:fonttools 0 (master)$ ./fonttools varLib.models 0,0 0,1 1,0 1,1 .5,.5 .75,.75
Sorted locations:
[{},
 {'A': 1.0},
 {'B': 1.0},
 {'A': 1.0, 'B': 1.0},
 {'A': 0.5, 'B': 0.5},
 {'A': 0.75, 'B': 0.75}]
Supports:
[{},
 {'A': (0, 1.0, 1.0)},
 {'B': (0, 1.0, 1.0)},
 {'A': (0, 1.0, 1.0), 'B': (0, 1.0, 1.0)},
 {'A': (0, 0.5, 1.0), 'B': (0, 0.5, 1.0)},
 {'A': (0.5, 0.75, 1.0), 'B': (0, 0.75, 1.0)}]
2018-04-27 16:50:32 -07:00
Erik van Blokland
1c6c35dc38 Change to designspace documentation: add layer attribute to the source element.
Add `layerName` attribute to the sourcedescriptor object
Read and write layerName.
Add a source layer test.
XXX this also disables the test_check() test for the moment because it generates odd results.
2018-04-27 13:24:11 +02:00
Behdad Esfahbod
02616ab9b3 [subset] Set to None empty Coverage tables in MarkGlyphSets 2018-04-25 20:59:18 -07:00
Behdad Esfahbod
795f2f95fb [otBase] Fix sharing of tables referred to by different offset sizes
When an offset refers to a table, we keep the size of the offset to
the referred-to table. When sharing tables, we were ignoring this,
which could result in a long offset being written out as a short, or
vice versa.  Fix it by not sharing such tables. This is not optimal
but fixes the bug.

Bug has been there forever.
2018-04-25 20:57:19 -07:00
Behdad Esfahbod
fc819d6235 [subset] Don't drop a GDEF that only has VarStore 2018-04-25 16:10:57 -07:00
Behdad Esfahbod
1917d6913b [subset] Remove more nonsensical code
Remaining parts of 4e3192163470ca168ff753cb526480e59bc77e1a
2018-04-25 16:09:30 -07:00
Behdad Esfahbod
95838bd4df [otBase] If decoding tables fails, append breadcrumb to exception 2018-04-25 15:53:43 -07:00
Cosimo Lupo
55539f6651
Merge pull request #1249 from anthrotype/varlib-finder
[varLib] add a --master-finder command line option
2018-04-25 16:14:04 +01:00
Cosimo Lupo
f3e0cf3604
varLib_test: add tests for --master-dir and -o options 2018-04-25 13:19:58 +01:00
Cosimo Lupo
c616e10e45
varLib: add --master-finder option
Takes a template containing predefined strings {dirname}, {basename},
{stem}, {ext} and {fullname}, to customize the location of the binary
master TTFs in relation to the designspace source filenames.
2018-04-25 13:19:58 +01:00
Cosimo Lupo
6a89d9c41a
Merge pull request #1245 from anthrotype/mutator-prune-names
[varLib.mutator] prune fvar nameIDs from instance's name table
2018-04-18 13:57:47 +02:00
Cosimo Lupo
3fe84a65ea
[varLib.mutator] prune fvar nameIDs from instance's name table
Fixes https://github.com/fonttools/fonttools/issues/1227
2018-04-18 12:35:54 +01:00
Cosimo Lupo
63c86b4db3
Merge pull request #1236 from anthrotype/bad-classdef-fmt
Allow decompiling bad ClassDef tables with invalid format
2018-04-16 13:55:47 +02:00
Cosimo Lupo
8ee3f016d7
Merge pull request #1242 from anthrotype/stat-1.2
[varLib] make STAT 1.2, and reuse fvar nameIDs
2018-04-16 13:55:23 +02:00
Cosimo Lupo
ffc7dfc23d
[varLib] don't need to read nameTable in _add_stat
for now at least...
2018-04-16 12:55:51 +02:00
youlun
2bcca15c56 Add font-number parameter for subset 2018-04-16 12:47:25 +02:00
Cosimo Lupo
f688d4bb86
[Tests/varLib] adjust STAT expected test data 2018-04-16 12:40:02 +02:00
Cosimo Lupo
08c30e9fde
[varLib] make STAT v1.2, reuse fvar nameIDs
Fixes https://github.com/googlei18n/fontmake/issues/417
2018-04-16 12:40:02 +02:00
Behdad Esfahbod
6a88c39834 [varLib.plot] Show master locations 2018-04-14 14:43:42 +02:00
Behdad Esfahbod
113558ac7d [varLib.plot] Set axis limits to -1,+1 2018-04-13 18:48:34 +02:00
Cosimo Lupo
78faa0c416
subset: minor: remove duplicate 'cvar' from list of hinting tables 2018-04-13 17:39:10 +02:00
Behdad Esfahbod
ebdd52512b [subset] Passthrough 'cvar'
https://github.com/fonttools/fonttools/issues/1237#issuecomment-381150772
2018-04-13 16:38:46 +02:00
Cosimo Lupo
4dfc7bf24e
subset: remove assert to handle HVAR direct mapping
It looks like this was (at least partially) implemented in
f01c86ca9b

Should fix https://github.com/fonttools/fonttools/issues/1237

I'm still not sure about that "File a bug." when AdvWidthMap is None,
but either LsbMap or RsbMap are not None..

And we still need to add tests for this though.
2018-04-13 15:16:31 +02:00
Cosimo Lupo
dde854d285
Allow decompiling bad ClassDef tables with invalid format
Fixes https://github.com/fonttools/fonttools/issues/1235
2018-04-13 12:58:29 +02:00
Cosimo Lupo
c5c161c055
t1Lib: add 'kind' argument to T1Font constructor
fixes issue introduced with last commit
b1fd6fbbcd

t1Lib_test.py::test_parse_lwfn was relying on 'path' being None.
2018-04-13 12:55:24 +02:00
Cosimo Lupo
b1fd6fbbcd
t1Lib: make 'path' argument required 2018-04-12 15:21:25 +02:00
Cosimo Lupo
cc8551df80
Merge pull request #1234 from fonttools/type1-ps-encoding
allow an encoding to be specified when parsing a Type 1 font
2018-04-12 15:08:07 +02:00
justvanrossum
52ea50f4bc allow an encoding to be specified when parsing a Type 1 font 2018-04-12 14:39:44 +02:00