Skip to main content

GlyphRunPlacement2d

Struct GlyphRunPlacement2d 

Source
pub struct GlyphRunPlacement2d<'run> { /* private fields */ }
Expand description

One prepared run’s placement in an ordered atlas batch.

Translation uses local logical pixels and tint multiplies the per-glyph tint. The optional clip is relative to the drawing viewport, is not translated with the run, and intersects the frame item’s clip. No shaping or rasterization is performed. A batch snapshots this input; later changes to the source run do not alter the batch until WgpuRenderer::update_glyph_batch is called.

Implementations§

Source§

impl<'run> GlyphRunPlacement2d<'run>

Source

pub const fn new(run: &'run GlyphRun2d, placement: ImageBatchPlacement) -> Self

Places an already prepared run without changing its source layout.

Source

pub const fn with_clip(self, clip: ScreenClipRect) -> Self

Sets a validated viewport-local clip, independent of the translation.

Source

pub const fn run(self) -> &'run GlyphRun2d

Returns the prepared source run.

Source

pub const fn placement(self) -> ImageBatchPlacement

Returns the run’s local logical translation and normalized tint.

Source

pub const fn clip(self) -> Option<ScreenClipRect>

Returns the optional viewport-local logical clip.

Trait Implementations§

Source§

impl<'run> Clone for GlyphRunPlacement2d<'run>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'run> Copy for GlyphRunPlacement2d<'run>

Auto Trait Implementations§

§

impl<'run> !RefUnwindSafe for GlyphRunPlacement2d<'run>

§

impl<'run> !UnwindSafe for GlyphRunPlacement2d<'run>

§

impl<'run> Freeze for GlyphRunPlacement2d<'run>

§

impl<'run> Send for GlyphRunPlacement2d<'run>

§

impl<'run> Sync for GlyphRunPlacement2d<'run>

§

impl<'run> Unpin for GlyphRunPlacement2d<'run>

§

impl<'run> UnsafeUnpin for GlyphRunPlacement2d<'run>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,