296 |
aurelien |
1 |
<?php
|
|
|
2 |
//============================================================+
|
|
|
3 |
// File name : makeallttffonts.php
|
|
|
4 |
// Begin : 2008-12-07
|
|
|
5 |
// Last Update : 2010-12-03
|
|
|
6 |
//
|
|
|
7 |
// Description : Process all TTF files on current directory to
|
|
|
8 |
// build TCPDF compatible font files.
|
|
|
9 |
//
|
|
|
10 |
// Author: Nicola Asuni
|
|
|
11 |
//
|
|
|
12 |
// (c) Copyright:
|
|
|
13 |
// Nicola Asuni
|
|
|
14 |
// Tecnick.com S.r.l.
|
|
|
15 |
// Via della Pace, 11
|
|
|
16 |
// 09044 Quartucciu (CA)
|
|
|
17 |
// ITALY
|
|
|
18 |
// www.tecnick.com
|
|
|
19 |
// info@tecnick.com
|
|
|
20 |
//
|
|
|
21 |
// License:
|
|
|
22 |
// Copyright (C) 2004-2010 Nicola Asuni - Tecnick.com S.r.l.
|
|
|
23 |
//
|
|
|
24 |
// This file is part of TCPDF software library.
|
|
|
25 |
//
|
|
|
26 |
// TCPDF is free software: you can redistribute it and/or modify it
|
|
|
27 |
// under the terms of the GNU Lesser General Public License as
|
|
|
28 |
// published by the Free Software Foundation, either version 3 of the
|
|
|
29 |
// License, or (at your option) any later version.
|
|
|
30 |
//
|
|
|
31 |
// TCPDF is distributed in the hope that it will be useful, but
|
|
|
32 |
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
33 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
34 |
// See the GNU Lesser General Public License for more details.
|
|
|
35 |
//
|
|
|
36 |
// You should have received a copy of the GNU Lesser General Public License
|
|
|
37 |
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
|
|
38 |
//
|
|
|
39 |
// See LICENSE.TXT file for more information.
|
|
|
40 |
//============================================================+
|
|
|
41 |
|
|
|
42 |
/**
|
|
|
43 |
* Process all TTF files on current directory to build TCPDF compatible font files.
|
|
|
44 |
* @package com.tecnick.tcpdf
|
|
|
45 |
* @author Nicola Asuni
|
|
|
46 |
* @copyright Copyright © 2004-2009, Nicola Asuni - Tecnick.com S.r.l. - ITALY - www.tecnick.com - info@tecnick.com
|
|
|
47 |
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
|
|
48 |
* @link www.tecnick.com
|
|
|
49 |
* @since 2008-12-07
|
|
|
50 |
*/
|
|
|
51 |
|
|
|
52 |
/**
|
|
|
53 |
*/
|
|
|
54 |
|
|
|
55 |
// read directory for files (only TTF files).
|
|
|
56 |
$handle = opendir('.');
|
|
|
57 |
while ($file = readdir($handle)) {
|
|
|
58 |
$path_parts = pathinfo($file);
|
|
|
59 |
if (isset($path_parts['extension']) AND (strtoupper($path_parts['extension']) === 'TTF')) {
|
|
|
60 |
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
|
61 |
// windows
|
|
|
62 |
exec('ttf2ufm.exe -a -F '.$path_parts['basename']);
|
|
|
63 |
} else {
|
|
|
64 |
// linux
|
|
|
65 |
exec('./ttf2ufm -a -F '.$path_parts['basename']);
|
|
|
66 |
}
|
|
|
67 |
exec('php -q makefont.php '.$path_parts['basename'].' '.$path_parts['filename'].'.ufm');
|
|
|
68 |
}
|
|
|
69 |
}
|
|
|
70 |
closedir($handle);
|
|
|
71 |
|
|
|
72 |
//============================================================+
|
|
|
73 |
// END OF FILE
|
|
|
74 |
//============================================================+
|