Struct glyph_brush::Text

source ·
pub struct Text<'a, X = Extra> {
    pub text: &'a str,
    pub scale: PxScale,
    pub font_id: FontId,
    pub extra: X,
}
Expand description

SectionText + extra.

Fields§

§text: &'a str

Text to render.

§scale: PxScale

Pixel scale of text. Defaults to 16.

§font_id: FontId

Font id to use for this section.

It must be a valid id in the FontMap used for layout calls. The default FontId(0) should always be valid.

§extra: X

Extra stuff for vertex generation.

Implementations§

source§

impl<'a, X> Text<'a, X>

source

pub fn with_text(self, text: &str) -> Text<'_, X>

source

pub fn with_scale<S: Into<PxScale>>(self, scale: S) -> Self

source

pub fn with_font_id<F: Into<FontId>>(self, font_id: F) -> Self

source

pub fn with_extra<X2>(self, extra: X2) -> Text<'a, X2>

source§

impl<'a, X: Default> Text<'a, X>

source

pub fn new(text: &'a str) -> Self

source§

impl<'a> Text<'a, Extra>

source

pub fn with_color<C: Into<Color>>(self, color: C) -> Self

source

pub fn with_z<Z: Into<f32>>(self, z: Z) -> Self

Trait Implementations§

source§

impl<'a, X: Clone> Clone for Text<'a, X>

source§

fn clone(&self) -> Text<'a, X>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, X: Debug> Debug for Text<'a, X>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<X: Default> Default for Text<'static, X>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a, X: Clone> From<&'a OwnedText<X>> for Text<'a, X>

source§

fn from(owned: &'a OwnedText<X>) -> Self

Converts to this type from the input type.
source§

impl<X: Clone> From<&Text<'_, X>> for OwnedText<X>

source§

fn from(s: &Text<'_, X>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&Text<'a>> for SectionText<'a>

source§

fn from(t: &Text<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Text<'a>> for SectionText<'a>

source§

fn from(t: Text<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a, X> From<Text<'a, X>> for Section<'a, X>

source§

fn from(text: Text<'a, X>) -> Self

Converts to this type from the input type.
source§

impl<'a, X: PartialEq> PartialEq for Text<'a, X>

source§

fn eq(&self, other: &Text<'a, X>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<X> ToSectionText for Text<'_, X>

source§

impl<'a, X: Copy> Copy for Text<'a, X>

source§

impl<'a, X> StructuralPartialEq for Text<'a, X>

Auto Trait Implementations§

§

impl<'a, X> RefUnwindSafe for Text<'a, X>where X: RefUnwindSafe,

§

impl<'a, X> Send for Text<'a, X>where X: Send,

§

impl<'a, X> Sync for Text<'a, X>where X: Sync,

§

impl<'a, X> Unpin for Text<'a, X>where X: Unpin,

§

impl<'a, X> UnwindSafe for Text<'a, X>where X: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V