597 Commits

Author SHA1 Message Date
Just van Rossum
327b05d8c0
[designspaceLib] [t1Lib] [misc.macRes] fix some cases where pathlib.Path objects were not accepted (#1421)
* fix two cases where pathlib.Path objects were not accepted

* make macRes reader accept os.PathLike objects

* use __fspath__ explicitly to support os.PathLike paths

* use __fspath__ explicitly to support os.PathLike paths

* convert tmpdir to str

* only test pathlib.Path on Python 3.6 and up
2018-12-30 12:07:05 +01:00
Nikolaus Waxweiler
e464e450ac Make build and load_designspace accept a DS object 2018-12-19 13:40:11 +00:00
Denis Moyogo Jacquerye
f998688c00
Merge pull request #1413 from moyogo/STAT-1.1
Pin STAT to version 1.1
2018-12-17 20:30:32 +00:00
Behdad Esfahbod
9c3dde3ce6 [varLib] Always write tuple entries for composite glyphs (#1383)
* [varLib] Always write tuple entries for composite glyphs

Fixes https://github.com/fonttools/fonttools/issues/1381
Fixes https://github.com/googlei18n/fontmake/issues/481 partially

* Make sure at least one gvar delta is written for composites

* Add test data for composite fix

* Put in the correct issue link

* Typo

* Fix typos

* Expand comment, add link to issue

* Add ttx files for test font
2018-12-17 14:03:40 +01:00
Denis Moyogo Jacquerye
c48a7b94c1 [varLib] downgrade STAT to version=0x00010001 in tests 2018-12-17 10:31:35 +00:00
Nikolaus Waxweiler
3b2bfcf29a Treat Mapping objects as dicts 2018-12-13 15:44:25 +00:00
Just van Rossum
a3817fd971
Merge pull request #1399 from justvanrossum/fontbuilder-cff2
[fontBuilder] some support for CFF2; inferring FontMatrix from unitsPerEm for CFF
2018-12-06 09:23:45 +01:00
justvanrossum
8812f9072b tests for #1400 2018-12-05 19:54:14 +01:00
justvanrossum
82c4f410fb remove empty fdArrayList argument, will be filled in 2018-12-05 15:09:27 +01:00
justvanrossum
874c08dcd2 CFF: set FontMatrix based on unitsPerEm automatically, unless manually overridden 2018-12-05 15:07:20 +01:00
justvanrossum
de1dbe5f16 some more test refactoring 2018-12-05 14:03:15 +01:00
justvanrossum
c663e7f299 refactor output verifying 2018-12-05 13:57:07 +01:00
justvanrossum
9d73327f3b Some support for CFF2 2018-12-05 13:51:42 +01:00
ReadRoberts
63c94beb20 Merge commit '889d683064cea426ac692431ee599752519cea18' into varlib-build-cff2vf
# Conflicts:
#	Lib/fontTools/misc/psCharStrings.py
2018-11-30 09:21:18 -08:00
Behdad Esfahbod
361e1e6aa0
Merge pull request #1377 from fonttools/varlib-interpolate-cff2
Varlib interpolate cff2
2018-11-30 00:21:13 -05:00
ReadRoberts
ad8130e1a4 [varlib] Remove path compatiblization logic from CFF2CharStringMergePen
Agreed that paths glyphs form source fonts shoudl be fully compatible before varLib.build is called.

Updated test files
2018-11-29 15:07:08 -08:00
ReadRoberts
c2abd045b3 [varLib.mutator] Add interpolation of glyph metrics.
Added interpolation of glyph advance width, from HVAR/hmtx, and derivation of new LSB.
Updated tests to match.
Needed to cherrypick from another branch an update for psCharstrings to allow the CFFSubr.draw() method to work.
2018-11-20 12:44:21 -08:00
Denis Moyogo Jacquerye
0c4f11f5ff
Merge pull request #1361 from moyogo/kerntable
Ignore the length of kern table sutable format 0
2018-11-20 13:41:13 +00:00
Denis Moyogo Jacquerye
7e3164e8da kern table: add tests for overflowing subtable 2018-11-20 12:41:57 +00:00
ReadRoberts
bde62cd653 [varLib.mutator] Move test for interpolating CFF2 tables
from varLib_test.py to mutator_test.py
2018-11-19 20:08:10 -08:00
ReadRoberts
617b8c6396 [varLib.mutator] Interpolating CFF2 tables. Make more fixes per recommendations
varStore.py. Commit the correct function references.
psCharstrings.py. Add decompiler class specifically for flattening subroutinized charstrings.
mutator.py. Flatten the subroutinized charstrings, delete the Subrs.
TestCFF2VF.otf, Updated to version with subroutinization. Updated expected ttx output.
2018-11-19 20:08:00 -08:00
ReadRoberts
fddd5b2bae [varLib.mutator] Interpolating CFF2 tables. Makes fixes per recommendations
varLib.py. restore import of 'fontTools.misc.py23 import *'
varStore.py. Rename 'applyScalar' to 'interpolateFromDeltasAndScalars', and refactor common code with __git__item to a static method.
mutator.py. Update to reflect function name change to interpolateFromDeltasAndScalars. Changed some logic from one line to several lines for readability, and i to avoid flake8 warnings about line too long.
2018-11-19 20:06:16 -08:00
ReadRoberts
b5f12785e1 [varLib.mutator] Add test case for interpolating CFF2 tables 2018-11-19 20:06:10 -08:00
ReadRoberts
8d40bf8448 Merge commit '335c98512e674e8d130a36bd1e1391373d2c7f66' into varlib-build-cff2vf 2018-11-19 17:31:34 -08:00
Cosimo Lupo
15e8df218a
Merge pull request #1384 from nyshadhr9/idef
Add IDEF for GETVARIATION opcode
2018-11-19 10:33:21 +00:00
Cosimo Lupo
f99afc70d3
Merge pull request #1326 from BoboTiG/fix-resource-leak
Fix several ResourceWarning: unclosed file and some related improvement
2018-11-16 23:00:24 +00:00
Nyshadh Reddy Rachamallu
dbfba397e0 maxp attributes maxInstructionDefs and maxStackElements should be modified when idef is added 2018-11-16 13:01:38 -05:00
Behdad Esfahbod
f530e3e398
Merge pull request #1372 from fonttools/varLib-faster-featureVars
[varLib] Far faster featureVars
2018-11-15 14:59:48 -08:00
Nyshadh Reddy Rachamallu
512bccf49e Add IDEF for GETVARIATION opcode 2018-11-15 15:18:03 -05:00
ReadRoberts
a460eee80b varLib. Add support for building CFF2 variable font
Fix syntax error reported by build system: can't mix string string types when doing literal concatenation

Fix local import reference - doesn't work in Python3.

Addressed issues raised by @msousa for PR 1345 yesterday.

Will change cff2_merge_funcs.py and cff2mergePen.py from tab to space indentations after the current comments are resolved.

Add various improvements from comments:
- do not edit the post table under varLib.build(). Setting post table format 2 or 3 is now expected to be managed by whatever calls varLib.build().
- In the t2CharStringPen module, rename closure _round() nested in makeRoundFunc to an exportable function, and use it in cff2mergePen.
- remove TypeSupply copyright from cff2mergePen.
- use modulo function to convert float to int when it is meant to be 0 in cff2mergePen.

cff2_merge_funcs.py:merge_PrivateDicts() should only be blending the hint related fields in the PrivateDict. This oversight that was surfaced by @madig reporting an error building his Cantrell font. The bug appeared when the font was subroutinized, as the pen draw method then has to interpret the Subr field in order to access T2Charstring subroutines.

Fix expected ttx output file. When I removed the logic to add glyph names to the post table, glyph names in the ttx file changed.

Miguel prefers a simple list for readability in cff2_merge_funs.py:138.
2018-11-12 11:38:18 -08:00
ReadRoberts
9de373455a varLib. Add support for building CFF2 variable font with a call to varLib.build().
Add test for building CFF2 variable font with a call to varLib.build().

The 'dollar' glyph in the test font is deliberately slightly malformed, with flat curves, in order to exercise the code for dealing with some of the differences in masters designs that can arise from T2 charstring optimization.
2018-11-12 11:38:12 -08:00
Behdad Esfahbod
16aa66c384 [varLib.featureVars] Update test expectation 2018-11-10 15:24:11 -05:00
justvanrossum
29cc726363 fix test expected data 2018-11-10 15:07:18 -05:00
Behdad Esfahbod
f6bfc4139d [varLib.featureVars] Add quadratic test
We get the optimal solution.
2018-11-09 18:59:28 -05:00
Behdad Esfahbod
8005d43146 [varLib.featureVars] Enable test now that it passes 2018-11-09 16:04:21 -05:00
Behdad Esfahbod
5a34805d05 [varLib.featureVars] Improve test 2018-11-09 11:55:11 -05:00
Behdad Esfahbod
133607f4b1 [varLib.featureVars] Add test 2018-11-09 11:47:49 -05:00
justvanrossum
fffd7e4b67 fixed test failure after merging #1357 2018-11-02 12:32:50 +01:00
justvanrossum
3b7ac3dd78 Merge branch 'master' into addmultilingualnames-mac 2018-11-02 12:30:24 +01:00
justvanrossum
0d06fd23ce fix test failure in addMultilingualName() test by setting mac to None, which makes it behave like before 2018-11-02 12:12:57 +01:00
justvanrossum
cc540c41e9 oops, removed leftover debug turd 2018-11-02 11:59:07 +01:00
justvanrossum
8841d98652 [name] make addMultilingualName() also add Mac names by default. 2018-11-02 11:56:22 +01:00
justvanrossum
0bfee639c6 test named instances 2018-11-02 08:02:56 +01:00
justvanrossum
6e299a1bd5 set reasonable values for ascent and descent, test toy variation font 2018-11-01 21:33:08 +01:00
justvanrossum
beaf0432a9 added many docstrings, and added setupHorizontalMetrics and setupVerticalMetrics methods to replace setupMetrics 2018-11-01 20:30:21 +01:00
justvanrossum
25f29841b7 rename setupDSIG to setupDummyDSIG and added a doc string to clarify the legacy status of this 2018-11-01 13:19:27 +01:00
justvanrossum
d10dc87527 test DSIG 2018-11-01 12:13:47 +01:00
justvanrossum
cabce338c7 calculate glyph bounds implicitly (unless asked not to do that) 2018-11-01 10:17:07 +01:00
justvanrossum
cfd00ef3dd don't need to specify keepGlyphNames, esp. if it matches defsult behavior 2018-11-01 09:57:35 +01:00
justvanrossum
19eac2e00a test localized name table entries 2018-11-01 09:55:27 +01:00