本文整理汇总了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