Struct fit_text::TextFormat[][src]

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,
}
Expand description

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

Implementations

Create a default TextFormat with the given font size

Use this TextFormat as the global default

Set the font size

Set the line spacing

Set the indentation of the first line

Set the indentation of all lines after the first

Set the color

Set the resize strategy

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.