12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- $checkdir = '';
- ini_set("memory_limit","256M");
- define('_MPDF_PATH','../');
- include("../mpdf.php");
- $mpdf=new mPDF('');
- if ($checkdir) {
- $ttfdir = $checkdir;
- }
- else { $ttfdir = _MPDF_TTFONTPATH; }
- $mqr=ini_get("magic_quotes_runtime");
- if ($mqr) { set_magic_quotes_runtime(0); }
- if (!class_exists('TTFontFile_Analysis', false)) { include(_MPDF_PATH .'classes/ttfontsuni_analysis.php'); }
- $ttf = new TTFontFile_Analysis();
- $ff = scandir($ttfdir);
- echo '<h3>Font collection files found in '.$ttfdir.' directory</h3>';
- foreach($ff AS $f) {
- $ret = array();
- if (strtolower(substr($f,-4,4))=='.ttc' || strtolower(substr($f,-4,4))=='.ttcf') {
- $ttf->getTTCFonts($ttfdir.$f);
- $nf = $ttf->numTTCFonts;
- echo '<p>Font collection file ('.$f.') contains the following fonts:</p>';
- for ($i=1; $i<=$nf; $i++) {
- $ret = $ttf->extractCoreInfo($ttfdir.$f, $i);
- $tfname = $ret[0];
- $bold = $ret[1];
- $italic = $ret[2];
- $fname = strtolower($tfname );
- $fname = preg_replace('/[ ()]/','',$fname );
- $style = '';
- if ($bold) { $style .= 'Bold'; }
- if ($italic) { $style .= 'Italic'; }
- if (!$style) { $style = 'Regular'; }
- echo '<div>['.$i.'] '.$tfname.' ('.$fname.') '.$style.'</div>';
- }
- echo '<hr />';
- }
- }
- exit;
|