PluginProbe
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin / 2.4.4
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin v2.4.4
trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 All 71 releases
pdf-print / mpdf / utils / font_collections.php

font_collections.php in PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin 2.4.4, at mpdf/utils/font_collections.php

72 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /* This script prints out details of any TrueType collection font files
4 in your font directory. Files ending wih .otc are examined.
5 Point your browser to
6 http://your.domain/your_path_to _mpdf/utils/font_collections.php
7 By default this will examine the folder /ttfonts/ (or the default font
8 directory defined by _MPDF_TTFONTPATH.
9 You can optionally define an alternative folder to examine by setting
10 the variable below (must be a relative path, or filesystem path):
11 */
12
13
14 $checkdir = '';
15
16
17 //////////////////////////////////
18 //////////////////////////////////
19 //////////////////////////////////
20
21 ini_set("memory_limit","256M");
22
23
24 define('_MPDF_PATH','../');
25
26 include("../mpdf.php");
27 $mpdf=new mPDF('');
28 if ($checkdir) {
29 $ttfdir = $checkdir;
30 } else {
31 $ttfdir = _MPDF_TTFONTPATH;
32 }
33
34
35
36 $mqr=ini_get("magic_quotes_runtime");
37 if ($mqr) { set_magic_quotes_runtime(0); }
38 if (!class_exists('TTFontFile_Analysis', false)) { include(_MPDF_PATH .'classes/ttfontsuni_analysis.php'); }
39 $ttf = new TTFontFile_Analysis();
40
41 $ff = scandir($ttfdir);
42
43 echo '<h3>Font collection files found in '.$ttfdir.' directory</h3>';
44 foreach($ff AS $f) {
45 $ret = array();
46 if (strtolower(substr($f,-4,4))=='.ttc' || strtolower(substr($f,-4,4))=='.ttcf') { // Mac ttcf
47 $ttf->getTTCFonts($ttfdir.$f);
48 $nf = $ttf->numTTCFonts;
49 echo '<p>Font collection file ('.$f.') contains the following fonts:</p>';
50 for ($i=1; $i<=$nf; $i++) {
51 $ret = $ttf->extractCoreInfo($ttfdir.$f, $i);
52 $tfname = $ret[0];
53 $bold = $ret[1];
54 $italic = $ret[2];
55 $fname = strtolower($tfname );
56 $fname = preg_replace('/[ ()]/','',$fname );
57 $style = '';
58 if ($bold) { $style .= 'Bold'; }
59 if ($italic) { $style .= 'Italic'; }
60 if (!$style) { $style = 'Regular'; }
61
62
63 echo '<div>['.$i.'] '.$tfname.' ('.$fname.') '.$style.'</div>';
64
65 }
66 echo '<hr />';
67 }
68 }
69
70
71 exit;
72