From 19abad362e541fc1ee063f4442c9fb588b9ff1f3 Mon Sep 17 00:00:00 2001 From: Roozbeh Pournader Date: Fri, 15 Aug 2014 16:51:31 -0700 Subject: Remove unassigned characters from the fonts' cmap. --- scripts/run_android_tests.py | 9 +++++++++ scripts/touchup_for_android.py | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'scripts') 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']: -- cgit v1.2.3