ttFont_test: add test for getGlyphID
This commit is contained in:
parent
1a202ab1be
commit
d77c8901c8
@ -262,3 +262,13 @@ def test_font_normalizeLocation_no_VF():
|
|||||||
ttf = TTFont()
|
ttf = TTFont()
|
||||||
with pytest.raises(TTLibError, match="Not a variable font"):
|
with pytest.raises(TTLibError, match="Not a variable font"):
|
||||||
ttf.normalizeLocation({})
|
ttf.normalizeLocation({})
|
||||||
|
|
||||||
|
|
||||||
|
def test_getGlyphID():
|
||||||
|
font = TTFont()
|
||||||
|
font.importXML(os.path.join(DATA_DIR, "TestTTF-Regular.ttx"))
|
||||||
|
|
||||||
|
assert font.getGlyphID("space") == 3
|
||||||
|
assert font.getGlyphID("glyph12345") == 12345 # virtual glyph
|
||||||
|
with pytest.raises(KeyError):
|
||||||
|
font.getGlyphID("non_existent")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user