pub trait FontData: FontDataClone + Debug {
    fn font_metrics(&self) -> FontMetrics;
    fn glyph_id(&self, c: char) -> Option<u16>;
    fn glyph_ids(&self) -> HashMap<u16, char>;
    fn glyph_metrics(&self, glyph_id: u16) -> Option<GlyphMetrics>;
}
Expand description

Provides access to font metrics.

Per default, printpdf uses owned_ttf_parser to extract the font data. You can implement this trait for other types if you want to use a different font backend.

Required Methods

Returns the unscaled metrics for this font.

Returns the glyph id for a Unicode character if it is present in this font.

Returns a mapping from glyph IDs to Unicode characters for all supported characters.

Returns the glyph metrics for a glyph of this font, if available.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Implementors