summaryrefslogtreecommitdiff
path: root/scripts/common_tests.py
diff options
context:
space:
mode:
authorRoozbeh Pournader <roozbeh@google.com>2015-01-08 00:33:56 -0800
committerJames Godfrey-Kittle <jamesgk@google.com>2015-04-16 12:16:25 -0700
commiteaece2cb0d1aa84b7e3316cd2dcd9597c3ff07e8 (patch)
treeab16b71e2fd2ba1936b6768cf94e2e19ec2b5e22 /scripts/common_tests.py
parent07f342a2690558b8f4ce3d1bbb545c6ef3c320d1 (diff)
More refactoring of touchup and test scripts.
Diffstat (limited to 'scripts/common_tests.py')
-rw-r--r--scripts/common_tests.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/common_tests.py b/scripts/common_tests.py
index 8fff95c..b4c0bfa 100644
--- a/scripts/common_tests.py
+++ b/scripts/common_tests.py
@@ -103,6 +103,23 @@ class TestMetaInfo(FontTest):
self.assertEqual(revision, expected_version)
+class TestNames(FontTest):
+ """Tests various strings in the name table."""
+
+ def setUp(self):
+ _, self.fonts = self.loaded_fonts
+ self.names = []
+ for font in self.fonts:
+ self.names.append(font_data.get_name_records(font))
+
+ def test_copyright(self):
+ """Tests the copyright message."""
+ for records in self.names:
+ self.assertEqual(
+ records[0],
+ 'Copyright 2014 Google Inc. All Rights Reserved.')
+
+
class TestDigitWidths(FontTest):
"""Tests the width of digits."""
@@ -189,3 +206,12 @@ class TestVerticalMetrics(FontTest):
self.assertEqual(head_table.yMin, -555)
self.assertEqual(head_table.yMax, 2163)
+ def test_hhea_table_metrics(self):
+ """Tests ascent, descent, and lineGap to be equal to Roboto v1 values.
+ """
+ for font in self.fonts:
+ hhea_table = font['hhea']
+ self.assertEqual(hhea_table.descent, -500)
+ self.assertEqual(hhea_table.ascent, 1900)
+ self.assertEqual(hhea_table.lineGap, 0)
+