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:
commit
3da104eef5
@ -68,6 +68,9 @@ class FakeFont:
|
|||||||
def getReverseGlyphMap(self):
|
def getReverseGlyphMap(self):
|
||||||
return self.reverseGlyphOrderDict_
|
return self.reverseGlyphOrderDict_
|
||||||
|
|
||||||
|
def getGlyphNames(self):
|
||||||
|
return sorted(self.getGlyphOrder())
|
||||||
|
|
||||||
|
|
||||||
class TestXMLReader_(object):
|
class TestXMLReader_(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -166,7 +166,7 @@ class table__g_v_a_r(DefaultTable.DefaultTable):
|
|||||||
writer.simpletag("reserved", value=self.reserved)
|
writer.simpletag("reserved", value=self.reserved)
|
||||||
writer.newline()
|
writer.newline()
|
||||||
axisTags = [axis.axisTag for axis in ttFont["fvar"].axes]
|
axisTags = [axis.axisTag for axis in ttFont["fvar"].axes]
|
||||||
for glyphName in ttFont.getGlyphOrder():
|
for glyphName in ttFont.getGlyphNames():
|
||||||
variations = self.variations.get(glyphName)
|
variations = self.variations.get(glyphName)
|
||||||
if not variations:
|
if not variations:
|
||||||
continue
|
continue
|
||||||
|
@ -81,15 +81,6 @@ GVAR_VARIATIONS = {
|
|||||||
GVAR_XML = [
|
GVAR_XML = [
|
||||||
'<version value="1"/>',
|
'<version value="1"/>',
|
||||||
'<reserved value="0"/>',
|
'<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">',
|
'<glyphVariations glyph="I">',
|
||||||
' <tuple>',
|
' <tuple>',
|
||||||
' <coord axis="wght" min="0.0" value="0.5" max="1.0"/>',
|
' <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"/>',
|
' <delta pt="7" x="1" y="11"/>',
|
||||||
' </tuple>',
|
' </tuple>',
|
||||||
'</glyphVariations>',
|
'</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
@ -572,6 +572,19 @@
|
|||||||
<delta pt="21" x="0" y="0"/>
|
<delta pt="21" x="0" y="0"/>
|
||||||
</tuple>
|
</tuple>
|
||||||
</glyphVariations>
|
</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">
|
<glyphVariations glyph="e">
|
||||||
<tuple>
|
<tuple>
|
||||||
<coord axis="wght" min="0.0" value="0.36365" max="1.0"/>
|
<coord axis="wght" min="0.0" value="0.36365" max="1.0"/>
|
||||||
@ -614,6 +627,12 @@
|
|||||||
<delta pt="16" x="0" y="0"/>
|
<delta pt="16" x="0" y="0"/>
|
||||||
</tuple>
|
</tuple>
|
||||||
</glyphVariations>
|
</glyphVariations>
|
||||||
|
<glyphVariations glyph="edotabove">
|
||||||
|
<tuple>
|
||||||
|
<coord axis="wght" value="1.0"/>
|
||||||
|
<delta pt="1" x="-6" y="91"/>
|
||||||
|
</tuple>
|
||||||
|
</glyphVariations>
|
||||||
<glyphVariations glyph="s">
|
<glyphVariations glyph="s">
|
||||||
<tuple>
|
<tuple>
|
||||||
<coord axis="wght" value="1.0"/>
|
<coord axis="wght" value="1.0"/>
|
||||||
@ -635,25 +654,6 @@
|
|||||||
<delta pt="15" x="0" y="0"/>
|
<delta pt="15" x="0" y="0"/>
|
||||||
</tuple>
|
</tuple>
|
||||||
</glyphVariations>
|
</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>
|
</gvar>
|
||||||
|
|
||||||
</ttFont>
|
</ttFont>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user