Struct FontCatalog
pub struct FontCatalog { /* private fields */ }Implementations§
§impl FontCatalog
impl FontCatalog
pub fn product( root: impl Into<PathBuf>, locale: impl Into<String>, ) -> FontCatalog
pub fn controlled_fixture( root: impl Into<PathBuf>, locale: impl Into<String>, ) -> FontCatalog
pub fn root(&self) -> &Path
pub fn locale(&self) -> &str
pub fn load(&self) -> Result<FontSystem, FontCatalogError>
pub fn load(&self) -> Result<FontSystem, FontCatalogError>
§Errors
Returns a FontCatalogError when the manifest or any declared font
is absent, corrupt, or does not match its declared face metadata.
pub fn load_bytes(
&self,
bytes: impl FnMut(&str) -> Option<Vec<u8>>,
) -> Result<FontSystem, FontCatalogError>
pub fn load_bytes( &self, bytes: impl FnMut(&str) -> Option<Vec<u8>>, ) -> Result<FontSystem, FontCatalogError>
Load canonical assets from host-provided bytes, with no filesystem or ambient fonts. Every asset is size/hash/face validated before a font system is returned.
§Errors
Rejects missing, corrupt, or mismatched assets.
pub fn load_browser_startup_bytes(
&self,
bytes: impl FnMut(&str) -> Option<Vec<u8>>,
) -> Result<FontSystem, FontCatalogError>
pub fn load_browser_startup_bytes( &self, bytes: impl FnMut(&str) -> Option<Vec<u8>>, ) -> Result<FontSystem, FontCatalogError>
Load the canonical core families required before a browser can mount. Script, symbol, math, and emoji assets remain absent until shaping reports demand and the host supplies their verified bytes.
§Errors
Rejects a missing or corrupt startup asset.
pub fn install_browser_asset(
&self,
system: &mut FontSystem,
name: &str,
data: Vec<u8>,
) -> Result<bool, FontCatalogError>
pub fn install_browser_asset( &self, system: &mut FontSystem, name: &str, data: Vec<u8>, ) -> Result<bool, FontCatalogError>
Validate and add one canonical optional browser asset to a live font
system. Returns false when the exact asset faces are already present.
§Errors
Rejects unknown names, corrupt bytes, or mismatched face metadata.
Trait Implementations§
§impl Clone for FontCatalog
impl Clone for FontCatalog
§fn clone(&self) -> FontCatalog
fn clone(&self) -> FontCatalog
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FontCatalog
impl RefUnwindSafe for FontCatalog
impl Send for FontCatalog
impl Sync for FontCatalog
impl Unpin for FontCatalog
impl UnsafeUnpin for FontCatalog
impl UnwindSafe for FontCatalog
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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>
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>
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