mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1304699 - Pass the proper unicode-range when looking up a font in the global font cache. r=jrmuizel
This commit is contained in:
parent
a2eb555081
commit
c6471e4eeb
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user