pub struct FontManager { /* private fields */ }Expand description
Deterministic font registry and fallback order.
Implementations§
Source§impl FontManager
impl FontManager
Sourcepub fn register_from(
&mut self,
resolver: &dyn FontResolver,
name: &str,
max_bytes: usize,
) -> Result<()>
pub fn register_from( &mut self, resolver: &dyn FontResolver, name: &str, max_bytes: usize, ) -> Result<()>
Resolves and registers one exact font under a caller-supplied byte cap.
Sourcepub fn register(&mut self, font: FontAsset) -> Result<()>
pub fn register(&mut self, font: FontAsset) -> Result<()>
Registers a font without replacing an existing name.
Examples found in repository?
More examples
Sourcepub fn set_fallback(&mut self, fallback: Vec<String>) -> Result<()>
pub fn set_fallback(&mut self, fallback: Vec<String>) -> Result<()>
Replaces the global fallback list after validating every exact name.
Sourcepub fn select_for_grapheme<'a>(
&'a self,
primary: &str,
grapheme: &str,
) -> Result<&'a FontAsset>
pub fn select_for_grapheme<'a>( &'a self, primary: &str, grapheme: &str, ) -> Result<&'a FontAsset>
Selects the first explicit primary/fallback font covering a grapheme.
Sourcepub fn digests(&self) -> impl Iterator<Item = (&str, &[u8; 32])>
pub fn digests(&self) -> impl Iterator<Item = (&str, &[u8; 32])>
Returns stable font digests in lexical name order.
Sourcepub fn fallback_names(&self) -> impl Iterator<Item = &str>
pub fn fallback_names(&self) -> impl Iterator<Item = &str>
Returns the explicit fallback order used during shaping.
Trait Implementations§
Source§impl Clone for FontManager
impl Clone for FontManager
Source§fn clone(&self) -> FontManager
fn clone(&self) -> FontManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FontManager
impl Debug for FontManager
Source§impl Default for FontManager
impl Default for FontManager
Source§fn default() -> FontManager
fn default() -> FontManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FontManager
impl RefUnwindSafe for FontManager
impl Send for FontManager
impl Sync for FontManager
impl Unpin for FontManager
impl UnsafeUnpin for FontManager
impl UnwindSafe for FontManager
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,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.