[cairo-bugs] [Bug 33178] Suggestions for cleaning HFONT handling

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jan 17 13:46:24 PST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=33178

--- Comment #4 from Brent Fulgham <bfulgham at webkit.org> 2011-01-17 13:46:22 PST ---
(In reply to comment #1)
> We can improve the documentation to make it clear that the application needs to
> unselect the font (either by selecting another font or with RestoreDC) before
> calling cairo_win32_scaled_font_done_font() and then destroying the font.
> 
> I'm not sure why cairo_win32_scaled_font_select_font() doesn't keep a reference
> to the scaled font until cairo_win32_scaled_font_done_font() is called.

I was thinking about this, too.  If we assume that the DC can only be
interacted with from a single thread, then retaining the
previously-selected-font internally would allow us to properly select the old
font back into the context when done_font was called.

I think this would be clearer than SaveDC/RestoreDC around the calls, just in
case some kind of drawing/scaling or other transformations need to be
interleaved with font handling.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the cairo-bugs mailing list