class HexaPDF::Font::Type1Wrapper

Parent

This class wraps a generic Type1 font object and provides the methods needed for working with the font in a PDF context.

Constants

VALID_ENCODING_NAMES

Array of valid encoding names in PDF

Attributes

dict[R]

The PDF font dictionary representing the wrapped font.

wrapped_font[R]

Returns the wrapped Type1 font object.

Public Class Methods

new(document, font, custom_encoding: false)

Creates a new object wrapping the Type1 font for the PDF document.

The optional argument custom_encoding can be set to true so that a custom encoding instead of the WinAnsiEncoding is used.

Public Instance Methods

decode_utf8(str)

Returns an array of glyph objects representing the characters in the UTF-8 encoded string.

encode(glyph)

Encodes the glyph and returns the code string.

font_type()

Returns the type of the font, i.e. :Type1.

glyph(name)

Returns a Glyph object for the given glyph name.

scaling_factor()

Returns 1 since all Type1 fonts use 1000 units for the em-square.