当前位置: 首页>>代码示例>>PHP>>正文


PHP TCPDF_FONTS::arrUTF8ToUTF16BE方法代码示例

本文整理汇总了PHP中TCPDF_FONTS::arrUTF8ToUTF16BE方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF_FONTS::arrUTF8ToUTF16BE方法的具体用法?PHP TCPDF_FONTS::arrUTF8ToUTF16BE怎么用?PHP TCPDF_FONTS::arrUTF8ToUTF16BE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TCPDF_FONTS的用法示例。


在下文中一共展示了TCPDF_FONTS::arrUTF8ToUTF16BE方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCellCode


//.........这里部分代码省略.........
                                     $output[] = $this->replaceChar($ch0, 0xf710);
                                 } elseif (in_array($ch0, $upvowel)) {
                                     // lower left
                                     $output[] = $this->replaceChar($ch0, 0xf701 + $ch0 - 0xe34);
                                 } elseif ($ch0 == 0xe47) {
                                     // lower left mai tai koo
                                     $output[] = $this->replaceChar($ch0, 0xf712);
                                 } else {
                                     // normal character
                                     $output[] = $ch0;
                                 }
                             } elseif (in_array($ch1, $lowtail) and in_array($ch0, $lowvowel)) {
                                 // lower vowel
                                 $output[] = $this->replaceChar($ch0, 0xf718 + $ch0 - 0xe38);
                             } elseif ($ch0 == 0xe0d and in_array($chn, $lowvowel)) {
                                 // yo ying without lower part
                                 $output[] = $this->replaceChar($ch0, 0xf70f);
                             } elseif ($ch0 == 0xe10 and in_array($chn, $lowvowel)) {
                                 // tho santan without lower part
                                 $output[] = $this->replaceChar($ch0, 0xf700);
                             } else {
                                 $output[] = $ch0;
                             }
                         } else {
                             // non-thai character
                             $output[] = $unicode[$i];
                         }
                     }
                     $unicode = $output;
                     // update font subsetchars
                     $this->setFontSubBuffer($this->CurrentFont['fontkey'], 'subsetchars', $this->CurrentFont['subsetchars']);
                 }
                 // end of K_THAI_TOPCHARS
                 $txt2 = TCPDF_FONTS::arrUTF8ToUTF16BE($unicode, false);
             }
         }
         $txt2 = TCPDF_STATIC::_escape($txt2);
         // get current text width (considering general font stretching and spacing)
         $txwidth = $this->GetStringWidth($txt);
         $width = $txwidth;
         // check for stretch mode
         if ($stretch > 0) {
             // calculate ratio between cell width and text width
             if ($width <= 0) {
                 $ratio = 1;
             } else {
                 $ratio = ($w - $this->cell_padding['L'] - $this->cell_padding['R']) / $width;
             }
             // check if stretching is required
             if ($ratio < 1 or $ratio > 1 and $stretch % 2 == 0) {
                 // the text will be stretched to fit cell width
                 if ($stretch > 2) {
                     // set new character spacing
                     $this->font_spacing += ($w - $this->cell_padding['L'] - $this->cell_padding['R'] - $width) / (max($this->GetNumChars($txt) - 1, 1) * ($this->font_stretching / 100));
                 } else {
                     // set new horizontal stretching
                     $this->font_stretching *= $ratio;
                 }
                 // recalculate text width (the text fills the entire cell)
                 $width = $w - $this->cell_padding['L'] - $this->cell_padding['R'];
                 // reset alignment
                 $align = '';
             }
         }
         if ($this->font_stretching != 100) {
             // apply font stretching
开发者ID:TheTypoMaster,项目名称:myapps,代码行数:67,代码来源:tcpdf.php

示例2: getCellCode


//.........这里部分代码省略.........
             default:
                 if ($this->rtl) {
                     $dx = $this->cell_padding['R'];
                 } else {
                     $dx = $this->cell_padding['L'];
                 }
                 break;
         }
         if ($this->rtl) {
             $xdx = $x - $dx - $width;
         } else {
             $xdx = $x + $dx;
         }
         $xdk = $xdx * $k;
         // print text
         $s .= sprintf('BT %F %F Td [(%s)] TJ ET', $xdk, ($this->h - $basefonty) * $k, $txt2);
         if (isset($uniblock)) {
             // print overlapping characters as separate string
             $xshift = 0;
             // horizontal shift
             $ty = ($this->h - $basefonty + 0.2 * $this->FontSize) * $k;
             $spw = ($w - $txwidth - $this->cell_padding['L'] - $this->cell_padding['R']) / ($ns ? $ns : 1);
             foreach ($uniblock as $uk => $uniarr) {
                 if ($uk % 2 == 0) {
                     // x space to skip
                     if ($spacewidth != 0) {
                         // justification shift
                         $xshift += count(array_keys($uniarr, 32)) * $spw;
                     }
                     $xshift += $this->GetArrStringWidth($uniarr);
                     // + shift justification
                 } else {
                     // character to print
                     $topchr = TCPDF_FONTS::arrUTF8ToUTF16BE($uniarr, false);
                     $topchr = TCPDF_STATIC::_escape($topchr);
                     $s .= sprintf(' BT %F %F Td [(%s)] TJ ET', $xdk + $xshift * $k, $ty, $topchr);
                 }
             }
         }
         if ($this->underline) {
             $s .= ' ' . $this->_dounderlinew($xdx, $basefonty, $width);
         }
         if ($this->linethrough) {
             $s .= ' ' . $this->_dolinethroughw($xdx, $basefonty, $width);
         }
         if ($this->overline) {
             $s .= ' ' . $this->_dooverlinew($xdx, $basefonty, $width);
         }
         if ($this->ColorFlag and $this->textrendermode < 4) {
             $s .= ' Q';
         }
         if ($link) {
             $this->Link($xdx, $yt, $width, $this->FontAscent + $this->FontDescent, $link, $ns);
         }
     }
     // output cell
     if ($s) {
         // output cell
         $rs .= $s;
         if ($this->font_spacing != 0) {
             // reset font spacing mode
             $rs .= ' BT 0 Tc ET';
         }
         if ($this->font_stretching != 100) {
             // reset font stretching mode
             $rs .= ' BT 100 Tz ET';
开发者ID:bochniak,项目名称:lms-1,代码行数:67,代码来源:tcpdf.php


注:本文中的TCPDF_FONTS::arrUTF8ToUTF16BE方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。