#[non_exhaustive]pub struct AtlasData {
pub geometry: AtlasGeometry,
pub coverage: Vec<u8>,
}Expand description
The CPU-side coverage buffer for a whole atlas, grid-packed per AtlasGeometry.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.geometry: AtlasGeometryThe glyph packing.
coverage: Vec<u8>Row-major coverage bytes, length tex_w * tex_h * layers. Texel (x, y) of layer l is at
((l * tex_h + y) * tex_w + x). Row 0 is the glyph’s top row, so a shader that flips y when
projecting to clip space samples a glyph’s top at uv.y == 0.
Implementations§
Source§impl AtlasData
impl AtlasData
Sourcepub fn build(fonts: &FontChain<'static>, cell_size: (u32, u32)) -> Self
pub fn build(fonts: &FontChain<'static>, cell_size: (u32, u32)) -> Self
Builds a fully-populated, grid-packed atlas for every glyph of every font in fonts, one
slot per glyph, so a static bitmap font needs no runtime rasterization.
The fonts are laid out back to back in chain order, so a font’s slots start at the sum of
the glyph counts before it, which is the same base GlyphAtlas::resolve adds to a
resolved glyph’s own index. Every font in the chain is assumed to share cell_size; a
backend’s builder checks that via FontChain::glyph_size before getting here.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AtlasData
impl RefUnwindSafe for AtlasData
impl Send for AtlasData
impl Sync for AtlasData
impl Unpin for AtlasData
impl UnsafeUnpin for AtlasData
impl UnwindSafe for AtlasData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.