25 #require_once 'Zend/Pdf/Element/Array.php'; 26 #require_once 'Zend/Pdf/Element/Name.php'; 30 #require_once 'Zend/Pdf/Resource/Font.php'; 70 private $_descendantFont;
78 static private function getToUnicodeCMapData()
80 return '/CIDInit /ProcSet findresource begin ' .
"\n" 81 .
'12 dict begin ' .
"\n" 83 .
'/CIDSystemInfo ' .
"\n" 84 .
'<</Registry (Adobe) ' .
"\n" 85 .
'/Ordering (UCS) ' .
"\n" 86 .
'/Supplement 0' .
"\n" 88 .
'/CMapName /Adobe-Identity-UCS def ' .
"\n" 89 .
'/CMapType 2 def ' .
"\n" 90 .
'1 begincodespacerange' .
"\n" 91 .
'<0000> <FFFF> ' .
"\n" 92 .
'endcodespacerange ' .
"\n" 93 .
'1 beginbfrange ' .
"\n" 94 .
'<0000> <FFFF> <0000> ' .
"\n" 95 .
'endbfrange ' .
"\n" 97 .
'CMapName currentdict /CMap defineresource pop ' .
"\n" 108 parent::__construct();
110 $this->_objectFactory->attach($descendantFont->
getFactory());
113 $this->_descendantFont = $descendantFont;
118 $this->_isBold = $descendantFont->
isBold();
119 $this->_isItalic = $descendantFont->
isItalic();
120 $this->_isMonospaced = $descendantFont->
isMonospace();
129 $this->_ascent = $descendantFont->
getAscent();
130 $this->_descent = $descendantFont->
getDescent();
131 $this->_lineGap = $descendantFont->
getLineGap();
139 $toUnicode = $this->_objectFactory->newStreamObject(self::getToUnicodeCMapData());
140 $this->_resource->ToUnicode = $toUnicode;
157 return $characterCodes;
171 return $characterCode;
194 return $this->_descendantFont->getCoveredPercentage($string, $charEncoding);
213 return $this->_descendantFont->widthsForChars($glyphNumbers);
227 return $this->_descendantFont->widthForChar($glyphNumber);
241 return iconv($charEncoding,
'UTF-16BE', $string);
255 return iconv(
'UTF-16BE', $charEncoding, $string);
encodeString($string, $charEncoding)
widthForGlyph($glyphNumber)
getCoveredPercentage($string, $charEncoding='')
glyphNumberForCharacter($characterCode)
__construct(Zend_Pdf_Resource_Font_CidFont $descendantFont)
decodeString($string, $charEncoding)
widthsForGlyphs($glyphNumbers)
glyphNumbersForCharacters($characterCodes)