pub struct GlyphAtlas { /* private fields */ }Expand description
Requested glyph set for symbol text rendering.
Implementations§
Source§impl GlyphAtlas
impl GlyphAtlas
Sourcepub fn request_text(&mut self, font_stack: &str, text: &str)
pub fn request_text(&mut self, font_stack: &str, text: &str)
Request all glyphs needed to render a text string.
Sourcepub fn entries(&self) -> impl Iterator<Item = &GlyphAtlasEntry>
pub fn entries(&self) -> impl Iterator<Item = &GlyphAtlasEntry>
Loaded atlas entries.
Sourcepub fn get(&self, font_stack: &str, codepoint: char) -> Option<&GlyphAtlasEntry>
pub fn get(&self, font_stack: &str, codepoint: char) -> Option<&GlyphAtlasEntry>
Look up a glyph entry by font stack and codepoint.
Sourcepub fn dimensions(&self) -> [u16; 2]
pub fn dimensions(&self) -> [u16; 2]
Atlas dimensions in pixels.
Sourcepub fn render_em_px(&self) -> f32
pub fn render_em_px(&self) -> f32
Pixel size of 1 em as reported by the provider used for the last
load_requested call.
Sourcepub fn load_requested(&mut self, provider: &dyn GlyphProvider)
pub fn load_requested(&mut self, provider: &dyn GlyphProvider)
Load all requested glyphs into a packed atlas using a glyph provider.
Each glyph is rasterized by the provider, then converted to a signed
distance field (SDF) with [SDF_BUFFER] pixels of padding. The
resulting atlas can be used directly with an SDF text shader.
Trait Implementations§
Source§impl Clone for GlyphAtlas
impl Clone for GlyphAtlas
Source§fn clone(&self) -> GlyphAtlas
fn clone(&self) -> GlyphAtlas
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GlyphAtlas
impl Debug for GlyphAtlas
Auto Trait Implementations§
impl Freeze for GlyphAtlas
impl RefUnwindSafe for GlyphAtlas
impl Send for GlyphAtlas
impl Sync for GlyphAtlas
impl Unpin for GlyphAtlas
impl UnsafeUnpin for GlyphAtlas
impl UnwindSafe for GlyphAtlas
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
Mutably borrows from an owned value. Read more