_fontType = Zend_Pdf_Font::TYPE_CIDFONT_TYPE_2; $this->_resource->Subtype = new Zend_Pdf_Element_Name('CIDFontType2'); $fontDescriptor = Zend_Pdf_Resource_Font_FontDescriptor::factory($this, $fontParser, $embeddingOptions); $this->_resource->FontDescriptor = $this->_objectFactory->newObject($fontDescriptor); /* Prepare CIDToGIDMap */ // Initialize 128K string of null characters (65536 2 byte integers) $cidToGidMapData = str_repeat("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 8192); // Fill the index $charGlyphs = $this->_cmap->getCoveredCharactersGlyphs(); foreach ($charGlyphs as $charCode => $glyph) { $cidToGidMapData[$charCode*2 ] = chr($glyph >> 8); $cidToGidMapData[$charCode*2 + 1] = chr($glyph & 0xFF); } // Store CIDToGIDMap within compressed stream object $cidToGidMap = $this->_objectFactory->newStreamObject($cidToGidMapData); $cidToGidMap->dictionary->Filter = new Zend_Pdf_Element_Name('FlateDecode'); $this->_resource->CIDToGIDMap = $cidToGidMap; } }