N-LayoutIter

#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------

Gnome::Pango::N-LayoutIter

Description

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

To obtain a Gnome::Pango::N-LayoutIter, use .get-iter() in class Gnome::Pango::Layout.

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

#------------------------------------------------------------------------------- #--[Record Structure]----------------------------------------------------------- #-------------------------------------------------------------------------------

Record N-LayoutIter

This is an opaque type of which fields are not available.

class N-LayoutIter:auth<github:MARTIMM>:api<2> is export is repr('CStruct') { }

#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------

Class initialization

new

:native-object

Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object() :$native-object! )

#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------

Methods

#-------------------------------------------------------------------------------

at-last-line

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

method at-last-line (--> Bool )

Return value; True if $iter is on the last line.

#-------------------------------------------------------------------------------

copy

Copies a Gnome::Pango::N-LayoutIter.

method copy (--> CArray[N-LayoutIter] )

Return value; the newly allocated Gnome::Pango::N-LayoutIter.

#-------------------------------------------------------------------------------

free

Frees an iterator that's no longer in use.

method free ( )

#-------------------------------------------------------------------------------

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.

method get-baseline (--> Int )

Return value; baseline of current line.

#-------------------------------------------------------------------------------

get-char-extents This function is not yet available

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.

method get-char-extents ( CArray[N-Rectangle]  $logical-rect )
  • $logical-rect; rectangle to fill with logical extents.

#-------------------------------------------------------------------------------

get-cluster-extents This function is not yet available

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

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

method get-cluster-extents ( CArray[N-Rectangle]  $ink-rect, CArray[N-Rectangle]  $logical-rect )
  • $ink-rect; rectangle to fill with ink extents.

  • $logical-rect; rectangle to fill with logical extents.

#-------------------------------------------------------------------------------

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 undefined run (see .get-run()).

method get-index (--> Int )

Return value; current byte index.

#-------------------------------------------------------------------------------

get-layout

Gets the layout associated with a Gnome::Pango::N-LayoutIter.

method get-layout (--> N-Object )

Return value; the layout associated with $iter.

#-------------------------------------------------------------------------------

get-layout-extents This function is not yet available

Obtains the extents of the Gnome::Pango::Layout being iterated over.

method get-layout-extents ( CArray[N-Rectangle]  $ink-rect, CArray[N-Rectangle]  $logical-rect )
  • $ink-rect; rectangle to fill with ink extents.

  • $logical-rect; rectangle to fill with logical extents.

#-------------------------------------------------------------------------------

get-line

Gets the current line.

Use the faster .get-line-readonly() if you do not plan to modify the contents of the line (glyphs, glyph widths, etc.).

method get-line (--> CArray[N-LayoutLine] )

Return value; the current line.

#-------------------------------------------------------------------------------

get-line-extents This function is not yet available

Obtains the extents of the current line.

Extents are in layout coordinates (origin is the top-left corner of the entire Gnome::Pango::Layout). 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 .get-extents() in class Gnome::Pango::N-LayoutLine.

method get-line-extents ( CArray[N-Rectangle]  $ink-rect, CArray[N-Rectangle]  $logical-rect )
  • $ink-rect; rectangle to fill with ink extents.

  • $logical-rect; rectangle to fill with logical extents.

#-------------------------------------------------------------------------------

get-line-readonly

Gets the current line for read-only access.

This is a faster alternative to .get-line(), but the user is not expected to modify the contents of the line (glyphs, glyph widths, etc.).

method get-line-readonly (--> CArray[N-LayoutLine] )

Return value; the current line, that should not be modified.

#-------------------------------------------------------------------------------

get-line-yrange

Divides the vertical space in the Gnome::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 .set-spacing() in class Gnome::Pango::Layout 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.

method get-line-yrange ( Array[Int] $y0, Array[Int] $y1 )
  • $y0; (transfer ownership: full) start of line.

  • $y1; (transfer ownership: full) end of line.

#-------------------------------------------------------------------------------

get-run This function is not yet available

Gets the current run.

When iterating by run, at the end of each line, there's a position with a undefined run, so this function can return undefined. The undefined 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 .get-run-readonly() if you do not plan to modify the contents of the run (glyphs, glyph widths, etc.).

method get-run ( )

#-------------------------------------------------------------------------------

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.

method get-run-baseline (--> Int )

Return value; No documentation about its value and use.

#-------------------------------------------------------------------------------

get-run-extents This function is not yet available

Gets the extents of the current run in layout coordinates.

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

method get-run-extents ( CArray[N-Rectangle]  $ink-rect, CArray[N-Rectangle]  $logical-rect )
  • $ink-rect; rectangle to fill with ink extents.

  • $logical-rect; rectangle to fill with logical extents.

#-------------------------------------------------------------------------------

get-run-readonly This function is not yet available

Gets the current run for read-only access.

When iterating by run, at the end of each line, there's a position with a undefined run, so this function can return undefined. The undefined 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 .get-run(), but the user is not expected to modify the contents of the run (glyphs, glyph widths, etc.).

method get-run-readonly ( )

#-------------------------------------------------------------------------------

next-char

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

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

method next-char (--> Bool )

Return value; 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.

method next-cluster (--> Bool )

Return value; 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.

method next-line (--> Bool )

Return value; 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.

method next-run (--> Bool )

Return value; whether motion was possible.

Gnome::Pango v0.1.14

Modules for package Gnome::Pango:api<2>. The language binding to Pango: Internationalized text layout and rendering

Authors

  • Marcel Timmerman

License

Artistic-2.0

Dependencies

Gnome::GObject:api<2>Gnome::Glib:api<2>Gnome::N:api<2>

Test Dependencies

Provides

  • Gnome::Pango::Context
  • Gnome::Pango::Layout
  • Gnome::Pango::N-Language
  • Gnome::Pango::N-LayoutIter
  • Gnome::Pango::N-LayoutLine
  • Gnome::Pango::N-Matrix
  • Gnome::Pango::N-TabArray
  • Gnome::Pango::T-direction
  • Gnome::Pango::T-gravity
  • Gnome::Pango::T-layout
  • Gnome::Pango::T-matrix
  • Gnome::Pango::T-tabarray
  • Gnome::Pango::T-types

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.