glyph_brush

Struct 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

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

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

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> Freeze for Text<'a, X>
where X: Freeze,

§

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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 T
where 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.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

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

Initializes a with the given initializer. Read more
source§

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

Dereferences the given pointer. Read more
source§

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

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

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

impl<T> ToOwned for T
where T: Clone,

source§

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 T
where U: Into<T>,

source§

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 T
where U: TryFrom<T>,

source§

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.
source§

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

source§

fn vzip(self) -> V