391 Commits

Author SHA1 Message Date
Cosimo Lupo
0337fc92fc
Tests: adjust to use new otRound function 2018-06-14 17:49:37 +01:00
Cosimo Lupo
f9f06ecc10
allow to run tests when zopfli/brotli are not installed 2018-06-12 11:00:40 +01:00
Cosimo Lupo
ae69133924
ttGlyphPen: gracefully handle missing components while decomposing 2018-06-11 18:40:11 +01:00
Cosimo Lupo
7a38a711be
ttx_test: last version digit may contain '\n' char
fixes https://travis-ci.org/fonttools/fonttools/jobs/390768657#L668
2018-06-11 14:15:18 +01:00
Cosimo Lupo
d9f7a26027
_g_l_y_f_test: test _checkFloat upgrades to double when overflowing short int 2018-06-07 15:40:50 +01:00
Cosimo Lupo
65eac8ef92
Merge pull request #1267 from fonttools/designspaceLib-checkDefault
designspaceLib remove checkDefault, checkAxes
2018-06-07 11:14:43 +01:00
Erik van Blokland
e4c90b9afe WIP uncomment test for conditions without min or max.
Add _axesAsDict to the test because there it is needed.
2018-05-30 22:26:59 +02:00
Erik van Blokland
855a475ad2 WIP removed test for incomplete rules. Added test for stray conditions. Removed high unicode character from lib test. Read stray unwrapped conditions, put them in a conditionset. 2018-05-27 19:18:13 +02:00
Erik van Blokland
8582dbdd2a WIP. Some comments. 2018-05-27 09:50:00 +02:00
Erik van Blokland
16cba5ad81 WIP Remove _locationFromElement. Single method for newDefaultLocation. Split some of the tests into smaller things. Add some thoughts to normaliseLocation and why this needs a separate method from the one in varLib. 2018-05-25 11:43:58 +02:00
Erik van Blokland
9d91c82bbe WIP test documentLib. Add a warning if a findDefault can't find a suitable location. 2018-05-24 21:49:33 +02:00
Cosimo Lupo
01173c4599
Merge pull request #1261 from chrissimpkins/ttx-tests
Add ttx tests
2018-05-23 20:13:22 +01:00
Erik van Blokland
086de222fa WIP axes are compulsory, so don't accomodate missing axes. Raise error if document is missing axes.
We know what the default location is before we start reading the masters and there is no guessing.
findDefault() method: default master is at all default values of all axes, or if that fails, the master with the copyInfo flag.
Warn if a location contains an axis that is not defined in the axes element. Otherwise ignore this value, no guessing.
Remove rulesToFeature() function.
2018-05-23 13:19:23 +02:00
Chris Simpkins
b52ddaddeb convert new ttx tests to py.path.local path joins and file checks 2018-05-22 15:13:51 -04:00
Chris Simpkins
f2eb328125 parametrize ttCompile timestamp tests 2018-05-22 07:50:23 -04:00
Chris Simpkins
c2fe5d25fd test formatting changes 2018-05-22 00:41:22 -04:00
Chris Simpkins
bb4753acd4 ttx tests: convert to skipped tests on Win using pytest skipif fixture 2018-05-14 22:47:01 -04:00
Chris Simpkins
189e2487fe ttx tests: exclude mocked exceptions on Windows platform testing 2018-05-14 20:32:37 -04:00
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
Cosimo Lupo
ceb41ec484 WIP: implement conditionSets in designspaceLib.RuleDescriptor (#1255)
* [designspaceLib] WIP: add conditionSets to RuleDescriptor...

the BaseDocReader still needs to be updated to be able to read both
legacy condition-without-conditionset and new-style conditionset
elements.

* test_rules: replace rule.conditions with conditionSets

* Tests: update test.designspace to use conditionset; replace 'with' with 'byname' in sub element

I don't like too much that now 'byname' precedes alphabetically 'name'.
We need to see if ElementTree allows to sort attribute arbitrarily

* Change versionnumber to 4.0 - would that be enough, or should there be seperate major / minor fields?
If we bump the version up to numeral 4, I'd like the check for the with / byname attributes. We can read the old `byname` and only write the new `with`.
Remove support for `initial` in axis attributes.

* WIP - formatversion, with attribute,

* WIP
anything that is not version 4.0 is version 3.0
added some local paths to the test so I can see what it's generating. I can take this out later.

* WIP
read the conditionsets properly. This makes the tests fail no longer.

* WIP
disambiguate axis tags from axis names. Test axes are now called "axisName_x", tags are called "TAGX"

* WIP forgot to push

* WIP
Raise `DesignSpaceDocumentError` when no maximum or minimum are given in a condition.
Add test for such an incomplete rule.
Remove path cruft.

* WIP improved test of raised error.

* WIP because no bot.

* WIP more spaces around percents.

* WIP - don't skip empty subs, just load whatever is there.

* WIP do not permit empty axes in a location when evaluating a rule. Fix some tests.

* WIP missed a str(tempdir), some rule tests.

* WIP proposal for changes to the designspace spec to the `rule` and `sub` elements.

* WIP edits.

* WIP. Typo.
2018-05-14 11:29:48 +02: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
1fededb376 Changed sourceDescriptor object attribute to layerName.
Changed non-standard axis name to all caps.
2018-04-28 13:01:25 +02: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
Cosimo Lupo
f3e0cf3604
varLib_test: add tests for --master-dir and -o options 2018-04-25 13:19:58 +01: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
f688d4bb86
[Tests/varLib] adjust STAT expected test data 2018-04-16 12:40:02 +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
Behdad Esfahbod
42bef176a3 [varLib] Tweak support-resolution algorithm
Improve varLib model algorithm.

This, basically means any varfont built that had an unusual master
configuration will change when rebuilt.

Here's a good test: a two-axis with 8 masters at unusual locations:

2-----------------5----------3
|                            |
|                    7       |
|                            |
|              6             |
|                            |
|                            |
|                            |
0-----------4----------------1

Previously, the reach of master 3 (Black Extended) would
have started from A=.4, ie, the A position of master 4.
It now correctly starts from 0. Same thing with masters
after it. Ie, master 5 gets a span on the A axis from
0 to 1, whereas before it was getting from .4 to 1.

Previously, the on-axis masters always cut the space. They
don't anymore. That's more consistent, and fixes the main
issue Erik showed at TYPO Labs 2017.  Same issue was also
causing the reach of master 3 to be limited, which I think
is the issue being discussed in the linked issue. Both should
be fixed.

It's hard to describe exactly what happened before / after.
Best to read the actual support values:

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

After:
$ ./fonttools varLib.models 0,0 0,1 1,0 1,1 .4,0 .6,1 .5,.5 .7,.7
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.7}]
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.7, 1.0)}]

