Package: pango

Function pango:layout-extents

Lambda List

pango:layout-extents (layout ink logical)

Arguments

layout -- a pango:layout object
ink -- a pango:rectangle instance to fill with the extents of the Pango layout as drawn, or nil
logical -- a pango:rectangle instance to fill with the logical extents of the Pango layout, or nil

Details

Computes the logical and ink extents of the Pango layout. Logical extents are usually what you want for positioning things. Note that both extents may have non-zero x and y parameters for the rectangles. You may want to use those to offset where you render the Pango layout. Not doing that is a very typical bug that shows up as right-to-left Pango layouts not being correctly positioned in a Pango layout with a set width.

The extents are given in Pango layout coordinates and in Pango units. Pango layout coordinates begin at the top left corner of the Pango layout.
 

See also

2025-2-15