pub struct FontContext { /* private fields */ }
Implementations§
Source§impl FontContext
impl FontContext
pub fn new(library: FontLibrary) -> Self
Sourcepub fn library(&self) -> &FontLibrary
pub fn library(&self) -> &FontLibrary
Returns the underlying font library.
Sourcepub fn reset_group_state(&mut self)
pub fn reset_group_state(&mut self)
Resets font group caches and state. This should be called at the end of every layout session.
Sourcepub fn register_group(
&mut self,
families: &str,
key: u64,
attrs: Attributes,
) -> FontGroupId
pub fn register_group( &mut self, families: &str, key: u64, attrs: Attributes, ) -> FontGroupId
Registers a font group.
Sourcepub fn select_group(&mut self, descriptor: FontGroupId)
pub fn select_group(&mut self, descriptor: FontGroupId)
Selects a font group for subsequent cluster mapping operations.
Sourcepub fn select_fallbacks(&mut self, script: Script, language: Option<&Language>)
pub fn select_fallbacks(&mut self, script: Script, language: Option<&Language>)
Selects fallback fonts for the specified writing system.
Sourcepub fn map_cluster(
&mut self,
cluster: &mut CharCluster,
synthesis: &mut Synthesis,
) -> Option<Font>
pub fn map_cluster( &mut self, cluster: &mut CharCluster, synthesis: &mut Synthesis, ) -> Option<Font>
Maps the characters in a cluster to nominal glyph identifiers and returns the most suitable font based on the currently selected descriptor and fallback configuration.
Auto Trait Implementations§
impl Freeze for FontContext
impl RefUnwindSafe for FontContext
impl Send for FontContext
impl Sync for FontContext
impl Unpin for FontContext
impl UnwindSafe for FontContext
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