本文整理汇总了PHP中TCPDF_STATIC::removeSHY方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF_STATIC::removeSHY方法的具体用法?PHP TCPDF_STATIC::removeSHY怎么用?PHP TCPDF_STATIC::removeSHY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF_STATIC
的用法示例。
在下文中一共展示了TCPDF_STATIC::removeSHY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCellCode
/**
* Returns the PDF string code to print a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.<br />
* If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.
* @param $w (float) Cell width. If 0, the cell extends up to the right margin.
* @param $h (float) Cell height. Default value: 0.
* @param $txt (string) String to print. Default value: empty string.
* @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
* @param $ln (int) Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right (or left for RTL languages)</li><li>1: to the beginning of the next line</li><li>2: below</li></ul>Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
* @param $align (string) Allows to center or align the text. Possible values are:<ul><li>L or empty string: left align (default value)</li><li>C: center</li><li>R: right align</li><li>J: justify</li></ul>
* @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false).
* @param $link (mixed) URL or identifier returned by AddLink().
* @param $stretch (int) font stretch mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if text is larger than cell width</li><li>2 = forced horizontal scaling to fit cell width</li><li>3 = character spacing only if text is larger than cell width</li><li>4 = forced character spacing to fit cell width</li></ul> General font stretching and scaling values will be preserved when possible.
* @param $ignore_min_height (boolean) if true ignore automatic minimum height value.
* @param $calign (string) cell vertical alignment relative to the specified Y value. Possible values are:<ul><li>T : cell top</li><li>C : center</li><li>B : cell bottom</li><li>A : font top</li><li>L : font baseline</li><li>D : font bottom</li></ul>
* @param $valign (string) text vertical alignment inside the cell. Possible values are:<ul><li>T : top</li><li>M : middle</li><li>B : bottom</li></ul>
* @return string containing cell code
* @protected
* @since 1.0
* @see Cell()
*/
protected function getCellCode($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M')
{
// replace 'NO-BREAK SPACE' (U+00A0) character with a simple space
$txt = str_replace(TCPDF_FONTS::unichr(160, $this->isunicode), ' ', $txt);
$prev_cell_margin = $this->cell_margin;
$prev_cell_padding = $this->cell_padding;
$txt = TCPDF_STATIC::removeSHY($txt, $this->isunicode);
$rs = '';
//string to be returned
$this->adjustCellPadding($border);
if (!$ignore_min_height) {
$min_cell_height = $this->FontSize * $this->cell_height_ratio + $this->cell_padding['T'] + $this->cell_padding['B'];
if ($h < $min_cell_height) {
$h = $min_cell_height;
}
}
$k = $this->k;
// check page for no-write regions and adapt page margins if necessary
list($this->x, $this->y) = $this->checkPageRegions($h, $this->x, $this->y);
if ($this->rtl) {
$x = $this->x - $this->cell_margin['R'];
} else {
$x = $this->x + $this->cell_margin['L'];
}
$y = $this->y + $this->cell_margin['T'];
$prev_font_stretching = $this->font_stretching;
$prev_font_spacing = $this->font_spacing;
// cell vertical alignment
switch ($calign) {
case 'A':
// font top
switch ($valign) {
case 'T':
// top
$y -= $this->cell_padding['T'];
break;
case 'B':
// bottom
$y -= $h - $this->cell_padding['B'] - $this->FontAscent - $this->FontDescent;
break;
default:
case 'C':
case 'M':
// center
$y -= ($h - $this->FontAscent - $this->FontDescent) / 2;
break;
}
break;
case 'L':
// font baseline
switch ($valign) {
case 'T':
// top
$y -= $this->cell_padding['T'] + $this->FontAscent;
break;
case 'B':
// bottom
$y -= $h - $this->cell_padding['B'] - $this->FontDescent;
break;
default:
case 'C':
case 'M':
// center
$y -= ($h + $this->FontAscent - $this->FontDescent) / 2;
break;
}
break;
case 'D':
// font bottom
switch ($valign) {
case 'T':
// top
$y -= $this->cell_padding['T'] + $this->FontAscent + $this->FontDescent;
break;
case 'B':
// bottom
$y -= $h - $this->cell_padding['B'];
break;
default:
case 'C':
//.........这里部分代码省略.........
示例2: getCellCode
/**
* Returns the PDF string code to print a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.<br />
* If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.
* @param $w (float) Cell width. If 0, the cell extends up to the right margin.
* @param $h (float) Cell height. Default value: 0.
* @param $txt (string) String to print. Default value: empty string.
* @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
* @param $ln (int) Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right (or left for RTL languages)</li><li>1: to the beginning of the next line</li><li>2: below</li></ul>Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
* @param $align (string) Allows to center or align the text. Possible values are:<ul><li>L or empty string: left align (default value)</li><li>C: center</li><li>R: right align</li><li>J: justify</li></ul>
* @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false).
* @param $link (mixed) URL or identifier returned by AddLink().
* @param $stretch (int) font stretch mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if text is larger than cell width</li><li>2 = forced horizontal scaling to fit cell width</li><li>3 = character spacing only if text is larger than cell width</li><li>4 = forced character spacing to fit cell width</li></ul> General font stretching and scaling values will be preserved when possible.
* @param $ignore_min_height (boolean) if true ignore automatic minimum height value.
* @param $calign (string) cell vertical alignment relative to the specified Y value. Possible values are:<ul><li>T : cell top</li><li>C : center</li><li>B : cell bottom</li><li>A : font top</li><li>L : font baseline</li><li>D : font bottom</li></ul>
* @param $valign (string) text vertical alignment inside the cell. Possible values are:<ul><li>T : top</li><li>M : middle</li><li>B : bottom</li></ul>
* @return string containing cell code
* @protected
* @since 1.0
* @see Cell()
*/
protected function getCellCode($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M')
{
// replace 'NO-BREAK SPACE' (U+00A0) character with a simple space
$txt = str_replace(TCPDF_FONTS::unichr(160, $this->isunicode), ' ', $txt);
$prev_cell_margin = $this->cell_margin;
$prev_cell_padding = $this->cell_padding;
$txt = TCPDF_STATIC::removeSHY($txt, $this->isunicode);
$rs = '';
//string to be returned
$this->adjustCellPadding($border);
if (!$ignore_min_height) {
$min_cell_height = $this->getCellHeight($this->FontSize);
if ($h < $min_cell_height) {
$h = $min_cell_height;
}
}
$k = $this->k;
// check page for no-write regions and adapt page margins if necessary
list($this->x, $this->y) = $this->checkPageRegions($h, $this->x, $this->y);
if ($this->rtl) {
$x = $this->x - $this->cell_margin['R'];
} else {
$x = $this->x + $this->cell_margin['L'];
}
$y = $this->y + $this->cell_margin['T'];
$prev_font_stretching = $this->font_stretching;
$prev_font_spacing = $this->font_spacing;
// cell vertical alignment
switch ($calign) {
case 'A':
// font top
switch ($valign) {
case 'T':
// top
$y -= $this->cell_padding['T'];
break;
case 'B':
// bottom
$y -= $h - $this->cell_padding['B'] - $this->FontAscent - $this->FontDescent;
break;
default:
case 'C':
case 'M':
// center
$y -= ($h - $this->FontAscent - $this->FontDescent) / 2;
break;
}
break;
case 'L':
// font baseline
switch ($valign) {
case 'T':
// top
$y -= $this->cell_padding['T'] + $this->FontAscent;
break;
case 'B':
// bottom
$y -= $h - $this->cell_padding['B'] - $this->FontDescent;
break;
default:
case 'C':
case 'M':
// center
$y -= ($h + $this->FontAscent - $this->FontDescent) / 2;
break;
}
break;
case 'D':
// font bottom
switch ($valign) {
case 'T':
// top
$y -= $this->cell_padding['T'] + $this->FontAscent + $this->FontDescent;
break;
case 'B':
// bottom
$y -= $h - $this->cell_padding['B'];
break;
default:
case 'C':
//.........这里部分代码省略.........