[−][src]Struct fit_text::TextFormat
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 Default for TextFormat
[src]
fn default() -> TextFormat
[src]
impl Clone for TextFormat
[src]
fn clone(&self) -> TextFormat
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialOrd<TextFormat> for TextFormat
[src]
fn partial_cmp(&self, other: &TextFormat) -> Option<Ordering>
[src]
fn lt(&self, other: &TextFormat) -> bool
[src]
fn le(&self, other: &TextFormat) -> bool
[src]
fn gt(&self, other: &TextFormat) -> bool
[src]
fn ge(&self, other: &TextFormat) -> bool
[src]
impl PartialEq<TextFormat> for TextFormat
[src]
fn eq(&self, other: &TextFormat) -> bool
[src]
fn ne(&self, other: &TextFormat) -> bool
[src]
impl From<u32> for TextFormat
[src]
impl Copy for TextFormat
[src]
impl Debug for TextFormat
[src]
Auto Trait Implementations
impl Send for TextFormat
impl Unpin for TextFormat
impl Sync for TextFormat
impl UnwindSafe for TextFormat
impl RefUnwindSafe for TextFormat
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> 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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,