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, ) -> TextFormat
pub const fn new_with_spacing( wrap_at: WrappingStrategy, size: PixelFont, color: Color, line_height: f32, char_width: f32, positioning: Positioning, ) -> TextFormat
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) -> TextFormat
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§fn default() -> TextFormat
fn default() -> TextFormat
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TextFormat
impl<'de> Deserialize<'de> for TextFormat
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TextFormat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TextFormat, <__D as Deserializer<'de>>::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§fn from(_: (Color, PixelFont, Positioning)) -> TextFormat
fn from(_: (Color, PixelFont, Positioning)) -> TextFormat
Converts to this type from the input type.
Source§impl From<(Color, PixelFont, WrappingStrategy)> for TextFormat
impl From<(Color, PixelFont, WrappingStrategy)> for TextFormat
Source§fn from(_: (Color, PixelFont, WrappingStrategy)) -> TextFormat
fn from(_: (Color, PixelFont, WrappingStrategy)) -> TextFormat
Converts to this type from the input type.
Source§impl From<(Color, PixelFont, WrappingStrategy, Positioning)> for TextFormat
impl From<(Color, PixelFont, WrappingStrategy, Positioning)> for TextFormat
Source§fn from(_: (Color, PixelFont, WrappingStrategy, Positioning)) -> TextFormat
fn from(_: (Color, PixelFont, WrappingStrategy, Positioning)) -> TextFormat
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§fn from(_: (Color, PixelFont, WrappingStrategy, f32)) -> TextFormat
fn from(_: (Color, PixelFont, WrappingStrategy, f32)) -> TextFormat
Converts to this type from the input type.
Source§impl From<(Color, PixelFont, WrappingStrategy, f32, f32)> for TextFormat
impl From<(Color, PixelFont, WrappingStrategy, f32, f32)> for TextFormat
Source§fn from(_: (Color, PixelFont, WrappingStrategy, f32, f32)) -> TextFormat
fn from(_: (Color, PixelFont, WrappingStrategy, f32, f32)) -> TextFormat
Converts to this type from the input type.
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, PixelFont, WrappingStrategy, f32, f32, Positioning),
) -> TextFormat
fn from( _: (Color, PixelFont, WrappingStrategy, f32, f32, Positioning), ) -> TextFormat
Converts to this type from the input type.
Source§impl From<Color> for TextFormat
impl From<Color> for TextFormat
Source§fn from(color: Color) -> TextFormat
fn from(color: Color) -> TextFormat
Converts to this type from the input type.
Source§impl PartialEq for TextFormat
impl PartialEq for TextFormat
Source§impl Serialize for TextFormat
impl Serialize for TextFormat
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.