pub struct TextFormat { /* private fields */ }
Expand description
Characters be drawn be at idx * char_width, idx * char_height
Implementations§
Source§impl TextFormat
impl TextFormat
pub const fn new( wrap_at: WrappingStrategy, size: PixelFont, color: Color, positioning: Positioning, ) -> Self
pub const fn new_with_spacing( wrap_at: WrappingStrategy, size: PixelFont, color: Color, line_height: f32, char_width: f32, positioning: Positioning, ) -> Self
Source§impl TextFormat
impl TextFormat
pub fn wrapping(&self) -> WrappingStrategy
pub fn font(&self) -> PixelFont
pub fn color(&self) -> Color
pub fn line_height(&self) -> isize
pub fn char_width(&self) -> isize
pub fn positioning(&self) -> Positioning
pub fn with_color(&self, color: Color) -> Self
Trait Implementations§
Source§impl Clone for TextFormat
impl Clone for TextFormat
Source§fn clone(&self) -> TextFormat
fn clone(&self) -> TextFormat
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TextFormat
impl Debug for TextFormat
Source§impl Default for TextFormat
impl Default for TextFormat
Source§impl<'de> Deserialize<'de> for TextFormat
impl<'de> Deserialize<'de> for TextFormat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<(Color, PixelFont, Positioning)> for TextFormat
impl From<(Color, PixelFont, Positioning)> for TextFormat
Source§impl From<(Color, PixelFont, WrappingStrategy)> for TextFormat
impl From<(Color, PixelFont, WrappingStrategy)> for TextFormat
Source§impl From<(Color, PixelFont, WrappingStrategy, Positioning)> for TextFormat
impl From<(Color, PixelFont, WrappingStrategy, Positioning)> for TextFormat
Source§fn from(
(color, size, wrap_at, positioning): (Color, PixelFont, WrappingStrategy, Positioning),
) -> Self
fn from( (color, size, wrap_at, positioning): (Color, PixelFont, WrappingStrategy, Positioning), ) -> Self
Converts to this type from the input type.
Source§impl From<(Color, PixelFont, WrappingStrategy, f32)> for TextFormat
impl From<(Color, PixelFont, WrappingStrategy, f32)> for TextFormat
Source§impl From<(Color, PixelFont, WrappingStrategy, f32, f32)> for TextFormat
impl From<(Color, PixelFont, WrappingStrategy, f32, f32)> for TextFormat
Source§impl From<(Color, PixelFont, WrappingStrategy, f32, f32, Positioning)> for TextFormat
impl From<(Color, PixelFont, WrappingStrategy, f32, f32, Positioning)> for TextFormat
Source§fn from(
(color, size, wrap_at, line_height, char_width, positioning): (Color, PixelFont, WrappingStrategy, f32, f32, Positioning),
) -> Self
fn from( (color, size, wrap_at, line_height, char_width, positioning): (Color, PixelFont, WrappingStrategy, f32, f32, Positioning), ) -> Self
Converts to this type from the input type.
Source§impl From<Color> for TextFormat
impl From<Color> for TextFormat
Source§impl PartialEq for TextFormat
impl PartialEq for TextFormat
Source§impl Serialize for TextFormat
impl Serialize for TextFormat
impl StructuralPartialEq for TextFormat
Auto Trait Implementations§
impl Freeze for TextFormat
impl RefUnwindSafe for TextFormat
impl Send for TextFormat
impl Sync for TextFormat
impl Unpin for TextFormat
impl UnwindSafe for TextFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more