makeallttffonts.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. //============================================================+
  3. // File name : makeallttffonts.php
  4. // Begin : 2008-12-07
  5. // Last Update : 2010-08-08
  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. * Process all TTF files on current directory to build TCPDF compatible font files.
  43. * @package com.tecnick.tcpdf
  44. * @author Nicola Asuni
  45. * @copyright Copyright &copy; 2004-2009, Nicola Asuni - Tecnick.com S.r.l. - ITALY - www.tecnick.com - info@tecnick.com
  46. * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  47. * @link www.tecnick.com
  48. * @since 2008-12-07
  49. */
  50. /**
  51. */
  52. // read directory for files (only graphics files).
  53. $handle = opendir('.');
  54. while($file = readdir($handle)) {
  55. $path_parts = pathinfo($file);
  56. $file_ext = strtolower($path_parts['extension']);
  57. if ($file_ext == 'ttf') {
  58. exec('./ttf2ufm -a -F '.$path_parts['basename'].'');
  59. exec('php -q makefont.php '.$path_parts['basename'].' '.$path_parts['filename'].'.ufm');
  60. }
  61. }
  62. closedir($handle);
  63. //============================================================+
  64. // END OF FILE
  65. //============================================================+