| @@ -1,200 +1,213 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -/* This script examines your font directory. | |
| 4 | - Point your browser to | |
| 5 | - http://your.domain/your_path_to _mpdf/utils/font_names.php | |
| 6 | - By default this will examine the folder /ttfonts/ (or the default font | |
| 7 | - directory defined by _MPDF_TTFONTPATH. | |
| 8 | - You can optionally define an alternative folder to examine by setting | |
| 9 | - the variable checkdir below (must be a relative path, or filesystem path). | |
| 10 | - You can optionally output just the font samples as a PDF file by setting $pdf=true. | |
| 11 | -*/ | |
| 12 | - | |
| 13 | - | |
| 14 | -$checkdir = ''; | |
| 15 | - | |
| 16 | -$pdf = false; | |
| 17 | - | |
| 18 | -////////////////////////////////// | |
| 19 | -////////////////////////////////// | |
| 20 | -////////////////////////////////// | |
| 21 | - | |
| 22 | -ini_set("memory_limit","256M"); | |
| 23 | - | |
| 24 | -define('_MPDF_PATH','../'); | |
| 25 | - | |
| 26 | -include("../mpdf.php"); | |
| 27 | -$mpdf=new mPDF('s'); | |
| 28 | -$mpdf->useSubstitutions = true; | |
| 29 | -if ($checkdir) { | |
| 30 | - $ttfdir = $checkdir; | |
| 31 | -} | |
| 32 | -else { $ttfdir = _MPDF_TTFONTPATH; } | |
| 33 | - | |
| 34 | -$mqr=ini_get("magic_quotes_runtime"); | |
| 35 | -if ($mqr) { set_magic_quotes_runtime(0); } | |
| 36 | -if (!class_exists('TTFontFile', false)) { include(_MPDF_PATH .'classes/ttfontsuni.php'); } | |
| 37 | -$ttf = new TTFontFile(); | |
| 38 | - | |
| 39 | -$tempfontdata = array(); | |
| 40 | -$tempsansfonts = array(); | |
| 41 | -$tempseriffonts = array(); | |
| 42 | -$tempmonofonts = array(); | |
| 43 | -$tempfonttrans = array(); | |
| 44 | - | |
| 45 | -$ff = scandir($ttfdir); | |
| 46 | - | |
| 47 | -foreach($ff AS $f) { | |
| 48 | - $ret = array(); | |
| 49 | - $isTTC = false; | |
| 50 | - if (strtolower(substr($f,-4,4))=='.ttc' || strtolower(substr($f,-5,5))=='.ttcf') { // Mac ttcf | |
| 51 | - $isTTC = true; | |
| 52 | - $ttf->getTTCFonts($ttfdir.$f); | |
| 53 | - $nf = $ttf->numTTCFonts; | |
| 54 | - for ($i=1; $i<=$nf; $i++) { | |
| 55 | - $ret[] = $ttf->extractCoreInfo($ttfdir.$f, $i); | |
| 56 | - } | |
| 57 | - } | |
| 58 | - else if (strtolower(substr($f,-4,4))=='.ttf' || strtolower(substr($f,-4,4))=='.otf' ) { | |
| 59 | - $ret[] = $ttf->extractCoreInfo($ttfdir.$f); | |
| 60 | - } | |
| 61 | - for ($i=0; $i<count($ret); $i++) { | |
| 62 | - if (!is_array($ret[$i])) { | |
| 63 | - if (!$pdf) echo $ret[$i].'<br />'; | |
| 64 | - } | |
| 65 | - else { | |
| 66 | - $tfname = $ret[$i][0]; | |
| 67 | - $bold = $ret[$i][1]; | |
| 68 | - $italic = $ret[$i][2]; | |
| 69 | - $fname = strtolower($tfname ); | |
| 70 | - $fname = preg_replace('/[ ()]/','',$fname ); | |
| 71 | - $tempfonttrans[$tfname] = $fname; | |
| 72 | - $style = ''; | |
| 73 | - if ($bold) { $style .= 'B'; } | |
| 74 | - if ($italic) { $style .= 'I'; } | |
| 75 | - if (!$style) { $style = 'R'; } | |
| 76 | - $tempfontdata[$fname][$style] = $f; | |
| 77 | - if ($isTTC) { | |
| 78 | - $tempfontdata[$fname]['TTCfontID'][$style] = $ret[$i][4]; | |
| 79 | - } | |
| 80 | - //if ($ret[$i][5]) { $tempfontdata[$fname]['rtl'] = true; } | |
| 81 | - //if ($ret[$i][7]) { $tempfontdata[$fname]['cjk'] = true; } | |
| 82 | - if ($ret[$i][8]) { $tempfontdata[$fname]['sip'] = true; } | |
| 83 | - if ($ret[$i][9]) { $tempfontdata[$fname]['smp'] = true; } | |
| 84 | - | |
| 85 | - $ftype = $ret[$i][3]; // mono, sans or serif | |
| 86 | - if ($ftype=='sans') { $tempsansfonts[] = $fname; } | |
| 87 | - else if ($ftype=='serif') { $tempseriffonts[] = $fname; } | |
| 88 | - else if ($ftype=='mono') { $tempmonofonts[] = $fname; } | |
| 89 | - } | |
| 90 | - } | |
| 91 | - | |
| 92 | -} | |
| 93 | -$tempsansfonts = array_unique($tempsansfonts); | |
| 94 | -$tempseriffonts = array_unique($tempseriffonts ); | |
| 95 | -$tempmonofonts = array_unique($tempmonofonts ); | |
| 96 | -$tempfonttrans = array_unique($tempfonttrans); | |
| 97 | - | |
| 98 | -if (!$pdf) { | |
| 99 | - echo '<h3>Information</h3>'; | |
| 100 | -} | |
| 101 | - | |
| 102 | -foreach ($tempfontdata AS $fname => $v) { | |
| 103 | - if (!isset($tempfontdata[$fname]['R']) || !$tempfontdata[$fname]['R']) { | |
| 104 | - if (!$pdf) echo 'WARNING - Font file for '.$fname.' may be an italic cursive script, or extra-bold etc.<br />'; | |
| 105 | - if (isset($tempfontdata[$fname]['I']) && $tempfontdata[$fname]['I']) { | |
| 106 | - $tempfontdata[$fname]['R'] = $tempfontdata[$fname]['I']; | |
| 107 | - } | |
| 108 | - else if (isset($tempfontdata[$fname]['B']) && $tempfontdata[$fname]['B']) { | |
| 109 | - $tempfontdata[$fname]['R'] = $tempfontdata[$fname]['B']; | |
| 110 | - } | |
| 111 | - else if (isset($tempfontdata[$fname]['BI']) && $tempfontdata[$fname]['BI']) { | |
| 112 | - $tempfontdata[$fname]['R'] = $tempfontdata[$fname]['BI']; | |
| 113 | - } | |
| 114 | - } | |
| 115 | - if (isset($tempfontdata[$fname]['smp']) && $tempfontdata[$fname]['smp']) { | |
| 116 | - if (!$pdf) echo 'INFO - Font file '.$fname.' contains characters in Unicode Plane 1 SMP<br />'; | |
| 117 | - $tempfontdata[$fname]['smp'] = false; | |
| 118 | - } | |
| 119 | - if (isset($tempfontdata[$fname]['sip']) && $tempfontdata[$fname]['sip']) { | |
| 120 | - if (!$pdf) echo 'INFO - Font file '.$fname.' contains characters in Unicode Plane 2 SIP<br />'; | |
| 121 | - if (preg_match('/^(.*)-extb/',$fname, $fm)) { | |
| 122 | - if (isset($tempfontdata[($fm[1])]) && $tempfontdata[($fm[1])]) { | |
| 123 | - $tempfontdata[($fm[1])]['sip-ext'] = $fname; | |
| 124 | - if (!$pdf) echo 'INFO - Font file '.$fname.' has been defined as a CJK ext-B for '.($fm[1]).'<br />'; | |
| 125 | - } | |
| 126 | - else if (isset($tempfontdata[($fm[1].'-exta')]) && $tempfontdata[($fm[1].'-exta')]) { | |
| 127 | - $tempfontdata[($fm[1].'-exta')]['sip-ext'] = $fname; | |
| 128 | - if (!$pdf) echo 'INFO - Font file '.$fname.' has been defined as a CJK ext-B for '.($fm[1].'-exta').'<br />'; | |
| 129 | - } | |
| 130 | - } | |
| 131 | - // else { unset($tempfontdata[$fname]['sip']); } | |
| 132 | - } | |
| 133 | - unset($tempfontdata[$fname]['sip']); | |
| 134 | - unset($tempfontdata[$fname]['smp']); | |
| 135 | -} | |
| 136 | - | |
| 137 | -$mpdf->fontdata = array_merge($tempfontdata ,$mpdf->fontdata); | |
| 138 | - | |
| 139 | - $mpdf->available_unifonts = array(); | |
| 140 | - foreach ($mpdf->fontdata AS $f => $fs) { | |
| 141 | - if (isset($fs['R']) && $fs['R']) { $mpdf->available_unifonts[] = $f; } | |
| 142 | - if (isset($fs['B']) && $fs['B']) { $mpdf->available_unifonts[] = $f.'B'; } | |
| 143 | - if (isset($fs['I']) && $fs['I']) { $mpdf->available_unifonts[] = $f.'I'; } | |
| 144 | - if (isset($fs['BI']) && $fs['BI']) { $mpdf->available_unifonts[] = $f.'BI'; } | |
| 145 | - } | |
| 146 | - | |
| 147 | - $mpdf->default_available_fonts = $mpdf->available_unifonts; | |
| 148 | - | |
| 149 | -if (!$pdf) { | |
| 150 | - echo '<hr />'; | |
| 151 | - echo '<h3>Font names as parsed by mPDF</h3>'; | |
| 152 | -} | |
| 153 | - | |
| 154 | -ksort($tempfonttrans); | |
| 155 | -$html = ''; | |
| 156 | -foreach($tempfonttrans AS $on=>$mn) { | |
| 157 | - if (!file_exists($ttfdir.$mpdf->fontdata[$mn]['R'])) { continue; } | |
| 158 | - $ond = '"'.$on.'"'; | |
| 159 | - $html .= '<p style="font-family:'.$on.';">'.$ond.' font is available as '.$mn; | |
| 160 | - if (isset($mpdf->fontdata[$mn]['sip-ext']) && $mpdf->fontdata[$mn]['sip-ext']) { | |
| 161 | - $html .= '; CJK ExtB: '.$mpdf->fontdata[$mn]['sip-ext']; | |
| 162 | - } | |
| 163 | - $html .= '</p>'; | |
| 164 | -} | |
| 165 | - | |
| 166 | -if ($pdf) { | |
| 167 | - $mpdf->WriteHTML($html); | |
| 168 | - $mpdf->Output(); | |
| 169 | - exit; | |
| 170 | -} | |
| 171 | - | |
| 172 | -foreach($tempfonttrans AS $on=>$mn) { | |
| 173 | - $ond = '"'.$on.'"'; | |
| 174 | - echo '<div style="font-family:\''.$on.'\';">'.$ond.' font is available as '.$mn; | |
| 175 | - if (isset($mpdf->fontdata[$mn]['sip-ext']) && $mpdf->fontdata[$mn]['sip-ext']) { | |
| 176 | - echo '; CJK ExtB: '.$mpdf->fontdata[$mn]['sip-ext']; | |
| 177 | - } | |
| 178 | - echo '</div>'; | |
| 179 | -} | |
| 180 | -echo '<hr />'; | |
| 181 | - | |
| 182 | -echo '<h3>Sample config_fonts.php file</h3>'; | |
| 183 | -echo '<div>Remember to edit the following arrays to place your preferred default first in order:</div>'; | |
| 184 | - | |
| 185 | -echo '<pre>'; | |
| 186 | - | |
| 187 | -ksort($tempfontdata); | |
| 188 | -echo '$this->fontdata = '.var_export($tempfontdata,true).";\n"; | |
| 189 | - | |
| 190 | -sort($tempsansfonts); | |
| 191 | -echo '$this->sans_fonts = array(\''.implode("', '", $tempsansfonts)."');\n"; | |
| 192 | -sort($tempseriffonts); | |
| 193 | -echo '$this->serif_fonts = array(\''.implode("', '", $tempseriffonts)."');\n"; | |
| 194 | -sort($tempmonofonts); | |
| 195 | -echo '$this->mono_fonts = array(\''.implode("', '", $tempmonofonts)."');\n"; | |
| 196 | -echo '</pre>'; | |
| 197 | - | |
| 198 | -exit; | |
| 199 | - | |
| 200 | -?> | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +/* This script examines your font directory. | |
| 4 | + Point your browser to | |
| 5 | + http://your.domain/your_path_to _mpdf/utils/font_names.php | |
| 6 | + By default this will examine the folder /ttfonts/ (or the default font | |
| 7 | + directory defined by _MPDF_TTFONTPATH. | |
| 8 | + You can optionally define an alternative folder to examine by setting | |
| 9 | + the variable checkdir below (must be a relative path, or filesystem path). | |
| 10 | + You can optionally output just the font samples as a PDF file by setting $pdf=true. | |
| 11 | +*/ | |
| 12 | + | |
| 13 | + | |
| 14 | +$checkdir = ''; | |
| 15 | + | |
| 16 | +$pdf = false; | |
| 17 | + | |
| 18 | +////////////////////////////////// | |
| 19 | +////////////////////////////////// | |
| 20 | +////////////////////////////////// | |
| 21 | + | |
| 22 | +ini_set("memory_limit","256M"); | |
| 23 | + | |
| 24 | +define('_MPDF_PATH','../'); | |
| 25 | + | |
| 26 | +include("../mpdf.php"); | |
| 27 | +$mpdf=new mPDF('s'); | |
| 28 | +$mpdf->useSubstitutions = true; | |
| 29 | +if ($checkdir) { | |
| 30 | + $ttfdir = $checkdir; | |
| 31 | +} else { | |
| 32 | + $ttfdir = _MPDF_TTFONTPATH; | |
| 33 | +} | |
| 34 | + | |
| 35 | +$mqr=ini_get("magic_quotes_runtime"); | |
| 36 | +if ($mqr) { set_magic_quotes_runtime(0); } | |
| 37 | +if (!class_exists('TTFontFile_Analysis', false)) { include(_MPDF_PATH .'classes/ttfontsuni_analysis.php'); } | |
| 38 | +$ttf = new TTFontFile_Analysis(); | |
| 39 | + | |
| 40 | +$tempfontdata = array(); | |
| 41 | +$tempsansfonts = array(); | |
| 42 | +$tempseriffonts = array(); | |
| 43 | +$tempmonofonts = array(); | |
| 44 | +$tempfonttrans = array(); | |
| 45 | + | |
| 46 | +$ff = scandir($ttfdir); | |
| 47 | + | |
| 48 | +foreach($ff AS $f) { | |
| 49 | + $ret = array(); | |
| 50 | + $isTTC = false; | |
| 51 | + if (strtolower(substr($f,-4,4))=='.ttc' || strtolower(substr($f,-5,5))=='.ttcf') { // Mac ttcf | |
| 52 | + $isTTC = true; | |
| 53 | + $ttf->getTTCFonts($ttfdir.$f); | |
| 54 | + $nf = $ttf->numTTCFonts; | |
| 55 | + for ($i=1; $i<=$nf; $i++) { | |
| 56 | + $ret[] = $ttf->extractCoreInfo($ttfdir.$f, $i); | |
| 57 | + } | |
| 58 | + } | |
| 59 | + else if (strtolower(substr($f,-4,4))=='.ttf' || strtolower(substr($f,-4,4))=='.otf' ) { | |
| 60 | + $ret[] = $ttf->extractCoreInfo($ttfdir.$f); | |
| 61 | + } | |
| 62 | + for ($i=0; $i<count($ret); $i++) { | |
| 63 | + if (!is_array($ret[$i])) { | |
| 64 | + if (!$pdf) echo $ret[$i].'<br />'; | |
| 65 | + } | |
| 66 | + else { | |
| 67 | + $tfname = $ret[$i][0]; | |
| 68 | + $bold = $ret[$i][1]; | |
| 69 | + $italic = $ret[$i][2]; | |
| 70 | + $fname = strtolower($tfname ); | |
| 71 | + $fname = preg_replace('/[ ()]/','',$fname ); | |
| 72 | + $tempfonttrans[$tfname] = $fname; | |
| 73 | + $style = ''; | |
| 74 | + if ($bold) { $style .= 'B'; } | |
| 75 | + if ($italic) { $style .= 'I'; } | |
| 76 | + if (!$style) { $style = 'R'; } | |
| 77 | + $tempfontdata[$fname][$style] = $f; | |
| 78 | + if ($isTTC) { | |
| 79 | + $tempfontdata[$fname]['TTCfontID'][$style] = $ret[$i][4]; | |
| 80 | + } | |
| 81 | + //if ($ret[$i][5]) { $tempfontdata[$fname]['rtl'] = true; } | |
| 82 | + //if ($ret[$i][7]) { $tempfontdata[$fname]['cjk'] = true; } | |
| 83 | + if ($ret[$i][8]) { $tempfontdata[$fname]['sip'] = true; } | |
| 84 | + if ($ret[$i][9]) { $tempfontdata[$fname]['smp'] = true; } | |
| 85 | + if ($ret[$i][10]) { $tempfontdata[$fname]['puaag'] = true; } | |
| 86 | + if ($ret[$i][11]) { $tempfontdata[$fname]['pua'] = true; } | |
| 87 | + if ($ret[$i][12]) { $tempfontdata[$fname]['unAGlyphs'] = true; } | |
| 88 | + $ftype = $ret[$i][3]; // mono, sans or serif | |
| 89 | + if ($ftype=='sans') { $tempsansfonts[] = $fname; } | |
| 90 | + else if ($ftype=='serif') { $tempseriffonts[] = $fname; } | |
| 91 | + else if ($ftype=='mono') { $tempmonofonts[] = $fname; } | |
| 92 | + } | |
| 93 | + } | |
| 94 | + | |
| 95 | +} | |
| 96 | +$tempsansfonts = array_unique($tempsansfonts); | |
| 97 | +$tempseriffonts = array_unique($tempseriffonts ); | |
| 98 | +$tempmonofonts = array_unique($tempmonofonts ); | |
| 99 | +$tempfonttrans = array_unique($tempfonttrans); | |
| 100 | + | |
| 101 | +if (!$pdf) { | |
| 102 | + echo '<h3>Information</h3>'; | |
| 103 | +} | |
| 104 | + | |
| 105 | +foreach ($tempfontdata AS $fname => $v) { | |
| 106 | + if (!isset($tempfontdata[$fname]['R']) || !$tempfontdata[$fname]['R']) { | |
| 107 | + if (!$pdf) echo 'WARNING - Font file for '.$fname.' may be an italic cursive script, or extra-bold etc.<br />'; | |
| 108 | + if (isset($tempfontdata[$fname]['I']) && $tempfontdata[$fname]['I']) { | |
| 109 | + $tempfontdata[$fname]['R'] = $tempfontdata[$fname]['I']; | |
| 110 | + } | |
| 111 | + else if (isset($tempfontdata[$fname]['B']) && $tempfontdata[$fname]['B']) { | |
| 112 | + $tempfontdata[$fname]['R'] = $tempfontdata[$fname]['B']; | |
| 113 | + } | |
| 114 | + else if (isset($tempfontdata[$fname]['BI']) && $tempfontdata[$fname]['BI']) { | |
| 115 | + $tempfontdata[$fname]['R'] = $tempfontdata[$fname]['BI']; | |
| 116 | + } | |
| 117 | + } | |
| 118 | + if (isset($tempfontdata[$fname]['smp']) && $tempfontdata[$fname]['smp']) { | |
| 119 | + if (!$pdf) echo 'INFO - Font file '.$fname.' contains characters in Unicode Plane 1 SMP<br />'; | |
| 120 | + $tempfontdata[$fname]['smp'] = false; | |
| 121 | + } | |
| 122 | +// if (isset($tempfontdata[$fname]['pua']) && $tempfontdata[$fname]['pua']) { | |
| 123 | +// if (!$pdf) echo 'INFO - Font file '.$fname.' contains characters in Unicode Private Use Area (U+E000-U+F8FF)<br />'; | |
| 124 | +// } | |
| 125 | + if (isset($tempfontdata[$fname]['unAGlyphs']) && $tempfontdata[$fname]['unAGlyphs']) { | |
| 126 | + if (!$pdf) echo 'INFO - Font file '.$fname.' contains non-indexed Arabic Glyphs "unAGlyphs" (which can be mapped to U+F500-U+F7FF)<br />'; | |
| 127 | + if (isset($tempfontdata[$fname]['puaag']) && $tempfontdata[$fname]['puaag']) { | |
| 128 | + if (!$pdf) echo 'WARNING - Font file '.$fname.' already includes mapped characters in the part of Unicode Private Use Area which mPDF uses for mapping non-indexed Arabic Glyphs "unAGlyphs" (U+F500-U+F7FF)<br />'; | |
| 129 | + } | |
| 130 | + } | |
| 131 | + if (isset($tempfontdata[$fname]['sip']) && $tempfontdata[$fname]['sip']) { | |
| 132 | + if (!$pdf) echo 'INFO - Font file '.$fname.' contains characters in Unicode Plane 2 SIP<br />'; | |
| 133 | + if (preg_match('/^(.*)-extb/',$fname, $fm)) { | |
| 134 | + if (isset($tempfontdata[($fm[1])]) && $tempfontdata[($fm[1])]) { | |
| 135 | + $tempfontdata[($fm[1])]['sip-ext'] = $fname; | |
| 136 | + if (!$pdf) echo 'INFO - Font file '.$fname.' has been defined as a CJK ext-B for '.($fm[1]).'<br />'; | |
| 137 | + } | |
| 138 | + else if (isset($tempfontdata[($fm[1].'-exta')]) && $tempfontdata[($fm[1].'-exta')]) { | |
| 139 | + $tempfontdata[($fm[1].'-exta')]['sip-ext'] = $fname; | |
| 140 | + if (!$pdf) echo 'INFO - Font file '.$fname.' has been defined as a CJK ext-B for '.($fm[1].'-exta').'<br />'; | |
| 141 | + } | |
| 142 | + } | |
| 143 | + // else { unset($tempfontdata[$fname]['sip']); } | |
| 144 | + } | |
| 145 | + unset($tempfontdata[$fname]['sip']); | |
| 146 | + unset($tempfontdata[$fname]['smp']); | |
| 147 | + unset($tempfontdata[$fname]['pua']); | |
| 148 | + unset($tempfontdata[$fname]['puaag']); | |
| 149 | + unset($tempfontdata[$fname]['unAGlyphs']); | |
| 150 | +} | |
| 151 | + | |
| 152 | +$mpdf->fontdata = array_merge($tempfontdata ,$mpdf->fontdata); | |
| 153 | + | |
| 154 | + $mpdf->available_unifonts = array(); | |
| 155 | + foreach ($mpdf->fontdata AS $f => $fs) { | |
| 156 | + if (isset($fs['R']) && $fs['R']) { $mpdf->available_unifonts[] = $f; } | |
| 157 | + if (isset($fs['B']) && $fs['B']) { $mpdf->available_unifonts[] = $f.'B'; } | |
| 158 | + if (isset($fs['I']) && $fs['I']) { $mpdf->available_unifonts[] = $f.'I'; } | |
| 159 | + if (isset($fs['BI']) && $fs['BI']) { $mpdf->available_unifonts[] = $f.'BI'; } | |
| 160 | + } | |
| 161 | + | |
| 162 | + $mpdf->default_available_fonts = $mpdf->available_unifonts; | |
| 163 | + | |
| 164 | +if (!$pdf) { | |
| 165 | + echo '<hr />'; | |
| 166 | + echo '<h3>Font names as parsed by mPDF</h3>'; | |
| 167 | +} | |
| 168 | + | |
| 169 | +ksort($tempfonttrans); | |
| 170 | +$html = ''; | |
| 171 | +foreach($tempfonttrans AS $on=>$mn) { | |
| 172 | + if (!file_exists($ttfdir.$mpdf->fontdata[$mn]['R'])) { continue; } | |
| 173 | + $ond = '"'.$on.'"'; | |
| 174 | + $html .= '<p style="font-family:'.$on.';">'.$ond.' font is available as '.$mn; | |
| 175 | + if (isset($mpdf->fontdata[$mn]['sip-ext']) && $mpdf->fontdata[$mn]['sip-ext']) { | |
| 176 | + $html .= '; CJK ExtB: '.$mpdf->fontdata[$mn]['sip-ext']; | |
| 177 | + } | |
| 178 | + $html .= '</p>'; | |
| 179 | +} | |
| 180 | + | |
| 181 | +if ($pdf) { | |
| 182 | + $mpdf->WriteHTML($html); | |
| 183 | + $mpdf->Output(); | |
| 184 | + exit; | |
| 185 | +} | |
| 186 | + | |
| 187 | +foreach($tempfonttrans AS $on=>$mn) { | |
| 188 | + $ond = '"'.$on.'"'; | |
| 189 | + echo '<div style="font-family:\''.$on.'\';">'.$ond.' font is available as '.$mn; | |
| 190 | + if (isset($mpdf->fontdata[$mn]['sip-ext']) && $mpdf->fontdata[$mn]['sip-ext']) { | |
| 191 | + echo '; CJK ExtB: '.$mpdf->fontdata[$mn]['sip-ext']; | |
| 192 | + } | |
| 193 | + echo '</div>'; | |
| 194 | +} | |
| 195 | +echo '<hr />'; | |
| 196 | + | |
| 197 | +echo '<h3>Sample config_fonts.php file</h3>'; | |
| 198 | +echo '<div>Remember to edit the following arrays to place your preferred default first in order:</div>'; | |
| 199 | + | |
| 200 | +echo '<pre>'; | |
| 201 | + | |
| 202 | +ksort($tempfontdata); | |
| 203 | +echo '$this->fontdata = '.var_export($tempfontdata,true).";\n"; | |
| 204 | + | |
| 205 | +sort($tempsansfonts); | |
| 206 | +echo '$this->sans_fonts = array(\''.implode("', '", $tempsansfonts)."');\n"; | |
| 207 | +sort($tempseriffonts); | |
| 208 | +echo '$this->serif_fonts = array(\''.implode("', '", $tempseriffonts)."');\n"; | |
| 209 | +sort($tempmonofonts); | |
| 210 | +echo '$this->mono_fonts = array(\''.implode("', '", $tempmonofonts)."');\n"; | |
| 211 | +echo '</pre>'; | |
| 212 | + | |
| 213 | +exit; | |