Added SourceSansPro-Regular along as CFF full-font test case

derived "expected" subset fonts from fonttools then manually tweaked further so they resemble hb-subset output
This commit is contained in:
Michiharu Ariza 2018-09-18 15:53:37 -07:00
parent e75e7224c9
commit bf4eb2e4cf
10 changed files with 8 additions and 2 deletions

Binary file not shown.

View File

@ -1,5 +1,6 @@
FONTS:
Roboto-Regular.ttf
SourceSansPro-Regular.otf
PROFILES:
default.txt

View File

@ -62,7 +62,7 @@ def fail_test(test, cli_args, message):
return 1
def run_test(test, should_check_ots):
out_file = os.path.join(tempfile.mkdtemp (), test.get_font_name () + '-subset.ttf')
out_file = os.path.join(tempfile.mkdtemp (), test.get_font_name () + '-subset' + test.get_font_extension ())
cli_args = [hb_subset,
"--font-file=" + test.font_path,
"--output-file=" + out_file,
@ -107,7 +107,7 @@ def run_ttx (file):
def strip_check_sum (ttx_string):
return re.sub ('checkSumAdjustment value=["]0x([0-9a-fA-F])+["]',
'checkSumAdjustment value="0x00000000"',
ttx_string.decode (), count=1)
ttx_string.decode ("utf-8"), count=1)
def has_ots ():
if not ots_sanitize:

View File

@ -28,6 +28,11 @@ class Test:
self.unicodes(),
font_base_name_parts[1])
def get_font_extension(self):
font_base_name = os.path.basename(self.font_path)
font_base_name_parts = os.path.splitext(font_base_name)
return font_base_name_parts[1]
# A group of tests to perform on the subsetter. Each test
# Identifies a font a subsetting profile, and a subset to be cut.
class SubsetTestSuite: