[−][src]Struct pane::TextFormat
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]
S: Scalar,
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]
U: Scalar + From<S>,
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]
S: Scalar,
fn clone(&self) -> TextFormat<S>
[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]
S: Scalar,
impl<S: PartialOrd> PartialOrd<TextFormat<S>> for TextFormat<S> where
S: Scalar,
[src]
S: Scalar,
fn partial_cmp(&self, other: &TextFormat<S>) -> Option<Ordering>
[src]
fn lt(&self, other: &TextFormat<S>) -> bool
[src]
fn le(&self, other: &TextFormat<S>) -> bool
[src]
fn gt(&self, other: &TextFormat<S>) -> bool
[src]
fn ge(&self, other: &TextFormat<S>) -> bool
[src]
impl<S: PartialEq> PartialEq<TextFormat<S>> for TextFormat<S> where
S: Scalar,
[src]
S: Scalar,
fn eq(&self, other: &TextFormat<S>) -> bool
[src]
fn ne(&self, other: &TextFormat<S>) -> bool
[src]
impl<S: Copy> Copy for TextFormat<S> where
S: Scalar,
[src]
S: Scalar,
impl<S: Debug> Debug for TextFormat<S> where
S: Scalar,
[src]
S: Scalar,
Auto Trait Implementations
impl<S> Sync for TextFormat<S> where
S: Sync,
S: Sync,
impl<S> Send for TextFormat<S> where
S: Send,
S: Send,
impl<S> Unpin for TextFormat<S> where
S: Unpin,
S: Unpin,
impl<S> RefUnwindSafe for TextFormat<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> UnwindSafe for TextFormat<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,