Basics
Guides
API Reference
Basics
Guides
API Reference
[15:7] extends: object
A PangoLayoutIter can be used to iterate over the visual extents of a
PangoLayout. To obtain a PangoLayoutIter, use
[method@Pango.Layout.get_iter]. The PangoLayoutIter structure is opaque,
and has no user-visible fields.
PangoLayoutIter (Handle = null)
Creates a new
LayoutIterby wrapping a native handle or another wrapper.
Handle is the native handle or another wrapper whose handle to adopt.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.at_last_line ()
Determines whether @iter is on the last line of the layout.
%TRUE if @iter is on the last line.copy ()
Copies a
PangoLayoutIter.
the newly allocated PangoLayoutIter.free ()
Frees an iterator that's no longer in use.
None.get_baseline ()
Gets the Y position of the current line's baseline, in layout coordinates. Layout coordinates have the origin at the top left of the entire layout.
baseline of current line.get_char_extents ()
Gets the extents of the current character, in layout coordinates. Layout coordinates have the origin at the top left of the entire layout. Only logical extents can sensibly be obtained for characters; ink extents make sense only down to the level of clusters.
logical_rect is rectangle to fill with logical extents.None.get_cluster_extents ()
Gets the extents of the current cluster, in layout coordinates. Layout coordinates have the origin at the top left of the entire layout.
ink_rect is rectangle to fill with ink extents.logical_rect is rectangle to fill with logical extents.None.get_index ()
Gets the current byte index. Note that iterating forward by char moves in visual order, not logical order, so indexes may not be sequential. Also, the index may be equal to the length of the text in the layout, if on the %NULL run (see [method@Pango.LayoutIter.get_run]).
current byte index.get_layout ()
Gets the layout associated with a
PangoLayoutIter.
the layout associated with @iter.get_layout_extents ()
Obtains the extents of the
PangoLayoutbeing iterated over.
ink_rect is rectangle to fill with ink extents.logical_rect is rectangle to fill with logical extents.None.get_line ()
Gets the current line. Use the faster [method@Pango.LayoutIter.get_line_readonly] if you do not plan to modify the contents of the line (glyphs, glyph widths, etc.).
the current line.get_line_extents ()
Obtains the extents of the current line. Extents are in layout coordinates (origin is the top-left corner of the entire
PangoLayout). Thus the extents returned by this function will be the same width/height but not at the same x/y as the extents returned from [method@Pango.LayoutLine.get_extents].
ink_rect is rectangle to fill with ink extents.logical_rect is rectangle to fill with logical extents.None.get_line_readonly ()
Gets the current line for read-only access. This is a faster alternative to [method@Pango.LayoutIter.get_line], but the user is not expected to modify the contents of the line (glyphs, glyph widths, etc.).
the current line, that should not be modified.get_line_yrange ()
Divides the vertical space in the
PangoLayoutbeing iterated over between the lines in the layout, and returns the space belonging to the current line. A line's range includes the line's logical extents. plus half of the spacing above and below the line, if [method@Pango.Layout.set_spacing] has been called to set layout spacing. The Y positions are in layout coordinates (origin at top left of the entire layout). Note: Since 1.44, Pango uses line heights for placing lines, and there may be gaps between the ranges returned by this function.
y0_ is start of line.y1_ is end of line.None.get_run_baseline ()
Gets the Y position of the current run's baseline, in layout coordinates. Layout coordinates have the origin at the top left of the entire layout. The run baseline can be different from the line baseline, for example due to superscript or subscript positioning.
get_run_extents ()
Gets the extents of the current run in layout coordinates. Layout coordinates have the origin at the top left of the entire layout.
ink_rect is rectangle to fill with ink extents.logical_rect is rectangle to fill with logical extents.None.next_char ()
Moves @iter forward to the next character in visual order. If @iter was already at the end of the layout, returns %FALSE.
whether motion was possible.next_cluster ()
Moves @iter forward to the next cluster in visual order. If @iter was already at the end of the layout, returns %FALSE.
whether motion was possible.next_line ()
Moves @iter forward to the start of the next line. If @iter is already on the last line, returns %FALSE.
whether motion was possible.next_run ()
Moves @iter forward to the next run in visual order. If @iter was already at the end of the layout, returns %FALSE.
whether motion was possible.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.