Font collection files found in '.$ttfdir.' directory'; 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 '
Font collection file ('.$f.') contains the following fonts:
'; 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 '