Closed Bug 489511 Opened 15 years ago Closed 15 years ago

gfxFontCache will never hit on Freetype2 backend.

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: ashie, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 (.NET CLR 3.5.30729)
Build Identifier: 

gfxFontCache::Lookup() requires font "face" name to lookup a font, but gfxFT2Font uses this function with font "family" name.

  https://hg.mozilla.org/mozilla-central/file/824f4ab3bfec/gfx/thebes/src/gfxFT2Fonts.cpp#l254

So that cache will never hit on this backend. I confirmed it on WinCE platform. I'm not sure but it will be caused also on other platforms which uses freetype2 backend.

gfxWindowsFont uses FontEntry::Name() to obtain font "face" name:

  https://hg.mozilla.org/mozilla-central/file/824f4ab3bfec/gfx/thebes/src/gfxWindowsFonts.cpp#l1186
  https://hg.mozilla.org/mozilla-central/file/824f4ab3bfec/gfx/thebes/public/gfxFont.h#l178

I think this is the correct way to lookup font cache.


Reproducible: Always
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 374008 [details] [diff] [review]
A patch to fix font cache issue

This seems a sensible solution to me, thank you.

(Naming font entries by face name seems sensible.  If we want gfxFontCache::GetCache()->Lookup() to work with a family name we'd have to also store the family name somewhere.)
Attachment #374008 - Flags: review+
http://hg.mozilla.org/mozilla-central/rev/fa0668077901
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: