GNOME Bugzilla – Bug 140199
win32 GDI Printer support
Last modified: 2006-01-16 15:20:00 UTC
Attached is a patch that adds support on win32 for rendering to a GDI printer rather than the display. This is done by creating a font map for a specific device context handle (HDC) and then the fonts created from the map will measure and render using that hdc. There's also a function to create a context for the hdc. I will be submitting a patch to enable gdk to render to a printer hdc so that an application can print using the gdk / pango api. The gdk patch is a bit of a hack and is incomplete, but I will clean it up if there's a chance of it being accepted. Also included in the patch is a cache for font metrics that I think was in pango 1.2.5. Is there a reason why this was taken out?
Created attachment 26699 [details] [review] Printing support
Can't say whether the GDI printer support is something that should be there or not. But as the new API is clearly identified as being Win32 only, and if it useful for you, why not? It seems that the font metrics cache was added "tentatively" to the pango-1-2 branch only (see bug #76328), and never got added to HEAD. I assume it works, and if it really has an noticeable effect (have you measured?), sure, it should be added to HEAD, too.
The question is probably whether to try to support printing via the gdk & pango api's in general. It would be nice if printing also would work on Linux, but that will require a bit more effort. Regarding the font metric cache, I have not timed it or even tried running without it; I just noticed it when going through the diff between our sources and CVS and couldn't just omit it since we modified the code that gets the metrics. There is a comment in the CVS code saying that other backends cache the results.
Printing will be supported in GTK+ only when we switch to using Cairo for rendering (2.8 timescale). The Unix solution for printing for now is gnome-print; the next version of gnome-print will have pretty good Pango integration.
Please file a separate bug and patch for the metrics cache issue, thanks.
Not sure if this will be still interesting for 1.10 where we'll have Cairo support, but too late for API additions for 1.8 at this point.
So what is the status of this bug now that we are almost with 1.12?
Closing it because adding printing support to gdk Drawable's was rejected in favor of cairo.