class HexaPDF::Type::Font

Parent

Represents a generic font object.

This class is the base class for all font objects, be it simple fonts or composite fonts.

Field Definitions

NameType/Allowed ValuesRequiredDefault Value
TypeSymboltrue:Font
ToUnicodeHexaPDF::Stream or Hashfalsenil

Public Instance Methods

bounding_box()

Returns the bounding box of the font or nil if it is not found.

embedded?()

Returns true if the font is embedded.

font_file()

Returns the embeeded font file object or nil if the font is not embedded.

font_wrapper()

Retrieves the font wrapper that is needed when this font is used for text output. Returns nil if this font can’t be used for text output.

Note: For internal use only!

See: HexaPDF::Font

font_wrapper=(font)

Sets the font wrapper.

See: font_wrapper

glyph_scaling_factor()

Returns the glyph scaling factor for transforming from glyph space to text space.

must_be_indirect?()

Font objects must always be indirect.

to_utf8(code)

Returns the UTF-8 string for the given character code, or calls the configuration option ‘font.on_missing_unicode_mapping’ if no mapping was found.