Test: raise DesignSpaceDocumentError when no axes defined
This commit is contained in:
parent
8080690c74
commit
3c59ffda5e
@ -4,6 +4,7 @@ from fontTools.ttLib import TTFont
|
||||
from fontTools.varLib import build
|
||||
from fontTools.varLib.interpolate_layout import interpolate_layout
|
||||
from fontTools.varLib.interpolate_layout import main as interpolate_layout_main
|
||||
from fontTools.designspaceLib import DesignSpaceDocumentError
|
||||
from fontTools.feaLib.builder import addOpenTypeFeaturesFromString
|
||||
import difflib
|
||||
import os
|
||||
@ -157,24 +158,9 @@ class InterpolateLayoutTest(unittest.TestCase):
|
||||
The variable font will inherit the GSUB table from the
|
||||
base master.
|
||||
"""
|
||||
suffix = '.ttf'
|
||||
ds_path = self.get_test_input('InterpolateLayout3.designspace')
|
||||
ufo_dir = self.get_test_input('master_ufo')
|
||||
ttx_dir = self.get_test_input('master_ttx_interpolatable_ttf')
|
||||
|
||||
self.temp_dir()
|
||||
ttx_paths = self.get_file_list(ttx_dir, '.ttx', 'TestFamily2-')
|
||||
for path in ttx_paths:
|
||||
self.compile_font(path, suffix, self.tempdir)
|
||||
|
||||
finder = lambda s: s.replace(ufo_dir, self.tempdir).replace('.ufo', suffix)
|
||||
instfont = interpolate_layout(ds_path, {'weight': 500}, finder)
|
||||
|
||||
tables = ['GSUB']
|
||||
expected_ttx_path = self.get_test_output('InterpolateLayout.ttx')
|
||||
self.expect_ttx(instfont, expected_ttx_path, tables)
|
||||
self.check_ttx_dump(instfont, expected_ttx_path, tables, suffix)
|
||||
|
||||
with self.assertRaisesRegex(DesignSpaceDocumentError, "No axes defined"):
|
||||
instfont = interpolate_layout(ds_path, {'weight': 500})
|
||||
|
||||
def test_varlib_interpolate_layout_GPOS_only_size_feat_same_val_ttf(self):
|
||||
"""Only GPOS; 'size' feature; same values in all masters.
|
||||
|
@ -3,6 +3,7 @@ from fontTools.misc.py23 import *
|
||||
from fontTools.ttLib import TTFont
|
||||
from fontTools.varLib import build
|
||||
from fontTools.varLib import main as varLib_main
|
||||
from fontTools.designspaceLib import DesignSpaceDocumentError
|
||||
import difflib
|
||||
import os
|
||||
import shutil
|
||||
@ -126,12 +127,9 @@ class BuildTest(unittest.TestCase):
|
||||
|
||||
def test_varlib_build_no_axes_ttf(self):
|
||||
"""Designspace file does not contain an <axes> element."""
|
||||
self._run_varlib_build_test(
|
||||
designspace_name='InterpolateLayout3',
|
||||
font_name='TestFamily2',
|
||||
tables=['GDEF', 'HVAR', 'MVAR', 'fvar', 'gvar'],
|
||||
expected_ttx_name='Build3'
|
||||
)
|
||||
ds_path = self.get_test_input('InterpolateLayout3.designspace')
|
||||
with self.assertRaisesRegex(DesignSpaceDocumentError, "No axes defined"):
|
||||
build(ds_path)
|
||||
|
||||
def test_varlib_avar_single_axis(self):
|
||||
"""Designspace file contains a 'weight' axis with <map> elements
|
||||
|
Loading…
x
Reference in New Issue
Block a user