Sascha Brawer
ce5d9de936
[morx] Pass font to format-specific AATLookup.read() methods
...
To use self.valueConverter.read(), we will need to pass the font.
2017-08-14 21:34:15 +02:00
Sascha Brawer
191c620951
[morx] Parametrize AATLookup.write() for different value types
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
bdf29b4169
[morx] Separate building from writing lookup tables
...
For AAT lookup format 2 (and other formats too), we need to shuffle
the data before we can estimate the encoded size. After this restructuring,
this data shuffling only needs to happen once.
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
Behdad Esfahbod
f188187b08
[morx] Implement StructWithLength.write()
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
Behdad Esfahbod
75b0eaa5bb
[morx] Fix SubStruct xmlWrite()
2017-08-14 21:34:15 +02:00
Sascha Brawer
7f774ae84c
[morx] Change MorphType to uint8, to comply with the spec
2017-08-14 21:34:15 +02:00
Sascha Brawer
b00e2dfec4
[morx] Recognize MorphType as another type of lookup
...
Currently, this makes no difference at all. Later, we'll use this
for dispatching AAT lookup types in the same way how we already
dispatch OpenType lookup types.
2017-08-14 21:34:15 +02:00
Sascha Brawer
f56b71937d
Add missing parts from morx branch
...
After this change, the `morx` table in Zapfino.ttf can be ttx'ed again.
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
Behdad Esfahbod
6eb807b55f
[subset] Keep (empty) DefaultLangSys for Script 'DFLT'
...
That's still required by the spec.
https://bugzilla.mozilla.org/show_bug.cgi?id=1331737#c32
2017-08-11 14:51:15 -07:00
Behdad Esfahbod
f0c58ddf9b
[varLib] Remove unused import
2017-08-09 21:43:44 -07:00
Behdad Esfahbod
fe01d87b94
[subset] Support GSUB/GPOS.FeatureVariations
...
We should add a test using the font at:
https://github.com/behdad/harfbuzz/issues/521
Test with:
$ fonttools subset avar_rvrn.ttf --text=r
2017-08-08 17:21:58 -07:00
Behdad Esfahbod
b2e9882b30
[subset] Update list of features
2017-08-08 17:21:58 -07:00
Jens Kutilek
f36c7ec39f
Make "unexpected character" exception ASCII-safe
2017-08-08 13:46:05 +02:00
Behdad Esfahbod
a1629fa52b
[varLib] Update supportScalar() to allow for OpenType-specific contraints
...
Part of https://github.com/fonttools/fonttools/issues/1020
2017-08-07 17:05:29 -07:00
justvanrossum
18fa7ccec0
supportScalar(): ignore an axis when its peak value is 0; fixes #1020
2017-08-07 13:16:24 +02:00
Erik van Blokland
4762865cac
Makes it a bit easier to find out what is wrong with the values.
2017-08-05 20:37:37 +02:00
Behdad Esfahbod
b9151ffacb
[varLib] Add assertions to make sure we merge similar ValueFormat2-zeroedness
2017-08-04 09:22:43 +01:00
Behdad Esfahbod
49f249b118
[varLib] Add faster tables first
...
Speeds up development speed :).
2017-08-04 09:07:38 +01:00
Behdad Esfahbod
f3031ce797
[varLib] Add comment
2017-08-04 08:55:34 +01:00
Behdad Esfahbod
010ea47de1
[varLib] Minor rename
2017-08-04 08:41:29 +01:00
Cosimo Lupo
b5ab6d3af3
[varLib] temporary workaround to make MVAR tests pass
...
https://travis-ci.org/fonttools/fonttools/jobs/260671300#L2519-L2519
Behdad will revert this later
2017-08-03 17:57:16 +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
74035147a0
[varLib] remove unused 'instances' argument in _add_avar
2017-08-03 14:57:02 +01:00
Behdad Esfahbod
3746f75d7f
[varLib] Split _add_fvar_avar() into _add_fvar() and _add_avar()
2017-08-03 12:38:23 +01:00
Cosimo Lupo
19c4b377b8
[varLib] add predefined avar mappings to fix rendering in CoreText
...
Fixes https://github.com/googlei18n/fontmake/issues/295
2017-08-02 15:12:26 +01:00
Behdad Esfahbod
c55ef5257d
[varLib] Flatten multiple tail PairPosFormat2 subtables before merging
...
Reuses the aligner. Neat.
2017-08-01 19:06:40 +01:00
Behdad Esfahbod
eca0c441d1
[varLib] Factor out PairPosFormat2 matrix alignment code
2017-08-01 19:06:40 +01:00
Behdad Esfahbod
f2a1f3446b
[varLib] Minor
2017-08-01 19:06:40 +01:00
Cosimo Lupo
ca1bb10aa8
[varLib] test avar mappings are 'interesting' after normalizing values
...
otherwise we could end up with unnecessary avar tables only containing
the standard maps.
2017-08-01 12:08:44 +01:00
Cosimo Lupo
4153d792c5
Updated changelog
2017-08-01 11:35:55 +01:00
Cosimo Lupo
b5da19dc4b
Merge pull request #970 from mashabow/cff-bounds-recalc
...
CFF bounds recalculation
2017-08-01 11:09:30 +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
22dfcd94a1
[cffLib] Use None instead of initialBounds
...
https://github.com/fonttools/fonttools/pull/970#discussion_r117621101
2017-08-01 10:53:29 +09:00
Masaya Nakamura
68c7275945
[hhea,vhea] Refactor
2017-08-01 10:53:28 +09:00
Masaya Nakamura
69199b3225
[hhea,vhea] Ensure charString has bounds
2017-08-01 10:53:27 +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
1b773c17d7
[hhea,vhea] Fix advance{Width,Height}Max calculations
...
Before this commit, empty glyphs were wrongly ignored.
2017-08-01 10:51:48 +09:00
Masaya Nakamura
994337ffe2
[ttLib] Update recalcBBoxes description
2017-08-01 10:51:48 +09:00
Masaya Nakamura
d13aab2c70
[hhea,vhea] Add recalcBBoxes support for CFF-flavored fonts
2017-08-01 10:51:48 +09:00
Masaya Nakamura
cf3474ba6a
[hhea,vhea] Refactor to support CFF bounds recalculation
2017-08-01 10:51:47 +09:00
Masaya Nakamura
d1bc55756f
[hhea,vhea] Use float('inf') instead of INFINITY
2017-08-01 10:51:47 +09:00