package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.pango/Ocgtk_pango/Pango/Wrappers/Layout_iter/index.html

Module Wrappers.Layout_iter

type t = [ `layout_iter ] Gobject.obj
val next_run : t -> bool

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

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

val next_line : t -> bool

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

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

val next_cluster : t -> bool

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

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

val next_char : t -> bool

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

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

val get_run_extents : t -> [ `rectangle ] Gobject.obj * [ `rectangle ] Gobject.obj

Gets the extents of the current run in layout coordinates.

Layout coordinates have the origin at the top left of the entire layout.

val get_run_baseline : t -> int

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.

val get_line_yrange : t -> int * int

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

val get_line_readonly : t -> [ `layout_line ] Gobject.obj option

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

val get_line_extents : t -> [ `rectangle ] Gobject.obj * [ `rectangle ] Gobject.obj

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.

val get_line : t -> [ `layout_line ] Gobject.obj option

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

val get_layout_extents : t -> [ `rectangle ] Gobject.obj * [ `rectangle ] Gobject.obj

Obtains the extents of the `PangoLayout` being iterated over.

val get_layout : t -> [ `layout | `object_ ] Gobject.obj option

Gets the layout associated with a `PangoLayoutIter`.

val get_index : t -> int

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

val get_cluster_extents : t -> [ `rectangle ] Gobject.obj * [ `rectangle ] Gobject.obj

Gets the extents of the current cluster, in layout coordinates.

Layout coordinates have the origin at the top left of the entire layout.

val get_char_extents : t -> [ `rectangle ] Gobject.obj

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.

val get_baseline : t -> int

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.

val at_last_line : t -> bool

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