Class (GI Struct)

Pango-1.0PangoLayoutIterAbstract

A Pango.LayoutIter can be used to iterate over the visual extents of a Pango.Layout.

To obtain a Pango.LayoutIter, use Pango.Layout.get_iter.

The Pango.LayoutIter structure is opaque, and has no user-visible fields.

Index

Constructors

Properties

$gtype: GType<LayoutIter>

Methods

  • Determines whether iter is on the last line of the layout.

    Returns boolean

    true if iter is on the last line

  • 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.

    Returns number

    baseline of current line

  • 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.

    Returns Pango.Rectangle

  • 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 Pango.LayoutIter.get_run).

    Returns number

    current byte index

  • Divides the vertical space in the Pango.Layout being 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 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.

    Returns [number, number]

  • Gets the current run.

    When iterating by run, at the end of each line, there's a position with a null run, so this function can return null. The null run at the end of each line ensures that all lines have at least one run, even lines consisting of only a newline.

    Use the faster Pango.LayoutIter.get_run_readonly if you do not plan to modify the contents of the run (glyphs, glyph widths, etc.).

    Returns GlyphItem

    the current run

  • 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.

    Returns number

  • Gets the current run for read-only access.

    When iterating by run, at the end of each line, there's a position with a null run, so this function can return null. The null run at the end of each line ensures that all lines have at least one run, even lines consisting of only a newline.

    This is a faster alternative to Pango.LayoutIter.get_run, but the user is not expected to modify the contents of the run (glyphs, glyph widths, etc.).

    Returns GlyphItem

    the current run, that should not be modified

  • Moves iter forward to the next character in visual order.

    If iter was already at the end of the layout, returns false.

    Returns boolean

    whether motion was possible

  • Moves iter forward to the next cluster in visual order.

    If iter was already at the end of the layout, returns false.

    Returns boolean

    whether motion was possible

  • Moves iter forward to the start of the next line.

    If iter is already on the last line, returns false.

    Returns boolean

    whether motion was possible

  • Moves iter forward to the next run in visual order.

    If iter was already at the end of the layout, returns false.

    Returns boolean

    whether motion was possible