32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-28 23:26:26 +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:
nicolaasuni 2013-05-13 19:11:35 +01:00
parent 5a2f2197e0
commit e7c64b4f1c
7 changed files with 31 additions and 20 deletions

View File

@ -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.
- replace require() with require_once().
- fix some minor typos on documentation.

View File

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

View File

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

View File

@ -2,11 +2,11 @@
//============================================================+
// File name : bul.php
// Begin : 2004-03-03
// Last Update : 2010-03-22
// Last Update : 2013-05-13
//
// Description : Language module for TCPDF
// (contains translated texts)
// Arabic
// Bulgarian
//
// Author: Nicola Asuni
//

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf_fonts.php
// Version : 1.0.005
// Version : 1.0.006
// 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
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@ -42,7 +42,7 @@
* @class TCPDF_FONTS
* Font methods for TCPDF library.
* @package com.tecnick.tcpdf
* @version 1.0.005
* @version 1.0.006
* @author Nicola Asuni - info@tecnick.com
*/
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 $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.
* @author Nicola Asuni
* @since 5.9.123 (2010-09-30)
* @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)) {
// Could not find file
return false;
@ -92,7 +93,7 @@ class TCPDF_FONTS {
// this font already exist (delete it from fonts folder to rebuild it)
return $font_name;
}
$fmetric['file'] = $font_name.'.z';
$fmetric['file'] = $font_name;
$fmetric['ctg'] = $font_name.'.ctg.z';
// get font data
$font = file_get_contents($fontfile);
@ -178,6 +179,7 @@ class TCPDF_FONTS {
$encrypted = substr($font, (12 + $fmetric['size1']), $fmetric['size2']);
$data .= $encrypted;
// store compressed font
$fmetric['file'] .= '.z';
$fp = fopen($outpath.$fmetric['file'], 'wb');
fwrite($fp, gzcompress($data));
fclose($fp);
@ -347,11 +349,17 @@ class TCPDF_FONTS {
} else {
// ---------- TRUE TYPE ----------
if ($fmetric['type'] != 'cidfont0') {
if ($link) {
// creates a symbolic link to the existing font
symlink($fontfile, $outpath.$fmetric['file']);
} 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
if (TCPDF_STATIC::_getULONG($font, $offset) != 0x10000) {
// sfnt version must be 0x00010000 for TrueType version 1.0.

View File

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

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 6.0.013
// Version : 6.0.014
// 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
// 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>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 6.0.012
* @version 6.0.014
*/
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>
* @package com.tecnick.tcpdf
* @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
*/
class TCPDF {