Struct genpdf::fonts::FontCache[][src]

pub struct FontCache { /* fields omitted */ }
Expand description

Stores font data that can be referenced by a Font or FontFamily.

If you use the high-level interface provided by Document, you don’t have to access this type. See the module documentation for details on the internals.

Implementations

Creates a new font cache with the given default font family.

Adds the given font to the cache and returns a reference to it.

Adds the given font family to the cache and returns a reference to it.

Embeds all loaded fonts into the document generated by the given renderer and caches a reference to them.

Returns the default font family for this font cache.

Returns a reference to the emebdded PDF font for the given font, if available.

This method may only be called with Font instances that have been created by this font cache. PDF fonts are only avaiable if load_pdf_fonts has been called.

Returns a reference to the Rusttype font for the given font, if available.

This method may only be called with Font instances that have been created by this font cache.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.