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:
parent
e75e7224c9
commit
bf4eb2e4cf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,5 +1,6 @@
|
||||||
FONTS:
|
FONTS:
|
||||||
Roboto-Regular.ttf
|
Roboto-Regular.ttf
|
||||||
|
SourceSansPro-Regular.otf
|
||||||
|
|
||||||
PROFILES:
|
PROFILES:
|
||||||
default.txt
|
default.txt
|
||||||
|
|
|
@ -62,7 +62,7 @@ def fail_test(test, cli_args, message):
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
def run_test(test, should_check_ots):
|
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,
|
cli_args = [hb_subset,
|
||||||
"--font-file=" + test.font_path,
|
"--font-file=" + test.font_path,
|
||||||
"--output-file=" + out_file,
|
"--output-file=" + out_file,
|
||||||
|
@ -107,7 +107,7 @@ def run_ttx (file):
|
||||||
def strip_check_sum (ttx_string):
|
def strip_check_sum (ttx_string):
|
||||||
return re.sub ('checkSumAdjustment value=["]0x([0-9a-fA-F])+["]',
|
return re.sub ('checkSumAdjustment value=["]0x([0-9a-fA-F])+["]',
|
||||||
'checkSumAdjustment value="0x00000000"',
|
'checkSumAdjustment value="0x00000000"',
|
||||||
ttx_string.decode (), count=1)
|
ttx_string.decode ("utf-8"), count=1)
|
||||||
|
|
||||||
def has_ots ():
|
def has_ots ():
|
||||||
if not ots_sanitize:
|
if not ots_sanitize:
|
||||||
|
|
|
@ -28,6 +28,11 @@ class Test:
|
||||||
self.unicodes(),
|
self.unicodes(),
|
||||||
font_base_name_parts[1])
|
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
|
# A group of tests to perform on the subsetter. Each test
|
||||||
# Identifies a font a subsetting profile, and a subset to be cut.
|
# Identifies a font a subsetting profile, and a subset to be cut.
|
||||||
class SubsetTestSuite:
|
class SubsetTestSuite:
|
||||||
|
|
Loading…
Reference in New Issue