Skip to content

Commit 78b7610

Browse files
committed
6.0.079 (2014-05-19)
- Patch item #69 "Named destinations, HTML internal and external links" was merged. - Bug item #920 "hyphenateText() should not hyphenate the content of style-tags in HTML mode" was fixed. - Image method now trigs an error in case the cache is now writeable. - Fixed issue with layer default status.
1 parent e1cbda7 commit 78b7610

File tree

5 files changed

+35
-20
lines changed

5 files changed

+35
-20
lines changed

CHANGELOG.TXT

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
6.0.079 (2014-05-19)
2+
- Patch item #69 "Named destinations, HTML internal and external links" was merged.
3+
- Bug item #920 "hyphenateText() should not hyphenate the content of style-tags in HTML mode" was fixed.
4+
- Image method now trigs an error in case the cache is now writeable.
5+
- Fixed issue with layer default status.
6+
17
6.0.078 (2014-05-12)
28
- A warning issue in addTTFfont() method was fixed.
39
- Fonts were updated to include cbbox metrics.

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.078
12-
Release date: 2014-05-12
11+
Version: 6.0.079
12+
Release date: 2014-05-19
1313
Author: Nicola Asuni
1414

1515
Copyright (c) 2002-2014:

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.078",
3+
"version": "6.0.079",
44
"homepage": "http://www.tcpdf.org/",
55
"type": "library",
66
"description": "TCPDF is a PHP class for generating PDF documents.",

include/tcpdf_static.php

+2-2
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.078';
58+
private static $tcpdf_version = '6.0.079';
5959

6060
/**
6161
* String alias for total number of pages.
@@ -1569,7 +1569,7 @@ public static function encodeNameObject($name) {
15691569
$length = strlen($name);
15701570
for ($i = 0; $i < $length; ++$i) {
15711571
$chr = $name[$i];
1572-
if (preg_match('/[0-9a-zA-Z]/', $chr) == 1) {
1572+
if (preg_match('/[0-9a-zA-Z#_=-]/', $chr) == 1) {
15731573
$escname .= $chr;
15741574
} else {
15751575
$escname .= sprintf('#%02X', ord($chr));

tcpdf.php

+24-15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
//============================================================+
33
// File name : tcpdf.php
4-
// Version : 6.0.078
4+
// Version : 6.0.079
55
// Begin : 2002-08-03
6-
// Last Update : 2014-05-06
6+
// Last Update : 2014-05-19
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
// -------------------------------------------------------------------
@@ -104,7 +104,7 @@
104104
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
105105
* @package com.tecnick.tcpdf
106106
* @author Nicola Asuni
107-
* @version 6.0.078
107+
* @version 6.0.079
108108
*/
109109

110110
// TCPDF configuration
@@ -128,7 +128,7 @@
128128
* 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>
129129
* @package com.tecnick.tcpdf
130130
* @brief PHP class for generating PDF documents without requiring external extensions.
131-
* @version 6.0.078
131+
* @version 6.0.079
132132
* @author Nicola Asuni - [email protected]
133133
*/
134134
class TCPDF {
@@ -6861,6 +6861,9 @@ public function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $alig
68616861
$original_file = $file;
68626862
$file = TCPDF_STATIC::getObjFilename('img');
68636863
$fp = fopen($file, 'w');
6864+
if (!$fp) {
6865+
$this->Error('Unable to write file: '.$file);
6866+
}
68646867
fwrite($fp, $imgdata);
68656868
fclose($fp);
68666869
unset($imgdata);
@@ -9713,17 +9716,13 @@ protected function _putcatalog() {
97139716
//$out .= ' /PieceInfo <<>>';
97149717
if (!empty($this->pdflayers)) {
97159718
$lyrobjs = '';
9716-
$lyrobjs_print = '';
9717-
$lyrobjs_view = '';
9719+
$lyrobjs_off = '';
97189720
$lyrobjs_lock = '';
97199721
foreach ($this->pdflayers as $layer) {
97209722
$layer_obj_ref = ' '.$layer['objid'].' 0 R';
97219723
$lyrobjs .= $layer_obj_ref;
9722-
if ($layer['print']) {
9723-
$lyrobjs_print .= $layer_obj_ref;
9724-
}
9725-
if ($layer['view']) {
9726-
$lyrobjs_view .= $layer_obj_ref;
9724+
if ($layer['view'] === false) {
9725+
$lyrobjs_off .= $layer_obj_ref;
97279726
}
97289727
if ($layer['lock']) {
97299728
$lyrobjs_lock .= $layer_obj_ref;
@@ -9734,8 +9733,7 @@ protected function _putcatalog() {
97349733
$out .= ' /Name '.$this->_textstring('Layers', $oid);
97359734
$out .= ' /Creator '.$this->_textstring('TCPDF', $oid);
97369735
$out .= ' /BaseState /ON';
9737-
$out .= ' /ON ['.$lyrobjs_print.']';
9738-
$out .= ' /OFF ['.$lyrobjs_view.']';
9736+
$out .= ' /OFF ['.$lyrobjs_off.']';
97399737
$out .= ' /Locked ['.$lyrobjs_lock.']';
97409738
$out .= ' /Intent /View';
97419739
$out .= ' /AS [';
@@ -21995,7 +21993,7 @@ protected function hyphenateWord($word, $patterns, $dictionary=array(), $leftmin
2199521993
if (isset($dictionary[$word_string])) {
2199621994
return TCPDF_FONTS::UTF8StringToArray($dictionary[$word_string], $this->isunicode, $this->CurrentFont);
2199721995
}
21998-
// suround word with '_' characters
21996+
// surround word with '_' characters
2199921997
$tmpword = array_merge(array(95), $word, array(95));
2200021998
$tmpnumchars = $numchars + 2;
2200121999
$maxpos = $tmpnumchars - $charmin;
@@ -22055,14 +22053,15 @@ public function hyphenateText($text, $patterns, $dictionary=array(), $leftmin=1,
2205522053
$word = array(); // last word
2205622054
$txtarr = array(); // text to be returned
2205722055
$intag = false; // true if we are inside an HTML tag
22056+
$skip = false; // true to skip hyphenation
2205822057
if (!is_array($patterns)) {
2205922058
$patterns = TCPDF_STATIC::getHyphenPatternsFromTEX($patterns);
2206022059
}
2206122060
// get array of characters
2206222061
$unichars = TCPDF_FONTS::UTF8StringToArray($text, $this->isunicode, $this->CurrentFont);
2206322062
// for each char
2206422063
foreach ($unichars as $char) {
22065-
if ((!$intag) AND TCPDF_FONT_DATA::$uni_type[$char] == 'L') {
22064+
if ((!$intag) AND (!$skip) AND TCPDF_FONT_DATA::$uni_type[$char] == 'L') {
2206622065
// letter character
2206722066
$word[] = $char;
2206822067
} else {
@@ -22079,6 +22078,16 @@ public function hyphenateText($text, $patterns, $dictionary=array(), $leftmin=1,
2207922078
} elseif ($intag AND (chr($char) == '>')) {
2208022079
// end of HTML tag
2208122080
$intag = false;
22081+
// check for style tag
22082+
if (empty(array_diff(array_slice($txtarr, -6, 5), array(115, 116, 121, 108, 101)))) { // = 'style'
22083+
if (empty(array_diff(array_slice($txtarr, -7, 1), array(47)))) { // '/' = 47
22084+
// closing style tag
22085+
$skip = false;
22086+
} else {
22087+
// opening style tag
22088+
$skip = true;
22089+
}
22090+
}
2208222091
}
2208322092
}
2208422093
}

0 commit comments

Comments
 (0)