private function readString($name) { $font = $this->font; $size = $font->readUInt16(); $this->data["{$name}Size"] = $size; $this->data[$name] = Font::UTF16ToUTF8($font->read($size)); }
protected function _parse() { $font = $this->getFont(); $tableOffset = $font->pos(); $data = $font->unpack(self::$header_format); $records = array(); for ($i = 0; $i < $data["count"]; $i++) { $record = new nameRecord(); $record_data = $font->unpack(nameRecord::$format); $record->map($record_data); $records[] = $record; } $names = array(); foreach ($records as $record) { $font->seek($tableOffset + $data["stringOffset"] + $record->offset); $s = $font->read($record->length); $record->string = Font::UTF16ToUTF8($s); $names[$record->nameID] = $record; } $data["records"] = $names; $this->data = $data; }