pub struct TextFont { /* private fields */ }Expand description
Opaque handle to one application-owned font and immutable size configuration.
Cloning shares parsed font bytes and settings without duplicating them. Equal registrations still issue different identities. A handle survives World replacement within its issuing application, but is not a file path, persistent key, or GPU resource. Foreign handles are rejected by extraction. Keeping a clone after application shutdown retains its shared font bytes.
Implementations§
Source§impl TextFont
impl TextFont
Reports shared parsed face/source storage, independent of size/style identity. Equal file contents loaded separately are not treated as shared storage.
Sourcepub fn settings(&self) -> TextSettings
pub fn settings(&self) -> TextSettings
Returns immutable logical size, shaping policy, and preparation budgets.
Sourcepub fn font_bytes(&self) -> usize
pub fn font_bytes(&self) -> usize
Returns the referenced source-font Vec capacity in bytes. Shared styles report the same source; application accounting charges that source once. Parsed dependency metadata and allocator overhead are excluded.
Sourcepub fn shaping_session(&self) -> Result<TextPreparationSession<'_>, TextError>
pub fn shaping_session(&self) -> Result<TextPreparationSession<'_>, TextError>
Borrows this registration for reusable CPU label shaping at logical scale 1.0.
The caller owns the session lifetime; no global cache, interior lock or self-referencing component is created. This parses shaping state but does not allocate an atlas or GPU resource. Font/layout limits stay fixed.
Trait Implementations§
impl Eq for TextFont
Auto Trait Implementations§
impl Freeze for TextFont
impl RefUnwindSafe for TextFont
impl Send for TextFont
impl Sync for TextFont
impl Unpin for TextFont
impl UnsafeUnpin for TextFont
impl UnwindSafe for TextFont
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
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,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
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
key and return true if they are equal.