mirror of
https://github.com/vdm-io/tcpdf.git
synced 2024-11-29 07:33:54 +00:00
6.0.014 (2013-04-13)
- The signature of addTTFfont() method includes a new parameter to link existing fonts instead of copying and compressing them.
This commit is contained in:
parent
5a2f2197e0
commit
e7c64b4f1c
@ -1,4 +1,7 @@
|
|||||||
6.0.013 (2013-04-)
|
6.0.014 (2013-04-13)
|
||||||
|
- The signature of addTTFfont() method includes a new parameter to link existing fonts instead of copying and compressing them.
|
||||||
|
|
||||||
|
6.0.013 (2013-04-10)
|
||||||
- Add support for SVG dx and dy text/tspan attributes.
|
- Add support for SVG dx and dy text/tspan attributes.
|
||||||
- replace require() with require_once().
|
- replace require() with require_once().
|
||||||
- fix some minor typos on documentation.
|
- fix some minor typos on documentation.
|
||||||
|
@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
|
|||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
||||||
Name: TCPDF
|
Name: TCPDF
|
||||||
Version: 6.0.013
|
Version: 6.0.014
|
||||||
Release date: 2013-05-10
|
Release date: 2013-05-13
|
||||||
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.013",
|
"version": "6.0.014",
|
||||||
"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.",
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
//============================================================+
|
//============================================================+
|
||||||
// File name : bul.php
|
// File name : bul.php
|
||||||
// Begin : 2004-03-03
|
// Begin : 2004-03-03
|
||||||
// Last Update : 2010-03-22
|
// Last Update : 2013-05-13
|
||||||
//
|
//
|
||||||
// Description : Language module for TCPDF
|
// Description : Language module for TCPDF
|
||||||
// (contains translated texts)
|
// (contains translated texts)
|
||||||
// Arabic
|
// Bulgarian
|
||||||
//
|
//
|
||||||
// Author: Nicola Asuni
|
// Author: Nicola Asuni
|
||||||
//
|
//
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
//============================================================+
|
//============================================================+
|
||||||
// File name : tcpdf_fonts.php
|
// File name : tcpdf_fonts.php
|
||||||
// Version : 1.0.005
|
// Version : 1.0.006
|
||||||
// Begin : 2008-01-01
|
// Begin : 2008-01-01
|
||||||
// Last Update : 2013-04-01
|
// Last Update : 2013-05-13
|
||||||
// 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)
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
@ -42,7 +42,7 @@
|
|||||||
* @class TCPDF_FONTS
|
* @class TCPDF_FONTS
|
||||||
* Font methods for TCPDF library.
|
* Font methods for TCPDF library.
|
||||||
* @package com.tecnick.tcpdf
|
* @package com.tecnick.tcpdf
|
||||||
* @version 1.0.005
|
* @version 1.0.006
|
||||||
* @author Nicola Asuni - info@tecnick.com
|
* @author Nicola Asuni - info@tecnick.com
|
||||||
*/
|
*/
|
||||||
class TCPDF_FONTS {
|
class TCPDF_FONTS {
|
||||||
@ -57,12 +57,13 @@ class TCPDF_FONTS {
|
|||||||
* @param $platid (int) Platform ID for CMAP table to extract (when building a Unicode font for Windows this value should be 3, for Macintosh should be 1).
|
* @param $platid (int) Platform ID for CMAP table to extract (when building a Unicode font for Windows this value should be 3, for Macintosh should be 1).
|
||||||
* @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.
|
||||||
* @return (string) TCPDF font name.
|
* @return (string) TCPDF font name.
|
||||||
* @author Nicola Asuni
|
* @author Nicola Asuni
|
||||||
* @since 5.9.123 (2010-09-30)
|
* @since 5.9.123 (2010-09-30)
|
||||||
* @public static
|
* @public static
|
||||||
*/
|
*/
|
||||||
public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1, $addcbbox=false) {
|
public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1, $addcbbox=false, $link=false) {
|
||||||
if (!file_exists($fontfile)) {
|
if (!file_exists($fontfile)) {
|
||||||
// Could not find file
|
// Could not find file
|
||||||
return false;
|
return false;
|
||||||
@ -92,7 +93,7 @@ class TCPDF_FONTS {
|
|||||||
// this font already exist (delete it from fonts folder to rebuild it)
|
// this font already exist (delete it from fonts folder to rebuild it)
|
||||||
return $font_name;
|
return $font_name;
|
||||||
}
|
}
|
||||||
$fmetric['file'] = $font_name.'.z';
|
$fmetric['file'] = $font_name;
|
||||||
$fmetric['ctg'] = $font_name.'.ctg.z';
|
$fmetric['ctg'] = $font_name.'.ctg.z';
|
||||||
// get font data
|
// get font data
|
||||||
$font = file_get_contents($fontfile);
|
$font = file_get_contents($fontfile);
|
||||||
@ -178,6 +179,7 @@ class TCPDF_FONTS {
|
|||||||
$encrypted = substr($font, (12 + $fmetric['size1']), $fmetric['size2']);
|
$encrypted = substr($font, (12 + $fmetric['size1']), $fmetric['size2']);
|
||||||
$data .= $encrypted;
|
$data .= $encrypted;
|
||||||
// store compressed font
|
// store compressed font
|
||||||
|
$fmetric['file'] .= '.z';
|
||||||
$fp = fopen($outpath.$fmetric['file'], 'wb');
|
$fp = fopen($outpath.$fmetric['file'], 'wb');
|
||||||
fwrite($fp, gzcompress($data));
|
fwrite($fp, gzcompress($data));
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
@ -347,10 +349,16 @@ class TCPDF_FONTS {
|
|||||||
} else {
|
} else {
|
||||||
// ---------- TRUE TYPE ----------
|
// ---------- TRUE TYPE ----------
|
||||||
if ($fmetric['type'] != 'cidfont0') {
|
if ($fmetric['type'] != 'cidfont0') {
|
||||||
// store compressed font
|
if ($link) {
|
||||||
$fp = fopen($outpath.$fmetric['file'], 'wb');
|
// creates a symbolic link to the existing font
|
||||||
fwrite($fp, gzcompress($font));
|
symlink($fontfile, $outpath.$fmetric['file']);
|
||||||
fclose($fp);
|
} else {
|
||||||
|
// store compressed font
|
||||||
|
$fmetric['file'] .= '.z';
|
||||||
|
$fp = fopen($outpath.$fmetric['file'], 'wb');
|
||||||
|
fwrite($fp, gzcompress($font));
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$offset = 0; // offset position of the font data
|
$offset = 0; // offset position of the font data
|
||||||
if (TCPDF_STATIC::_getULONG($font, $offset) != 0x10000) {
|
if (TCPDF_STATIC::_getULONG($font, $offset) != 0x10000) {
|
||||||
|
@ -55,7 +55,7 @@ class TCPDF_STATIC {
|
|||||||
* Current TCPDF version.
|
* Current TCPDF version.
|
||||||
* @private static
|
* @private static
|
||||||
*/
|
*/
|
||||||
private static $tcpdf_version = '6.0.013';
|
private static $tcpdf_version = '6.0.014';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.013
|
// Version : 6.0.014
|
||||||
// Begin : 2002-08-03
|
// Begin : 2002-08-03
|
||||||
// Last Update : 2013-05-10
|
// Last Update : 2013-05-13
|
||||||
// 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 : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3
|
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
@ -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.012
|
* @version 6.0.014
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
|
if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
|
||||||
@ -168,7 +168,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.012
|
* @version 6.0.014
|
||||||
* @author Nicola Asuni - info@tecnick.com
|
* @author Nicola Asuni - info@tecnick.com
|
||||||
*/
|
*/
|
||||||
class TCPDF {
|
class TCPDF {
|
||||||
|
Loading…
Reference in New Issue
Block a user