Merge pull request #1908 from justvanrossum/sort-gvar-issue1907

[TTX] sort gvar XML output by glyph name, not glyph order
This commit is contained in:
Cosimo Lupo 2020-05-04 17:43:55 +01:00 committed by GitHub
commit 3da104eef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1038 additions and 1035 deletions

View File

@ -68,6 +68,9 @@ class FakeFont:
def getReverseGlyphMap(self):
return self.reverseGlyphOrderDict_
def getGlyphNames(self):
return sorted(self.getGlyphOrder())
class TestXMLReader_(object):
def __init__(self):

View File

@ -166,7 +166,7 @@ class table__g_v_a_r(DefaultTable.DefaultTable):
writer.simpletag("reserved", value=self.reserved)
writer.newline()
axisTags = [axis.axisTag for axis in ttFont["fvar"].axes]
for glyphName in ttFont.getGlyphOrder():
for glyphName in ttFont.getGlyphNames():
variations = self.variations.get(glyphName)
if not variations:
continue

View File

@ -81,15 +81,6 @@ GVAR_VARIATIONS = {
GVAR_XML = [
'<version value="1"/>',
'<reserved value="0"/>',
'<glyphVariations glyph="space">',
' <tuple>',
' <coord axis="wdth" value="0.7"/>',
' <delta pt="0" x="1" y="11"/>',
' <delta pt="1" x="2" y="22"/>',
' <delta pt="2" x="3" y="33"/>',
' <delta pt="3" x="4" y="44"/>',
' </tuple>',
'</glyphVariations>',
'<glyphVariations glyph="I">',
' <tuple>',
' <coord axis="wght" min="0.0" value="0.5" max="1.0"/>',
@ -113,6 +104,15 @@ GVAR_XML = [
' <delta pt="7" x="1" y="11"/>',
' </tuple>',
'</glyphVariations>',
'<glyphVariations glyph="space">',
' <tuple>',
' <coord axis="wdth" value="0.7"/>',
' <delta pt="0" x="1" y="11"/>',
' <delta pt="1" x="2" y="22"/>',
' <delta pt="2" x="3" y="33"/>',
' <delta pt="3" x="4" y="44"/>',
' </tuple>',
'</glyphVariations>',
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -572,6 +572,19 @@
<delta pt="21" x="0" y="0"/>
</tuple>
</glyphVariations>
<glyphVariations glyph="dotabovecomb">
<tuple>
<coord axis="wght" value="1.0"/>
<delta pt="0" x="-8" y="28"/>
<delta pt="1" x="13" y="16"/>
<delta pt="2" x="17" y="-13"/>
<delta pt="3" x="-27" y="-20"/>
<delta pt="4" x="0" y="0"/>
<delta pt="5" x="0" y="0"/>
<delta pt="6" x="0" y="0"/>
<delta pt="7" x="0" y="0"/>
</tuple>
</glyphVariations>
<glyphVariations glyph="e">
<tuple>
<coord axis="wght" min="0.0" value="0.36365" max="1.0"/>
@ -614,6 +627,12 @@
<delta pt="16" x="0" y="0"/>
</tuple>
</glyphVariations>
<glyphVariations glyph="edotabove">
<tuple>
<coord axis="wght" value="1.0"/>
<delta pt="1" x="-6" y="91"/>
</tuple>
</glyphVariations>
<glyphVariations glyph="s">
<tuple>
<coord axis="wght" value="1.0"/>
@ -635,25 +654,6 @@
<delta pt="15" x="0" y="0"/>
</tuple>
</glyphVariations>
<glyphVariations glyph="dotabovecomb">
<tuple>
<coord axis="wght" value="1.0"/>
<delta pt="0" x="-8" y="28"/>
<delta pt="1" x="13" y="16"/>
<delta pt="2" x="17" y="-13"/>
<delta pt="3" x="-27" y="-20"/>
<delta pt="4" x="0" y="0"/>
<delta pt="5" x="0" y="0"/>
<delta pt="6" x="0" y="0"/>
<delta pt="7" x="0" y="0"/>
</tuple>
</glyphVariations>
<glyphVariations glyph="edotabove">
<tuple>
<coord axis="wght" value="1.0"/>
<delta pt="1" x="-6" y="91"/>
</tuple>
</glyphVariations>
</gvar>
</ttFont>