pub struct FontResolver<'a> {
pub select_font: FontSelectionFn<'a>,
pub select_fallback: FallbackSelectionFn<'a>,
}
Expand description
A font resolver for <text>
elements.
This type can be useful if you want to have an alternative font handling to
the default one. By default, only fonts specified upfront in
Options::fontdb
will be used. This type allows
you to load additional fonts on-demand and customize the font selection
process.
Fields§
§select_font: FontSelectionFn<'a>
Resolver function that will be used when selecting a specific font
for a generic Font
specification.
select_fallback: FallbackSelectionFn<'a>
Resolver function that will be used when selecting a fallback font for a character.
Implementations§
source§impl FontResolver<'_>
impl FontResolver<'_>
sourcepub fn default_font_selector() -> FontSelectionFn<'static>
pub fn default_font_selector() -> FontSelectionFn<'static>
sourcepub fn default_fallback_selector() -> FallbackSelectionFn<'static>
pub fn default_fallback_selector() -> FallbackSelectionFn<'static>
Creates a default font fallback selection resolver.
The default implementation searches through the entire fontdb
to find a font that has the correct style and supports the character.
Trait Implementations§
source§impl Debug for FontResolver<'_>
impl Debug for FontResolver<'_>
Auto Trait Implementations§
impl<'a> Freeze for FontResolver<'a>
impl<'a> !RefUnwindSafe for FontResolver<'a>
impl<'a> Send for FontResolver<'a>
impl<'a> Sync for FontResolver<'a>
impl<'a> Unpin for FontResolver<'a>
impl<'a> !UnwindSafe for FontResolver<'a>
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