Skip to content

Commit

Permalink
Add R.alt test glyph that redefines global axes as local axes
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Sep 4, 2023
1 parent 68a3f8c commit 9b899e7
Show file tree
Hide file tree
Showing 11 changed files with 287 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="R.alt" format="2">
<advance width="720"/>
<outline>
<contour>
<point x="385" y="0" type="line"/>
<point x="705" y="0" type="line"/>
<point x="672" y="211" type="line" smooth="yes"/>
<point x="663" y="266"/>
<point x="624" y="304"/>
<point x="556" y="304" type="curve"/>
<point x="366" y="304" type="line"/>
</contour>
<contour>
<point x="30" y="0" type="line"/>
<point x="350" y="0" type="line"/>
<point x="350" y="800" type="line"/>
<point x="30" y="800" type="line"/>
</contour>
<contour>
<point x="280" y="548" type="line"/>
<point x="365" y="548" type="line" smooth="yes"/>
<point x="394" y="548"/>
<point x="407" y="536"/>
<point x="407" y="487" type="curve" smooth="yes"/>
<point x="407" y="432"/>
<point x="394" y="424"/>
<point x="365" y="424" type="curve" smooth="yes"/>
<point x="280" y="424" type="line"/>
<point x="280" y="232" type="line"/>
<point x="398" y="232" type="line" smooth="yes"/>
<point x="611" y="232"/>
<point x="700" y="325"/>
<point x="700" y="517" type="curve" smooth="yes"/>
<point x="700" y="708"/>
<point x="601" y="800"/>
<point x="387" y="800" type="curve" smooth="yes"/>
<point x="280" y="800" type="line"/>
</contour>
</outline>
</glyph>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>R.alt</key>
<string>R_.alt.glif</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="R.alt" format="2">
<advance width="1277"/>
<outline>
<contour>
<point x="800" y="0" type="line"/>
<point x="1231" y="0" type="line"/>
<point x="1180" y="83" type="line" smooth="yes"/>
<point x="1137" y="153"/>
<point x="1083" y="210"/>
<point x="985" y="210" type="curve"/>
<point x="690" y="210" type="line"/>
</contour>
<contour>
<point x="60" y="0" type="line"/>
<point x="480" y="0" type="line"/>
<point x="480" y="800" type="line"/>
<point x="60" y="800" type="line"/>
</contour>
<contour>
<point x="354" y="513" type="line"/>
<point x="771" y="513" type="line" smooth="yes"/>
<point x="834" y="513"/>
<point x="862" y="501"/>
<point x="862" y="455" type="curve" smooth="yes"/>
<point x="862" y="402"/>
<point x="834" y="394"/>
<point x="771" y="394" type="curve" smooth="yes"/>
<point x="354" y="394" type="line"/>
<point x="354" y="126" type="line"/>
<point x="737" y="126" type="line" smooth="yes"/>
<point x="1114" y="126"/>
<point x="1242" y="231"/>
<point x="1242" y="445" type="curve" smooth="yes"/>
<point x="1242" y="684"/>
<point x="1114" y="800"/>
<point x="739" y="800" type="curve" smooth="yes"/>
<point x="354" y="800" type="line"/>
</contour>
</outline>
</glyph>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>R.alt</key>
<string>R_.alt.glif</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="R.alt" format="2">
<advance width="1171"/>
<outline>
<contour>
<point x="980" y="0" type="line"/>
<point x="1048" y="0" type="line"/>
<point x="913" y="98" type="line" smooth="yes"/>
<point x="826" y="161"/>
<point x="778" y="187"/>
<point x="740" y="185" type="curve"/>
<point x="723" y="185" type="line"/>
</contour>
<contour>
<point x="120" y="0" type="line"/>
<point x="160" y="0" type="line"/>
<point x="160" y="700" type="line"/>
<point x="120" y="700" type="line"/>
</contour>
<contour>
<point x="140" y="660" type="line"/>
<point x="640" y="660" type="line" smooth="yes"/>
<point x="935" y="660"/>
<point x="1018" y="575"/>
<point x="1018" y="432" type="curve" smooth="yes"/>
<point x="1018" y="289"/>
<point x="935" y="205"/>
<point x="640" y="205" type="curve" smooth="yes"/>
<point x="140" y="205" type="line"/>
<point x="140" y="165" type="line"/>
<point x="620" y="165" type="line" smooth="yes"/>
<point x="995" y="165"/>
<point x="1061" y="286"/>
<point x="1061" y="432" type="curve" smooth="yes"/>
<point x="1061" y="580"/>
<point x="995" y="700"/>
<point x="620" y="700" type="curve" smooth="yes"/>
<point x="140" y="700" type="line"/>
</contour>
</outline>
</glyph>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>R.alt</key>
<string>R_.alt.glif</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="R.alt" format="2">
<advance width="454"/>
<outline>
<contour>
<point x="350" y="0" type="line"/>
<point x="394" y="0" type="line"/>
<point x="300" y="132" type="line" smooth="yes"/>
<point x="267" y="179"/>
<point x="254" y="195"/>
<point x="232" y="195" type="curve"/>
<point x="213" y="195" type="line"/>
</contour>
<contour>
<point x="60" y="0" type="line"/>
<point x="100" y="0" type="line"/>
<point x="100" y="700" type="line"/>
<point x="60" y="700" type="line"/>
</contour>
<contour>
<point x="80" y="660" type="line"/>
<point x="180" y="660" type="line" smooth="yes"/>
<point x="299" y="660"/>
<point x="354" y="565"/>
<point x="354" y="432" type="curve" smooth="yes"/>
<point x="354" y="299"/>
<point x="299" y="205"/>
<point x="180" y="205" type="curve" smooth="yes"/>
<point x="80" y="205" type="line"/>
<point x="80" y="165" type="line"/>
<point x="170" y="165" type="line" smooth="yes"/>
<point x="330" y="165"/>
<point x="393" y="286"/>
<point x="393" y="432" type="curve" smooth="yes"/>
<point x="393" y="580"/>
<point x="330" y="700"/>
<point x="170" y="700" type="curve" smooth="yes"/>
<point x="80" y="700" type="line"/>
</contour>
</outline>
<lib>
<dict>
<key>com.black-foundry.glyph-designspace</key>
<dict>
<key>axes</key>
<array>
<dict>
<key>default</key>
<integer>0</integer>
<key>maximum</key>
<integer>1</integer>
<key>minimum</key>
<integer>0</integer>
<key>name</key>
<string>width</string>
</dict>
<dict>
<key>default</key>
<integer>0</integer>
<key>maximum</key>
<integer>1</integer>
<key>minimum</key>
<integer>0</integer>
<key>name</key>
<string>weight</string>
</dict>
</array>
<key>sources</key>
<array>
<dict>
<key>layername</key>
<string>weight=1</string>
<key>location</key>
<dict>
<key>weight</key>
<integer>1</integer>
</dict>
</dict>
<dict>
<key>layername</key>
<string>width=1</string>
<key>location</key>
<dict>
<key>width</key>
<integer>1</integer>
</dict>
</dict>
<dict>
<key>layername</key>
<string>width=1,weight=1</string>
<key>location</key>
<dict>
<key>weight</key>
<integer>1</integer>
<key>width</key>
<integer>1</integer>
</dict>
</dict>
</array>
</dict>
<key>xyz.fontra.layer-names</key>
<dict>
<key>MutatorSansLightCondensed/foreground</key>
<string>&lt;default&gt;</string>
<key>MutatorSansLightCondensed/weight=1</key>
<string>weight=1</string>
<key>MutatorSansLightCondensed/width=1</key>
<string>width=1</string>
<key>MutatorSansLightCondensed/width=1,weight=1</key>
<string>width=1,weight=1</string>
</dict>
<key>xyz.fontra.source-names</key>
<dict>
<key>LightCondensed</key>
<string>&lt;default&gt;</string>
</dict>
</dict>
</lib>
</glyph>
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
<string>Q_.glif</string>
<key>R</key>
<string>R_.glif</string>
<key>R.alt</key>
<string>R_.alt.glif</string>
<key>S</key>
<string>S_.glif</string>
<key>S.closed</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,17 @@
<string>varco_flop</string>
<string>glyphs.varco_flop</string>
</array>
<array>
<string>weight=1</string>
<string>glyphs.weight=1</string>
</array>
<array>
<string>width=1</string>
<string>glyphs.width=1</string>
</array>
<array>
<string>width=1,weight=1</string>
<string>glyphs.width=1,weight=1</string>
</array>
</array>
</plist>
4 changes: 3 additions & 1 deletion test-py/test_backend_designspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def readGLIFData(glyphName, ufoLayers):
}


