Skip to content

Commit e7c64b4

Browse files
committed
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.
1 parent 5a2f219 commit e7c64b4

File tree

7 files changed

+31
-20
lines changed

7 files changed

+31
-20
lines changed

CHANGELOG.TXT

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
6.0.013 (2013-04-)
1+
6.0.014 (2013-04-13)
2+
- The signature of addTTFfont() method includes a new parameter to link existing fonts instead of copying and compressing them.
3+
4+
6.0.013 (2013-04-10)
25
- Add support for SVG dx and dy text/tspan attributes.
36
- replace require() with require_once().
47
- fix some minor typos on documentation.

README.TXT

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
88
------------------------------------------------------------
99

1010
Name: TCPDF
11-
Version: 6.0.013
12-
Release date: 2013-05-10
11+
Version: 6.0.014
12+
Release date: 2013-05-13
1313
Author: Nicola Asuni
1414

1515
Copyright (c) 2002-2013:

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tecnick.com/tcpdf",
3-
"version": "6.0.013",
3+
"version": "6.0.014",
44
"homepage": "http://www.tcpdf.org/",
55
"type": "library",
66
"description": "TCPDF is a PHP class for generating PDF documents.",

config/lang/bul.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
//============================================================+
33
// File name : bul.php
44
// Begin : 2004-03-03
5-
// Last Update : 2010-03-22
5+
// Last Update : 2013-05-13
66
//
77
// Description : Language module for TCPDF
88
// (contains translated texts)
9-
// Arabic
9+
// Bulgarian
1010
//
1111
// Author: Nicola Asuni
1212
//

include/tcpdf_fonts.php

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
//============================================================+
33
// File name : tcpdf_fonts.php
4-
// Version : 1.0.005
4+
// Version : 1.0.006
55
// Begin : 2008-01-01
6-
// Last Update : 2013-04-01
6+
// Last Update : 2013-05-13
77
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
88
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
99
// -------------------------------------------------------------------
@@ -42,7 +42,7 @@
4242
* @class TCPDF_FONTS
4343
* Font methods for TCPDF library.
4444
* @package com.tecnick.tcpdf
45-
* @version 1.0.005
45+
* @version 1.0.006
4646
* @author Nicola Asuni - [email protected]
4747
*/
4848
class TCPDF_FONTS {
@@ -57,12 +57,13 @@ class TCPDF_FONTS {
5757
* @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).
5858
* @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.
5959
* @param $addcbbox (boolean) If true includes the character bounding box information on the php font file.
60+
* @param $link (boolean) If true link to system font instead of copying the font data (not transportable) - Note: do not work with Type1 fonts.
6061
* @return (string) TCPDF font name.
6162
* @author Nicola Asuni
6263
* @since 5.9.123 (2010-09-30)
6364
* @public static
6465
*/
65-
public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1, $addcbbox=false) {
66+
public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1, $addcbbox=false, $link=false) {
6667
if (!file_exists($fontfile)) {
6768
// Could not find file
6869
return false;
@@ -92,7 +93,7 @@ public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $
9293
// this font already exist (delete it from fonts folder to rebuild it)
9394
return $font_name;
9495
}
95-
$fmetric['file'] = $font_name.'.z';
96+
$fmetric['file'] = $font_name;
9697
$fmetric['ctg'] = $font_name.'.ctg.z';
9798
// get font data
9899
$font = file_get_contents($fontfile);
@@ -178,6 +179,7 @@ public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $
178179
$encrypted = substr($font, (12 + $fmetric['size1']), $fmetric['size2']);
179180
$data .= $encrypted;
180181
// store compressed font
182+
$fmetric['file'] .= '.z';
181183
$fp = fopen($outpath.$fmetric['file'], 'wb');
182184
fwrite($fp, gzcompress($data));
183185
fclose($fp);
@@ -347,10 +349,16 @@ public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $
347349
} else {
348350
// ---------- TRUE TYPE ----------
349351
if ($fmetric['type'] != 'cidfont0') {
350-
// store compressed font
351-
$fp = fopen($outpath.$fmetric['file'], 'wb');
352-
fwrite($fp, gzcompress($font));
353-
fclose($fp);
352+
if ($link) {
353+
// creates a symbolic link to the existing font
354+
symlink($fontfile, $outpath.$fmetric['file']);
355+
} else {
356+
// store compressed font
357+
$fmetric['file'] .= '.z';
358+
$fp = fopen($outpath.$fmetric['file'], 'wb');
359+
fwrite($fp, gzcompress($font));
360+
fclose($fp);
361+
}
354362
}
355363
$offset = 0; // offset position of the font data
356364
if (TCPDF_STATIC::_getULONG($font, $offset) != 0x10000) {

include/tcpdf_static.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class TCPDF_STATIC {
5555
* Current TCPDF version.
5656
* @private static
5757
*/
58-
private static $tcpdf_version = '6.0.013';
58+
private static $tcpdf_version = '6.0.014';
5959

6060
/**
6161
* String alias for total number of pages.

tcpdf.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
//============================================================+
33
// File name : tcpdf.php
4-
// Version : 6.0.013
4+
// Version : 6.0.014
55
// Begin : 2002-08-03
6-
// Last Update : 2013-05-10
6+
// Last Update : 2013-05-13
77
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
88
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3
99
// -------------------------------------------------------------------
@@ -139,7 +139,7 @@
139139
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
140140
* @package com.tecnick.tcpdf
141141
* @author Nicola Asuni
142-
* @version 6.0.012
142+
* @version 6.0.014
143143
*/
144144

145145
if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
@@ -168,7 +168,7 @@
168168
* 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>
169169
* @package com.tecnick.tcpdf
170170
* @brief PHP class for generating PDF documents without requiring external extensions.
171-
* @version 6.0.012
171+
* @version 6.0.014
172172
* @author Nicola Asuni - [email protected]
173173
*/
174174
class TCPDF {

0 commit comments

Comments
 (0)