Make simpler test in cffLib tests
This commit is contained in:
parent
3011f3b7d4
commit
e50733df21
@ -2,6 +2,8 @@ from __future__ import print_function, division, absolute_import
|
|||||||
from fontTools.cffLib import TopDict, PrivateDict, CharStrings
|
from fontTools.cffLib import TopDict, PrivateDict, CharStrings
|
||||||
from fontTools.misc.testTools import parseXML, DataFilesHandler
|
from fontTools.misc.testTools import parseXML, DataFilesHandler
|
||||||
from fontTools.ttLib import TTFont
|
from fontTools.ttLib import TTFont
|
||||||
|
import copy
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
@ -59,6 +61,21 @@ class CffLibTest(DataFilesHandler):
|
|||||||
topDict2 = font2["CFF "].cff.topDictIndex[0]
|
topDict2 = font2["CFF "].cff.topDictIndex[0]
|
||||||
self.assertEqual(topDict2.Encoding[32], "space")
|
self.assertEqual(topDict2.Encoding[32], "space")
|
||||||
|
|
||||||
|
def test_CFF_deepcopy(self):
|
||||||
|
"""Test that deepcopying a TTFont with a CFF table does not recurse
|
||||||
|
infinitely."""
|
||||||
|
ttx_path = os.path.join(
|
||||||
|
os.path.dirname(__file__),
|
||||||
|
"..",
|
||||||
|
"varLib",
|
||||||
|
"data",
|
||||||
|
"master_ttx_interpolatable_otf",
|
||||||
|
"TestFamily2-Master0.ttx",
|
||||||
|
)
|
||||||
|
font = TTFont(recalcBBoxes=False, recalcTimestamp=False)
|
||||||
|
font.importXML(ttx_path)
|
||||||
|
copy.deepcopy(font)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.exit(unittest.main())
|
sys.exit(unittest.main())
|
||||||
|
@ -162,22 +162,6 @@ class InterpolateLayoutTest(unittest.TestCase):
|
|||||||
with self.assertRaisesRegex(DesignSpaceDocumentError, "No axes defined"):
|
with self.assertRaisesRegex(DesignSpaceDocumentError, "No axes defined"):
|
||||||
instfont = interpolate_layout(ds_path, {'weight': 500})
|
instfont = interpolate_layout(ds_path, {'weight': 500})
|
||||||
|
|
||||||
def test_varlib_interpolate_layout_GSUB_only_otf(self):
|
|
||||||
"""A smoke-test for layout-interpolating of OTFs."""
|
|
||||||
ds_path = self.get_test_input('InterpolateLayout.designspace')
|
|
||||||
ds = DesignSpaceDocument.fromfile(ds_path)
|
|
||||||
ttx_dir = self.get_test_input('master_ttx_interpolatable_otf')
|
|
||||||
|
|
||||||
self.temp_dir()
|
|
||||||
ttx_paths = self.get_file_list(ttx_dir, '.ttx', 'TestFamily2-')
|
|
||||||
for path, source in zip(ttx_paths, ds.sources):
|
|
||||||
font = TTFont(recalcBBoxes=False, recalcTimestamp=False)
|
|
||||||
font.importXML(path)
|
|
||||||
source.font = font
|
|
||||||
|
|
||||||
finder = lambda s: s
|
|
||||||
instfont = interpolate_layout(ds, {'weight': 500}, finder)
|
|
||||||
|
|
||||||
def test_varlib_interpolate_layout_GPOS_only_size_feat_same_val_ttf(self):
|
def test_varlib_interpolate_layout_GPOS_only_size_feat_same_val_ttf(self):
|
||||||
"""Only GPOS; 'size' feature; same values in all masters.
|
"""Only GPOS; 'size' feature; same values in all masters.
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user