6764 Commits

Author SHA1 Message Date
ReadRoberts
ebc1b0b779 [cff2 varlib subset] Add message to assert for when a CFF2 charstring has an initial width. 2018-12-10 10:44:59 -08:00
ReadRoberts
0586c06199 [varLib subset CFF2] Set PrivateDict nominal and default WidthX to None
@bedhad
Address issues raised in #1403

I do think setting the dummy CFF2 PrivateDict nominalWidthX and defaultWidthX to None, which leads to the charstring.width also being None,  is a good idea. I originally set them to 0, which produces a charstring width of 0, in order to avoid problems with logic that assumes that the field is good for math. However, I now think that it is better to find errors around charstring type assumptions earlier than later.

 "drop_hints()" is actually not wrong - I did look at this when making the changes. For CFF2 charstrings, self.width is always equal to self.private.defaultWidthX, so the width is never inserted. This is because in psCharstrings.py::T2WidthExtractor.popallWidth(), the test "evenOdd ^ (len(args) % 2)" is alway False.  Left to myself, I would not change this code. If the CFF2 charstring is correct, there is not a problem. if the CFF2 charstring is not correct, then both in drop_hints() and in T2WidthExtractor.popallWidth(), the logic will stack dump. I did add asserts, but am not totally sure it is worth the extra calls.
2018-12-06 11:55:48 -08:00
justvanrossum
2b7656550d [fontBuilder] More varLib.builder leverage 2018-12-06 18:30:09 +01: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
ReadRoberts
c13855bdd6 cff2 vf fixes. Make calc_bounds work, fix subsetting bug.
Fixed psCharstrings so that calc_bounds will run. I would guess no-one has tried to use a BoundsPen on a CFF2 VF before - thanks to Chris Chapman. It now returns a result only for the default instance.

Fixed bug in subsetting: removed assert that a Subr is not empty after subsetting or de-hinting. CFF2 Charstrings do not have terminal "return' op.
2018-12-05 15:50:10 -08:00
Behdad Esfahbod
e05673bf16
Merge pull request #1401 from justvanrossum/test1400
[varLib.featureVars] tests for #1400
2018-12-05 13:14:39 -08:00
justvanrossum
8812f9072b tests for #1400 2018-12-05 19:54:14 +01:00
Behdad Esfahbod
37366b563e [varLib.featureVars] Fix overlap remainder logic
Fixes https://github.com/fonttools/fonttools/issues/1400
2018-12-05 10:33:35 -08:00
justvanrossum
7d64d30037 fixed typo in var name 2018-12-05 15:10:54 +01:00
justvanrossum
82c4f410fb remove empty fdArrayList argument, will be filled in 2018-12-05 15:09:27 +01:00
justvanrossum
c3fa7de615 cosmetic change 2018-12-05 15:07:58 +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
Just van Rossum
93cb09316a
Merge pull request #1398 from justvanrossum/regex-raw-strings
[ttLib] Use raw strings for regex patterns, fixes #1389.
2018-12-05 12:58:42 +01:00
justvanrossum
1828dae78a Use raw strings for regex patterns. Fixes #1389 2018-12-05 12:46:36 +01:00
Behdad Esfahbod
93633a85ef [CFF] Move variations-specific CFF code to varLib.cff module 2018-12-04 19:22:02 -08:00
Behdad Esfahbod
aedcc33bbf
Merge pull request #1397 from fonttools/clean-cff2
CFF2 code cleanup
2018-12-04 19:16:10 -08:00
ReadRoberts
1f2600ff65 [cff2] Add subset.cff functions for CFF/CFF2 class:
desubroutinize
remove_hints
remove_unused_subroutines

Fix issue in cff2mergePen.py because of  removing CFFS2Subrs class in prior commit.
2018-12-04 18:34:22 -08:00
ReadRoberts
61c213d0ff [cffLib] clean up isCFF2 in psCharStrings
Removed check_program functions. Supporting these requires knowledge of CFF vs CFF2 state, whci is leads to wide-spread diffuse changes. Also, not needed - the endchar/return opcodes are removed when compiling for CFF2.

Removed CFF2Subr class. This was used for CFF2 CharStrings, and allowed avoiding referencing the width fields. I worked around this by providing dummy values for the Private.nominalWidthX and defaultWidthX.

