當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TCPDF_STATIC::set_mqr方法代碼示例

本文整理匯總了PHP中TCPDF_STATIC::set_mqr方法的典型用法代碼示例。如果您正苦於以下問題:PHP TCPDF_STATIC::set_mqr方法的具體用法?PHP TCPDF_STATIC::set_mqr怎麽用?PHP TCPDF_STATIC::set_mqr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TCPDF_STATIC的用法示例。


在下文中一共展示了TCPDF_STATIC::set_mqr方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _putfonts

 /**
  * Output fonts.
  * @author Nicola Asuni
  * @protected
  */
 protected function _putfonts()
 {
     $nf = $this->n;
     foreach ($this->diffs as $diff) {
         //Encodings
         $this->_newobj();
         $this->_out('<< /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [' . $diff . '] >>' . "\n" . 'endobj');
     }
     $mqr = TCPDF_STATIC::get_mqr();
     TCPDF_STATIC::set_mqr(false);
     foreach ($this->FontFiles as $file => $info) {
         // search and get font file to embedd
         $fontfile = TCPDF_FONTS::getFontFullPath($file, $info['fontdir']);
         if (!TCPDF_STATIC::empty_string($fontfile)) {
             $font = file_get_contents($fontfile);
             $compressed = substr($file, -2) == '.z';
             if (!$compressed and isset($info['length2'])) {
                 $header = ord($font[0]) == 128;
                 if ($header) {
                     // strip first binary header
                     $font = substr($font, 6);
                 }
                 if ($header and ord($font[$info['length1']]) == 128) {
                     // strip second binary header
                     $font = substr($font, 0, $info['length1']) . substr($font, $info['length1'] + 6);
                 }
             } elseif ($info['subset'] and (!$compressed or $compressed and function_exists('gzcompress'))) {
                 if ($compressed) {
                     // uncompress font
                     $font = gzuncompress($font);
                 }
                 // merge subset characters
                 $subsetchars = array();
                 // used chars
                 foreach ($info['fontkeys'] as $fontkey) {
                     $fontinfo = $this->getFontBuffer($fontkey);
                     $subsetchars += $fontinfo['subsetchars'];
                 }
                 // rebuild a font subset
                 $font = TCPDF_FONTS::_getTrueTypeFontSubset($font, $subsetchars);
                 // calculate new font length
                 $info['length1'] = strlen($font);
                 if ($compressed) {
                     // recompress font
                     $font = gzcompress($font);
                 }
             }
             $this->_newobj();
             $this->FontFiles[$file]['n'] = $this->n;
             $stream = $this->_getrawstream($font);
             $out = '<< /Length ' . strlen($stream);
             if ($compressed) {
                 $out .= ' /Filter /FlateDecode';
             }
             $out .= ' /Length1 ' . $info['length1'];
             if (isset($info['length2'])) {
                 $out .= ' /Length2 ' . $info['length2'] . ' /Length3 0';
             }
             $out .= ' >>';
             $out .= ' stream' . "\n" . $stream . "\n" . 'endstream';
             $out .= "\n" . 'endobj';
             $this->_out($out);
         }
     }
     TCPDF_STATIC::set_mqr($mqr);
     foreach ($this->fontkeys as $k) {
         //Font objects
         $font = $this->getFontBuffer($k);
         $type = $font['type'];
         $name = $font['name'];
         if ($type == 'core') {
             // standard core font
             $out = $this->_getobj($this->font_obj_ids[$k]) . "\n";
             $out .= '<</Type /Font';
             $out .= ' /Subtype /Type1';
             $out .= ' /BaseFont /' . $name;
             $out .= ' /Name /F' . $font['i'];
             if (strtolower($name) != 'symbol' and strtolower($name) != 'zapfdingbats') {
                 $out .= ' /Encoding /WinAnsiEncoding';
             }
             if ($k == 'helvetica') {
                 // add default font for annotations
                 $this->annotation_fonts[$k] = $font['i'];
             }
             $out .= ' >>';
             $out .= "\n" . 'endobj';
             $this->_out($out);
         } elseif ($type == 'Type1' or $type == 'TrueType') {
             // additional Type1 or TrueType font
             $out = $this->_getobj($this->font_obj_ids[$k]) . "\n";
             $out .= '<</Type /Font';
             $out .= ' /Subtype /' . $type;
             $out .= ' /BaseFont /' . $name;
             $out .= ' /Name /F' . $font['i'];
             $out .= ' /FirstChar 32 /LastChar 255';
//.........這裏部分代碼省略.........
開發者ID:TheTypoMaster,項目名稱:myapps,代碼行數:101,代碼來源:tcpdf.php


注:本文中的TCPDF_STATIC::set_mqr方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。