6.0.087 (2014-06-25)

- A bug affecting fitcell option in Multicell was fixed.
This commit is contained in:
nicolaasuni 2014-06-25 17:28:31 +01:00
parent b1c0cc74a8
commit 322f23efcf
4 changed files with 25 additions and 17 deletions

View File

@ -1,3 +1,6 @@
6.0.087 (2014-06-25)
- A bug affecting fitcell option in Multicell was fixed.
6.0.086 (2014-06-20) 6.0.086 (2014-06-20)
- Bug item #938 "Hyphenation-dash extends outside of cell" was fixed (collateral effect). - Bug item #938 "Hyphenation-dash extends outside of cell" was fixed (collateral effect).

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 6.0.086 Version: 6.0.087
Release date: 2014-06-20 Release date: 2014-06-25
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2014: Copyright (c) 2002-2014:

View File

@ -1,6 +1,6 @@
{ {
"name": "tecnick.com/tcpdf", "name": "tecnick.com/tcpdf",
"version": "6.0.086", "version": "6.0.087",
"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.",

View File

@ -1,7 +1,7 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 6.0.085 // Version : 6.0.087
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2014-06-19 // Last Update : 2014-06-19
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
@ -104,7 +104,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.085 * @version 6.0.087
*/ */
// TCPDF configuration // TCPDF configuration
@ -128,7 +128,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.085 * @version 6.0.087
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF { class TCPDF {
@ -1291,14 +1291,14 @@ class TCPDF {
/** /**
* Boolean flag to enable document timestamping with TSA. * Boolean flag to enable document timestamping with TSA.
* @protected * @protected
* @since 6.0.085 (2014-06-19) * @since 6.0.087 (2014-06-19)
*/ */
protected $tsa_timestamp = false; protected $tsa_timestamp = false;
/** /**
* Timestamping data. * Timestamping data.
* @protected * @protected
* @since 6.0.085 (2014-06-19) * @since 6.0.087 (2014-06-19)
*/ */
protected $tsa_data = array(); protected $tsa_data = array();
@ -5870,20 +5870,20 @@ class TCPDF {
if ($maxh > 0) { if ($maxh > 0) {
// get text height // get text height
$text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border); $text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border);
if ($fitcell) { if ($fitcell AND ($text_height > $maxh) AND ($this->FontSizePt > 1)) {
// try to reduce font size to fit text on cell (use a quick search algorithm) // try to reduce font size to fit text on cell (use a quick search algorithm)
$fmin = 1; $fmin = 1;
$fmax = $this->FontSizePt; $fmax = $this->FontSizePt;
$diff_epsilon = (1 / $this->k); // one point (min resolution) $diff_epsilon = (1 / $this->k); // one point (min resolution)
$maxit = (2 * intval($fmax)); // max number of iterations $maxit = (2 * min(100, max(10, intval($fmax)))); // max number of iterations
while ($maxit > 0) { while ($maxit >= 0) {
$fmid = (($fmax + $fmin) / 2); $fmid = (($fmax + $fmin) / 2);
$this->SetFontSize($fmid, false); $this->SetFontSize($fmid, false);
$this->resetLastH(); $this->resetLastH();
$text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border); $text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border);
$diff = ($maxh - $text_height); $diff = ($maxh - $text_height);
if ($diff >= 0) { if ($diff >= 0) {
if ($diff < $diff_epsilon) { if ($diff <= $diff_epsilon) {
break; break;
} }
$fmin = $fmid; $fmin = $fmid;
@ -5892,10 +5892,15 @@ class TCPDF {
} }
--$maxit; --$maxit;
} }
if ($maxit <= 0) { if ($maxit < 0) {
$fmid = $fmin; // premature exit, we get the minimum font value to fit the cell
$this->SetFontSize($fmin);
$this->resetLastH();
$text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border);
} else {
$this->SetFontSize($fmid);
$this->resetLastH();
} }
$this->SetFontSize($fmid);
} }
if ($text_height < $maxh) { if ($text_height < $maxh) {
if ($valign == 'M') { if ($valign == 'M') {
@ -13621,7 +13626,7 @@ class TCPDF {
* @param $tsa_cert (string) Specifies the location of TSA certificate for authorization (optional for cURL) * @param $tsa_cert (string) Specifies the location of TSA certificate for authorization (optional for cURL)
* @public * @public
* @author Richard Stockinger * @author Richard Stockinger
* @since 6.0.085 (2014-06-16) * @since 6.0.087 (2014-06-16)
*/ */
public function setTimeStamp($tsa_host='', $tsa_username='', $tsa_password='', $tsa_cert='') { public function setTimeStamp($tsa_host='', $tsa_username='', $tsa_password='', $tsa_cert='') {
$this->tsa_data = array(); $this->tsa_data = array();
@ -13649,7 +13654,7 @@ class TCPDF {
* @return (string) Timestamped digital signature * @return (string) Timestamped digital signature
* @protected * @protected
* @author Richard Stockinger * @author Richard Stockinger
* @since 6.0.085 (2014-06-16) * @since 6.0.087 (2014-06-16)
*/ */
protected function applyTSA($signature) { protected function applyTSA($signature) {
if (!$this->tsa_timestamp) { if (!$this->tsa_timestamp) {