當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。