Package: gdk

Function gdk:pango-layout-line-clip-region

Lambda List

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

Arguments

line -- a pango:layout-line instance
xorigin -- an integer with the x pixel where you intend to draw the Pango layout line with this clip
yorigin -- an integer with the baseline pixel where you intend to draw the Pango layout line with this clip
ranges -- list of byte indexes into the Pango layout, where even members of 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 arguments are the top left position of the Pango layout. The ranges list should contain ranges of bytes in the text of the Pango layout. The clip region will include space to the left or right of the line, to the layout bounding box, if you have indexes above or below the indexes contained inside the line. This is to draw the selection all the way to the side of the Pango layout. However, the clip region is in line coordinates, not Pango layout coordinates.

Note that the regions returned correspond to logical extents of the text ranges, not ink extents. So the drawn line 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