313 Commits

Author SHA1 Message Date
Sascha Brawer
16a4001901 [AAT] Implement subsetting of lcar ligature carets table 2017-08-25 07:35:13 -07:00
Sascha Brawer
13fe9b5c34 [AAT] Make lcar ligature carets table a format-switching table
For consistency with other AAT tables, and to support additional
formats in the (rather unlikely) case those would ever be defined.
2017-08-25 14:53:43 +02:00
Sascha Brawer
f5793401ce [AAT] Implement bsln baseline table
The AAT baseline table uses arrays whose length is constant instead of
getting encoded in the data. Extended otBase to support such arrays.
2017-08-25 03:55:06 -07:00
Sascha Brawer
84b0cacf95 [AAT] Implement subsetting of opbd Optical Bounds table 2017-08-22 14:36:05 -07:00
Sascha Brawer
28b179a018 [AAT] Implement subsetting of prop table with AAT glyph properties 2017-08-22 08:06:59 -07:00
Sascha Brawer
2f69d2959c [AAT] Fix decompilation of AppleChancery and other AAT fonts
Fixes https://github.com/fonttools/fonttools/issues/1031.
2017-08-19 20:41:43 -07:00
Cosimo Lupo
4bf68d82bc [otConverters_test] add tests for _LazyList 2017-08-18 17:26:35 +01:00
Sascha Brawer
a47f658855 [AAT] Support the opbd table with optical bounds
Interestingly, this can handle the examples from the AAT specification
(which are part of the unit tests), and also most AAT fonts on my disk.
However, some other AAT fonts such as Apple Chancery cannot be decompiled.
The failure seems to be a general problem with how fonttools decompiles
AAT lookups of format 4, and unrelated to this present change.
2017-08-18 08:39:44 -07:00
Sascha Brawer
d05617b4bd [AAT] Support prop table with glyph properties 2017-08-17 11:09:53 -07:00
Cosimo Lupo
ed0d09be22 Merge pull request #1026 from anthrotype/avar-tests
[varLib] add tests for avar; always include default maps
2017-08-17 11:12:37 +01:00
Sascha Brawer
d11e7d98e8 [AAT] Support lcar table 2017-08-16 11:47:27 -07: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
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
Sascha Brawer
ff7cf27777 [AAT] Fix binary search headers of AATLookup formats 2 and 6
In format 2 and 6, AAT lookups contain a binary search header with
the number of elements in the lookup table. Before this change, the
element count would also include the special trailing end-of-table
value that is required by the font format specification.  However,
the binary search header should only count the actual elements
without the trailer.

Also, in the examples from the AAT specification, the special
end-of-table entries use 0xFFFF for glyph ID keys, and zeroes
for the filler values. Before this change, we had filled the
values with 0xFF bytes.
2017-08-16 19:43:25 +02:00
Sascha Brawer
4cf76edd87 [AAT] Delegate XML reading and writing to value class converter
Before this change, the code assumed that all values of AAT lookups
get internally represented as strings, which is correct for GlyphID
values but not generally the case.

Also renaming the XML element from `Substitution` to `Lookup`
because AAT lookups have other uses beyond glyph substitutions.
2017-08-15 19:40:50 +02:00
Sascha Brawer
228550a1d2 [AAT] Do not prune AATLookup values
Before this change, the decoder would silently remove "redundant" values
when decompiling AAT lookups. However, it is perfectly valid for a lookup
to map a glyph ID to itself, and also not all AAT lookups have glyph IDs as
their value range.
2017-08-15 18:33:57 +02:00
Sascha Brawer
020f7391ef [morx] Parametrize AATLookup value type in otData 2017-08-14 21:34:15 +02:00
Sascha Brawer
61874d3600 [morx] Generalize AATLookup to other value types
With AAT, the same lookup data structure can be used for various
types of values. In the morx table, the values are glyph IDs or
glyph classes, which both are encoded as 16-bit unsigned integers.
In other AAT tables, however, the values can be different data types
with different encodings. By passing a `valueWriter` callback and
explicit `valueSize`, we prepare for eventually templatizing
the building of AATLookups.

