aboutsummaryrefslogtreecommitdiff
path: root/Tests/misc/psCharStrings_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/misc/psCharStrings_test.py')
-rw-r--r--Tests/misc/psCharStrings_test.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/misc/psCharStrings_test.py b/Tests/misc/psCharStrings_test.py
index 47ff4fda..5e36fe73 100644
--- a/Tests/misc/psCharStrings_test.py
+++ b/Tests/misc/psCharStrings_test.py
@@ -8,6 +8,7 @@ from fontTools.misc.psCharStrings import (
read_fixed1616,
read_realNumber,
)
+from fontTools.pens.recordingPen import RecordingPen
import unittest
@@ -158,6 +159,14 @@ class T2CharStringTest(unittest.TestCase):
self.assertNotIsInstance(expected_arg, str)
self.assertAlmostEqual(arg, expected_arg)
+ def test_pen_closePath(self):
+ # Test CFF2/T2 charstring: it does NOT end in "endchar"
+ # https://github.com/fonttools/fonttools/issues/2455
+ cs = self.stringToT2CharString("100 100 rmoveto -50 -150 200 0 -50 150 rrcurveto")
+ pen = RecordingPen()
+ cs.draw(pen)
+ self.assertEqual(pen.value[-1], ('closePath', ()))
+
if __name__ == "__main__":
import sys