module HexaPDF::FontLoader::FromConfiguration

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

Public Class Methods

available_fonts(document)

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 ‘font.map’ 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.

document

The PDF document to associate the font wrapper with.

name

The name of the font.

variant

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

subset

Specifies whether the font should be subset if possible.

This method uses the FromFile font loader behind the scenes.