Re: [Pango] Getting consistent layout extents without a rendering surface



After more investigation I've discovered that the different extents (and line 
counts) are caused by the scaling matrix set in cairo context used for 
rendering. To summarize:

Layouts with the same text, same attributes and same width may have the lines 
wrapping in a non consistent manner if the scaling matrix changes (most 
usually the line count changes by +1/-1)

Is this behavior intended or this could be a bug? This seems pretty weird to 
me, as scaling down the visualized text should make characters smaller, but 
should not cause layout changes

Regards,
Alessandro

On Friday 01 April 2011 16:29:04 Alessandro Pignotti wrote:
> Hi everyone,
> 
> I'm experimenting with using Pango to determine the size of a layout before
> knowing the actual surface where it will be drawn on.
> 
> I'm noticing that the extends returned by pango_layout_get_extents for a
> temporary layout and the layout created by pango_cairo_create_layout at
> render time are not consistent. For both layouts the width and attributes
> are set at the same values.
> 
> Are there any guidelines to guarantee consistent layout results? Could the
> problem be related to subpixel hinting that is configured at system (GTK)
> level? Is there any way to verify that the same font is actually being
> selected in the two case I described?
> 
> Thanks a lot for your help, please let me know if more information is
> needed Alessandro Pignotti

Attachment: signature.asc
Description: This is a digitally signed message part.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]