Esempio n. 1
0
 private function collectChars($chars)
 {
     if (($unicodeEncodingTable = TTF::getEncodingTable($this->cmap, 3, 1)) === null) {
         throw new Exception('No unicode (3,1) encoding table found');
     }
     for ($i = 0; $i < strlen($chars); $i += 2) {
         $charCode = self::ORD(substr($chars, $i, 2));
         $orgIndex = TTF::characterToIndex($unicodeEncodingTable, $charCode);
         $description = $orgIndex > -1 ? $this->glyf[$orgIndex] : null;
         if (!$this->orgIndexAlreadyExists($orgIndex)) {
             $this->TTFchars[] = new TTFchar($charCode, $orgIndex, 0, $description);
         }
     }
 }