summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build-v2.py4
-rwxr-xr-xscripts/run_general_tests.py3
-rwxr-xr-xscripts/touchup_for_android.py11
-rwxr-xr-xscripts/touchup_for_web.py6
4 files changed, 15 insertions, 9 deletions
diff --git a/scripts/build-v2.py b/scripts/build-v2.py
index 0ef86e9..6026939 100644
--- a/scripts/build-v2.py
+++ b/scripts/build-v2.py
@@ -101,7 +101,7 @@ proj.generateFont(Mix([rg, bd], 0.35), "%s/Medium/Regular/Lt"%FAMILYNAME)
proj.generateFont(Mix([rg, bd], RPoint(0.73, 0.73)),
"%s/Bold/Bold/Rg"%FAMILYNAME)
proj.generateFont(Mix([rg, bd], RPoint(1.125, 1.0)),
- "%s/Black/Bold/Bk"%FAMILYNAME)
+ "%s/Black/Regular/Bk"%FAMILYNAME)
proj.generateFont(th.font, "%s/Thin Italic/Italic/Th"%FAMILYNAME,
italic=True, stemWidth=80)
@@ -115,7 +115,7 @@ proj.generateFont(Mix([rg, bd], RPoint(0.73, 0.73)),
"%s/Bold Italic/Bold Italic/Rg"%FAMILYNAME,
italic=True, stemWidth=290)
proj.generateFont(Mix([rg, bd], RPoint(1.125, 1.0)),
- "%s/Black Italic/Bold Italic/Bk"%FAMILYNAME,
+ "%s/Black Italic/Italic/Bk"%FAMILYNAME,
italic=True, stemWidth=290)
# unfortunately some condensed forms (*.cn) of glyphs are not compatible with
diff --git a/scripts/run_general_tests.py b/scripts/run_general_tests.py
index 1a007d2..3321fa3 100755
--- a/scripts/run_general_tests.py
+++ b/scripts/run_general_tests.py
@@ -44,12 +44,13 @@ class TestItalicAngle(font_tests.TestItalicAngle):
class TestMetaInfo(font_tests.TestMetaInfo):
"""Bugs:
+ https://github.com/google/roboto/issues/142
https://code.google.com/a/google.com/p/roboto/issues/detail?id=8
https://code.google.com/a/google.com/p/roboto/issues/detail?id=29
"""
loaded_fonts = FONTS
- mark_heavier_as_bold = True
+ mark_heavier_as_bold = False
test_us_weight = None
#expected_version = '2.' + roboto_data.get_build_number()
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."""
diff --git a/scripts/touchup_for_web.py b/scripts/touchup_for_web.py
index 3e29e58..7879d9e 100755
--- a/scripts/touchup_for_web.py
+++ b/scripts/touchup_for_web.py
@@ -47,12 +47,6 @@ def apply_web_specific_fixes(font, family_name):
family_name += ' Condensed'
full_name = family_name + ' ' + subfamily_name
- # macStyle
- bold = subfamily_name.startswith(('Bold', 'Black'))
- italic = subfamily_name.endswith('Italic')
- macStyle = (italic << 1) | bold
- font['head'].macStyle = macStyle
-
# Family, subfamily names
font_data.set_name_record(font, 16, family_name)
style_map = ['Regular', 'Bold', 'Italic', 'Bold Italic']