[][src]Struct egui::paint::font::Galley

pub struct Galley {
    pub text: String,
    pub lines: Vec<Line>,
    pub size: Vec2,
}

A collection of text locked into place.

Fields

text: String

The full text

lines: Vec<Line>

Lines of text, from top to bottom. The number of chars in all lines sum up to text.chars().count()

size: Vec2

Implementations

impl Galley[src]

pub fn sanity_check(&self)[src]

pub fn char_start_pos(&self, char_idx: usize) -> Vec2[src]

If given a char index after the first line, the end of the last character is returned instead. Returns a Vec2 rather than a Pos2 as this is an offset into the galley. shrug

pub fn char_at(&self, pos: Vec2) -> GalleyCursor[src]

Character offset at the given position within the galley

Trait Implementations

impl Clone for Galley[src]

impl Debug for Galley[src]

impl Default for Galley[src]

Auto Trait Implementations

impl RefUnwindSafe for Galley

impl Send for Galley

impl Sync for Galley

impl Unpin for Galley

impl UnwindSafe for Galley

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