diff options
author | Roozbeh Pournader <roozbeh@google.com> | 2015-01-06 23:05:29 -0800 |
---|---|---|
committer | James Godfrey-Kittle <jamesgk@google.com> | 2015-04-16 12:16:24 -0700 |
commit | 3c963abcf66d44c1587376e7d245b889ae62401a (patch) | |
tree | 3c37ad64eda098c72e88e28fabda64b4968659a2 /scripts/run_android_tests.py | |
parent | 26c0c6588b8bae5df35c9c968d0e088b5cc37ef6 (diff) |
Update Android touchup and test tools for latest delivery.
Touchup:
- Shared touchups between Android and web are moved to a new module
- OS/2.usWeightClass is fixed to match the font name
- Unassigned characters are no longer explicitly dropped
Testing:
- Rhotic hook is skipped when checking that spacing marks don't form
ligatures
- OS/2.usWeightClass is tested to be set correctly
Diffstat (limited to 'scripts/run_android_tests.py')
-rwxr-xr-x | scripts/run_android_tests.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/run_android_tests.py b/scripts/run_android_tests.py index adb2c06..1c9e45c 100755 --- a/scripts/run_android_tests.py +++ b/scripts/run_android_tests.py @@ -11,6 +11,8 @@ from nototools import font_data from nototools import render from nototools import unicode_data +import roboto_data + def load_fonts(): """Load all fonts built for Android.""" @@ -20,6 +22,22 @@ def load_fonts(): return all_font_files, all_fonts +class TestMetaInfo(unittest.TestCase): + """Test various meta information.""" + + def setUp(self): + _, self.fonts = load_fonts() + + def test_us_weight(self): + "Tests the usWeight of the fonts to be correct.""" + for font in self.fonts: + weight = roboto_data.extract_weight_name(font_data.font_name(font)) + expected_numeric_weight = roboto_data.WEIGHTS[weight] + self.assertEqual( + font['OS/2'].usWeightClass, + expected_numeric_weight) + + class TestVerticalMetrics(unittest.TestCase): """Test the vertical metrics of fonts.""" @@ -108,6 +126,10 @@ class TestSpacingMarks(unittest.TestCase): u'\u03D2'): print 'Testing %s combinations' % base_letter for mark in self.marks_to_test: + if mark == 0x02DE: + # Skip rhotic hook, as it's perhaps OK for it to form + # ligatures + continue mark = unichr(mark) advances = self.get_advances(base_letter + mark, font) self.assertEqual(len(advances), 2, |