class HexaPDF::Document::Fonts


This class provides utility functions for working with fonts. It is available through the HexaPDF::Document#fonts method.

Public Class Methods


Creates a new Fonts object for the given PDF document.

Public Instance Methods

add(name, **options) → font

Adds the font to the document and returns it (using the font loaders specified with the configuration option ‘font_loaders’).

If a font with the same parameters has been loaded before, the cached font object is used.


Returns a hash of the form ‘font_name => [variants, …]’ with all the fonts that are configured. These fonts can be added to the document by using the add method.