Example #1
0
 /**
  * Get the I2CE_Encoding according to one of the standard adobe encodings
  */
 protected function getAdobeStandardEncoding($encoding)
 {
     if (isset($this->adobe_standard_encondings[$encoding])) {
         return;
     }
     $enc = new I2CE_Encoding($encoding);
     if (!isset($this->glyph_list)) {
         $this->loadGlyphList();
     }
     $a = $this->load_file('PDF_CORE', $encoding . '.list');
     foreach ($a as $l) {
         $l = trim($l);
         $e = explode(" ", rtrim($l));
         $cc = (int) $e[0];
         $gn = $e[1];
         $cps = $this->glyph_list[$gn];
         if (count($cps) == 1) {
             //a adobe glyphname may be associated to several unicode codepoints (e.g. lamedholam)
             //if this is the case, we ignore it.
             $enc->setGlyphname($cps[0], $gn);
             $enc->setCharacterCode($cps[0], $cc);
         }
     }
     $this->adobe_standard_encodings[$encoding] = $enc;
     return $enc;
 }