[t1Lib_test] also test parsing LWFN (dumped to data fork)

This commit is contained in:
Cosimo Lupo 2015-10-26 02:52:57 +00:00
parent 4b9087c000
commit 620db1f9a3

View File

@ -9,6 +9,8 @@ import random
CWD = os.path.abspath(os.path.dirname(__file__))
DATADIR = os.path.join(CWD, 'testdata')
# I used `tx` to convert PFA to LWFN (stored in the data fork)
LWFN = os.path.join(DATADIR, 'TestT1-Regular.lwfn')
PFA = os.path.join(DATADIR, 'TestT1-Regular.pfa')
PFB = os.path.join(DATADIR, 'TestT1-Regular.pfb')
@ -63,6 +65,14 @@ class ReadWriteTest(unittest.TestCase):
class T1FontTest(unittest.TestCase):
def test_parse_lwfn(self):
# the extended attrs are lost on git so we can't auto-detect 'LWFN'
font = t1Lib.T1Font()
font.data = t1Lib.readLWFN(LWFN)
font.parse()
self.assertEqual(font['FontName'], 'TestT1-Regular')
self.assertTrue('Subrs' in font['Private'])
def test_parse_pfa(self):
font = t1Lib.T1Font(PFA)
font.parse()