TODO: We should add this as a test case.

There's another improvement I want to make, but that's separate.
2018-03-26 20:32:27 -07:00
Cosimo Lupo
f0b73e3f0d
[lexer_test] fix macOS CI failues when tmpdir is a symlink
https://travis-ci.org/fonttools/fonttools/jobs/347725568#L364
2018-03-01 20:50:42 +00:00
Cosimo Lupo
4173315f09
[ttGlyphPen] rename option to 'handleOverflowingTransforms' 2018-03-01 20:17:48 +00:00
Cosimo Lupo
6ce8eec89c
[ttGlyphPen_test] add test for decomposeOverflowingTransform=False 2018-03-01 20:10:32 +00:00
Cosimo Lupo
08c663f798
[ttGlyphPen_test] remove OverflowError test 2018-03-01 19:59:49 +00:00
Cosimo Lupo
4771e7cd6c
[ttGlyphPen_test] add test for OverflowError 2018-03-01 19:41:40 +00:00
Cosimo Lupo
ede35d72c8
[ttGlyphPen_test] test decomposed contours keep original order 2018-03-01 18:52:55 +00:00
Cosimo Lupo
778d4933da
[ttGlyphPen_test] check ambiguous out-of-range case
that has both a value that exceeds the bounds, and one that's almost 2;
the former case should take precedence and the componed be decomposed
2018-03-01 18:01:01 +00:00
Denis Moyogo Jacquerye
85e363c216
Add TTGlyphPen test for scale limits 2018-03-01 17:48:49 +00:00
Cosimo Lupo
1d020617d4
Merge pull request #1202 from fonttools/split-glyphs
[ttx] add option to dump glyf table's glyphs as individual ttx
2018-03-01 12:16:45 +00:00
Miguel Sousa
6ea8c184d9
[feaLib] Add test-fea2fea comments 2018-03-01 10:25:24 +00:00
Miguel Sousa
a7fcde030e
[feaLib] cvXX feature test 2018-03-01 10:25:23 +00:00
Miguel Sousa
a4c055c18a
[feaLib] Generalize FeatureNamesBlock 2018-03-01 10:22:09 +00:00
Cosimo Lupo
d98fe0f1be
[lexer_test] test absolute include, relative to cwd, and
featurefilepath=None
2018-02-28 19:40:36 +00:00
Cosimo Lupo
a398996855
ttx_test: add test for -g splitGlyphs option 2018-02-28 13:13:31 +00:00
Cosimo Lupo
6473cc9349
add more tests for userNameToFilename function
plus minor whitespace
2018-02-28 12:26:52 +00:00
Bill Amidei
ccae4687cc
Moving userNameToFileName to its own file, adding unit test 2018-02-28 11:30:33 +00:00
Cosimo Lupo
232e2b8467
Revert "Merge pull request #1130 from anthrotype/temp-revert-split-glyphs"
This reverts commit 060f856f92e0fb2d8e60f6be080c89c08528bacb, reversing
changes made to 1e42224af741fac73e20f7193d8115cfda7d3594.
2018-02-28 11:24:19 +00:00
Cosimo Lupo
e5c0bdd5df
[feaLib.ast] make location=None by default
This would make it easier to construct feaLib AST from code,
where the location is not defined and thus should be None.
Also, we can make other arguments as kwargs with a default
value, now that the first parameter is no longer 'location'.
2018-02-27 19:00:08 +00:00
Cosimo Lupo
05e66d29d0
Merge pull request #1175 from belluzj/add-designspace-lib
Add properties to designspace documents
2018-02-26 12:01:49 +00: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