Instead of raising AssertionError when users define custom axes
without explicit `<labelname xml:lang="en">ZZZZ</labelname>` element,
it's better to use the axis' name attribute, and treat it as "en"
language.
For example, if users generate the designspace from SuperPolator,
they can't edit the axis labelname attribute from the UI (or maybe
it's just me that couldn't figure out how to do it).
Right now only merges DefaultLangSys. Also, does not remove unused Feature's after merge.
Moreover, does not merge kind Lookups of the same Feature.
But it works!
I added the id() trick because normal objects are not hashable in Python3.
Remove that hack and use a custom dict subclass that allows us to use
objects as keys as long as they don't change.
The custom dict has a different, desirable, property as well: upon seeing
keys it does not know, it just adds them to the end of the list. Will use
this feature in next commits to merge ScriptList properly.
It appears that cElementTree is still present as a deprecated alias in python 3
We tell coverage to skip this branch since it is not (currently) being hit
The upstream code comes from here:
https://github.com/regebro/svg.path
I prefer to 'vendor' the svg path parser instead of adding it as a
requirement to fonttools, because this way we can patch it to call a
pen object directly instead of returning a list of Path instances.
Also I'm only interested in the parser module, the rest of svg.path
is not useful here.
The license of svg.path is MIT, so it's compatible with fonttools
license (BSD 2-clause).
I added the original code so it's clear from the subsequent commits
what changes are being applied.
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.