pango_layout_get_clip_region


Description:


public Region pango_layout_get_clip_region (Layout layout, int x_origin, int y_origin, int[] index_ranges)

Obtains a clip region which contains the areas where the given ranges of text would be drawn.

x_origin and y_origin are the top left point to center the layout. index_ranges should contain ranges of bytes in the layout’s text.

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

Parameters:

layout

a Layout

x_origin

X pixel where you intend to draw the layout with this clip

y_origin

Y pixel where you intend to draw the layout with this clip

index_ranges

array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes

n_ranges

number of ranges in index_ranges, i.e. half the size of index_ranges

Returns:

a clip region containing the given ranges


Namespace: Gdk
Package: gdk-3.0