[][src]Struct fit_text::TextFormat

pub struct TextFormat {
    pub font_size: u32,
    pub line_spacing: f64,
    pub first_line_indent: Indent,
    pub lines_indent: Indent,
    pub color: Color,
    pub resize: Resize,
}

A format for some text

Fields

font_size: u32

The font size

line_spacing: f64

The spacing between lines. This should usually be somewhere between 1.0 and 2.0, but any scalar is valid

first_line_indent: Indent

The number of spaces to indent the first line of a paragraph

lines_indent: Indent

The number of spaces to indent all lines of a paragraph after the first

color: Color

The color of the text

resize: Resize

The resize strategy

Methods

impl TextFormat[src]

pub fn new(font_size: u32) -> TextFormat[src]

Create a default TextFormat with the given font size

pub fn set_as_default(&self)[src]

Use this TextFormat as the global default

pub fn font_size(self, font_size: u32) -> Self[src]

Set the font size

pub fn line_spacing(self, line_spacing: f64) -> Self[src]

Set the line spacing

pub fn first_line_indent(self, first_line_indent: Indent) -> Self[src]

Set the indentation of the first line

pub fn lines_indent(self, lines_indent: Indent) -> Self[src]

Set the indentation of all lines after the first

pub fn color(self, color: Color) -> Self[src]

Set the color

pub fn resize(self, resize: Resize) -> Self[src]

Set the resize strategy

pub fn resize_font(self, max_size: u32) -> Self[src]

Change the font size depending on the the resize strategy

The given max size is not used if the strategy is Resize::None

Trait Implementations

impl From<u32> for TextFormat[src]

impl Clone for TextFormat[src]

impl Default for TextFormat[src]

impl PartialOrd<TextFormat> for TextFormat[src]

impl Copy for TextFormat[src]

impl PartialEq<TextFormat> for TextFormat[src]

impl Debug for TextFormat[src]

Auto Trait Implementations

Blanket Implementations

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.

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

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

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