summaryrefslogtreecommitdiff
path: root/scripts/touchup_for_android.py
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-12-11 12:04:37 -0800
committerJames Godfrey-Kittle <jamesgk@google.com>2015-12-11 12:11:57 -0800
commitf9116ecf24f80e3c9161cd5189e8e9a90c03e908 (patch)
tree11d169d70bdb4a49dd2d0469c0a000683407e674 /scripts/touchup_for_android.py
parenta40611066facdeab2ba726411d8f1acbf907132b (diff)
Don't set Black weight as bold outside of Android
There's no documented reason why we were doing this before, so let's output these fonts for now and see if they work on other platforms. Android can come next.
Diffstat (limited to 'scripts/touchup_for_android.py')
-rwxr-xr-xscripts/touchup_for_android.py11
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."""