#[repr(C)]pub struct LoadedFont {
pub font_hash: u64,
pub family_name: AzString,
pub num_glyphs: u32,
pub has_bytes: bool,
}Expand description
Descriptor for a font that the layout engine currently has loaded in its font cache.
Returned by CallbackInfo::get_loaded_fonts(). The font_hash field is
the same u64 carried by DisplayListItem::Text glyph runs, so a callback
can correlate a loaded font with the text runs that use it and then fetch
the raw bytes via CallbackInfo::get_loaded_font_bytes(font_hash) (e.g. to
embed every font the layout actually used into a generated PDF).
Fields§
§font_hash: u64Stable hash of the parsed font, identical to the font_hash stored on
DisplayListItem::Text glyph runs. Use this to look up the bytes with
CallbackInfo::get_loaded_font_bytes.
family_name: AzStringPostScript / family name from the font’s name table, or an empty
string if the font did not provide one.
num_glyphs: u32Total number of glyphs in the font (from the maxp table).
has_bytes: booltrue if the source font bytes are retained and can be retrieved with
CallbackInfo::get_loaded_font_bytes(font_hash). Fonts loaded on the
production (lazy mmap) path retain their bytes; some test-only fonts do
not.
Implementations§
Trait Implementations§
Source§impl Clone for LoadedFont
impl Clone for LoadedFont
Source§fn clone(&self) -> LoadedFont
fn clone(&self) -> LoadedFont
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoadedFont
impl Debug for LoadedFont
impl Eq for LoadedFont
Source§impl Extend<LoadedFont> for LoadedFontVec
impl Extend<LoadedFont> for LoadedFontVec
Source§fn extend<T: IntoIterator<Item = LoadedFont>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = LoadedFont>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)