Bug 1393624 - Blacklist more invalid characters found in Apple's fonts. r=jrmuizel
authorJonathan Kew <jkew@mozilla.com>
Thu, 31 Aug 2017 15:17:44 +0100
changeset 377989 a87b382c2135
parent 377988 cf2763028159
child 377990 048c89a84fa0
push id32420
push userkwierso@gmail.com
push dateThu, 31 Aug 2017 23:26:51 +0000
treeherdermozilla-central@14eea6bedcf3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1393624
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1393624 - Blacklist more invalid characters found in Apple's fonts. r=jrmuizel
gfx/thebes/gfxMacPlatformFontList.mm
--- a/gfx/thebes/gfxMacPlatformFontList.mm
+++ b/gfx/thebes/gfxMacPlatformFontList.mm
@@ -211,27 +211,35 @@ MacOSFontEntry::ReadCMAP(FontInfoData *a
                 if (hasGSUB && SupportsScriptInGSUB(sr->tags)) {
                     continue;
                 }
 
                 charmap->ClearRange(sr->rangeStart, sr->rangeEnd);
             }
         }
 
-        // Bug 1360309: several of Apple's Chinese fonts have spurious blank
-        // glyphs for obscure Tibetan codepoints. Blacklist these so that font
-        // fallback will not use them.
+        // Bug 1360309, 1393624: several of Apple's Chinese fonts have spurious
+        // blank glyphs for obscure Tibetan and Arabic-script codepoints.
+        // Blacklist these so that font fallback will not use them.
         if (mRequiresAAT && (FamilyName().EqualsLiteral("Songti SC") ||
                              FamilyName().EqualsLiteral("Songti TC") ||
                              FamilyName().EqualsLiteral("STSong") ||
         // Bug 1390980: on 10.11, the Kaiti fonts are also affected.
                              FamilyName().EqualsLiteral("Kaiti SC") ||
                              FamilyName().EqualsLiteral("Kaiti TC") ||
                              FamilyName().EqualsLiteral("STKaiti"))) {
+            charmap->ClearRange(0x0f6b, 0x0f70);
             charmap->ClearRange(0x0f8c, 0x0f8f);
+            charmap->clear(0x0f98);
+            charmap->clear(0x0fbd);
+            charmap->ClearRange(0x0fcd, 0x0fff);
+            charmap->clear(0x0620);
+            charmap->clear(0x065f);
+            charmap->ClearRange(0x06ee, 0x06ef);
+            charmap->clear(0x06ff);
         }
     }
 
     mHasCmapTable = NS_SUCCEEDED(rv);
     if (mHasCmapTable) {
         gfxPlatformFontList *pfl = gfxPlatformFontList::PlatformFontList();
         mCharacterMap = pfl->FindCharMap(charmap);
     } else {