[]Struct pango::LayoutIter

pub struct LayoutIter(_);

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

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

Implementations

impl LayoutIter[src]

pub fn at_last_line(&mut self) -> bool[src]

Determines whether self is on the last line of the layout.

Returns

true if self is on the last line.

pub fn get_baseline(&mut self) -> i32[src]

Gets the Y position of the current line's baseline, in layout coordinates (origin at top left of the entire layout).

Returns

baseline of current line.

pub fn get_char_extents(&mut self) -> Rectangle[src]

Gets the extents of the current character, in layout coordinates (origin is 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

rectangle to fill with logical extents

pub fn get_cluster_extents(&mut self) -> (Rectangle, Rectangle)[src]

Gets the extents of the current cluster, in layout coordinates (origin is the top left of the entire layout).

ink_rect

rectangle to fill with ink extents, or None

logical_rect

rectangle to fill with logical extents, or None

pub fn get_index(&mut self) -> i32[src]

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 None run (see LayoutIter::get_run).

Returns

current byte index.

pub fn get_layout(&mut self) -> Option<Layout>[src]

Gets the layout associated with a LayoutIter.

Returns

the layout associated with self.

pub fn get_layout_extents(&mut self) -> (Rectangle, Rectangle)[src]

Obtains the extents of the Layout being iterated over. ink_rect or logical_rect can be None if you aren't interested in them.

ink_rect

rectangle to fill with ink extents, or None

logical_rect

rectangle to fill with logical extents, or None

pub fn get_line(&mut self) -> Option<LayoutLine>[src]

Gets the current line.

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

Returns

the current line.

pub fn get_line_extents(&mut self) -> (Rectangle, Rectangle)[src]

Obtains the extents of the current line. ink_rect or logical_rect can be None if you aren't interested in them. Extents are in layout coordinates (origin is the top-left corner of the entire 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 LayoutLine::get_extents.

ink_rect

rectangle to fill with ink extents, or None

logical_rect

rectangle to fill with logical extents, or None

pub fn get_line_readonly(&mut self) -> Option<LayoutLine>[src]

Gets the current line for read-only access.

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

Returns

the current line, that should not be modified.

pub fn get_line_yrange(&mut self) -> (i32, i32)[src]

Divides the vertical space in the 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 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_

start of line, or None

y1_

end of line, or None

pub fn get_run(&mut self) -> Option<LayoutRun>[src]

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

Returns

the current run.

pub fn get_run_extents(&mut self) -> (Rectangle, Rectangle)[src]

Gets the extents of the current run in layout coordinates (origin is the top left of the entire layout).

ink_rect

rectangle to fill with ink extents, or None

logical_rect

rectangle to fill with logical extents, or None

pub fn get_run_readonly(&mut self) -> Option<LayoutRun>[src]

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

Returns

the current run, that should not be modified.

pub fn next_char(&mut self) -> bool[src]

Moves self forward to the next character in visual order. If self was already at the end of the layout, returns false.

Returns

whether motion was possible.

pub fn next_cluster(&mut self) -> bool[src]

Moves self forward to the next cluster in visual order. If self was already at the end of the layout, returns false.

Returns

whether motion was possible.

pub fn next_line(&mut self) -> bool[src]

Moves self forward to the start of the next line. If self is already on the last line, returns false.

Returns

whether motion was possible.

pub fn next_run(&mut self) -> bool[src]

Moves self forward to the next run in visual order. If self was already at the end of the layout, returns false.

Returns

whether motion was possible.

Trait Implementations

impl Clone for LayoutIter

impl Debug for LayoutIter[src]

impl Eq for LayoutIter[src]

impl Hash for LayoutIter[src]

impl Ord for LayoutIter[src]

impl PartialEq<LayoutIter> for LayoutIter[src]

impl PartialOrd<LayoutIter> for LayoutIter[src]

impl StaticType for LayoutIter

impl StructuralEq for LayoutIter[src]

impl StructuralPartialEq for LayoutIter[src]

Auto Trait Implementations

impl RefUnwindSafe for LayoutIter

impl !Send for LayoutIter

impl !Sync for LayoutIter

impl Unpin for LayoutIter

impl UnwindSafe for LayoutIter

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.