26 Commits

Author SHA1 Message Date
ReadRoberts
ecf738b964 Add support for building VVAR table from vmtx and VORG tables.
Add test case.
2019-03-21 10:06:47 -07:00
Nikolaus Waxweiler
8bff72139c Reinstate fixed load_masters() 2019-02-05 13:02:53 +00:00
Nikolaus Waxweiler
1e746e34ee
Revert "load_masters: actually assign font attributes" (#1486)
* Revert "load_masters: actually assign font attributes"

This reverts commit ef1d4cd02d1e46f5dac3914f547a6e4275cf3077, which caused a
crash in `interpolate_layout()` when `deepcopy`ing OTFs.

Amend code and tests while I work on a real fix.
2019-02-05 11:38:46 +00:00
Nikolaus Waxweiler
63a56b98fd _add_MVAR: set model only once, after a tables have been fetched 2019-02-04 16:03:47 +00:00
Cosimo Lupo
7740d1736c
varLib_test: add test for sparse masters 2019-01-16 11:25:29 +00:00
Cosimo Lupo
b2fac2333e
[varLib] allow loading masters from TTX files as well
in a designspace document, the sources' filename attribute can now contain
a relative path to a .TTX file for that master, in addition to .TTF or .UFO
(the latter, resolved through a master_finder callable as before).
2019-01-14 16:32:51 +00:00
Cosimo Lupo
7d688ff18a
varLib_test: read TTFonts from compiled binary files
instead of importing from TTX, and set lazy=True so we exercise the special SFNTReader.__deepcopy__
2019-01-03 11:26:53 +00:00
Cosimo Lupo
5b250db6cb
varLib_test: test loading master with layerName but without required font object 2019-01-02 13:39:39 +00:00
Cosimo Lupo
ba197cb84c
varLib_test: no need to reload master_ttfs; reuse the reload_font helper func in the other tests 2019-01-02 12:52:57 +00:00
Nikolaus Waxweiler
e464e450ac Make build and load_designspace accept a DS object 2018-12-19 13:40:11 +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
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
Cosimo Lupo
af8c461c92
varLib_test: add test case for GSUB FeatureVariations 2018-09-14 16:51:25 +02:00
Cosimo Lupo
3c59ffda5e
Test: raise DesignSpaceDocumentError when no axes defined 2018-09-11 18:33:53 +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
8f5929879d [varLib_test] minor
There must be some keystroke in my text editor that triggers these
strange non-ASCII unprintable characters...

I didn't have time to investigate.
2017-08-16 19:04:13 +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
Miguel Sousa
6241ff77ec [varLib_test] no need for this test since axisMap parameter is no longer supported
test_varlib_build3_ttf() already covers the case of a .designspace without <axes> element
2017-04-13 00:58:23 -07:00
Behdad Esfahbod
9034f4f3f1 [varLib] Rewrite axis configuration code
We do not accept nonstandard axes if <axes> element is not present.
Breaks one test.  Needs updated expectations.

Soon we'll be generating avar as well and all will be better, much better.
2017-04-12 21:54:43 -07:00
Miguel Sousa
bbecfe38c4 [varLib tests] More tests 2017-03-06 00:59:21 -08:00
Miguel Sousa
274654d440 [varLib tests] Move test results to separate folder 2017-03-05 13:44:32 -08:00
Miguel Sousa
bfccdbb5d5 [varLib tests] Rename test files 2017-03-05 12:05:16 -08:00
Cosimo Lupo
57ed70d7b0
[varLib_test] compile binary varfont and check TTX dump doesn't change 2017-03-01 17:55:20 +00:00
Miguel Sousa
6ccd7c83f0 File rename for consistency (https://github.com/fonttools/fonttools/pull/866#issuecomment-283345103) 2017-03-01 06:28:57 -08:00