summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/common_tests.py9
-rwxr-xr-xscripts/run_android_tests.py1
-rwxr-xr-xscripts/run_web_tests.py7
-rwxr-xr-xscripts/touchup_for_web.py7
4 files changed, 11 insertions, 13 deletions
diff --git a/scripts/common_tests.py b/scripts/common_tests.py
index 41880c8..14d761b 100644
--- a/scripts/common_tests.py
+++ b/scripts/common_tests.py
@@ -108,6 +108,7 @@ class TestNames(FontTest):
def setUp(self):
_, self.fonts = self.loaded_fonts
+ self.condensed_family_name = self.family_name + ' Condensed'
self.names = []
for font in self.fonts:
self.names.append(font_data.get_name_records(font))
@@ -119,6 +120,14 @@ class TestNames(FontTest):
records[0],
'Copyright 2011 Google Inc. All Rights Reserved.')
+ def test_family_name(self):
+ """Tests the family name."""
+ for records in self.names:
+ self.assertIn(records[1],
+ [self.family_name, self.condensed_family_name])
+ if 16 in records:
+ self.assertEqual(records[16], records[1])
+
class TestDigitWidths(FontTest):
"""Tests the width of digits."""
diff --git a/scripts/run_android_tests.py b/scripts/run_android_tests.py
index 26730b0..e277268 100755
--- a/scripts/run_android_tests.py
+++ b/scripts/run_android_tests.py
@@ -21,6 +21,7 @@ class TestMetaInfo(common_tests.TestMetaInfo):
class TestNames(common_tests.TestNames):
loaded_fonts = FONTS
+ family_name = 'Roboto'
class TestDigitWidths(common_tests.TestDigitWidths):
diff --git a/scripts/run_web_tests.py b/scripts/run_web_tests.py
index eae3acf..2fc55e8 100755
--- a/scripts/run_web_tests.py
+++ b/scripts/run_web_tests.py
@@ -34,13 +34,6 @@ class TestNames(common_tests.TestNames):
loaded_fonts = FONTS
family_name = 'RobotoDraft'
- def test_family_name(self):
- """Tests the family name."""
- for records in self.names:
- self.assertEqual(records[1], self.family_name)
- if 16 in records:
- self.assertEqual(records[16], self.family_name)
-
def test_unique_identifier_and_full_name(self):
"""Tests the unique identifier and full name."""
for records in self.names:
diff --git a/scripts/touchup_for_web.py b/scripts/touchup_for_web.py
index d0efddc..8760394 100755
--- a/scripts/touchup_for_web.py
+++ b/scripts/touchup_for_web.py
@@ -11,12 +11,7 @@ import temporary_touchups
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']
- hhea.ascent = 1900
- hhea.descent = -500
- hhea.lineGap = 0
-
+ # Set OS/2 table values to old values
os2 = font['OS/2']
os2.sTypoAscender = 1536
os2.sTypoDescender = -512