bug 668813 pt 1 - check character coverage of other styles in the selected font family before falling back to other families. r=jdaggett

This commit is contained in:
Jonathan Kew 2011-08-09 09:00:52 +01:00
Родитель 65ca3acc2e
Коммит 43bc79e305
1 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -2610,6 +2610,25 @@ gfxFontGroup::FindFontForChar(PRUint32 aCh, PRUint32 aPrevCh,
*aMatchType = gfxTextRange::kFontGroup;
return font.forget();
}
// check other faces of the family
// XXX optimization point: give the family a charmap that is the union
// of the char maps of all its faces, so we can quickly test whether
// it's worth doing this search
gfxFontFamily *family = font->GetFontEntry()->Family();
if (family) {
FontSearch matchData(aCh, font);
family->FindFontForChar(&matchData);
gfxFontEntry *fe = matchData.mBestMatch;
if (fe) {
PRBool needsBold =
font->GetStyle()->weight >= 600 && !fe->IsBold();
selectedFont =
fe->FindOrMakeFont(font->GetStyle(), needsBold);
if (selectedFont) {
return selectedFont.forget();
}
}
}
}
// if character is in Private Use Area, don't do matching against pref or system fonts