Abstract helper class for {@link Zend_Pdf_Resource_Font} which manages font character maps.
Defines the public interface for concrete subclasses which are responsible for mapping Unicode characters to the font's glyph numbers. Also provides shared utility methods.
Cmap objects should ordinarily be obtained through the factory method \cmapWithTypeData().
The supported character map types are those found in the OpenType spec. For additional detail on the internal binary format of these tables, see:
todo | Write code for Zend_Pdf_FontCmap_HighByteMapping class. |
---|---|
todo | Write code for Zend_Pdf_FontCmap_MixedCoverage class. |
todo | Write code for Zend_Pdf_FontCmap_TrimmedArray class. |
todo | Write code for Zend_Pdf_FontCmap_SegmentedCoverage class. |
package | Zend_Pdf |
subpackage | Fonts |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
__construct(string $cmapData)
Parses the raw binary table data. Throws an exception if the table is malformed.
string
Raw binary cmap table data.
\Zend_Pdf_Exception |
---|
cmapWithTypeData(integer $cmapType, mixed $cmapData) : \Zend_Pdf_Cmap
The cmap type must be one of the following values:
Throws an exception if the table type is invalid or the cmap table data cannot be validated.
integer
Type of cmap.
mixed
Cmap table data. Usually a string or array.
\Zend_Pdf_Exception |
---|
\Zend_Pdf_Cmap
getCoveredCharacters() : array
array
Unicode character codes.glyphNumberForCharacter(integer $characterCode) : integer
If a particular character doesn't exist in this font, the special 'missing character glyph' will be substituted.
See also \glyphNumbersForCharacters() which is optimized for bulk operations.
integer
Unicode character code (code point).
integer
Glyph number.glyphNumbersForCharacters(array $characterCodes) : array
If a particular character doesn't exist in this font, the special 'missing character glyph' will be substituted.
See also \glyphNumberForCharacter().
array
Array of Unicode character codes (code points).
array
Array of glyph numbers._extractInt2($data, integer $index) : integer
Integers are always big-endian. Throws an exception if the index is out of range.
integer
Position in string of integer.
\Zend_Pdf_Exception |
---|
integer
_extractUInt2($data, integer $index) : integer
Integers are always big-endian. Throws an exception if the index is out of range.
integer
Position in string of integer.
\Zend_Pdf_Exception |
---|
integer
_extractUInt4($data, integer $index) : integer
Integers are always big-endian. Throws an exception if the index is out of range.
NOTE: If you ask for a 4-byte unsigned integer on a 32-bit machine, the resulting value WILL BE SIGNED because PHP uses signed integers internally for everything. To guarantee portability, be sure to use bitwise or similar operators on large integers!
integer
Position in string of integer.
\Zend_Pdf_Exception |
---|
integer
MISSING_CHARACTER_GLYPH = 0
TYPE_BYTE_ENCODING = 0
TYPE_BYTE_ENCODING_STATIC = 241
TYPE_HIGH_BYTE_MAPPING = 2
TYPE_MIXED_COVERAGE = 8
TYPE_SEGMENTED_COVERAGE = 12
TYPE_SEGMENT_TO_DELTA = 4
TYPE_TRIMMED_ARRAY = 10
TYPE_TRIMMED_TABLE = 6
TYPE_UNKNOWN = 255