@pytest.mark.parametrize("glyphName", ["A", "B", "Q", "varcotest1", "varcotest2"])
@pytest.mark.parametrize(
"glyphName", ["A", "B", "Q", "R.alt", "varcotest1", "varcotest2"]
)
async def test_roundTripGlyph(writableTestFont, glyphName):
existingData = readGLIFData(glyphName, writableTestFont.ufoLayers)
glyphMap = await writableTestFont.getGlyphMap()
Expand Down
8 changes: 4 additions & 4 deletions test-py/test_font.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,8 @@ def getTestFont(testFontName):


getGlyphNamesTestData = [
("designspace", 51, ["A", "Aacute", "Adieresis", "B"]),
("ufo", 51, ["A", "Aacute", "Adieresis", "B"]),
("designspace", 52, ["A", "Aacute", "Adieresis", "B"]),
("ufo", 52, ["A", "Aacute", "Adieresis", "B"]),
]


Expand All @@ -869,10 +869,10 @@ async def test_getGlyphNames(testFontName, numGlyphs, firstFourGlyphNames):
getGlyphMapTestData = [
(
"designspace",
51,
52,
{"A": [ord("A"), ord("a")], "B": [ord("B"), ord("b")], "I.narrow": []},
),
("ufo", 51, {"A": [ord("A"), ord("a")], "B": [ord("B"), ord("b")], "I.narrow": []}),
("ufo", 52, {"A": [ord("A"), ord("a")], "B": [ord("B"), ord("b")], "I.narrow": []}),
]


Expand Down

0 comments on commit 9b899e7

Please sign in to comment.