def testGetGlyphSets(self):
self.makeUFO()
# hack contents.plist
path = os.path.join(self.ufoPath, "glyphs.layer 1", "contents.plist")
with open(path, "wb") as f:
writePlist(dict(b="a.glif"), f)
path = os.path.join(self.ufoPath, "glyphs.layer 2", "contents.plist")
with open(path, "wb") as f:
writePlist(dict(c="a.glif"), f)
# now test
writer = UFOWriter(self.ufoPath)
# default
expected = ["a"]
result = list(writer.getGlyphSet().keys())
self.assertEqual(expected, result)
# layer 1
expected = ["b"]
result = list(writer.getGlyphSet("layer 1", defaultLayer=False).keys())
self.assertEqual(expected, result)
# layer 2
expected = ["c"]
result = list(writer.getGlyphSet("layer 2", defaultLayer=False).keys())
self.assertEqual(expected, result)
# make a new font with two layers
评论列表
文章目录