Bug 1304699 - Pass the proper unicode-range when looking up a font in the global font cache. r=jrmuizel

This commit is contained in:
Jonathan Kew 2016-09-27 01:48:56 +01:00
parent a2eb555081
commit c6471e4eeb
4 changed files with 11 additions and 4 deletions

View File

@ -3105,6 +3105,10 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget *aDrawTarget,
bool ok = true;
RefPtr<gfxFont> smallCapsFont = GetSmallCapsFont();
if (!smallCapsFont) {
NS_WARNING("failed to get reduced-size font for smallcaps!");
smallCapsFont = this;
}
enum RunCaseAction {
kNoChange,

View File

@ -303,7 +303,7 @@ public:
already_AddRefed<gfxFont>
Lookup(const gfxFontEntry* aFontEntry,
const gfxFontStyle* aStyle,
const gfxCharacterMap* aUnicodeRangeMap = nullptr);
const gfxCharacterMap* aUnicodeRangeMap);
// We created a new font (presumably because Lookup returned null);
// put it in the cache. The font's refcount should be nonzero. It is

View File

@ -280,7 +280,8 @@ gfxFontEntry::FindOrMakeFont(const gfxFontStyle *aStyle,
gfxCharacterMap* aUnicodeRangeMap)
{
// the font entry name is the psname, not the family name
RefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(this, aStyle);
RefPtr<gfxFont> font =
gfxFontCache::GetCache()->Lookup(this, aStyle, aUnicodeRangeMap);
if (!font) {
gfxFont *newFont = CreateFontInstance(aStyle, aNeedsBold);

View File

@ -1686,7 +1686,8 @@ already_AddRefed<gfxFont>
gfxFcFont::MakeScaledFont(gfxFontStyle *aFontStyle, gfxFloat aScaleFactor)
{
gfxFcFontEntry* fe = static_cast<gfxFcFontEntry*>(GetFontEntry());
RefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(fe, aFontStyle);
RefPtr<gfxFont> font =
gfxFontCache::GetCache()->Lookup(fe, aFontStyle, nullptr);
if (font) {
return font.forget();
}
@ -1946,7 +1947,8 @@ gfxFcFont::GetOrMakeFont(FcPattern *aRequestedPattern, FcPattern *aFontPattern,
style.style = gfxFontconfigUtils::GetThebesStyle(renderPattern);
style.weight = gfxFontconfigUtils::GetThebesWeight(renderPattern);
RefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(fe, &style);
RefPtr<gfxFont> font =
gfxFontCache::GetCache()->Lookup(fe, &style, nullptr);
if (!font) {
// Note that a file/index pair (or FT_Face) and the gfxFontStyle are
// not necessarily enough to provide a key that will describe a unique