[][src]Struct embedded_graphics::fonts::Text

pub struct Text<'a> {
    pub text: &'a str,
    pub position: Point,
}

A text object.

The Text struct represents a string that can be drawn onto a display.

The text object only contains the string and position and no additional styling information, like the font or color. To draw a text object it is necessary to attach a style to it by using the into_styled method to create a Styled object.

See the module-level documentation for examples how to use text objects.

Fields

text: &'a str

The string.

position: Point

The position.

Defines the top-left starting pixel of the text object.

Methods

impl<'a> Text<'a>[src]

pub const fn new(text: &'a str, position: Point) -> Self[src]

Creates a text.

pub fn into_styled<C, F>(
    self,
    style: TextStyle<C, F>
) -> Styled<Self, TextStyle<C, F>> where
    C: PixelColor,
    F: Font
[src]

Attaches a text style to the text object.

Trait Implementations

impl<'a> Clone for Text<'a>[src]

impl<'a> Copy for Text<'a>[src]

impl<'a> Debug for Text<'a>[src]

impl<'a> Eq for Text<'a>[src]

impl<'a> Hash for Text<'a>[src]

impl<'a> Ord for Text<'a>[src]

impl<'a> PartialEq<Text<'a>> for Text<'a>[src]

impl<'a> PartialOrd<Text<'a>> for Text<'a>[src]

impl<'a> StructuralEq for Text<'a>[src]

impl<'a> StructuralPartialEq for Text<'a>[src]

impl<'_> Transform for Text<'_>[src]

Auto Trait Implementations

impl<'a> Send for Text<'a>

impl<'a> Sync for Text<'a>

impl<'a> Unpin for Text<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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<V, T> VZip<V> for T where
    V: MultiLane<T>,