Re: Calculating bounding boxes for rendered fonts
- From: John Cupitt <john cupitt ng-london org uk>
- To: "Ian King [ES]" <king eiffel com>
- Cc: gtk-list gnome org
- Subject: Re: Calculating bounding boxes for rendered fonts
- Date: Wed, 26 May 2004 16:17:11 +0000
Hi,
Ian King [ES] wrote:
I need to be able to correctly calculate a bounding box for a string in
a particular rendered font. At the moment I am creating a PangoLayout
with a particular string and font description, then calling
pango_layout_get_pixel_size. This seems to work when the rendered font
is non-italic. However, when I italicize the font description, the
query to pango_layout_get_pixel_size returns the same value, even though
the rendered font is wider than the returned dimensions.
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.
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]