Struct glow_glyph::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>(self, scale: S) -> Text<'a, X>
where S: Into<PxScale>,

source

pub fn with_font_id<F>(self, font_id: F) -> Text<'a, X>
where F: Into<FontId>,

source

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

source§

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

source

pub fn new(text: &'a str) -> Text<'a, X>

source§

impl<'a> Text<'a>

source

pub fn with_color<C>(self, color: C) -> Text<'a>
where C: Into<[f32; 4]>,

source

pub fn with_z<Z>(self, z: Z) -> Text<'a>
where Z: Into<f32>,

Trait Implementations§

source§

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

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

source§

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

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

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

source§

fn default() -> Text<'static, X>

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

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

source§

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

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>) -> Section<'a, X>

Converts to this type from the input type.
source§

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

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

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

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,

§

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>,

§

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>,

§

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