Added a public method PrivateDict.in_cff2.
2018-12-04 15:31:55 -08:00
Behdad Esfahbod
d53a26acae
Merge pull request #1378 from fonttools/varlib-build-cff2vf
[varLib]Add support for building CFF2 variable font
2018-11-30 21:47:03 -05:00
Behdad Esfahbod
31019eac8e [CFF] Whitespace 2018-11-30 21:46:16 -05:00
Behdad Esfahbod
2d94f6e512
Merge pull request #1388 from fonttools/pyup-scheduled-update-2018-11-26
Scheduled weekly dependency update for week 47
2018-11-30 20:20:38 -05:00
Behdad Esfahbod
ee1b1a6a3b
Merge pull request #1390 from arshadkazmi42/patch-1
Fix tox url in README
2018-11-30 20:20:23 -05:00
ReadRoberts
331a55588b [varlib] update model.reorderMasters() to support arbitrary mapping. 2018-11-30 10:37:34 -08:00
ReadRoberts
63c94beb20 Merge commit '889d683064cea426ac692431ee599752519cea18' into varlib-build-cff2vf
# Conflicts:
#	Lib/fontTools/misc/psCharStrings.py
2018-11-30 09:21:18 -08:00
ReadRoberts
29b1246515 [varlib] Move master list reordering into models.py
It is useful to re-order the CFF2 master font list to match the sorted location order, but doing so means touching internal fields of the model, so we'll move this into the VariationModel class.
2018-11-30 09:12:27 -08:00
Denis Moyogo Jacquerye
889d683064 Bump version: 3.33.0 → 3.33.1.dev0 2018-11-30 14:20:33 +00:00
Denis Moyogo Jacquerye
3431770225 Release 3.33.0 2018-11-30 14:20:32 +00:00
Denis Moyogo Jacquerye
183cddc995 Update changelog [skip ci] 2018-11-30 14:13:48 +00:00
Behdad Esfahbod
361e1e6aa0
Merge pull request #1377 from fonttools/varlib-interpolate-cff2
Varlib interpolate cff2
2018-11-30 00:21:13 -05:00
Behdad Esfahbod
cce640a146 [CFF] Minor 2018-11-30 00:13:38 -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
Behdad Esfahbod
8b1730774a [CFF] Move varLib.mutator-specific code out of subset.cff 2018-11-29 17:07:51 -05:00
Behdad Esfahbod
f97b802869 [CFF] Minor 2018-11-29 14:20:45 -05:00
Behdad Esfahbod
fb3248ff1b [CFF] Whitespace 2018-11-29 14:15:54 -05:00
Behdad Esfahbod
18cfe2371a [CFF} Rename subset.cffLib to subset.cff 2018-11-29 14:09:57 -05:00
Behdad Esfahbod
7daf9ef298 [CFF] Whitespace 2018-11-29 14:08:53 -05:00
Behdad Esfahbod
d423236019 [CFF] Unbreak subsetter 2018-11-29 14:08:42 -05:00
Behdad Esfahbod
85bc8fec07 [CFF] Remove unused code 2018-11-29 13:45:52 -05:00
Arshad Kazmi
704d7dc237
Fix tox url in README 2018-11-29 00:10:51 +05:30
pyup-bot
8d08a2eb3f Update zopfli from 0.1.4 to 0.1.6 2018-11-26 15:04:13 +00: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
ReadRoberts
6cb84deccf varLib. Add support for building CFF2 variable font with a call to varLib.build().
Fix bug in psCharStrings, to allow the CFF2Subr calls draw function to work
2018-11-20 12:20:46 -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
Denis Moyogo Jacquerye
46add5375d kern table: allow subtables larger than length value 2018-11-20 12:41:57 +00:00
Behdad Esfahbod
abb9d149ed [subset] Fix subsetting of VarStore
Was *so* broken.  Ouch!

Reported by Nyshadh, reproduced with Comfortaa-Regular.ttf.
2018-11-20 00:24:28 -05:00
ReadRoberts
92b5e0faaa [varLib.mutator] Fix changes lost during cherry-picking. 2018-11-19 20:35:34 -08:00