pango_layout_get_pixel_extents()



The doc for pango_layout_get_pixel_extents() says:

"Compute the logical and ink extents of layout. See the documentation for 
pango_font_get_glyph_extents() for details about the interpretation of the 
rectangles."

And pango_font_get_glyph_extents() says:

"The coordinate system for each rectangle has its origin at the base line 
and horizontal origin of the character with increasing coordinates 
extending to the right and down."

This (former) seems to be wrong. When I use
pango_layout_get_pixel_extents() it seems like I get the bounding box for
the whole layout (that can be several lines) starting in the top left
corner and not at some baseline. For the ink rect the origo seems to be
top left corner of the logical rect. And the logical rect seems to always
start at (0,0), at least in my small tests.

The behaviour seems logical so it's probably just the reference to 
pango_font_get_glyph_extents() that is wrong.

But it could have been the baseline as origo even for the layout, if one
use the baseline for the first line (whatever that means) as the baseline 
for the layout.

ps. I hope I don't bore you with my mails about minor things in the docs.

--
/Dennis




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