Re: ink_rect and logical_rect; bug or feature?

Darin Adler <darin bentspoon com> writes:

> When I get the ink_rect for my layout with pango_layout_get_pixel_extents, I
> get something like this (x,y width,height):
>     40,-11 104,11
> And the logical_rect for the same layout is:
>     40,0 104,18
> What does this mean? I'm assuming that a -11 for the y coordinate of the ink
> rect means that the topmost text pixel is 11 pixels above the baseline. But
> what does the 0 for the y coordinate of the logical rect mean? How far from
> the baseline is the top of the logical rect?

The coordinates for pango_layout_get_[pixel]_extents are from
the upper left of the layout, for both the ink and the logical
rect. (On the other hand, for layout_line_get_extents, the
origin is on the baseline.)

These numbers look a little odd, though it's perfectly legitimtae
for the ink rect to extend beyond the logical rect in some
circumstances. I'd have to know more details about the text,
options, font, etc, to know whether they are correct or not.
> (Also, please scold me and tell me what list I should really be asking this
> question on.)

Well, in theory, the list for general Pango discussion is
gtk-i18n-list. Discussion, especially about development
issues for Pango does go on here too.


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