module HexaPDF::FontLoader::FromConfiguration

This module uses the configuration option ‘’ for loading a font.

Public Class Methods


Returns a hash of the form ‘font_name => [variants, …]’ of the configured fonts.

call(document, name, variant: :none, subset: true, **)

Returns a TrueType font wrapper for the given font by looking up the needed file in the ‘’ configuration option.

The file object representing the font file is not closed and if needed must be closed by the caller once the font is not needed anymore.


The PDF document to associate the font wrapper with.


The name of the font.


The font variant. Normally one of :none, :bold, :italic, :bold_italic.


Specifies whether the font should be subset if possible.

This method uses the FromFile font loader behind the scenes.