summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRoozbeh Pournader <roozbeh@google.com>2014-08-15 16:51:31 -0700
committerJames Godfrey-Kittle <jamesgk@google.com>2015-04-16 12:16:21 -0700
commit19abad362e541fc1ee063f4442c9fb588b9ff1f3 (patch)
treea08f11c5e64e3a611c120919745dbf502a0ea626 /scripts
parent7237600eb825bafbd37b7b751540ad8ac3110a4a (diff)
Remove unassigned characters from the fonts' cmap.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/run_android_tests.py9
-rwxr-xr-xscripts/touchup_for_android.py6
2 files changed, 13 insertions, 2 deletions
diff --git a/scripts/run_android_tests.py b/scripts/run_android_tests.py
index 3898753..3eab071 100644
--- a/scripts/run_android_tests.py
+++ b/scripts/run_android_tests.py
@@ -64,6 +64,15 @@ class TestCharacterCoverage(unittest.TestCase):
self.assertNotIn(0x2191, charset) # UPWARDS ARROW
self.assertNotIn(0x2193, charset) # DOWNWARDS ARROW
+ def test_lack_of_unassigned_chars(self):
+ """Tests that unassigned characters are not in the fonts."""
+ for font in self.fonts:
+ charset = coverage.character_set(font)
+ self.assertNotIn(0x2072, charset)
+ self.assertNotIn(0x2073, charset)
+ self.assertNotIn(0x208F, charset)
+
+
def test_inclusion_of_sound_recording_copyright(self):
"""Tests that sound recording copyright symbol is in the fonts."""
for font in self.fonts:
diff --git a/scripts/touchup_for_android.py b/scripts/touchup_for_android.py
index 1dac756..0674e94 100755
--- a/scripts/touchup_for_android.py
+++ b/scripts/touchup_for_android.py
@@ -151,8 +151,10 @@ def apply_android_specific_fixes(font):
hhea.descent = -500
hhea.lineGap = 0
- # Remove tab, combining keycap, and the arrows from the cmap table
- font_data.delete_from_cmap(font, [0x0009, 0x20E3, 0x2191, 0x2193])
+ # Remove tab, combining keycap, the arrows, and unassigned characters
+ # from the cmap table
+ font_data.delete_from_cmap(font, [
+ 0x0009, 0x20E3, 0x2072, 0x2073, 0x208F, 0x2191, 0x2193])
# Drop tables not useful on Android
for table in ['LTSH', 'hdmx', 'VDMX', 'gasp']: