本文整理匯總了PHP中Font::UTF16ToUTF8方法的典型用法代碼示例。如果您正苦於以下問題:PHP Font::UTF16ToUTF8方法的具體用法?PHP Font::UTF16ToUTF8怎麽用?PHP Font::UTF16ToUTF8使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Font
的用法示例。
在下文中一共展示了Font::UTF16ToUTF8方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: readString
private function readString($name)
{
$font = $this->font;
$size = $font->readUInt16();
$this->data["{$name}Size"] = $size;
$this->data[$name] = Font::UTF16ToUTF8($font->read($size));
}
示例2: _parse
protected function _parse()
{
$font = $this->getFont();
$data = array();
$tableOffset = $font->pos();
$data = $font->unpack(self::$header_format);
$records = array();
for ($i = 0; $i < $data["count"]; $i++) {
$record = new Font_Table_name_Record();
$record_data = $font->unpack(Font_Table_name_Record::$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;
}