Implements the "segment mapping to delta values" character map (type 4).

This is the Microsoft standard mapping table type for OpenType fonts. It provides the ability to cover multiple contiguous ranges of the Unicode character set, with the exception of Unicode Surrogates (U+D800 - U+DFFF).

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 glyph numbers, used with range offset.

$_glyphIndexArray : array

Default

array()
 

The number of binary search steps required to cover the entire search range.

$_searchIterations : integer

Default

0
 

The size of the binary search range for segments.

$_searchRange : integer

Default

0
 

The ending character code for the segment at the end of the low search range.

$_searchRangeEndCode : integer

Default

0
 

The number of segments in the table.

$_segmentCount : integer

Default

0
 

Array of ending character codes for each segment.

$_segmentTableEndCodes : array

Default

array()
 

Array of character code to glyph delta values for each segment.

$_segmentTableIdDeltas : array

Default

array()
 

Array of offsets into the glyph index array for each segment.

$_segmentTableIdRangeOffsets : array

Default

array()
 

Array of starting character codes for each segment.

$_segmentTableStartCodes : 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