Re: Calculating bounding boxes for rendered fonts



Hi,

John Cupitt <john cupitt ng-london org uk> writes:

> I'm using
> 
>   pango_layout_get_extents( layout, &ink_rect, &logical_rect );
> 
> ink rect is the bounding box of the pixels that will be painted,
> logical_rect includes a bunch of extra spacing and allowance for
> ascenders / descenders / extra punctuation / other stuff I don't
> understand. PANGO_PIXELS() converts to pixel coordinates.

There's also pango_layout_get_pixel_extents() so you don't really need
to use PANGO_PIXELS(). Also, watch out, the ink rect may sometimes
extend the logical rectangle.


Sven



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