本文整理汇总了PHP中TCPDF_FONTS::UniArrSubString方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF_FONTS::UniArrSubString方法的具体用法?PHP TCPDF_FONTS::UniArrSubString怎么用?PHP TCPDF_FONTS::UniArrSubString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF_FONTS
的用法示例。
在下文中一共展示了TCPDF_FONTS::UniArrSubString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Write
//.........这里部分代码省略.........
// character position
$j = 0;
// current starting position
$sep = -1;
// position of the last blank space
$shy = false;
// true if the last blank is a soft hypen (SHY)
$l = 0;
// current string length
$nl = 0;
//number of lines
$linebreak = false;
$pc = 0;
// previous character
// for each character
while ($i < $nb) {
if ($maxh > 0 and $this->y >= $maxy) {
break;
}
//Get the current character
$c = $chars[$i];
if ($c == 10) {
// 10 = "\n" = new line
//Explicit line break
if ($align == 'J') {
if ($this->rtl) {
$talign = 'R';
} else {
$talign = 'L';
}
} else {
$talign = $align;
}
$tmpstr = TCPDF_FONTS::UniArrSubString($uchars, $j, $i);
if ($firstline) {
$startx = $this->x;
$tmparr = array_slice($chars, $j, $i - $j);
if ($rtlmode) {
$tmparr = TCPDF_FONTS::utf8Bidi($tmparr, $tmpstr, $this->tmprtl, $this->isunicode, $this->CurrentFont);
}
$linew = $this->GetArrStringWidth($tmparr);
unset($tmparr);
if ($this->rtl) {
$this->endlinex = $startx - $linew;
} else {
$this->endlinex = $startx + $linew;
}
$w = $linew;
$tmpcellpadding = $this->cell_padding;
if ($maxh == 0) {
$this->SetCellPadding(0);
}
}
if ($firstblock and $this->isRTLTextDir()) {
$tmpstr = $this->stringRightTrim($tmpstr);
}
// Skip newlines at the begining of a page or column
if (!empty($tmpstr) or $this->y < $this->PageBreakTrigger - $row_height) {
$this->Cell($w, $h, $tmpstr, 0, 1, $talign, $fill, $link, $stretch);
}
unset($tmpstr);
if ($firstline) {
$this->cell_padding = $tmpcellpadding;
return TCPDF_FONTS::UniArrSubString($uchars, $i);
}
++$nl;