pub struct FontTable {
pub fonts: Vec<FontInfo>,
pub id_cs: Vec<CsId>,
pub loader: Option<Box<dyn FontLoader>>,
pub dense: Vec<DenseMetrics>,
}Expand description
The table of loaded fonts.
Fields§
§fonts: Vec<FontInfo>Fonts by id; id 0 is \nullfont.
id_cs: Vec<CsId>Identifier control sequence of each font (TeX’s font_id_text).
loader: Option<Box<dyn FontLoader>>The loader, if any.
dense: Vec<DenseMetrics>Dense metric tables for fast lookup of small character codes, by
font id (see FontTable::sync_dense).
Implementations§
Source§impl FontTable
impl FontTable
Sourcepub fn sync_dense(&mut self)
pub fn sync_dense(&mut self)
Builds the dense tables of fonts added since the last call. Call
before hot loops; the character metrics of a font must not change
afterwards (call FontTable::invalidate_dense if they do).
Sourcepub fn invalidate_dense(&mut self, f: u32)
pub fn invalidate_dense(&mut self, f: u32)
Forgets the dense table of font f and those after it.
Sourcepub fn char_metrics(&self, f: u32, c: u32) -> Option<&CharMetrics>
pub fn char_metrics(&self, f: u32, c: u32) -> Option<&CharMetrics>
The metrics of character c in font f.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for FontTable
impl !Send for FontTable
impl !Sync for FontTable
impl !UnwindSafe for FontTable
impl Freeze for FontTable
impl Unpin for FontTable
impl UnsafeUnpin for FontTable
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