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

pub struct Font { /* fields omitted */ }

The interface uses points as the unit for everything.

Implementations

impl Font[src]

pub fn new(
    atlas: Arc<Mutex<TextureAtlas>>,
    font_data: &'static [u8],
    scale_in_points: f32,
    pixels_per_point: f32
) -> Font
[src]

pub fn round_to_pixel(&self, point: f32) -> f32[src]

pub fn line_spacing(&self) -> f32[src]

Height of one line of text. In points TODO: rename height ?

pub fn height(&self) -> f32[src]

pub fn uv_rect(&self, c: char) -> Option<UvRect>[src]

pub fn layout_single_line(&self, text: String) -> Galley[src]

Typeset the given text onto one line. Assumes there are no \n in the text. Always returns exactly one fragment.

pub fn layout_multiline(&self, text: String, max_width_in_points: f32) -> Galley[src]

pub fn layout_paragraph_max_width(
    &self,
    text: &str,
    max_width_in_points: f32
) -> Vec<Line>
[src]

A paragraph is text with no line break character in it. The text will be linebreaked by the given max_width_in_points.

Auto Trait Implementations

impl !RefUnwindSafe for Font

impl Send for Font

impl Sync for Font

impl Unpin for Font

impl !UnwindSafe for Font

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