diff options
Diffstat (limited to 'scripts/touchup_for_android.py')
-rwxr-xr-x | scripts/touchup_for_android.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/touchup_for_android.py b/scripts/touchup_for_android.py index 187a432..4426bd0 100755 --- a/scripts/touchup_for_android.py +++ b/scripts/touchup_for_android.py @@ -68,6 +68,17 @@ def apply_android_specific_fixes(font): if table in font: del font[table] + # Set bold bits for Black (macStyle bit 0, fsSelection bit 5, subfamily) + name_records = font_data.get_name_records(font) + family_name = name_records[1] + subfam_name = name_records[2] + if family_name.endswith('Black'): + font['head'].macStyle |= (1 << 0) + font['OS/2'].fsSelection |= (1 << 5) + new_subfam_name = ( + ('Bold ' + subfam_name) if subfam_name != 'Regular' else 'Bold') + font_data.set_name_record(font, 2, new_subfam_name) + def correct_font(source_font_name, target_font_name): """Corrects metrics and other meta information.""" |