For reproducible builds, check the presence of SOURCE_DATE_EPOCH
environment variable and use it for the time stamp. This affects the
head.modified (and head.created in merge.py).
See https://reproducible-builds.org/specs/source-date-epoch/
The XML output for other tables is also sorted alphabetically
by glyph name, not by glyph order.
This reverts commit c77e9fe12d5879aeb79c05f8ececebb3275524b7.
Before this change, the AAT lookups were alphabetically sorted by glyph name,
but it seems more natural to write XML in the usual glyph order. No changes to
the binary format (which already was in glyph order); this only affects how
XML output is produced.
The AAT `ankr` anchor point table is an auxiliary table for `kerx`,
used to store anchor overrides in case the glyph itself does not
supply the needed anchors as control points. Among the fonts that
come pre-installed with MacOS 10.12.6, `ankr` is used by a handful
of non-Latin fonts such as “Myanmar MN”, “Devanagari Sangam MN”,
and “Arial HB”.
https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6ankr.html
Other metamorphosis types are not yet supported and will raise an error
upon decompilation. The TTX tool catches the error and continues to emit
a hexdump of the table contents, just as before this change.
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.
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".
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.
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.
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.
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.
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>
```