I agree. The best would be to somehow be able to generate a metafile DC that has no extent. I found no way to do so, maybe a windows expert can help here.<br><br>Otherwise I think win32 printing surface should be modified not to save the extent found in metafile DCs.<br>
<br>Zoltan<br><br><div class="gmail_quote">2009/12/18 Kozhevnikov Mikhail <span dir="ltr"><<a href="mailto:mikhailkozhevnikov@yandex.ru">mikhailkozhevnikov@yandex.ru</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Zoltan,<br><br>Thanks much for your suggestion, I'll try it. I would actually try to find a solution that doesn't require cairo code modification.<br><br>I guess this list is the most appropriate place for posting any bugs or suggestions. And I do consider it a bug, unless there's some better way we're not aware of to solve the problem. <br>
<br>Cheers,<br>Mikhail.<br><br>18.12.09, 08:57, "Zoltán Turányi" <<a href="mailto:teknos@gmail.com" target="_blank">teknos@gmail.com</a>>:<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1em;">
<div class="im">Hi Mikhail,<br><br>I think my previous mail did not reach you and the list, so here is its contents again.<br><br></div>I have ran into the same (or just a similar) problem. After somedebugging I have found that printing surfaces query the clip box oncreation and later drop all glyphs that are outside that clip region(plus some margin). The dropping is specific to fonts (and I thinkalso for bitmap fallback, but I am not sure) and is not done for e.g.,paths.<div class="im">
<br><br>Specifically, in cairo-win32-printing-surface.c the function cairo_win32_printing_surface_</div><div style="display: block;">create()calls the GetClipBox() windows GDI call to set the surface.extent fieldof the surface under creation. This is sometimes too small -as you say coming from device metrics-, so glyphdropping will happen. I found no way yet to create a metafile context which did not have this limitation. I also think this is the reason why one cannot draw on a device context created from an old format Windows metafile (wmf) - such contexts cannot return a clip box, so surface creation fails.<br>
<br>The glyph dropping happens in _cairo_gstate_transform_glyphs_to_backend(),which uses surface.extent to see which glyphs to drop. This functiondoes not drop any glyph if you call it with num_transformed_glyphs=NULL.<br>
<br>So what I did to avoid this problem is to change the call to thisfunction to set this parameter to NULL and recompiled cairo. Voila, itworks.<div class="im"><br><br>I am new to cairo and don't really know whom to report such bugs (which may not be bugs in reality), so any help here is appreciated. Maybe these should be discussed on this list.<br>
<br>Zoltán<br></div></div><div class="im"><br><br><div class="gmail_quote">2009/12/18 Kozhevnikov Mikhail <span dir="ltr"><<a href="mailto:mikhailkozhevnikov@yandex.ru" target="_blank">mikhailkozhevnikov@yandex.ru</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,<br><br>Anybody knows the way to prevent text clipping when drawing to windows metafile?<br>
<br>Cairo (or GDI?) seems to use the current device metrics (i.e. 1600x900 for my monitor) to clip the text in a metafile. That is, I can not create a metafile of, say, 2000x2000 - the text will be clipped out.<br><br>I've tried cairo_reset_clip() and some WinAPI calls, e.g. SetViewportExtEx, SetWindowsExtEx, SelectClipRgn, but they make no difference.<br>
<br>Thanks in advance,<br>(and sorry for bothering everybody with windows metafiles)<br>Mikhail.<br><span style="color: rgb(136, 136, 136);">--<br>cairo mailing list<br><a href="mailto:cairo@cairographics.org" target="_blank">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br></span></blockquote></div><br></div></blockquote><font color="#888888"><br><br>-- <br>
Яндекс.Почта. Письма есть. Спама - нет. <a href="http://mail.yandex.ru/nospam/sign" target="_blank">http://mail.yandex.ru/nospam/sign</a></font></blockquote></div><br>