6.0.016 (2013-05-15)

- The tcpdf_addfont.php tool was improved (thanks to Remi Collet).
This commit is contained in:
nicolaasuni 2013-05-15 16:30:05 +01:00
parent 39528a1441
commit 7424ac0d45
7 changed files with 45 additions and 21 deletions

View File

@ -1,4 +1,7 @@
6.0.015 (2013-04-14)
6.0.016 (2013-05-15)
- The tcpdf_addfont.php tool was improved (thanks to Remi Collet).
6.0.015 (2013-05-14)
- Some unused vars were removed from AddFont() method.
- Some directories were moved inside the examples directory.
- All examples were updated to reflect the new default structure.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 6.0.015
Release date: 2013-05-14
Version: 6.0.016
Release date: 2013-05-15
Author: Nicola Asuni
Copyright (c) 2002-2013:

View File

@ -1,6 +1,6 @@
{
"name": "tecnick.com/tcpdf",
"version": "6.0.015",
"version": "6.0.016",
"homepage": "http://www.tcpdf.org/",
"type": "library",
"description": "TCPDF is a PHP class for generating PDF documents.",

View File

@ -58,7 +58,7 @@ class TCPDF_FONTS {
* @param $encid (int) Encoding ID for CMAP table to extract (when building a Unicode font for Windows this value should be 1, for Macintosh should be 0). When Platform ID is 3, legal values for Encoding ID are: 0=Symbol, 1=Unicode, 2=ShiftJIS, 3=PRC, 4=Big5, 5=Wansung, 6=Johab, 7=Reserved, 8=Reserved, 9=Reserved, 10=UCS-4.
* @param $addcbbox (boolean) If true includes the character bounding box information on the php font file.
* @param $link (boolean) If true link to system font instead of copying the font data (not transportable) - Note: do not work with Type1 fonts.
* @return (string) TCPDF font name.
* @return (string) TCPDF font name or boolean false in case of error.
* @author Nicola Asuni
* @since 5.9.123 (2010-09-30)
* @public static

View File

@ -55,7 +55,7 @@ class TCPDF_STATIC {
* Current TCPDF version.
* @private static
*/
private static $tcpdf_version = '6.0.015';
private static $tcpdf_version = '6.0.016';
/**
* String alias for total number of pages.

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 6.0.015
// Version : 6.0.016
// Begin : 2002-08-03
// Last Update : 2013-05-13
// Last Update : 2013-05-15
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@ -139,7 +139,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 6.0.015
* @version 6.0.016
*/
// Load main configuration file only if the K_TCPDF_EXTERNAL_CONFIG constant is set to false.
@ -178,7 +178,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.php');
* TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br>
* @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions.
* @version 6.0.015
* @version 6.0.016
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF {

View File

@ -2,10 +2,11 @@
<?php
//============================================================+
// File name : tcpdf_addfont.php
// Version : 1.0.000
// Version : 1.0.001
// Begin : 2013-05-13
// Last Update : 2013-05-14
// Last Update : 2013-05-15
// Authors : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// Remi Collet
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
// Copyright (C) 2011-2013 Nicola Asuni - Tecnick.com LTD
@ -42,7 +43,7 @@
if (php_sapi_name() != 'cli') {
echo 'You need to run this command from console.';
exit();
exit(1);
}
// Include the main TCPDF library (search the library on the following directories).
@ -187,7 +188,10 @@ foreach ($inopt as $opt => $val) {
}
case 'o':
case 'outpath': {
$options['outpath'] = $val;
$options['outpath'] = realpath($val);
if (substr($options['outpath'], -1) != '/') {
$options['outpath'] .= '/';
}
break;
}
case 'p':
@ -225,24 +229,41 @@ foreach ($inopt as $opt => $val) {
} // end of while loop
if (empty($options['fonts'])) {
die("ERROR: missing input fonts (try --help for usage)\n");
echo "ERROR: missing input fonts (try --help for usage)\n\n";
exit(2);
}
// check the output path
if (!is_dir($options['outpath']) OR !is_writable($options['outpath'])) {
die("ERROR: Can't write to ".$options['outpath']."\n");
echo "ERROR: Can't write to ".$options['outpath']."\n\n";
exit(3);
}
echo "*** Converting fonts for TCPDF ***\n\n";
echo "\n>>> Converting fonts for TCPDF:\n";
echo '--- Output dir set to '.$options['outpath']."\n\n";
echo '*** Output dir set to '.$options['outpath']."\n";
foreach ($options['fonts'] as $fontfile) {
// check if there are conversion errors
$errors = false;
foreach ($options['fonts'] as $font) {
$fontfile = realpath($font);
$fontname = TCPDF_FONTS::addTTFfont($fontfile, $options['type'], $options['enc'], $options['flags'], $options['outpath'], $options['platid'], $options['encid'], $options['addcbbox'], $options['link']);
echo ">>> ".$fontfile.' added as '.$fontname."\n";
if ($fontname === false) {
$errors = true;
echo "--- ERROR: can't add ".$font."\n";
} else {
echo "+++ OK : ".$fontfile.' added as '.$fontname."\n";
}
}
echo "\n";
if ($errors) {
echo "--- Process completed with ERRORS!\n\n";
exit(4);
}
echo ">>> Process successfully completed!\n\n";
exit(0);
//============================================================+
// END OF FILE