6.0.097 (2014-10-20)

- Bug item #988 "hyphenateText - charmin parameter not work" was fixed.
This commit is contained in:
nicolaasuni 2014-10-20 21:02:38 +01:00
parent ff87991642
commit 73b436e180
6 changed files with 79 additions and 23 deletions

View File

@ -1,3 +1,6 @@
6.0.097 (2014-10-20)
- Bug item #988 "hyphenateText - charmin parameter not work" was fixed.
6.0.096 (2014-10-06)
- Bug item #982 "Display style is not inherited in SVG" was fixed.
- Bug item #984 "Double quote url in CSS" was fixed.

View File

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

View File

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

View File

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

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 6.0.096
// Version : 6.0.097
// Begin : 2002-08-03
// Last Update : 2014-10-06
// Last Update : 2014-10-20
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@ -104,7 +104,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 6.0.096
* @version 6.0.097
*/
// 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>
* @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions.
* @version 6.0.096
* @version 6.0.097
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF {
@ -7411,10 +7411,9 @@ class TCPDF {
$this->x = $this->lMargin + $cellpadding;
}
if (is_string($h)) {
$this->y += $this->lasth;
} else {
$this->y += $h;
$h = $this->lasth;
}
$this->y += $h;
$this->newline = true;
}
@ -22150,10 +22149,10 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
* Returns an array of chars containing soft hyphens.
* @param $word (array) array of chars
* @param $patterns (array) Array of hypenation patterns.
* @param $dictionary (array) Array of words to be returned without applying the hyphenation algoritm.
* @param $dictionary (array) Array of words to be returned without applying the hyphenation algorithm.
* @param $leftmin (int) Minimum number of character to leave on the left of the word without applying the hyphens.
* @param $rightmin (int) Minimum number of character to leave on the right of the word without applying the hyphens.
* @param $charmin (int) Minimum word length to apply the hyphenation algoritm.
* @param $charmin (int) Minimum word length to apply the hyphenation algorithm.
* @param $charmax (int) Maximum length of broken piece of word.
* @return array text with soft hyphens
* @author Nicola Asuni
@ -22184,10 +22183,10 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
// surround word with '_' characters
$tmpword = array_merge(array(46), $word, array(46));
$tmpnumchars = $numchars + 2;
$maxpos = $tmpnumchars - $charmin;
$maxpos = $tmpnumchars - 1;
for ($pos = 0; $pos < $maxpos; ++$pos) {
$imax = min(($tmpnumchars - $pos), $charmax);
for ($i = $charmin; $i <= $imax; ++$i) {
for ($i = 1; $i <= $imax; ++$i) {
$subword = strtolower(TCPDF_FONTS::UTF8ArrSubString($tmpword, $pos, ($pos + $i), $this->isunicode));
if (isset($patterns[$subword])) {
$pattern = TCPDF_FONTS::UTF8StringToArray($patterns[$subword], $this->isunicode, $this->CurrentFont);
@ -22230,10 +22229,10 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
* Returns text with soft hyphens.
* @param $text (string) text to process
* @param $patterns (mixed) Array of hypenation patterns or a TEX file containing hypenation patterns. TEX patterns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
* @param $dictionary (array) Array of words to be returned without applying the hyphenation algoritm.
* @param $dictionary (array) Array of words to be returned without applying the hyphenation algorithm.
* @param $leftmin (int) Minimum number of character to leave on the left of the word without applying the hyphens.
* @param $rightmin (int) Minimum number of character to leave on the right of the word without applying the hyphens.
* @param $charmin (int) Minimum word length to apply the hyphenation algoritm.
* @param $charmin (int) Minimum word length to apply the hyphenation algorithm.
* @param $charmax (int) Maximum length of broken piece of word.
* @return array text with soft hyphens
* @author Nicola Asuni

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf_barcodes_1d.php
// Version : 1.0.026
// Version : 1.0.027
// Begin : 2008-06-09
// Last Update : 2014-05-20
// Last Update : 2014-10-20
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@ -37,14 +37,14 @@
* PHP class to creates array representations for common 1D barcodes to be used with TCPDF.
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.026
* @version 1.0.027
*/
/**
* @class TCPDFBarcode
* PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).<br>
* @package com.tecnick.tcpdf
* @version 1.0.026
* @version 1.0.027
* @author Nicola Asuni
*/
class TCPDFBarcode {
@ -242,7 +242,7 @@ class TCPDFBarcode {
/**
* Set the barcode.
* @param $code (string) code to print
* @param $type (string) type of barcode: <ul><li>C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.</li><li>C39+ : CODE 39 with checksum</li><li>C39E : CODE 39 EXTENDED</li><li>C39E+ : CODE 39 EXTENDED + CHECKSUM</li><li>C93 : CODE 93 - USS-93</li><li>S25 : Standard 2 of 5</li><li>S25+ : Standard 2 of 5 + CHECKSUM</li><li>I25 : Interleaved 2 of 5</li><li>I25+ : Interleaved 2 of 5 + CHECKSUM</li><li>C128 : CODE 128</li><li>C128A : CODE 128 A</li><li>C128B : CODE 128 B</li><li>C128C : CODE 128 C</li><li>EAN2 : 2-Digits UPC-Based Extention</li><li>EAN5 : 5-Digits UPC-Based Extention</li><li>EAN8 : EAN 8</li><li>EAN13 : EAN 13</li><li>UPCA : UPC-A</li><li>UPCE : UPC-E</li><li>MSI : MSI (Variation of Plessey code)</li><li>MSI+ : MSI + CHECKSUM (modulo 11)</li><li>POSTNET : POSTNET</li><li>PLANET : PLANET</li><li>RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)</li><li>KIX : KIX (Klant index - Customer index)</li><li>IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200</li><li>CODABAR : CODABAR</li><li>CODE11 : CODE 11</li><li>PHARMA : PHARMACODE</li><li>PHARMA2T : PHARMACODE TWO-TRACKS</li></ul>
* @param $type (string) type of barcode: <ul><li>C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.</li><li>C39+ : CODE 39 with checksum</li><li>C39E : CODE 39 EXTENDED</li><li>C39E+ : CODE 39 EXTENDED + CHECKSUM</li><li>C93 : CODE 93 - USS-93</li><li>S25 : Standard 2 of 5</li><li>S25+ : Standard 2 of 5 + CHECKSUM</li><li>I25 : Interleaved 2 of 5</li><li>I25+ : Interleaved 2 of 5 + CHECKSUM</li><li>C128 : CODE 128</li><li>C128A : CODE 128 A</li><li>C128B : CODE 128 B</li><li>C128C : CODE 128 C</li><li>EAN2 : 2-Digits UPC-Based Extention</li><li>EAN5 : 5-Digits UPC-Based Extention</li><li>EAN8 : EAN 8</li><li>EAN13 : EAN 13</li><li>UPCA : UPC-A</li><li>UPCE : UPC-E</li><li>MSI : MSI (Variation of Plessey code)</li><li>MSI+ : MSI + CHECKSUM (modulo 11)</li><li>POSTNET : POSTNET</li><li>PLANET : PLANET</li><li>RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)</li><li>KIX : KIX (Klant index - Customer index)</li><li>IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200</li><li>IMBPRE: Pre-processed Intelligent Mail Barcode - Onecode - USPS-B-3200, using only F,A,D,T letters</li><li>CODABAR : CODABAR</li><li>CODE11 : CODE 11</li><li>PHARMA : PHARMACODE</li><li>PHARMA2T : PHARMACODE TWO-TRACKS</li></ul>
* @return array barcode array
* @public
*/
@ -352,6 +352,10 @@ class TCPDFBarcode {
$arrcode = $this->barcode_imb($code);
break;
}
case 'IMBPRE': { // IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200- pre-processed
$arrcode = $this->barcode_imb_pre($code);
break;
}
case 'CODABAR': { // CODABAR
$arrcode = $this->barcode_codabar($code);
break;
@ -2038,7 +2042,6 @@ class TCPDFBarcode {
return $bararray;
}
/**
* IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
* (requires PHP bcmath extension)
@ -2166,6 +2169,57 @@ class TCPDFBarcode {
return $bararray;
}
/**
* IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
*
* @param $code (string) pre-formatted IMB barcode (65 chars "FADT")
* @return array barcode representation.
* @protected
*/
protected function barcode_imb_pre($code) {
if (!preg_match('/^[fadtFADT]{65}$/', $code) == 1) {
return false;
}
$characters = str_split(strtolower($code), 1);
// build bars
$k = 0;
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 3, 'bcode' => array());
for ($i = 0; $i < 65; ++$i) {
switch($characters[$i]) {
case 'f': {
// full bar
$p = 0;
$h = 3;
break;
}
case 'a': {
// ascender
$p = 0;
$h = 2;
break;
}
case 'd': {
// descender
$p = 1;
$h = 2;
break;
}
case 't': {
// tracker (short)
$p = 1;
$h = 1;
break;
}
}
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p);
$bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0);
$bararray['maxw'] += 2;
}
unset($bararray['bcode'][($k - 1)]);
--$bararray['maxw'];
return $bararray;
}
/**
* Convert large integer number to hexadecimal representation.
* (requires PHP bcmath extension)