Bug 1230497 - Ignore font fallback in Core Text shaping if it's just for a join-control character. r=jdaggett
authorJonathan Kew <jkew@mozilla.com>
Mon, 07 Dec 2015 19:22:06 -0500
changeset 310008 803db6db0f680e066a2e3830cdd22959b07a0459
parent 310007 87caa5721cd900ab113ba5991e0d7616b84bd076
child 310009 2bdd9ec79799eff3ceec0a318f5a0632d918a527
child 310029 56e5d2fe4c19e5ae606acebc40490c9167f9a211
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs1230497
milestone45.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 1230497 - Ignore font fallback in Core Text shaping if it's just for a join-control character. r=jdaggett
gfx/thebes/gfxCoreTextShaper.cpp
--- a/gfx/thebes/gfxCoreTextShaper.cpp
+++ b/gfx/thebes/gfxCoreTextShaper.cpp
@@ -179,21 +179,24 @@ gfxCoreTextShaper::ShapeText(gfxContext 
         if (runAttr != attrObj) {
             // If Core Text manufactured a new dictionary, this may indicate
             // unexpected font substitution. In that case, we fail (and fall
             // back to harfbuzz shaping)...
             const void* font1 = ::CFDictionaryGetValue(attrObj, kCTFontAttributeName);
             const void* font2 = ::CFDictionaryGetValue(runAttr, kCTFontAttributeName);
             if (font1 != font2) {
                 // ...except that if the fallback was only for a variation
-                // selector that is otherwise unsupported, we just ignore it.
-                if (range.length == 1 &&
-                    gfxFontUtils::IsVarSelector(aText[range.location -
-                                                      startOffset])) {
-                    continue;
+                // selector or join control that is otherwise unsupported,
+                // we just ignore it.
+                if (range.length == 1) {
+                    char16_t ch = aText[range.location - startOffset];
+                    if (gfxFontUtils::IsJoinControl(ch) ||
+                        gfxFontUtils::IsVarSelector(ch)) {
+                        continue;
+                    }
                 }
                 NS_WARNING("unexpected font fallback in Core Text");
                 success = false;
                 break;
             }
         }
         if (SetGlyphsFromRun(aShapedText, aOffset, aLength, aCTRun, startOffset) != NS_OK) {
             success = false;