class HexaPDF:: Font:: CMap
| Parent | Object |
|---|
Represents a CMap, a mapping from character codes to CIDs (character IDs) or to their Unicode value.
See: PDF2.0 s9.7.5, s9.10.3; Adobe Technical Notes #5014 and #5411
Attributes
The writing mode of the CMap: 0 for horizontal, 1 for vertical writing.
Public Class Methods
Returns a string containing a CID CMap that represents the given code to CID mapping.
See: Writer#create_cid_cmap
Returns a string containing a ToUnicode CMap that represents the given code to Unicode codepoint mapping.
See: Writer#create_to_unicode_cmap
Public Instance Methods
Adds an individual mapping from character code to CID.
Adds a CID range, mapping characters codes from start_code to end_code to CIDs starting with start_cid.
Add a codespace range using an array of ranges for the individual bytes.
This means that the first range is checked against the first byte, the second range against the second byte and so on.
Adds a mapping from character code to Unicode string in UTF-8 encoding.
Adds a mapping from a range of character codes to strings starting with the given 16-bit integer values (representing the raw UTF-16BE characters).
Parses the string and returns all character codes.
An error is raised if the string contains invalid bytes.
Returns the CID for the given character code, or 0 if no mapping was found.
Returns the Unicode string in UTF-8 encoding for the given character code, or nil if no mapping was found.