[cairo] Problem in dot matrix windows printer!!!

Elmar Braun Elmar.Braun at sh-p.de
Tue Mar 1 01:13:02 PST 2011


The HDC that you use for cairo_win32_printing_surface_create has a "mapping mode":

http://msdn.microsoft.com/en-us/library/dd144897(VS.85).aspx

In my experience (1.8.10) Cairo text output breaks when the mapping mode is anything other than MM_TEXT. Printer HDCs sometimes come preset to MM_ANISOTROPIC or MM_ISOTROPIC.

If this is the problem, you can SetMapMode() to MM_TEXT. But you'll also need to call GetWindowExtEx() and GetViewportExtEx(), and cairo_scale() with a factor of viewport extent divided by window extent. That's what makes win32 printing work for me anyway.

Hope this helps,
Elmar



More information about the cairo mailing list