Pdf/Cmap/TrimmedTable.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Pdf
- Subpackage
- Fonts
- Version
- $Id: TrimmedTable.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Pdf_Cmap_TrimmedTable
Implements the "trimmed table mapping" character map (type 6).
This table type is preferred over the Zend_Pdf_Cmap_SegmentToDelta table when the Unicode characters covered by the font fall into a single contiguous range.
- Parent(s)
- \Zend_Pdf_Cmap
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
TYPE_HIGH_BYTE_MAPPING
= 2High Byte Mapping character map table type.
Inherited from: \Zend_Pdf_Cmap::TYPE_HIGH_BYTE_MAPPING- Inherited_from
- \Zend_Pdf_Cmap::TYPE_HIGH_BYTE_MAPPING
TYPE_SEGMENT_TO_DELTA
= 4Segment Value to Delta Mapping character map table type.
Inherited from: \Zend_Pdf_Cmap::TYPE_SEGMENT_TO_DELTA- Inherited_from
- \Zend_Pdf_Cmap::TYPE_SEGMENT_TO_DELTA
TYPE_MIXED_COVERAGE
= 8Mixed Coverage character map table type.
Inherited from: \Zend_Pdf_Cmap::TYPE_MIXED_COVERAGE- Inherited_from
- \Zend_Pdf_Cmap::TYPE_MIXED_COVERAGE
TYPE_SEGMENTED_COVERAGE
= 12Segmented Coverage character map table type.
Inherited from: \Zend_Pdf_Cmap::TYPE_SEGMENTED_COVERAGE- Inherited_from
- \Zend_Pdf_Cmap::TYPE_SEGMENTED_COVERAGE
TYPE_BYTE_ENCODING_STATIC
= 241Static Byte Encoding character map table type.
Inherited from: \Zend_Pdf_Cmap::TYPE_BYTE_ENCODING_STATICVariant of TYPE_BYTEENCODING.
- Inherited_from
- \Zend_Pdf_Cmap::TYPE_BYTE_ENCODING_STATIC
MISSING_CHARACTER_GLYPH
= 0Glyph representing missing characters.
Inherited from: \Zend_Pdf_Cmap::MISSING_CHARACTER_GLYPH- Inherited_from
- \Zend_Pdf_Cmap::MISSING_CHARACTER_GLYPH
Properties

integer $_endCode = 0The ending character code covered by this table.
0Details- Type
- integer

array $_glyphIndexArray = array()Glyph index array.
Stores the actual glyph numbers.
array()Details- Type
- array
Methods

__construct(string $cmapData) : voidObject constructor
Parses the raw binary table data. Throws an exception if the table is malformed.
| Name | Type | Description |
|---|---|---|
| $cmapData | string | Raw binary cmap table data. |
| Exception | Description |
|---|---|
| \Zend_Pdf_Exception |

_extractInt2(string $data, integer $index) : integerExtracts a signed 2-byte integer from a string.
Inherited from: \Zend_Pdf_Cmap::_extractInt2()Integers are always big-endian. Throws an exception if the index is out of range.
| Name | Type | Description |
|---|---|---|
| $data | string | &$data |
| $index | integer | Position in string of integer. |
| Type | Description |
|---|---|
| integer |
| Exception | Description |
|---|---|
| \Zend_Pdf_Exception |

_extractUInt2(string $data, integer $index) : integerExtracts an unsigned 2-byte integer from a string.
Inherited from: \Zend_Pdf_Cmap::_extractUInt2()Integers are always big-endian. Throws an exception if the index is out of range.
| Name | Type | Description |
|---|---|---|
| $data | string | &$data |
| $index | integer | Position in string of integer. |
| Type | Description |
|---|---|
| integer |
| Exception | Description |
|---|---|
| \Zend_Pdf_Exception |

_extractUInt4(string $data, integer $index) : integerExtracts an unsigned 4-byte integer from a string.
Inherited from: \Zend_Pdf_Cmap::_extractUInt4()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!
| Name | Type | Description |
|---|---|---|
| $data | string | &$data |
| $index | integer | Position in string of integer. |
| Type | Description |
|---|---|
| integer |
| Exception | Description |
|---|---|
| \Zend_Pdf_Exception |

cmapWithTypeData(integer $cmapType, mixed $cmapData) : \Zend_Pdf_CmapInstantiates the appropriate concrete subclass based on the type of cmap table and returns the instance.
Inherited from: \Zend_Pdf_Cmap::cmapWithTypeData()The cmap type must be one of the following values:
- Zend_Pdf_Cmap::TYPE_BYTE_ENCODING
- Zend_Pdf_Cmap::TYPE_BYTE_ENCODING_STATIC
- Zend_Pdf_Cmap::TYPE_HIGH_BYTE_MAPPING
- Zend_Pdf_Cmap::TYPE_SEGMENT_TO_DELTA
- Zend_Pdf_Cmap::TYPE_TRIMMED_TABLE
- Zend_Pdf_Cmap::TYPE_MIXED_COVERAGE
- Zend_Pdf_Cmap::TYPE_TRIMMED_ARRAY
- Zend_Pdf_Cmap::TYPE_SEGMENTED_COVERAGE
Throws an exception if the table type is invalid or the cmap table data cannot be validated.
| Name | Type | Description |
|---|---|---|
| $cmapType | integer | Type of cmap. |
| $cmapData | mixed | Cmap table data. Usually a string or array. |
| Type | Description |
|---|---|
| \Zend_Pdf_Cmap |
| Exception | Description |
|---|---|
| \Zend_Pdf_Exception |

getCoveredCharacters() : arrayReturns an array containing the Unicode characters that have entries in this character map.
| Type | Description |
|---|---|
| array | Unicode character codes. |

glyphNumberForCharacter(integer $characterCode) : integerReturns the glyph number corresponding to the Unicode character.
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.
| Name | Type | Description |
|---|---|---|
| $characterCode | integer | Unicode character code (code point). |
| Type | Description |
|---|---|
| integer | Glyph number. |

glyphNumbersForCharacters(array $characterCodes) : arrayReturns an array of glyph numbers corresponding to the Unicode characters.
If a particular character doesn't exist in this font, the special 'missing character glyph' will be substituted.
See also glyphNumberForCharacter().
| Name | Type | Description |
|---|---|---|
| $characterCodes | array | Array of Unicode character codes (code points). |
| Type | Description |
|---|---|
| array | Array of glyph numbers. |