[cairo] Exact placement of a multiline pango layout

Behdad Esfahbod behdad at behdad.org
Fri Oct 22 12:13:46 PDT 2010


pango_layout_get_extents()?

On 10/22/10 14:51, Stefan Salewski wrote:
> Hello,
> 
> I am drawing a multiline pango layout to a cairo surface, and I want do
> draw a rectangle around that text, giving something
> ---------------
> |Line 1       |
> |Line two     |
> |A longer Line|
> ---------------
> 
> Propose is something like drawing labels in a graphical layout tool. So
> I need exact control over layout, the frame in the example should exact
> enclose the logical(or ink) layout.
> 
> Indeed, I have already a few working solutions, but I think they work
> only by fortune, and may fail with other types of text.
> 
> I was not able to find a good exapmle like this one for cairo's toy
> text:
> 
> http://cairographics.org/samples/text_align_center/
> 
> I have found this thread from a mailing list, a similar problem,
> 
> http://lists.freedesktop.org/archives/cairo/2007-February/009472.html
> 
> but I am still not convinced that I understand the correct solution. I
> think there should exists really some more simple examples for pango.
> 
> Best regards
> 
> Stefan Salewski
> 
> 
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
> 


More information about the cairo mailing list