Bug 1360309 - Work around some broken Apple fonts. r=jrmuizel, a=ritu
authorJonathan Kew <jkew@mozilla.com>
Wed, 03 May 2017 09:03:18 +0100
changeset 396143 d5a452ce541c6b93b081bd1eb665a6b6940f6fb5
parent 396142 ab214dae788de6dfeb2e3a16ae81326c9102b0d0
child 396144 49be8c224dea755b8e4bbc042965d90eb0c379d2
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, ritu
bugs1360309
milestone54.0
Bug 1360309 - Work around some broken Apple fonts. r=jrmuizel, a=ritu
gfx/thebes/gfxMacPlatformFontList.mm
--- a/gfx/thebes/gfxMacPlatformFontList.mm
+++ b/gfx/thebes/gfxMacPlatformFontList.mm
@@ -211,16 +211,25 @@ MacOSFontEntry::ReadCMAP(FontInfoData *a
                 // We check for GSUB here, as GPOS alone would not be ok.
                 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.
+        if (mRequiresAAT && (FamilyName().EqualsLiteral("Songti SC") ||
+                             FamilyName().EqualsLiteral("Songti TC") ||
+                             FamilyName().EqualsLiteral("STSong"))) {
+            charmap->ClearRange(0x0f8c, 0x0f8f);
+        }
     }
 
     mHasCmapTable = NS_SUCCEEDED(rv);
     if (mHasCmapTable) {
         gfxPlatformFontList *pfl = gfxPlatformFontList::PlatformFontList();
         mCharacterMap = pfl->FindCharMap(charmap);
     } else {
         // if error occurred, initialize to null cmap