Gjsify LogoGjsify Logo

A PangoLayoutIter can be used to iterate over the visual extents of a PangoLayout.

To obtain a PangoLayoutIter, use [methodPango.Layout.get_iter].

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

record

Hierarchy

  • LayoutIter

Index

Constructors

Properties

name: string

Methods

  • at_last_line(): boolean
  • free(): void
  • get_baseline(): number
  • 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

  • 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

  • get_index(): number
  • 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 [methodPango.LayoutIter.get_run]).

    Returns number

  • Gets the current line.

    Use the faster [methodPango.LayoutIter.get_line_readonly] if you do not plan to modify the contents of the line (glyphs, glyph widths, etc.).

    Returns LayoutLine

  • 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 [methodPango.LayoutLine.get_extents].

    Returns [Pango.Rectangle, Pango.Rectangle]

  • Gets the current line for read-only access.

    This is a faster alternative to [methodPango.LayoutIter.get_line], but the user is not expected to modify the contents of the line (glyphs, glyph widths, etc.).

    Returns LayoutLine

  • get_line_yrange(): [number, number]
  • Divides the vertical space in the PangoLayout 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 [methodPango.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 [methodPango.LayoutIter.get_run_readonly] if you do not plan to modify the contents of the run (glyphs, glyph widths, etc.).

    Returns GlyphItem

  • get_run_baseline(): number
  • 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 [methodPango.LayoutIter.get_run], but the user is not expected to modify the contents of the run (glyphs, glyph widths, etc.).

    Returns GlyphItem

  • next_char(): boolean
  • Moves iter forward to the next character in visual order.

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

    Returns boolean

  • next_cluster(): boolean
  • Moves iter forward to the next cluster in visual order.

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

    Returns boolean

  • next_line(): boolean
  • Moves iter forward to the start of the next line.

    If iter is already on the last line, returns %FALSE.

    Returns boolean

  • next_run(): boolean
  • Moves iter forward to the next run in visual order.

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

    Returns boolean

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method