コード例 #1
0
 public function __construct(&$encoding, $ttf_file)
 {
     parent::__construct(array('H', 'V'), $encoding);
     $found_ttf_file = I2CE::getFileSearch()->search('TTF_PATH', $ttf_file);
     if (!$found_ttf_file) {
         die("Cannot find file ({$ttf_file})\n");
     }
     $this->ttf_file = $found_ttf_file;
     $this->openForReading();
     $this->loadDirectory();
     $this->read_numGlyphs();
     $this->read_head();
     $this->read_post();
     $this->read_hhea();
     $this->read_hmtx();
     $this->read_loca();
     $this->read_glyf();
     if ($this->inDirectory('kern')) {
         $this->read_kern();
     }
     $this->read_name();
     $this->close();
     $this->setDirection('H');
 }
コード例 #2
0
 /**
  * @param I2CE_Encoding $encoding -- the encoding used for the internal storage of strings/characters
  *       needs to be one that is a valid encoding for PHP multibyte strings. 
  *  @param I2CE_Encoding $file_encoding -- the character encoding  used in the file afm file
  *  @param string $afmfile  the afm file to load.
  */
 public function __construct(&$internal_encoding, &$file_encoding, $afmfile)
 {
     $this->gn2cc = array();
     parent::__construct(array('H', 'V'), $internal_encoding);
     $this->loadFontMetricFromAFM($file_encoding, $afmfile);
 }