pub struct FontCache { /* private fields */ }
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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.