Also, assert that the called writer wrote the exact number of bytes
that was predicted when figuring out what format should be used for
encoding an AATLookup.
2017-08-14 21:34:15 +02:00
Sascha Brawer
7f2007f46c [morx] Write AATLookup format 8 2017-08-14 21:34:15 +02:00
Sascha Brawer
91827e663f [morx] Write AATLookup format 2 2017-08-14 21:34:15 +02:00
Sascha Brawer
68dc15375b [morx] Fix output for AATLookup format 6
We now produce the correct binary search headers, and add a fake item
for terminating the binary search.
2017-08-14 21:34:15 +02:00
Sascha Brawer
57f01b27cb [morx] Preliminary code for writing AATLookups
Needs more work.
2017-08-14 21:34:15 +02:00
Sascha Brawer
4b5b8ea53d [morx] Implement AATLookup.xmlRead 2017-08-14 21:34:15 +02:00
Sascha Brawer
b40ba05f6f [morx] Group AATLookup substitutions into a parent XML element 2017-08-14 21:34:15 +02:00
Sascha Brawer
483bb67b60 Rebase morx branch to current master 2017-08-14 21:34:15 +02: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
Masaya Nakamura
3708f2c8d3 Don't cache charString bounds
https://github.com/fonttools/fonttools/pull/970#discussion_r117903692
2017-08-01 10:54:47 +09:00
Masaya Nakamura
423e829b73 [_v_h_e_a_test] Add tests for recalc() 2017-08-01 10:53:27 +09:00
Masaya Nakamura
a4fda12810 [_h_h_e_a_test] Add tests for recalc() 2017-08-01 10:51:48 +09:00
Masaya Nakamura
b22b59f730 [cffLib] Use intRect() for FontBBox rounding
AFDKO seems to calculate bounds and side bearings in this manner.
2017-08-01 10:51:47 +09:00
Masaya Nakamura
b84ee6744d [cffLib] Recalc CFF's FontBBox when compiling 2017-08-01 10:51:47 +09:00
Masaya Nakamura
a68bfc2458 [psCharStrings] Add recalcBounds() to T2CharString 2017-08-01 10:51:47 +09:00
Behdad Esfahbod
39ffa74128 Merge pull request #1019 from fonttools/varlib-iup-optimal
Varlib iup optimal
2017-07-28 12:09:27 +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
ReadRoberts
22162d8a71 Update CFF2 test XML data to match latest output: default FontMatrix is omitted from FDArray FontDict. 2017-06-20 16:23:52 -07:00
Denis Moyogo Jacquerye
6d07d48846 Upate CFF tests for default for UnderlinePosition
Missing UnderlinePosition added in a72f26e5
2017-06-09 07:03:54 +01:00
Miguel Sousa
d80bc25dad Merge branch 'specializer-tests' 2017-05-31 17:43:32 -07:00
Miguel Sousa
0d894c6ec2 [cffLib.specializer_test] Resolve conflicts 2017-05-31 17:20:34 -07:00
Cosimo Lupo
bdeb9f8925
[Tests/feaLib/data] minor: update comments referring to issue #976 2017-05-30 11:01:39 +01:00
Cosimo Lupo
12b90f073e [feaLib] don't de-duplicate lookups
keep original lookup order and preserve the feature file's semantics

Fixes https://github.com/fonttools/fonttools/issues/448
2017-05-30 11:45:03 +02:00
Cosimo Lupo
fd3cd6f367 Merge pull request #969 from fonttools/varlib-iup
Varlib iup
2017-05-24 11:44:59 +01:00
Behdad Esfahbod
877ac7540c Fix test after 0ed2df3f22bd4172e439b8deeb2070e3f62b26d3
interpolate_layout now accepts axis names in designspace name
format, NOT axis tags.
2017-05-23 00:31:15 -07:00
Jens Kutilek
92c8b3f754 Add test and test data for mutator with interpolated points 2017-05-18 16:40:33 -07:00
Behdad Esfahbod
af041259ee Fix tests for recent changes 2017-05-18 16:06:10 -07:00
Cosimo Lupo
faa899f9e9
[specializer_test] temporarily disable failing tests
Let's appease the bots for now.
Later on we can add tests for invalid args number for each operator so specializer.py module can reach 100 coverage.
2017-05-16 23:01:00 +01:00
Cosimo Lupo
1c9198e3f0
[_g_l_y_f] add test for GlyphCoordinates' float precision loss issue (#964) 2017-05-16 10:34:37 +01:00
Miguel Sousa
5d981cae0a [cffLib.specializer_test] Additional tests 2017-05-08 15:49:56 -07:00
Miguel Sousa
3c29ff73a7 [cffLib.specializer_test] Tests for missing arguments 2017-05-08 15:49:47 -07:00
Miguel Sousa
1d3ac1add4 [cffLib.specializer_test] TODO 2017-05-08 15:49:39 -07:00