[cairo] EMF: text clipping

Zoltán Turányi teknos at gmail.com
Fri Dec 18 04:59:11 PST 2009


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.

Otherwise I think win32 printing surface should be modified not to save the
extent found in metafile DCs.

Zoltan

2009/12/18 Kozhevnikov Mikhail <mikhailkozhevnikov at yandex.ru>

> Hi Zoltan,
>
> Thanks much for your suggestion, I'll try it. I would actually try to find
> a solution that doesn't require cairo code modification.
>
> 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.
>
> Cheers,
> Mikhail.
>
> 18.12.09, 08:57, "Zoltán Turányi" <teknos at gmail.com>:
>
> Hi Mikhail,
>
> I think my previous mail did not reach you and the list, so here is its
> contents again.
>
> 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.
>
>
> Specifically, in cairo-win32-printing-surface.c the function
> cairo_win32_printing_surface_
> 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.
>
> 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.
>
> 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.
>
>
> 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.
>
> Zoltán
>
>
> 2009/12/18 Kozhevnikov Mikhail <mikhailkozhevnikov at yandex.ru>
>
>> Hello,
>>
>> Anybody knows the way to prevent text clipping when drawing to windows
>> metafile?
>>
>> 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.
>>
>> I've tried cairo_reset_clip() and some WinAPI calls, e.g.
>> SetViewportExtEx, SetWindowsExtEx, SelectClipRgn, but they make no
>> difference.
>>
>> Thanks in advance,
>> (and sorry for bothering everybody with windows metafiles)
>> Mikhail.
>> --
>> cairo mailing list
>> cairo at cairographics.org
>> http://lists.cairographics.org/mailman/listinfo/cairo
>>
>
>
>
> --
> Яндекс.Почта. Письма есть. Спама - нет. http://mail.yandex.ru/nospam/sign
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20091218/81e5b488/attachment.htm 


More information about the cairo mailing list