aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/libraries/mpdf/utils/font_collections.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/3rdparty/libraries/mpdf/utils/font_collections.php')
-rw-r--r--inc/3rdparty/libraries/mpdf/utils/font_collections.php72
1 files changed, 72 insertions, 0 deletions
diff --git a/inc/3rdparty/libraries/mpdf/utils/font_collections.php b/inc/3rdparty/libraries/mpdf/utils/font_collections.php
new file mode 100644
index 00000000..20f387ef
--- /dev/null
+++ b/inc/3rdparty/libraries/mpdf/utils/font_collections.php
@@ -0,0 +1,72 @@
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
21ini_set("memory_limit","256M");
22
23
24define('_MPDF_PATH','../');
25
26include("../mpdf.php");
27$mpdf=new mPDF('');
28if ($checkdir) {
29 $ttfdir = $checkdir;
30}
31else { $ttfdir = _MPDF_TTFONTPATH; }
32
33
34
35$mqr=ini_get("magic_quotes_runtime");
36if ($mqr) { set_magic_quotes_runtime(0); }
37if (!class_exists('TTFontFile_Analysis', false)) { include(_MPDF_PATH .'classes/ttfontsuni_analysis.php'); }
38$ttf = new TTFontFile_Analysis();
39
40$ff = scandir($ttfdir);
41
42echo '<h3>Font collection files found in '.$ttfdir.' directory</h3>';
43foreach($ff AS $f) {
44 $ret = array();
45 if (strtolower(substr($f,-4,4))=='.ttc' || strtolower(substr($f,-4,4))=='.ttcf') { // Mac ttcf
46 $ttf->getTTCFonts($ttfdir.$f);
47 $nf = $ttf->numTTCFonts;
48 echo '<p>Font collection file ('.$f.') contains the following fonts:</p>';
49 for ($i=1; $i<=$nf; $i++) {
50 $ret = $ttf->extractCoreInfo($ttfdir.$f, $i);
51 $tfname = $ret[0];
52 $bold = $ret[1];
53 $italic = $ret[2];
54 $fname = strtolower($tfname );
55 $fname = preg_replace('/[ ()]/','',$fname );
56 $style = '';
57 if ($bold) { $style .= 'Bold'; }
58 if ($italic) { $style .= 'Italic'; }
59 if (!$style) { $style = 'Regular'; }
60
61
62 echo '<div>['.$i.'] '.$tfname.' ('.$fname.') '.$style.'</div>';
63
64 }
65 echo '<hr />';
66 }
67}
68
69
70exit;
71
72?> \ No newline at end of file