Last Comment Bug 550445 - DirectWrite nsIFontEnumerator.EnumerateFonts needs to recognize aGeneric
: DirectWrite nsIFontEnumerator.EnumerateFonts needs to recognize aGeneric
Status: NEW
:
Product: Core
Classification: Components
Component: Layout: Text (show other bugs)
: Trunk
: x86 Windows 7
-- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks: dwrite
  Show dependency treegraph
 
Reported: 2010-03-05 03:22 PST by Siddharth Agarwal [:sid0] (inactive)
Modified: 2011-05-21 16:49 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description User image Siddharth Agarwal [:sid0] (inactive) 2010-03-05 03:22:01 PST
fe = Components.classes["@mozilla.org/gfx/fontenumerator;1"].createInstance(Components.interfaces.nsIFontEnumerator); fe.EnumerateFonts("x-western", "serif", {})

returns all fonts, whether serif, non-serif or monospace. Only serif fonts are returned with GDI. (This causes the font chooser to be populated with all sorts of fonts for each style.)
Comment 1 User image Jonathan Kew (:jfkthame) 2010-03-05 03:34:17 PST
This is because gfxDWriteFontEntry does not implement the MatchesGenericFamily method, so it falls back to the base implementation in gfxFontEntry, which always answers "yes".
Comment 2 User image David Baron :dbaron: ⌚️UTC-8 2010-03-05 09:59:50 PST
Could this explain a bunch of the reftest failures in bug 549832 where serif/sans-serif fonts got crossed?
Comment 3 User image Mime Čuvalo 2011-05-21 16:49:32 PDT
This happens for me and I think DirectWrite is disabled (at least it says so in about:support).  Related to bug 107888?

Note You need to log in before you can comment on or make changes to this bug.