5013 Commits

Author SHA1 Message Date
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
Cosimo Lupo
0d474737d7
Merge pull request #1231 from hoeflerco/fix-tagComparison
Fixes the eq comparison of the Tag object to work in a comparison with None type
2018-04-05 10:46:03 +02:00
Cosimo Lupo
bd08d9b7d9
Merge pull request #1232 from andyzickler/context-guard-ttfont
Add context guard to ttfont
2018-04-04 08:39:54 +02:00
Andy Zickler
1e2ee8e15e Add context guard to ttfont 2018-04-03 18:08:52 -04:00
Andy Clymer
a3307324ae Includes a suggested fix from @anthrotype 2018-04-03 15:40:54 -04:00
Andy Clymer
241a4474b4 Fixes the eq comparison of the Tag object to work with a None type 2018-04-03 14:54:39 -04:00
Cosimo Lupo
5db9309167
Bump version: 3.25.0 → 3.25.1.dev0 2018-04-03 13:58:14 +01:00
Cosimo Lupo
852f993c28
Release 3.25.0 2018-04-03 13:58:13 +01:00
Cosimo Lupo
710939174d
Update changelog 2018-04-03 13:58:01 +01:00
Cosimo Lupo
0055f9414c
models: convert delta array to float if overflows signed short integers
We should check other places where such overflows may occur and do the same.
Or do maybe it in GlyphCoordinates class.
2018-04-03 11:40:44 +01:00
Cosimo Lupo
6b6c34ab1a
otTables: fix IndexError while pruning of HVAR pre-write 2018-04-03 10:28:27 +01:00
Behdad Esfahbod
a523a69716 [varLib.models] Improve model
When adding a master and computing its support, when hitting another master,
we don't need to limit our box in every direction; we just need to limit in
one so we don't hit the older master with our support. Implement heuristic
that takes the first axis that minimizes the area loss.

This is not perfect, but a good improvement.

Before:
$ fonttools varLib.models 0,0 0,1 1,0 1,1 .4,0 .6,1 .5,.5 .7,.9Sorted locations:
[{},
 {'A': 0.4},
 {'A': 1.0},
 {'B': 1.0},
 {'A': 1.0, 'B': 1.0},
 {'A': 0.6, 'B': 1.0},
 {'A': 0.5, 'B': 0.5},
 {'A': 0.7, 'B': 0.9}]
Supports:
[{},
 {'A': (0, 0.4, 1.0)},
 {'A': (0.4, 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.6, 1.0), 'B': (0, 1.0, 1.0)},
 {'A': (0, 0.5, 1.0), 'B': (0, 0.5, 1.0)},
 {'A': (0.5, 0.7, 1.0), 'B': (0.5, 0.9, 1.0)}]

After:
$ fonttools varLib.models 0,0 0,1 1,0 1,1 .4,0 .6,1 .5,.5 .7,.9
Sorted locations:
[{},
 {'A': 0.4},
 {'A': 1.0},
 {'B': 1.0},
 {'A': 1.0, 'B': 1.0},
 {'A': 0.6, 'B': 1.0},
 {'A': 0.5, 'B': 0.5},
 {'A': 0.7, 'B': 0.9}]
Supports:
[{},
 {'A': (0, 0.4, 1.0)},
 {'A': (0.4, 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.6, 1.0), 'B': (0, 1.0, 1.0)},
 {'A': (0, 0.5, 1.0), 'B': (0, 0.5, 1.0)},
 {'A': (0, 0.7, 1.0), 'B': (0.5, 0.9, 1.0)}]

(Note the last line.)
2018-03-28 02:11:49 -07:00
Behdad Esfahbod
28000a4195 [varLib.plot] Display master names 2018-03-28 01:57:59 -07:00
Behdad Esfahbod
34458fe347 [varLib.plot] Label axes 2018-03-28 01:44:27 -07:00
Behdad Esfahbod
0359daad3d Revert "[varLib.models] Improve modeling"
This reverts commit e4d363cc5c14471b02a98657e9bc04b75109c687.
2018-03-28 01:38:10 -07:00