class HexaPDF:: Type:: FontSimple
Parent | HexaPDF::Type::Font |
---|
Represents a simple PDF font.
A simple font has only single-byte character codes and only supports horizontal metrics.
See: PDF2.0 s9.6
Field Definitions
Name | Type/Allowed Values | Required | Default Value |
---|---|---|---|
Type | Symbol | true | :Font |
ToUnicode | HexaPDF::Stream or Hash | false | nil |
Name | Symbol | false | nil |
FirstChar | Integer | false | nil |
LastChar | Integer | false | nil |
Widths | HexaPDF::PDFArray or Array | false | nil |
FontDescriptor | HexaPDF::Type::FontDescriptor or Hash | false | nil |
Encoding | HexaPDF::Dictionary or Symbol or Hash | false | nil |
Public Instance Methods
Decodes the given string into an array of character codes.
Returns the encoding object used for this font.
Note that the encoding is cached internally when accessed the first time.
Returns the font descriptor. May be nil
for a standard 14 font.
The font descriptor is required except for the standard 14 fonts in PDF version up to 1.7.
Returns true
if the font is a symbolic font, false
if it is not, and nil
if it is not known.
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.
Returns the unscaled width of the given code point in glyph units, or 0 if the width for the code point is missing.
Returns whether word spacing is applicable when using this font.
Always returns true
for simple fonts.
See: PDF2.0 s9.3.3
Returns the writing mode which is always :horizontal for simple fonts like Type1.