bug 716229 pt 2 - initialize font-matching using the group's primary font. r=roc
authorJonathan Kew <jfkthame@gmail.com>
Sun, 15 Jan 2012 08:45:09 +0000
changeset 85764 1b67951de0a28eb0f308fdd1061a02a48c07c767
parent 85763 b4195741db430f6ef949926ae0efe8902baae27e
child 85765 006ab840347570b92f26c28f2efe05973357ced6
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs716229
milestone12.0a1
bug 716229 pt 2 - initialize font-matching using the group's primary font. r=roc
gfx/thebes/gfxFont.cpp
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -3372,19 +3372,23 @@ void gfxFontGroup::ComputeRanges(nsTArra
 {
     aRanges.Clear();
 
     if (aLength == 0) {
         return;
     }
 
     PRUint32 prevCh = 0;
-    gfxFont *prevFont = nsnull;
     PRUint8 matchType = 0;
 
+    // initialize prevFont to the group's primary font, so that this will be
+    // used for string-initial control chars, etc rather than risk hitting font
+    // fallback for these (bug 716229)
+    gfxFont *prevFont = GetFontAt(0);
+
     for (PRUint32 i = 0; i < aLength; i++) {
 
         const PRUint32 origI = i; // save off in case we increase for surrogate
 
         // set up current ch
         PRUint32 ch = aString[i];
 
         // in 16-bit case only, check for surrogate pair