test if issue #2295 is fixed

This commit is contained in:
Eigi 2021-05-07 10:42:53 +02:00 committed by Cosimo Lupo
parent 36a1c5519e
commit 20c4a3ce74

View File

@ -362,6 +362,23 @@ class GlyfTableTest(unittest.TestCase):
self.assertEqual(font["glyf"][".notdef"].numberOfContours, 0) self.assertEqual(font["glyf"][".notdef"].numberOfContours, 0)
self.assertEqual(font["glyf"]["space"].numberOfContours, 0) self.assertEqual(font["glyf"]["space"].numberOfContours, 0)
def test_getPhantomPoints(self):
# https://github.com/fonttools/fonttools/issues/2295
font = TTFont()
glyphNames = [".notdef"]
font.setGlyphOrder(glyphNames)
font["loca"] = newTable("loca")
font["loca"].locations = [0] * (len(glyphNames) + 1)
font["glyf"] = newTable("glyf")
font["glyf"].decompile(b"\x00", font)
font["hmtx"] = newTable("hmtx")
font["hmtx"].metrics = {".notdef": (100,0)}
font["head"] = newTable("head")
font["head"].unitsPerEm = 1000
self.assertEqual(
font["glyf"].getPhantomPoints(".notdef", font, 0),
[(0, 0), (100, 0), (0, 0), (0, -1000)]
)
class GlyphTest: class GlyphTest: