Implements the "byte encoding" character map (type 0).

This is the (legacy) Apple standard encoding mechanism and provides coverage for characters in the Mac Roman character set only. Consequently, this cmap type should be used only as a last resort.

The mapping from Mac Roman to Unicode can be found at http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMAN.TXT.

package Zend_Pdf
subpackage Fonts
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Pdf_Cmap

 Methods

Object constructor

__construct(string $cmapData) 

Parses the raw binary table data. Throws an exception if the table is malformed.

inherited_from \Zend_Pdf_Cmap::__construct()

Parameters

$cmapData

string

Raw binary cmap table data.

Exceptions

\Zend_Pdf_Exception

Object constructor

__construct(string $cmapData) 
Inherited

Parses the raw binary table data. Throws an exception if the table is malformed.

Parameters

$cmapData

string

Raw binary cmap table data.

Exceptions

\Zend_Pdf_Exception

Instantiates the appropriate concrete subclass based on the type of cmap table and returns the instance.

cmapWithTypeData(integer $cmapType, mixed $cmapData) : \Zend_Pdf_Cmap
InheritedStatic

The cmap type must be one of the following values:

  • [Zend_Pdf_Cmap::TYPE_BYTE_ENCODING](/classes/Zend_Pdf_Cmap.html#constant_TYPE_BYTE_ENCODING)
  • [Zend_Pdf_Cmap::TYPE_BYTE_ENCODING_STATIC](/classes/Zend_Pdf_Cmap.html#constant_TYPE_BYTE_ENCODING_STATIC)
  • [Zend_Pdf_Cmap::TYPE_HIGH_BYTE_MAPPING](/classes/Zend_Pdf_Cmap.html#constant_TYPE_HIGH_BYTE_MAPPING)
  • [Zend_Pdf_Cmap::TYPE_SEGMENT_TO_DELTA](/classes/Zend_Pdf_Cmap.html#constant_TYPE_SEGMENT_TO_DELTA)
  • [Zend_Pdf_Cmap::TYPE_TRIMMED_TABLE](/classes/Zend_Pdf_Cmap.html#constant_TYPE_TRIMMED_TABLE)
  • [Zend_Pdf_Cmap::TYPE_MIXED_COVERAGE](/classes/Zend_Pdf_Cmap.html#constant_TYPE_MIXED_COVERAGE)
  • [Zend_Pdf_Cmap::TYPE_TRIMMED_ARRAY](/classes/Zend_Pdf_Cmap.html#constant_TYPE_TRIMMED_ARRAY)
  • [Zend_Pdf_Cmap::TYPE_SEGMENTED_COVERAGE](/classes/Zend_Pdf_Cmap.html#constant_TYPE_SEGMENTED_COVERAGE)

Throws an exception if the table type is invalid or the cmap table data cannot be validated.

Parameters

$cmapType

integer

Type of cmap.

$cmapData

mixed

Cmap table data. Usually a string or array.

Exceptions

\Zend_Pdf_Exception

Returns

\Zend_Pdf_Cmap

Returns an array containing the Unicode characters that have entries in this character map.

getCoveredCharacters() : array
inherited_from \Zend_Pdf_Cmap::getCoveredCharacters()

Returns

arrayUnicode character codes.

Returns an array containing the Unicode characters that have entries in this character map.

getCoveredCharacters() : array
Inherited

Returns

arrayUnicode character codes.

Returns the glyph number corresponding to the Unicode character.

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.

inherited_from \Zend_Pdf_Cmap::glyphNumberForCharacter()

Parameters

$characterCode

integer

Unicode character code (code point).

Returns

integerGlyph number.

Returns the glyph number corresponding to the Unicode character.

glyphNumberForCharacter(integer $characterCode) : integer
Inherited

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.

Parameters

$characterCode

integer

Unicode character code (code point).

Returns

integerGlyph number.

Returns an array of glyph numbers corresponding to the Unicode characters.

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().

inherited_from \Zend_Pdf_Cmap::glyphNumbersForCharacters()

Parameters

$characterCodes

array

Array of Unicode character codes (code points).

Returns

arrayArray of glyph numbers.

Returns an array of glyph numbers corresponding to the Unicode characters.

glyphNumbersForCharacters(array $characterCodes) : array
Inherited

If a particular character doesn't exist in this font, the special 'missing character glyph' will be substituted.

See also \glyphNumberForCharacter().

Parameters

$characterCodes

array

Array of Unicode character codes (code points).

Returns

arrayArray of glyph numbers.

Extracts a signed 2-byte integer from a string.

_extractInt2($data, integer $index) : integer
Inherited

Integers are always big-endian. Throws an exception if the index is out of range.

Parameters

$data

$index

integer

Position in string of integer.

Exceptions

\Zend_Pdf_Exception

Returns

integer

Extracts an unsigned 2-byte integer from a string.

_extractUInt2($data, integer $index) : integer
Inherited

Integers are always big-endian. Throws an exception if the index is out of range.

Parameters

$data

$index

integer

Position in string of integer.

Exceptions

\Zend_Pdf_Exception

Returns

integer

Extracts an unsigned 4-byte integer from a string.

_extractUInt4($data, integer $index) : integer
Inherited

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!

Parameters

$data

$index

integer

Position in string of integer.

Exceptions

\Zend_Pdf_Exception

Returns

integer

 Properties

 

Glyph index array. Stores the actual glyph numbers. The array keys are the translated Unicode code points.

$_glyphIndexArray : array

Default

array()

 Constants

 

Glyph representing missing characters.

MISSING_CHARACTER_GLYPH = 0 
 

Byte Encoding character map table type.

TYPE_BYTE_ENCODING = 0 
 

Static Byte Encoding character map table type. Variant of {@link TYPE_BYTEENCODING}.

TYPE_BYTE_ENCODING_STATIC = 241 
 

High Byte Mapping character map table type.

TYPE_HIGH_BYTE_MAPPING = 2 
 

Mixed Coverage character map table type.

TYPE_MIXED_COVERAGE = 8 
 

Segmented Coverage character map table type.

TYPE_SEGMENTED_COVERAGE = 12 
 

Segment Value to Delta Mapping character map table type.

TYPE_SEGMENT_TO_DELTA = 4 
 

Trimmed Array character map table type.

TYPE_TRIMMED_ARRAY = 10 
 

Trimmed Table character map table type.

TYPE_TRIMMED_TABLE = 6 
 

Unknown character map table type.

TYPE_UNKNOWN = 255