本文整理匯總了PHP中TCPDF_STATIC::_getFWORD方法的典型用法代碼示例。如果您正苦於以下問題:PHP TCPDF_STATIC::_getFWORD方法的具體用法?PHP TCPDF_STATIC::_getFWORD怎麽用?PHP TCPDF_STATIC::_getFWORD使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TCPDF_STATIC
的用法示例。
在下文中一共展示了TCPDF_STATIC::_getFWORD方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addTTFfont
//.........這裏部分代碼省略.........
$numTables = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2;
// skip searchRange, entrySelector and rangeShift
$offset += 6;
// tables array
$table = array();
// ---------- get tables ----------
for ($i = 0; $i < $numTables; ++$i) {
// get table info
$tag = substr($font, $offset, 4);
$offset += 4;
$table[$tag] = array();
$table[$tag]['checkSum'] = TCPDF_STATIC::_getULONG($font, $offset);
$offset += 4;
$table[$tag]['offset'] = TCPDF_STATIC::_getULONG($font, $offset);
$offset += 4;
$table[$tag]['length'] = TCPDF_STATIC::_getULONG($font, $offset);
$offset += 4;
}
// check magicNumber
$offset = $table['head']['offset'] + 12;
if (TCPDF_STATIC::_getULONG($font, $offset) != 0x5F0F3CF5) {
// magicNumber must be 0x5F0F3CF5
return false;
}
$offset += 4;
$offset += 2; // skip flags
// get FUnits
$fmetric['unitsPerEm'] = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2;
// units ratio constant
$urk = (1000 / $fmetric['unitsPerEm']);
$offset += 16; // skip created, modified
$xMin = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk);
$offset += 2;
$yMin = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk);
$offset += 2;
$xMax = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk);
$offset += 2;
$yMax = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk);
$offset += 2;
$fmetric['bbox'] = ''.$xMin.' '.$yMin.' '.$xMax.' '.$yMax.'';
$macStyle = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2;
// PDF font flags
$fmetric['Flags'] = $flags;
if (($macStyle & 2) == 2) {
// italic flag
$fmetric['Flags'] |= 64;
}
// get offset mode (indexToLocFormat : 0 = short, 1 = long)
$offset = $table['head']['offset'] + 50;
$short_offset = (TCPDF_STATIC::_getSHORT($font, $offset) == 0);
$offset += 2;
// get the offsets to the locations of the glyphs in the font, relative to the beginning of the glyphData table
$indexToLoc = array();
$offset = $table['loca']['offset'];
if ($short_offset) {
// short version
$tot_num_glyphs = floor($table['loca']['length'] / 2); // numGlyphs + 1
for ($i = 0; $i < $tot_num_glyphs; ++$i) {
$indexToLoc[$i] = TCPDF_STATIC::_getUSHORT($font, $offset) * 2;
$offset += 2;
}
} else {
// long version