182 Commits

Author SHA1 Message Date
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
ReadRoberts
63c94beb20 Merge commit '889d683064cea426ac692431ee599752519cea18' into varlib-build-cff2vf
# Conflicts:
#	Lib/fontTools/misc/psCharStrings.py
2018-11-30 09:21:18 -08: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
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
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
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
David Březina
28245afe1e Fix normalization error when condition’s minimum/maximum are missing in designspace, update test too
Fixes #1346
2018-10-24 18:46:45 +02:00
Cosimo Lupo
6db88d7cb7
remove deprecated fontTools.varLib.designspace 2018-10-18 18:40:54 +01:00
Cosimo Lupo
af8c461c92
varLib_test: add test case for GSUB FeatureVariations 2018-09-14 16:51:25 +02:00
Cosimo Lupo
ac9790ca89
travis: 'brew install python' on macOS, use generic py3 tox env
formula is now named just 'python'.
For the homebrew version installed on Travis (which we don't
autoupdate) we *should* get python3.6 with this currently.

It might be the case that python3 is already installed on
Travis macOS image, but need to check.

We call tox with 'TOXENV=py3' so that when Travis updates its homebrew,
we'll get python3.7 automatically.

Finally, use virtualenv instead of venv on mac to fix tox bootstrapping issue

https://github.com/pypa/virtualenv/issues/1051
https://github.com/pre-commit/pre-commit/issues/631
https://travis-ci.org/fonttools/fonttools/jobs/427582922#L214

fixup
2018-09-12 12:09:43 +02:00
Cosimo Lupo
8c597b5375
mutator: round to closest width class
this is the mapping between the half of each percentage intervals and
the associated usWidthClass:

{56.25: 1,
 68.75: 2,
 81.25: 3,
 93.75: 4,
 106.25: 5,
 118.75: 6,
 137.5: 7,
 175.0: 8}

Notice how wdth=80 (in the adjusted test case) will fall in width class
3, instead of 4, because it is < 81.25, thus closer to the nominal 75
than to 87.5.
2018-06-19 14:16:17 +01:00
Cosimo Lupo
8fcbf78d8b
Tests: adjust expected usWeightClass and usWidthClass 2018-06-18 19:41:03 +01:00
Cosimo Lupo
0337fc92fc
Tests: adjust to use new otRound function 2018-06-14 17:49:37 +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
Behdad Esfahbod
1adf7fd2c0 [varLib] Update tests for VarStore optimization
Also, don't emit GDEF if VarStore is empty.
2018-02-21 01:10:36 -08:00
Behdad Esfahbod
d5efd2b7ee [varLib] When optimizing NumShorts, drop zero columns
Related to https://github.com/fonttools/fonttools/issues/1184
2018-02-20 20:51:56 -08:00
Behdad Esfahbod
48125e9812 [varLib] Fix HVAR generation
We cannot tail-optimize there.
2018-02-18 22:58:47 -08:00
Behdad Esfahbod
21cbab8ce9 Fix read/write of VarIdxMap to use glyph names
Was relying on glyph IDs. Ouch.
2018-02-18 22:33:32 -08:00
Behdad Esfahbod
eb6af2da72 [varLib] Fix pruning of HVAR 2018-02-18 21:49:39 -08:00
Cosimo Lupo
f62f79eb23
otConverters: don't write XML comment if NameID value is 0 == NULL
Fixes https://github.com/fonttools/fonttools/issues/1151
2018-01-19 13:25:59 +00:00
Miguel Sousa
62df8ba108 [varLib_test] update expected results
The STAT table is now beginning to be generated after
8af430997d
2017-11-13 23:33:55 -08:00
Cosimo Lupo
26a2616286 [varLib_test] upldate expected results
We pass the fvar axis order to VariationModel after
645b7a8355
2017-10-26 11:25:06 +01:00
Behdad Esfahbod
3fbc4688eb [varLib.mutator] Drop GDEF is nothing left in it
Part of fixing https://github.com/fonttools/fonttools/pull/1079#issuecomment-338710803
2017-10-25 11:58:44 -04:00
Cosimo Lupo
5de673c424 [Tests] adjust GDEF expected data 2017-10-20 20:13:14 -04:00
Behdad Esfahbod
5fabd3eb32 [varLib] Fix build expectation after MVAR support in mutator
Looks right to me...
2017-10-20 20:13:14 -04:00
Jens Kutilek
a25a401fd2 Merging TT hinting (#1069)
Merge cvts; copy fpgm, prep, glyf programs from base master if compatible.
2017-10-12 10:40:40 +02:00
Jens Kutilek
55cda3901c Only emit a cvar tuple if any delta is not zero. 2017-10-09 17:30:27 +02:00
Jens Kutilek
f7c4995413 Set correct expected control value 2017-10-09 13:22:33 +02:00
Jens Kutilek
9209da1bc3 Add cvt table to test data 2017-10-09 13:18:59 +02:00
Jens Kutilek
5b39aa7af2 Implement building cvar tables 2017-10-09 13:08:55 +02:00
Jens Kutilek
f0d5db9975 Add cvt tables to test data 2017-10-06 11:47:20 +02:00
Jens Kutilek
80414303d0 Add interpolation of cvt/cvar table 2017-10-05 13:32:06 +02:00
Cosimo Lupo
2524d76bdb [varLib/data] add UFO sources for Noto Sans subset
used to build the the interpolatable ttx files.

We can reuse it for other variation-related tests.
2017-08-16 18:46:38 +01:00
Cosimo Lupo
45c08d2858 [varLib_test] add tests for building avar table
this adds three new tests for varLib.build:

1) the input designspace contains a single 'weight' axis with <map>
   elements that modify the normalization mapping;

2) the input designspace contains two 'weight' and 'width' axes both
   with <map> elements, but the 'width' axis only contains identity
   mappings;

3) the input designspace contains two 'weight' and 'width' axes, but
   only one axis ('weight') has some <map> elements.

The master interpolatable ttx files for 'TestFamily3' are a subset of
Noto Sans containing only the letters to type the word "FontTools".
2017-08-16 18:44:18 +01:00
Cosimo Lupo
d89fcf93bc [varLib_test] add 'MVAR' to expected tables list
Note: the `expect_ttx` test is passing, but the `check_ttx_dump` which ensures the TTX dump is the same after saving and reloading the font, is currently failing, as the "ValueRecordSize" count is None

```
--- /Users/cosimolupo/Documents/Github/fonttools/Tests/varLib/data/test_results/Build.ttx
+++ /var/folders/7k/fl5q53lj51g0d8hxdkrx9_z80000gn/T/tmpoBCAua/tmp1.ttx
@@ -174,8 +174,7 @@
   <MVAR>
     <Version value="0x00010000"/>
     <Reserved value="0"/>
-    <ValueRecordSize value="8"/>
-    <!-- ValueRecordCount=2 -->
+    <ValueRecordSize value="None"/>
     <VarStore Format="1">
       <Format value="1"/>
       <VarRegionList>
```
2017-08-03 16:51:25 +01:00
Cosimo Lupo
4398e3b26b [Tests/varLib] fix up expected test data following latest IUP optimization algorithm 2017-07-27 17:06:32 +01:00
Jens Kutilek
92c8b3f754 Add test and test data for mutator with interpolated points 2017-05-18 16:40:33 -07:00
Sascha Brawer
017fa4e9c6 [fvar] Expose flags in XML
Fixes https://github.com/fonttools/fonttools/issues/932.
2017-05-02 00:51:44 +08:00