Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Zend_Pdf_Cmap Class Reference

Public Member Functions

 __construct ($cmapData)
 Object constructor.
 
 glyphNumbersForCharacters ($characterCodes)
 Returns an array of glyph numbers corresponding to the Unicode characters.
 
 glyphNumberForCharacter ($characterCode)
 Returns the glyph number corresponding to the Unicode character.
 
 getCoveredCharacters ()
 Returns an array containing the Unicode characters that have entries in this character map.
 
 getCoveredCharactersGlyphs ()
 Returns an array containing the glyphs numbers that have entries in this character map.
 

Static Public Member Functions

static cmapWithTypeData ($cmapType, $cmapData)
 Instantiates the appropriate concrete subclass based on the type of cmap table and returns the instance.
 

Public Attributes

const TYPE_BYTE_ENCODING = 0x00
 Byte Encoding character map table type.
 
const TYPE_HIGH_BYTE_MAPPING = 0x02
 High Byte Mapping character map table type.
 
const TYPE_SEGMENT_TO_DELTA = 0x04
 Segment Value to Delta Mapping character map table type.
 
const TYPE_TRIMMED_TABLE = 0x06
 Trimmed Table character map table type.
 
const TYPE_MIXED_COVERAGE = 0x08
 Mixed Coverage character map table type.
 
const TYPE_TRIMMED_ARRAY = 0x0a
 Trimmed Array character map table type.
 
const TYPE_SEGMENTED_COVERAGE = 0x0c
 Segmented Coverage character map table type.
 
const TYPE_BYTE_ENCODING_STATIC = 0xf1
 Static Byte Encoding character map table type.
 
const TYPE_UNKNOWN = 0xff
 Unknown character map table type.
 
const MISSING_CHARACTER_GLYPH = 0x00
 Glyph representing missing characters.
 

Protected Member Functions

 _extractInt2 (&$data, $index)
 Extracts a signed 2-byte integer from a string.
 
 _extractUInt2 (&$data, $index)
 Extracts an unsigned 2-byte integer from a string.
 
 _extractUInt4 (&$data, $index)
 Extracts an unsigned 4-byte integer from a string.
 

Constructor & Destructor Documentation

__construct (   $cmapData)
abstract

Object constructor.

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

Parameters
string$cmapDataRaw binary cmap table data.
Exceptions
Zend_Pdf_Exception

Member Function Documentation

_extractInt2 ( $data,
  $index 
)
protected

Extracts a signed 2-byte integer from a string.

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

Parameters
string&$data
integer$indexPosition in string of integer.
Returns
integer
Exceptions
Zend_Pdf_Exception
_extractUInt2 ( $data,
  $index 
)
protected

Extracts an unsigned 2-byte integer from a string.

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

Parameters
string&$data
integer$indexPosition in string of integer.
Returns
integer
Exceptions
Zend_Pdf_Exception
_extractUInt4 ( $data,
  $index 
)
protected

Extracts 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!

Parameters
string&$data
integer$indexPosition in string of integer.
Returns
integer
Exceptions
Zend_Pdf_Exception
static cmapWithTypeData (   $cmapType,
  $cmapData 
)
static

Instantiates 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.

Parameters
integer$cmapTypeType of cmap.
mixed$cmapDataCmap table data. Usually a string or array.
Returns
Zend_Pdf_Cmap
Exceptions
Zend_Pdf_Exception
getCoveredCharacters ( )
abstract

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

Returns
array Unicode character codes.
getCoveredCharactersGlyphs ( )
abstract

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

glyphNumberForCharacter (   $characterCode)
abstract

Returns 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.

Parameters
integer$characterCodeUnicode character code (code point).
Returns
integer Glyph number.
glyphNumbersForCharacters (   $characterCodes)
abstract

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

Parameters
array$characterCodesArray of Unicode character codes (code points).
Returns
array Array of glyph numbers.

Member Data Documentation

const MISSING_CHARACTER_GLYPH = 0x00

Glyph representing missing characters.

const TYPE_BYTE_ENCODING = 0x00

Byte Encoding character map table type.

const TYPE_BYTE_ENCODING_STATIC = 0xf1

Static Byte Encoding character map table type.

Variant of TYPE_BYTEENCODING.

const TYPE_HIGH_BYTE_MAPPING = 0x02

High Byte Mapping character map table type.

const TYPE_MIXED_COVERAGE = 0x08

Mixed Coverage character map table type.

const TYPE_SEGMENT_TO_DELTA = 0x04

Segment Value to Delta Mapping character map table type.

const TYPE_SEGMENTED_COVERAGE = 0x0c

Segmented Coverage character map table type.

const TYPE_TRIMMED_ARRAY = 0x0a

Trimmed Array character map table type.

const TYPE_TRIMMED_TABLE = 0x06

Trimmed Table character map table type.

const TYPE_UNKNOWN = 0xff

Unknown character map table type.