[CFFToCFF2] Add a test

Exercises:
https://github.com/fonttools/fonttools/pull/3518#discussion_r1611033728
This commit is contained in:
Behdad Esfahbod 2024-05-24 15:07:05 -06:00
parent 6a812ce925
commit 1536efc22e
2 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import copy
import os
import sys
import unittest
from io import BytesIO
class CffLibTest(DataFilesHandler):
@ -119,5 +120,17 @@ class CffLibTest(DataFilesHandler):
self.assertEqual(len(glyphOrder), len(set(glyphOrder)))
class CFFToCFF2Test(DataFilesHandler):
def test_conversion(self):
font_path = self.getpath("CFFToCFF2-1.otf")
font = TTFont(font_path)
from fontTools.cffLib.CFFToCFF2 import convertCFFToCFF2
convertCFFToCFF2(font)
f = BytesIO()
font.save(f)
if __name__ == "__main__":
sys.exit(unittest.main())

Binary file not shown.