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 license@zend.com so we can send you a copy immediately.
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 {@link 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:
TYPE_BYTE_ENCODING = '0x00'
Byte Encoding character map table type.
Details TYPE_HIGH_BYTE_MAPPING = '0x02'
High Byte Mapping character map table type.
Details TYPE_SEGMENT_TO_DELTA = '0x04'
Segment Value to Delta Mapping character map table type.
Details TYPE_TRIMMED_TABLE = '0x06'
Trimmed Table character map table type.
Details TYPE_MIXED_COVERAGE = '0x08'
Mixed Coverage character map table type.
Details TYPE_TRIMMED_ARRAY = '0x0a'
Trimmed Array character map table type.
Details TYPE_SEGMENTED_COVERAGE = '0x0c'
Segmented Coverage character map table type.
Details TYPE_BYTE_ENCODING_STATIC = '0xf1'
Static Byte Encoding character map table type. Variant of {@link TYPE_BYTEENCODING}.
Details TYPE_UNKNOWN = '0xff'
Unknown character map table type.
Details MISSING_CHARACTER_GLYPH = '0x00'
Glyph representing missing characters.
Details__construct(
string $cmapData
)
:
Object constructor
Parses the raw binary table data. Throws an exception if the table is malformed.
Details_extractInt2(
string $data, integer $index
)
:
integerExtracts a signed 2-byte integer from a string.
Integers are always big-endian. Throws an exception if the index is out of range.
Details_extractUInt2(
string $data, integer $index
)
:
integerExtracts an unsigned 2-byte integer from a string.
Integers are always big-endian. Throws an exception if the index is out of range.
Details_extractUInt4(
string $data, integer $index
)
:
integerExtracts an unsigned 4-byte integer from a string.
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!
DetailscmapWithTypeData(
integer $cmapType, mixed $cmapData
)
:
Zend_Pdf_CmapInstantiates the appropriate concrete subclass based on the type of cmap table and returns the instance.
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.
DetailsgetCoveredCharacters(
)
:
arrayReturns an array containing the Unicode characters that have entries in this character map.
DetailsgetCoveredCharactersGlyphs(
)
:
arrayReturns an array containing the glyphs numbers that have entries in this character map.
Keys are Unicode character codes (integers)
This functionality is partially covered by glyphNumbersForCharacters(getCoveredCharacters()) call, but this method do it in more effective way (prepare complete list instead of searching glyph for each character code).
DetailsglyphNumberForCharacter(
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 {@link glyphNumbersForCharacters()} which is optimized for bulk operations.
DetailsglyphNumbersForCharacters(
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 {@link glyphNumberForCharacter()}.
Details