[cairo] A problem with large Windows Metafiles

Zoltán Turányi teknos at gmail.com
Thu Jul 1 02:09:34 PDT 2010


I am using cairo on Windows to draw into Windows metafiles using the
printing surface. Unfortunately the printing surface takes its surface
extents from the original clip defined in the metafile device context, which
by default is the physical screen size (I found no ways to change this).
Then, if I draw on the surface outside its extent then some drawing
operations (e.g., strokes) end up in the makefile, some others (fonts) do
not. This is very annoying as I need to use co-ordinates larger than the
current screen size. Right now I have patched my cairo copy to set the
extents to a big enough value, but I hope a real solution can be made part
of the next release. Also, I believe it is incorrect behaviour: a mechanism
similar to clipping should clip either everything or nothing.

I am not that deep into cairo internals, but I remember seeing something as
an unbounded surface: I think this is the right type of surface for a
windows metafile (especially if its device context is passed unclipped to
cairo). However, specifically for a printing surface I found no ways to
indicate this. I am also a bit unsure what would be the impact of removing
the extent for real printer device.

I have submitted a bug (#25893) with example code quite some time ago and
would be willing to contribute, but I think I need to discuss the above
issues with someone knowing more of then win32 backend before just proposing
a patch.

Here is a PNG rendering of an erroneous makefile to demo my effect. (Each
box is aligned at 100 boundaries and my screen size was something like
1600x1120. Fonts do not show outside.)

Can anyone help me how to progress this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100701/8b8dccc0/attachment.htm>

More information about the cairo mailing list