class HexaPDF:: Font:: Type1Wrapper
Parent | Object |
---|
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
Returns the PDF object associated with the wrapper.
Public Class Methods
Creates a new Type1Wrapper
object wrapping the Type1
font.
The optional argument pdf_object
can be used to set the PDF font object that this wrapper should be associated with. If no object is set, a suitable one is automatically created.
If pdf_object
is provided, the PDF object’s encoding is used. Otherwise, the WinAnsiEncoding or, for ‘Special’ fonts, the font’s internal encoding is used. The optional argument custom_encoding
can be set to true
so that a custom encoding is used (only respected if pdf_object
is not provided).
Public Instance Methods
Returns true
if the font contains bold glyphs.
Returns a custom Glyph
object which represents the given string
via the given glyph name
.
This functionality can be used to associate a single glyph name with multiple, different strings for replacement glyph purposes. When used in such a way, the used glyph name is often :question.
Returns a glyph object for the given Unicode codepoint.
If a Unicode codepoint is not available as glyph object, it is tried to map the codepoint using the font’s internal encoding. This is useful, for example, for the ZapfDingbats font to use ASCII characters for accessing the glyphs.
The configuration option ‘font.on_missing_glyph’ is invoked if no glyph for a given codepoint is available.
Returns an array of glyph objects representing the characters in the UTF-8 encoded string.
See decode_codepoint
for details.
Encodes the glyph and returns the code string.
Returns the type of the font, i.e. :Type1.
Returns true
if the font contains glyphs with an incline (italic or slant).