本文整理汇总了PHP中mPDF::_charDefined方法的典型用法代码示例。如果您正苦于以下问题:PHP mPDF::_charDefined方法的具体用法?PHP mPDF::_charDefined怎么用?PHP mPDF::_charDefined使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mPDF
的用法示例。
在下文中一共展示了mPDF::_charDefined方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
foreach ($unicode_ranges as $urk => $ur) {
if ($urk >= $urgp * $ningroup && $urk < ($urgp + 1) * $ningroup) {
if ($ur['pua'] || $ur['reserved'] || $ur['control']) {
$html .= '<td style="background-color: #000000;"></td>';
} else {
$rangekey = $urk;
$range = $ur['range'];
$rangestart = $ur['starthex'];
$rangeend = $ur['endhex'];
$rangestartdec = $ur['startdec'];
$rangeenddec = $ur['enddec'];
$uniinrange = 0;
$fontinrange = 0;
for ($i = $rangestartdec; $i <= $rangeenddec; $i++) {
//if (isset($cw[$i])) { $fontinrange++; }
if ($mpdf->_charDefined($cw, $i)) {
$fontinrange++;
}
if (isset($unichars[$i])) {
$uniinrange++;
}
}
if ($uniinrange) {
if ($fontinrange) {
$pc = $fontinrange / $uniinrange;
$str = '(' . $fontinrange . '/' . $uniinrange . ')';
if ($pc == 1) {
$fullcovers[$urk][] = $fname;
$html .= '<td style="background-color: #00FF00;"></td>';
} else {
if ($pc > 1) {
示例2: if
if ($urk >= ($urgp*$ningroup) && $urk < (($urgp+1)*$ningroup)) {
if ($ur['pua'] || $ur['reserved'] || $ur['control']) {
$html .= '<td style="background-color: #000000;"></td>';
}
else {
$rangekey = $urk;
$range = $ur['range'];
$rangestart = $ur['starthex'];
$rangeend = $ur['endhex'];
$rangestartdec = $ur['startdec'];
$rangeenddec = $ur['enddec'];
$uniinrange = 0;
$fontinrange = 0;
for ($i=$rangestartdec; $i<=$rangeenddec; $i++) {
//if (isset($cw[$i])) { $fontinrange++; }
if ($mpdf->_charDefined($cw, $i)) { $fontinrange++; }
if (isset($unichars[$i])) { $uniinrange++; }
}
if ($uniinrange) {
if ($fontinrange) {
$pc = ($fontinrange/$uniinrange);
$str = '('.$fontinrange.'/'.$uniinrange.')';
if ($pc==1) {
$fullcovers[$urk][] = $fname;
$html .= '<td style="background-color: #00FF00;"></td>';
}
else if ($pc>1) {
$fullcovers[$urk][] = $fname;
$html .= '<td style="background-color: #00FF00;">'.$str.'</td>';
}
else if ($pc>=0.9) {
示例3: strtoupper
// create HTML content
$html .= '<table cellpadding="2" cellspacing="0" style="font-family:' . $font . ';text-align:center; border-collapse: collapse; ">';
$html .= '<tr><td colspan="18" style="font-family:helvetica;font-weight:bold">' . strtoupper($font) . '</td></tr>';
$html .= '<tr><td colspan="18" style="font-family:helvetica;font-size:8pt;font-weight:bold">' . strtoupper($range) . ' (U+' . $rangestart . '-U+' . $rangeend . ')</td></tr>';
$html .= '<tr><td></td>';
$html .= '<td></td>';
for ($i = 0; $i < 16; $i++) {
$html .= '<td><b>-' . sprintf('%X', $i) . '</b></td>';
}
// print each character
for ($i = 32; $i < $max; ++$i) {
if ($i > 0 and $i % 16 == 0) {
$notthisline = true;
while ($notthisline) {
for ($j = 0; $j < 16; $j++) {
if ($mpdf->_charDefined($cw, $i + $j)) {
//if (isset($cw[($i+$j)])) {
$notthisline = false;
}
}
if ($notthisline) {
if ($showmissing) {
$range = '';
foreach ($unicode_ranges as $urk => $ur) {
if ($i >= $ur['startdec'] && $i <= $ur['enddec']) {
$rangekey = $urk;
$range = $ur['range'];
$rangestart = $ur['starthex'];
$rangeend = $ur['endhex'];
break;
}
示例4:
$html .= '<tr><td colspan="18" style="font-family:helvetica;font-size:8pt;font-weight:bold">'.strtoupper($range).' (U+'.$rangestart .'-U+'.$rangeend.')</td></tr>';
$html .= '<tr><td></td>';
$html .= '<td></td>';
for ($i = 0; $i < 16; $i++) {
$html .= '<td><b>-'.sprintf('%X', $i).'</b></td>';
}
// print each character
for ($i = 32; $i < $max; ++$i) {
if (($i > 0) AND (($i % 16) == 0)) {
$notthisline = true;
while($notthisline) {
for ($j = 0; $j < 16; $j++) {
if ($mpdf->_charDefined($cw, ($i + $j))) {
//if (isset($cw[($i+$j)])) {
$notthisline = false;
}
}
if ($notthisline) {
if ($showmissing) {
$range = '';
foreach($unicode_ranges AS $urk => $ur) {
if ($i >= $ur['startdec'] && $i <= $ur['enddec']) {
$rangekey = $urk;
$range = $ur['range'];
$rangestart = $ur['starthex'];
$rangeend = $ur['endhex'];
break;
}