API Documentation

Pdf/Cmap/ByteEncoding.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 license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Pdf  
subpackage
Fonts  
version
$Id: ByteEncoding.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Pdf_Cmap_ByteEncoding

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 {@link http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMAN.TXT}.

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

Properties

Propertyprotectedarray  $_glyphIndexArray= 'array'

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

Default valuearrayDetails
Type
array

Methods

methodpublic__construct( string $cmapData ) : void

Object constructor

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

Parameters
Name Type Description
$cmapData string Raw binary cmap table data.
Throws
Exception Description
\Zend_Pdf_Exception
methodprotected_extractInt2( string $data, integer $index ) : integer

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

Parameters
Name Type Description
$data string

&$data

$index integer Position in string of integer.
Returns
Type Description
integer
Throws
Exception Description
\Zend_Pdf_Exception
methodprotected_extractUInt2( string $data, integer $index ) : integer

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

Parameters
Name Type Description
$data string

&$data

$index integer Position in string of integer.
Returns
Type Description
integer
Throws
Exception Description
\Zend_Pdf_Exception
methodprotected_extractUInt4( string $data, integer $index ) : integer

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

Parameters
Name Type Description
$data string

&$data

$index integer Position in string of integer.
Returns
Type Description
integer
Throws
Exception Description
\Zend_Pdf_Exception
methodpubliccmapWithTypeData( integer $cmapType, mixed $cmapData ) : \Zend_Pdf_Cmap
static

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

  • {@link Zend_Pdf_Cmap::TYPE_BYTE_ENCODING}
  • {@link Zend_Pdf_Cmap::TYPE_BYTE_ENCODING_STATIC}
  • {@link Zend_Pdf_Cmap::TYPE_HIGH_BYTE_MAPPING}
  • {@link Zend_Pdf_Cmap::TYPE_SEGMENT_TO_DELTA}
  • {@link Zend_Pdf_Cmap::TYPE_TRIMMED_TABLE}
  • {@link Zend_Pdf_Cmap::TYPE_MIXED_COVERAGE}
  • {@link Zend_Pdf_Cmap::TYPE_TRIMMED_ARRAY}
  • {@link Zend_Pdf_Cmap::TYPE_SEGMENTED_COVERAGE}

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

Parameters
Name Type Description
$cmapType integer Type of cmap.
$cmapData mixed Cmap table data. Usually a string or array.
Returns
Type Description
\Zend_Pdf_Cmap
Throws
Exception Description
\Zend_Pdf_Exception
methodpublicgetCoveredCharacters( ) : array

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

Returns
Type Description
array Unicode character codes.
methodpublicglyphNumberForCharacter( integer $characterCode ) : integer

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 {@link glyphNumbersForCharacters()} which is optimized for bulk operations.

Parameters
Name Type Description
$characterCode integer

Unicode character code (code point).

Returns
Type Description
integer Glyph number.
methodpublicglyphNumbersForCharacters( array $characterCodes ) : array

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 {@link glyphNumberForCharacter()}.

Parameters
Name Type Description
$characterCodes array

Array of Unicode character codes (code points).

Returns
Type Description
array Array of glyph numbers.
Documentation was generated by DocBlox 0.13.3.