From 20c4a3ce749cef8f31d71863f41822ca6d6d8c56 Mon Sep 17 00:00:00 2001 From: Eigi Date: Fri, 7 May 2021 10:42:53 +0200 Subject: [PATCH] test if issue #2295 is fixed --- Tests/ttLib/tables/_g_l_y_f_test.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Tests/ttLib/tables/_g_l_y_f_test.py b/Tests/ttLib/tables/_g_l_y_f_test.py index 70560cc7b..84f30dc6c 100644 --- a/Tests/ttLib/tables/_g_l_y_f_test.py +++ b/Tests/ttLib/tables/_g_l_y_f_test.py @@ -362,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: