From 2f282db233aa1bd7afe3dabcebf2fd0c6cafa98b Mon Sep 17 00:00:00 2001 From: nick Date: Wed, 25 Jul 2012 18:50:52 +0100 Subject: [PATCH] 5.9.175 (2012-07-25) - The problem of missing letter on hyphen break was fixed. --- CHANGELOG.TXT | 3 +++ README.TXT | 2 +- config/lang/rus.php | 4 ++-- config/lang/ukr.php | 4 ++-- tcpdf.php | 26 +++++++++++++------------- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 271bfd3..ce50bc9 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +5.9.175 (2012-07-25) + - The problem of missing letter on hyphen break was fixed. + 5.9.174 (2012-07-25) - The problem of wrong filename when downloading PDF from an Android device was fixed. - The method setHeaderData() was extended to set text and line color for header (see example n. 1). diff --git a/README.TXT b/README.TXT index 5934f93..d63ce36 100755 --- a/README.TXT +++ b/README.TXT @@ -8,7 +8,7 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.9.174 +Version: 5.9.175 Release date: 2012-07-25 Author: Nicola Asuni diff --git a/config/lang/rus.php b/config/lang/rus.php index 86b9b57..a3ce942 100755 --- a/config/lang/rus.php +++ b/config/lang/rus.php @@ -2,7 +2,7 @@ //============================================================+ // File name : rus.php // Begin : 2004-03-03 -// Last Update : 2010-10-26 +// Last Update : 2012-07-25 // // Description : Language module for TCPDF // (contains translated texts) @@ -40,7 +40,7 @@ $l['a_meta_dir'] = 'ltr'; $l['a_meta_language'] = 'ru'; // TRANSLATIONS -------------------------------------- -$l['w_page'] = 'страницы'; +$l['w_page'] = 'страница'; //============================================================+ // END OF FILE diff --git a/config/lang/ukr.php b/config/lang/ukr.php index dbf567d..781c477 100644 --- a/config/lang/ukr.php +++ b/config/lang/ukr.php @@ -2,7 +2,7 @@ //============================================================+ // File name : ukr.php // Begin : 2004-03-03 -// Last Update : 2010-10-26 +// Last Update : 2012-07-25 // // Description : Language module for TCPDF // (contains translated texts) @@ -40,7 +40,7 @@ $l['a_meta_dir'] = 'ltr'; $l['a_meta_language'] = 'ua'; // TRANSLATIONS -------------------------------------- -$l['w_page'] = 'страница'; +$l['w_page'] = 'сторінка'; //============================================================+ // END OF FILE diff --git a/tcpdf.php b/tcpdf.php index 11a3261..18bf13a 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,7 +1,7 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.174 + * @version 5.9.175 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -150,7 +150,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.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.
* @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 5.9.174 + * @version 5.9.175 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -161,7 +161,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.174'; + private $tcpdf_version = '5.9.175'; // Protected properties @@ -7344,8 +7344,8 @@ class TCPDF { // \p{Z} or \p{Separator}: any kind of Unicode whitespace or invisible separator. // \p{Lo} or \p{Other_Letter}: a Unicode letter or ideograph that does not have lowercase and uppercase variants. // \p{Lo} is needed because Chinese characters are packed next to each other without spaces in between. - if (($c != 160) - AND (($c == 173) + if (($c != 160) + AND (($c == 173) OR preg_match($this->re_spaces, $this->unichr($c)) OR (($c == 45) AND ($i < ($nb - 1)) @@ -7356,11 +7356,8 @@ class TCPDF { ) { // update last blank space position $sep = $i; - if ($c == 45) { - ++$sep; - } // check if is a SHY - if ($c == 173) { + if (($c == 173) OR ($c == 45)) { $shy = true; if ($pc == 45) { $tmp_shy_replacement_width = 0; @@ -7449,9 +7446,9 @@ class TCPDF { $linew = $this->GetArrStringWidth($tmparr); unset($tmparr); if ($this->rtl) { - $this->endlinex = $startx - $linew; + $this->endlinex = ($startx - $linew); } else { - $this->endlinex = $startx + $linew; + $this->endlinex = ($startx + $linew); } $w = $linew; $tmpcellpadding = $this->cell_padding; @@ -7514,6 +7511,9 @@ class TCPDF { $this->Cell($w, $h, $shy_char_left.$tmpstr.$shy_char_right, 0, 1, $align, $fill, $link, $stretch); unset($tmpstr); if ($firstline) { + if ($chars[$sep] == 45) { + $endspace += 1; + } // return the remaining text $this->cell_padding = $tmpcellpadding; return ($this->UniArrSubString($uchars, ($sep + $endspace))); @@ -7521,7 +7521,7 @@ class TCPDF { $i = $sep; $sep = -1; $shy = false; - $j = ($i+1); + $j = ($i + 1); } } // account for margin changes