[][src]Struct pane::TextFormat

pub struct TextFormat<S> where
    S: Scalar
{ pub font_size: u32, pub just: Justification, pub line_spacing: S, pub first_line_indent: usize, pub lines_indent: usize, pub color: Color, pub resize: Resize, }

A format for some text

Fields

font_size: u32

The font size

just: Justification

The horizantal justification

line_spacing: S

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

first_line_indent: usize

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

lines_indent: usize

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<S> TextFormat<S> where
    S: Scalar
[src]

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

Create a default TextFormat with the given font size

pub fn left(self) -> Self[src]

Align the TextFormat to the left

pub fn centered(self) -> Self[src]

Center-align the TextFormat

pub fn right(self) -> Self[src]

Align the TextFormat to the right

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

Set the font size

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

Set the line spacing

pub fn map_line_spacing<U>(&self) -> TextFormat<U> where
    U: Scalar + From<S>, 
[src]

Changes the type of the line spacing and thus the TextFormat itself

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

Set the indentation of the first line

pub fn lines_indent(self, lines_indent: usize) -> 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<S: Clone> Clone for TextFormat<S> where
    S: Scalar
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<S> From<u32> for TextFormat<S> where
    S: Scalar
[src]

impl<S: PartialOrd> PartialOrd<TextFormat<S>> for TextFormat<S> where
    S: Scalar
[src]

impl<S: PartialEq> PartialEq<TextFormat<S>> for TextFormat<S> where
    S: Scalar
[src]

impl<S: Copy> Copy for TextFormat<S> where
    S: Scalar
[src]

impl<S: Debug> Debug for TextFormat<S> where
    S: Scalar
[src]

Auto Trait Implementations

impl<S> Sync for TextFormat<S> where
    S: Sync

impl<S> Send for TextFormat<S> where
    S: Send

impl<S> Unpin for TextFormat<S> where
    S: Unpin

impl<S> RefUnwindSafe for TextFormat<S> where
    S: RefUnwindSafe

impl<S> UnwindSafe for TextFormat<S> where
    S: UnwindSafe

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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.

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]