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') {
        // Mac 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);
Esempio n. 2
0
            }
        }
    }
}
// loads array $unicode_ranges
include 'UnicodeRanges.php';
//==============================================================
$html = '<html><head><style>td { border: 0.1mm solid #555555; } 
body { font-weight: normal; font-family: helvetica;font-size:8pt; }
td { font-family: helvetica;font-size:8pt; vertical-align: top;}
</style></head><body>';
//==============================================================
$ff = scandir($ttfdir);
$tempfontdata = array();
foreach ($ff as $f) {
    $ttf = new TTFontFile_Analysis();
    $ret = array();
    $isTTC = false;
    if (strtolower(substr($f, -4, 4)) == '.ttf' || strtolower(substr($f, -4, 4)) == '.otf') {
        $ret[] = $ttf->extractCoreInfo($ttfdir . $f);
    }
    for ($i = 0; $i < count($ret); $i++) {
        if (is_array($ret[$i])) {
            $tfname = $ret[$i][0];
            $bold = $ret[$i][1];
            $italic = $ret[$i][2];
            $fname = strtolower($tfname);
            $fname = preg_replace('/[ ()]/', '', $fname);
            //$tempfonttrans[$tfname] = $fname;
            $style = '';
            if ($bold) {