24 #require_once 'Zend/Pdf/Cmap.php'; 82 $glyphNumbers = array();
83 foreach ($characterCodes as $key => $characterCode) {
85 if (($characterCode < $this->_startCode) || ($characterCode > $this->_endCode)) {
91 $glyphNumbers[$key] = $this->_glyphIndexArray[$glyphIndex];
111 if (($characterCode < $this->_startCode) || ($characterCode > $this->_endCode)) {
115 return $this->_glyphIndexArray[$glyphIndex];
126 $characterCodes = array();
128 $characterCodes[] =
$code;
130 return $characterCodes;
147 $glyphNumbers = array();
152 return $glyphNumbers;
171 $actualLength = strlen($cmapData);
172 if ($actualLength < 9) {
173 #require_once 'Zend/Pdf/Exception.php'; 182 #require_once 'Zend/Pdf/Exception.php'; 188 if ($length != $actualLength) {
189 #require_once 'Zend/Pdf/Exception.php'; 190 throw new Zend_Pdf_Exception(
"Table length ($length) does not match actual length ($actualLength)",
200 if ($language != 0) {
207 $expectedCount = ($length - 10) >> 1;
208 if ($entryCount != $expectedCount) {
209 #require_once 'Zend/Pdf/Exception.php'; 210 throw new Zend_Pdf_Exception(
"Entry count is wrong; expected: $expectedCount; actual: $entryCount",
214 $this->_endCode = $this->_startCode + $entryCount - 1;
217 for (
$i = 0;
$i < $entryCount;
$i++, $offset += 2) {
218 $this->_glyphIndexArray[] = $this->
_extractUInt2($cmapData, $offset);
224 if ($offset != $length) {
225 #require_once 'Zend/Pdf/Exception.php'; 226 throw new Zend_Pdf_Exception(
"Ending offset ($offset) does not match length ($length)",
glyphNumberForCharacter($characterCode)
getCoveredCharactersGlyphs()
const CMAP_WRONG_TABLE_LENGTH
const CMAP_FINAL_OFFSET_NOT_LENGTH
const CMAP_WRONG_ENTRY_COUNT
const CMAP_TABLE_DATA_TOO_SMALL
glyphNumbersForCharacters($characterCodes)
const CMAP_WRONG_TABLE_TYPE
const MISSING_CHARACTER_GLYPH
_extractUInt2(&$data, $index)