bug 706888 - ignore GSUB in broken version of Droid Sans Arabic. r=jdaggett
authorJonathan Kew <jkew@mozilla.com>
Thu, 26 Apr 2012 20:06:52 +0100
changeset 92549 42ef0ce00b8c7338d8655add28d2b0ec5b6657e4
parent 92548 d16a99a00743edb4565709efbf92c80c3ff431ed
child 92550 1cc5c7879c82eb9b62050842d8cbfea8a9210d52
push id22544
push useremorley@mozilla.com
push dateFri, 27 Apr 2012 11:53:27 +0000
treeherdermozilla-central@d871849ac3a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs706888
milestone15.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 706888 - ignore GSUB in broken version of Droid Sans Arabic. r=jdaggett
gfx/thebes/gfxFT2FontList.cpp
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -792,16 +792,27 @@ gfxFT2FontList::AppendFacesFromFontFile(
 
                 // bug 721719 - set the IgnoreGSUB flag on entries for Roboto
                 // because of unwanted on-by-default "ae" ligature.
                 // (See also AppendFaceFromFontListEntry.)
                 if (name.EqualsLiteral("roboto")) {
                     fe->mIgnoreGSUB = true;
                 }
 
+                // bug 706888 - set the IgnoreGSUB flag on the broken version of
+                // Droid Sans Arabic from certain phones, as identified by the
+                // font checksum in the 'head' table
+                else if (name.EqualsLiteral("droid sans arabic")) {
+                    const TT_Header *head = static_cast<const TT_Header*>
+                        (FT_Get_Sfnt_Table(face, ft_sfnt_head));
+                    if (head && head->CheckSum_Adjust == 0xe445242) {
+                        fe->mIgnoreGSUB = true;
+                    }
+                }
+
                 AppendToFaceList(faceList, name, fe);
 #ifdef PR_LOGGING
                 if (LOG_ENABLED()) {
                     LOG(("(fontinit) added (%s) to family (%s)"
                          " with style: %s weight: %d stretch: %d",
                          NS_ConvertUTF16toUTF8(fe->Name()).get(), 
                          NS_ConvertUTF16toUTF8(family->Name()).get(), 
                          fe->IsItalic() ? "italic" : "normal",