Bug 1393624 - Blacklist more invalid characters found in Apple's fonts. r=jrmuizel, a=gchang
authorJonathan Kew <jkew@mozilla.com>
Thu, 31 Aug 2017 15:17:44 +0100
changeset 421546 fe4bfcfc5db2
parent 421545 e2beb66c58e0
child 421547 cdd1559ed4d3
push id7712
push userryanvm@gmail.com
push dateMon, 04 Sep 2017 13:16:27 +0000
treeherdermozilla-beta@cdd1559ed4d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, gchang
bugs1393624
milestone56.0
Bug 1393624 - Blacklist more invalid characters found in Apple's fonts. r=jrmuizel, a=gchang
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 {