diff options
Diffstat (limited to 'Tests/ttLib/tables/_g_l_y_f_test.py')
-rw-r--r-- | Tests/ttLib/tables/_g_l_y_f_test.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/Tests/ttLib/tables/_g_l_y_f_test.py b/Tests/ttLib/tables/_g_l_y_f_test.py index 531bb82a..84f30dc6 100644 --- a/Tests/ttLib/tables/_g_l_y_f_test.py +++ b/Tests/ttLib/tables/_g_l_y_f_test.py @@ -173,10 +173,9 @@ class GlyphCoordinatesTest(object): assert g[0][0] == otRound(afloat) def test__checkFloat_overflow(self): - g = GlyphCoordinates([(1, 1)], typecode="h") + g = GlyphCoordinates([(1, 1)]) g.append((0x8000, 0)) - assert g.array.typecode == "d" - assert g.array == array.array("d", [1.0, 1.0, 32768.0, 0.0]) + assert list(g.array) == [1.0, 1.0, 32768.0, 0.0] CURR_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) @@ -363,6 +362,23 @@ class GlyfTableTest(unittest.TestCase): self.assertEqual(font["glyf"][".notdef"].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: |