mirror of
https://github.com/vdm-io/tcpdf.git
synced 2024-06-05 23:30:47 +00:00
6.0.016 (2013-05-15)
- The tcpdf_addfont.php tool was improved (thanks to Remi Collet).
This commit is contained in:
parent
39528a1441
commit
7424ac0d45
|
@ -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 unused vars were removed from AddFont() method.
|
||||||
- Some directories were moved inside the examples directory.
|
- Some directories were moved inside the examples directory.
|
||||||
- All examples were updated to reflect the new default structure.
|
- All examples were updated to reflect the new default structure.
|
||||||
|
|
|
@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
||||||
Name: TCPDF
|
Name: TCPDF
|
||||||
Version: 6.0.015
|
Version: 6.0.016
|
||||||
Release date: 2013-05-14
|
Release date: 2013-05-15
|
||||||
Author: Nicola Asuni
|
Author: Nicola Asuni
|
||||||
|
|
||||||
Copyright (c) 2002-2013:
|
Copyright (c) 2002-2013:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "tecnick.com/tcpdf",
|
"name": "tecnick.com/tcpdf",
|
||||||
"version": "6.0.015",
|
"version": "6.0.016",
|
||||||
"homepage": "http://www.tcpdf.org/",
|
"homepage": "http://www.tcpdf.org/",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "TCPDF is a PHP class for generating PDF documents.",
|
"description": "TCPDF is a PHP class for generating PDF documents.",
|
||||||
|
|
|
@ -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 $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 $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.
|
* @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
|
* @author Nicola Asuni
|
||||||
* @since 5.9.123 (2010-09-30)
|
* @since 5.9.123 (2010-09-30)
|
||||||
* @public static
|
* @public static
|
||||||
|
|
|
@ -55,7 +55,7 @@ class TCPDF_STATIC {
|
||||||
* Current TCPDF version.
|
* Current TCPDF version.
|
||||||
* @private static
|
* @private static
|
||||||
*/
|
*/
|
||||||
private static $tcpdf_version = '6.0.015';
|
private static $tcpdf_version = '6.0.016';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* String alias for total number of pages.
|
* String alias for total number of pages.
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
//============================================================+
|
//============================================================+
|
||||||
// File name : tcpdf.php
|
// File name : tcpdf.php
|
||||||
// Version : 6.0.015
|
// Version : 6.0.016
|
||||||
// Begin : 2002-08-03
|
// 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
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
// 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>
|
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
|
||||||
* @package com.tecnick.tcpdf
|
* @package com.tecnick.tcpdf
|
||||||
* @author Nicola Asuni
|
* @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.
|
// 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>
|
* 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
|
* @package com.tecnick.tcpdf
|
||||||
* @brief PHP class for generating PDF documents without requiring external extensions.
|
* @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
|
* @author Nicola Asuni - info@tecnick.com
|
||||||
*/
|
*/
|
||||||
class TCPDF {
|
class TCPDF {
|
||||||
|
|
|
@ -2,10 +2,11 @@
|
||||||
<?php
|
<?php
|
||||||
//============================================================+
|
//============================================================+
|
||||||
// File name : tcpdf_addfont.php
|
// File name : tcpdf_addfont.php
|
||||||
// Version : 1.0.000
|
// Version : 1.0.001
|
||||||
// Begin : 2013-05-13
|
// 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
|
// 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)
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Copyright (C) 2011-2013 Nicola Asuni - Tecnick.com LTD
|
// Copyright (C) 2011-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
@ -42,7 +43,7 @@
|
||||||
|
|
||||||
if (php_sapi_name() != 'cli') {
|
if (php_sapi_name() != 'cli') {
|
||||||
echo 'You need to run this command from console.';
|
echo 'You need to run this command from console.';
|
||||||
exit();
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include the main TCPDF library (search the library on the following directories).
|
// Include the main TCPDF library (search the library on the following directories).
|
||||||
|
@ -187,7 +188,10 @@ foreach ($inopt as $opt => $val) {
|
||||||
}
|
}
|
||||||
case 'o':
|
case 'o':
|
||||||
case 'outpath': {
|
case 'outpath': {
|
||||||
$options['outpath'] = $val;
|
$options['outpath'] = realpath($val);
|
||||||
|
if (substr($options['outpath'], -1) != '/') {
|
||||||
|
$options['outpath'] .= '/';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'p':
|
case 'p':
|
||||||
|
@ -225,24 +229,41 @@ foreach ($inopt as $opt => $val) {
|
||||||
} // end of while loop
|
} // end of while loop
|
||||||
|
|
||||||
if (empty($options['fonts'])) {
|
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
|
// check the output path
|
||||||
if (!is_dir($options['outpath']) OR !is_writable($options['outpath'])) {
|
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']);
|
$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
|
// END OF FILE
|
||||||
|
|
Loading…
Reference in New Issue
Block a user