本文整理匯總了PHP中TCPDF_STATIC::_getFIXED方法的典型用法代碼示例。如果您正苦於以下問題:PHP TCPDF_STATIC::_getFIXED方法的具體用法?PHP TCPDF_STATIC::_getFIXED怎麽用?PHP TCPDF_STATIC::_getFIXED使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TCPDF_STATIC
的用法示例。
在下文中一共展示了TCPDF_STATIC::_getFIXED方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addTTFfont
//.........這裏部分代碼省略.........
$offset += 2; // skip Format selector (=0).
// Number of NameRecords that follow n.
$numNameRecords = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2;
// Offset to start of string storage (from start of table).
$stringStorageOffset = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2;
for ($i = 0; $i < $numNameRecords; ++$i) {
$offset += 6; // skip Platform ID, Platform-specific encoding ID, Language ID.
// Name ID.
$nameID = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2;
if ($nameID == 6) {
// String length (in bytes).
$stringLength = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2;
// String offset from start of storage area (in bytes).
$stringOffset = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2;
$offset = ($table['name']['offset'] + $stringStorageOffset + $stringOffset);
$fmetric['name'] = substr($font, $offset, $stringLength);
$fmetric['name'] = preg_replace('/[^a-zA-Z0-9_\-]/', '', $fmetric['name']);
break;
} else {
$offset += 4; // skip String length, String offset
}
}
if (empty($fmetric['name'])) {
$fmetric['name'] = $font_name;
}
// ---------- get post data ----------
$offset = $table['post']['offset'];
$offset += 4; // skip Format Type
$fmetric['italicAngle'] = TCPDF_STATIC::_getFIXED($font, $offset);
$offset += 4;
$fmetric['underlinePosition'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk);
$offset += 2;
$fmetric['underlineThickness'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk);
$offset += 2;
$isFixedPitch = (TCPDF_STATIC::_getULONG($font, $offset) == 0) ? false : true;
$offset += 2;
if ($isFixedPitch) {
$fmetric['Flags'] |= 1;
}
// ---------- get hhea data ----------
$offset = $table['hhea']['offset'];
$offset += 4; // skip Table version number
// Ascender
$fmetric['Ascent'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk);
$offset += 2;
// Descender
$fmetric['Descent'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk);
$offset += 2;
// LineGap
$fmetric['Leading'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk);
$offset += 2;
// advanceWidthMax
$fmetric['MaxWidth'] = round(TCPDF_STATIC::_getUFWORD($font, $offset) * $urk);
$offset += 2;
$offset += 22; // skip some values
// get the number of hMetric entries in hmtx table
$numberOfHMetrics = TCPDF_STATIC::_getUSHORT($font, $offset);
// ---------- get maxp data ----------
$offset = $table['maxp']['offset'];
$offset += 4; // skip Table version number
// get the the number of glyphs in the font.