Package: gdk

Function gdk:pango-layout-clip-region

Lambda List

gdk:pango-layout-clip-region (layout xorigin yorigin ranges)

Arguments

layout -- a pango:layout object
xorigin -- an integer with the x pixel where you intend to draw the Pango layout with this clip
yorigin -- an integer with the y pixel where you intend to draw the Pango layout with this clip
ranges -- a list of byte indexes into the Pango layout, where even members of the list are start indexes and odd elements are end indexes

Return Value

The cairo:region-t instance with the clip region containing the given ranges.

Details

Obtains a clip region which contains the areas where the given ranges of text would be drawn. The xorigin and yorigin argumentes are the top left point to center the layout. The ranges argument list should contain ranges of bytes in the text of the Pango layout.

Note that the regions returned correspond to logical extents of the text ranges, not ink extents. So the drawn Pango layout may in fact touch areas out of the clip region. The clip region is mainly useful for highlightling parts of text, such as when text is selected.
 

See also

#2024-6-28