pub struct TextAtlasBudget { /* private fields */ }Expand description
Fixed atlas texel/cache capacity and per-run limits for optional font rendering.
The default is a 1024x1024 RGBA atlas (4 MiB CPU plus 4 MiB GPU), at most
4096 cached glyphs and the default GlyphRunBudget. Glyph cache metadata is
reserved once and grows neither beyond its count limit nor through eviction.
Shared font bytes, shaping/rasterizer scratch and host-owned runs are separate.
Implementations§
Source§impl TextAtlasBudget
impl TextAtlasBudget
Sourcepub fn new(
width: u32,
height: u32,
max_cached_glyphs: usize,
run: GlyphRunBudget,
) -> Result<Self, TextError>
pub fn new( width: u32, height: u32, max_cached_glyphs: usize, run: GlyphRunBudget, ) -> Result<Self, TextError>
Creates fixed physical-texel dimensions and a glyph count in 1..=65535.
Dimensions are additionally checked against the actual GPU at atlas creation.
Sourcepub const fn max_cached_glyphs(self) -> usize
pub const fn max_cached_glyphs(self) -> usize
Returns maximum cached glyphs, including spacing glyphs.
Sourcepub const fn run_budget(self) -> GlyphRunBudget
pub const fn run_budget(self) -> GlyphRunBudget
Returns limits applied to each created retained glyph run.
Trait Implementations§
Source§impl Clone for TextAtlasBudget
impl Clone for TextAtlasBudget
impl Copy for TextAtlasBudget
Source§impl Debug for TextAtlasBudget
impl Debug for TextAtlasBudget
Source§impl Default for TextAtlasBudget
impl Default for TextAtlasBudget
impl Eq for TextAtlasBudget
Source§impl PartialEq for TextAtlasBudget
impl PartialEq for TextAtlasBudget
impl StructuralPartialEq for TextAtlasBudget
Auto Trait Implementations§
impl Freeze for TextAtlasBudget
impl RefUnwindSafe for TextAtlasBudget
impl Send for TextAtlasBudget
impl Sync for TextAtlasBudget
impl Unpin for TextAtlasBudget
impl UnsafeUnpin for TextAtlasBudget
impl UnwindSafe for TextAtlasBudget
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.