From 62764abc5eed32c1e319f19fd9737bbe7f81ed2e Mon Sep 17 00:00:00 2001 From: Roozbeh Pournader Date: Mon, 8 Dec 2014 09:21:48 -0800 Subject: Add target for ChromeOS fonts. --- scripts/touchup_for_web.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'scripts/touchup_for_web.py') diff --git a/scripts/touchup_for_web.py b/scripts/touchup_for_web.py index b055d89..39e7c19 100755 --- a/scripts/touchup_for_web.py +++ b/scripts/touchup_for_web.py @@ -24,7 +24,7 @@ def apply_temporary_fixes(font): font_data.set_name_record(font, 5, version_record) -def apply_web_specific_fixes(font): +def apply_web_specific_fixes(font, family_name): """Apply fixes needed for web fonts.""" # Set ascent, descent, and lineGap values to Android K values hhea = font['hhea'] @@ -39,7 +39,6 @@ def apply_web_specific_fixes(font): os2.usWinAscent = 1946 os2.usWinDescent = 512 - family_name = 'RobotoDraft' subfamily_name = font_data.get_name_records(font)[2].encode('ASCII') assert(subfamily_name in ['Thin', 'Thin Italic', @@ -69,17 +68,17 @@ def apply_web_specific_fixes(font): font, 6, family_name+'-'+subfamily_name.replace(' ', '')) -def correct_font(source_font_name, target_font_name): +def correct_font(source_font_name, target_font_name, family_name): """Corrects metrics and other meta information.""" font = ttLib.TTFont(source_font_name) apply_temporary_fixes(font) - apply_web_specific_fixes(font) + apply_web_specific_fixes(font, family_name) font.save(target_font_name) def main(argv): """Correct the font specified in the command line.""" - correct_font(argv[1], argv[2]) + correct_font(argv[1], argv[2], argv[3]) if __name__ == "__main__": -- cgit v1.2.3