pub struct Font {
inner: Arc<FontInner>,
}Expand description
Bitmap font — owns a glyph atlas and per-codepoint metrics. Cheaply
cloneable; the underlying atlas is Arc-wrapped.
Fields§
§inner: Arc<FontInner>Implementations§
Source§impl Font
impl Font
Sourcepub fn bitmap_8x8(app: &Application) -> Self
pub fn bitmap_8x8(app: &Application) -> Self
Build the embedded 8×8 ASCII bitmap font.
The returned Font carries its own atlas texture and glyph metrics —
no external font files required.
Sourcepub fn cell_pixels(&self) -> u32
pub fn cell_pixels(&self) -> u32
Pixels per cell side (8 for font8x8).
pub(crate) fn atlas(&self) -> &Texture
pub(crate) fn glyph(&self, c: char) -> Option<GlyphMetrics>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Font
impl !RefUnwindSafe for Font
impl Send for Font
impl Sync for Font
impl Unpin for Font
impl UnsafeUnpin for Font
impl !UnwindSafe for Font
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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