mirror of
https://github.com/vdm-io/tcpdf.git
synced 2024-11-25 22:07:33 +00:00
5.9.155
This commit is contained in:
parent
9c8c5f961f
commit
f8f51d16cb
@ -1,3 +1,13 @@
|
||||
5.9.155 (2012-04-02)
|
||||
- Bug item #3512596 "font import problems" was fixed.
|
||||
- Method addTTFfont() was modified to extract only specified Platform ID and Encoding ID (check the source code documentation).
|
||||
- All fonts were updated.
|
||||
- Bug item #3513867 "booklet and setHeaderTemplateAutoreset: header shifted left" was fixed.
|
||||
- Bug item #3513749 "TCPDF Superscript/Subscript" was fixed.
|
||||
|
||||
5.9.154 (2012-03-29)
|
||||
- A debug echo was removed.
|
||||
|
||||
5.9.153 (2012-03-28)
|
||||
- A bug on font conversion was fixed.
|
||||
- All fonts were updated.
|
||||
|
@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
|
||||
------------------------------------------------------------
|
||||
|
||||
Name: TCPDF
|
||||
Version: 5.9.153
|
||||
Release date: 2012-03-28
|
||||
Version: 5.9.155
|
||||
Release date: 2012-04-02
|
||||
Author: Nicola Asuni
|
||||
|
||||
Copyright (c) 2002-2012:
|
||||
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
45
tcpdf.php
45
tcpdf.php
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf.php
|
||||
// Version : 5.9.153
|
||||
// Version : 5.9.155
|
||||
// Begin : 2002-08-03
|
||||
// Last Update : 2012-03-28
|
||||
// Last Update : 2012-04-02
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com
|
||||
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3
|
||||
// -------------------------------------------------------------------
|
||||
@ -137,7 +137,7 @@
|
||||
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
|
||||
* @package com.tecnick.tcpdf
|
||||
* @author Nicola Asuni
|
||||
* @version 5.9.153
|
||||
* @version 5.9.155
|
||||
*/
|
||||
|
||||
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
|
||||
@ -149,7 +149,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.<br>
|
||||
* @package com.tecnick.tcpdf
|
||||
* @brief PHP class for generating PDF documents without requiring external extensions.
|
||||
* @version 5.9.153
|
||||
* @version 5.9.155
|
||||
* @author Nicola Asuni - info@tecnick.com
|
||||
*/
|
||||
class TCPDF {
|
||||
@ -160,7 +160,7 @@ class TCPDF {
|
||||
* Current TCPDF version.
|
||||
* @private
|
||||
*/
|
||||
private $tcpdf_version = '5.9.153';
|
||||
private $tcpdf_version = '5.9.155';
|
||||
|
||||
// Protected properties
|
||||
|
||||
@ -4261,7 +4261,7 @@ class TCPDF {
|
||||
// print header template
|
||||
$x = 0;
|
||||
$dx = 0;
|
||||
if ($this->booklet AND (($this->page % 2) == 0)) {
|
||||
if (!$this->header_xobj_autoreset AND $this->booklet AND (($this->page % 2) == 0)) {
|
||||
// adjust margins for booklet mode
|
||||
$dx = ($this->original_lMargin - $this->original_rMargin);
|
||||
}
|
||||
@ -10001,17 +10001,19 @@ class TCPDF {
|
||||
|
||||
/**
|
||||
* Convert and add the selected TrueType or Type1 font to the fonts folder (that must be writeable).
|
||||
* @param $fontfile (string) TrueType or Type1 font file (full path).
|
||||
* @param $fontfile (string) Font file (full path).
|
||||
* @param $fonttype (string) Font type. Leave empty for autodetect mode. Valid values are: TrueTypeUnicode, TrueType, Type1, CID0JP = CID-0 Japanese, CID0KR = CID-0 Korean, CID0CS = CID-0 Chinese Simplified, CID0CT = CID-0 Chinese Traditional.
|
||||
* @param $enc (string) Name of the encoding table to use. Leave empty for default mode. Omit this parameter for TrueType Unicode and symbolic fonts like Symbol or ZapfDingBats.
|
||||
* @param $flags (int) Unsigned 32-bit integer containing flags specifying various characteristics of the font (PDF32000:2008 - 9.8.2 Font Descriptor Flags): +1 for fixed font; +4 for symbol or +32 for non-symbol; +64 for italic. Fixed and Italic mode are generally autodetected so you have to set it to 32 = non-symbolic font (default) or 4 = symbolic font.
|
||||
* @param $outpath (string) Output path for generated font files (must be writeable by the web server). Leave empty for default font folder.
|
||||
* @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).
|
||||
* @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.
|
||||
* @return (string) TCPDF font name.
|
||||
* @author Nicola Asuni
|
||||
* @public
|
||||
* @since 5.9.123 (2010-09-30)
|
||||
*/
|
||||
public function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='') {
|
||||
public function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1) {
|
||||
if (!file_exists($fontfile)) {
|
||||
$this->Error('Could not find file: '.$fontfile.'');
|
||||
}
|
||||
@ -10298,7 +10300,7 @@ class TCPDF {
|
||||
fclose($fp);
|
||||
}
|
||||
$offset = 0; // offset position of the font data
|
||||
if ($this->_getULONG($font, $offset) != 0x10000) { echo $this->_getULONG($font, $offset);
|
||||
if ($this->_getULONG($font, $offset) != 0x10000) {
|
||||
// sfnt version must be 0x00010000 for TrueType version 1.0.
|
||||
return $font;
|
||||
}
|
||||
@ -10480,11 +10482,8 @@ class TCPDF {
|
||||
// ---------- get CIDToGIDMap ----------
|
||||
$ctg = array();
|
||||
foreach ($encodingTables as $enctable) {
|
||||
if (($enctable['platformID'] == 3) AND ($enctable['encodingID'] == 0)) {
|
||||
$modesymbol = true;
|
||||
} else {
|
||||
$modesymbol = false;
|
||||
}
|
||||
// get only specified Platform ID and Encoding ID
|
||||
if (($enctable['platformID'] == $platid) AND ($enctable['encodingID'] == $encid)) {
|
||||
$offset = $table['cmap']['offset'] + $enctable['offset'];
|
||||
$format = $this->_getUSHORT($font, $offset);
|
||||
$offset += 2;
|
||||
@ -10615,8 +10614,8 @@ class TCPDF {
|
||||
for ($k = 0; $k < $entryCount; ++$k) {
|
||||
$c = ($k + $firstCode);
|
||||
$g = $this->_getUSHORT($font, $offset);
|
||||
$ctg[$c] = $g;
|
||||
$offset += 2;
|
||||
$ctg[$c] = $g;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -10694,6 +10693,7 @@ class TCPDF {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isset($ctg[0])) {
|
||||
$ctg[0] = 0;
|
||||
}
|
||||
@ -10910,11 +10910,7 @@ class TCPDF {
|
||||
$offset += 4;
|
||||
}
|
||||
foreach ($encodingTables as $enctable) {
|
||||
if (($enctable['platformID'] == 3) AND ($enctable['encodingID'] == 0)) {
|
||||
$modesymbol = true;
|
||||
} else {
|
||||
$modesymbol = false;
|
||||
}
|
||||
// get all platforms and encodings
|
||||
$offset = $table['cmap']['offset'] + $enctable['offset'];
|
||||
$format = $this->_getUSHORT($font, $offset);
|
||||
$offset += 2;
|
||||
@ -21123,6 +21119,8 @@ class TCPDF {
|
||||
$html = preg_replace('/<li([^\>]*)>'.$this->re_space['p'].'*<img/'.$this->re_space['m'], '<li\\1><font size="1"> </font><img', $html);
|
||||
$html = preg_replace('/<([^\>\/]*)>[\s]/', '<\\1> ', $html); // preserve some spaces
|
||||
$html = preg_replace('/[\s]<\/([^\>]*)>/', ' </\\1>', $html); // preserve some spaces
|
||||
$html = preg_replace('/<su([bp])/', '<zws/><su\\1', $html); // fix sub/sup alignment
|
||||
$html = preg_replace('/<\/su([bp])>/', '</su\\1><zws/>', $html); // fix sub/sup alignment
|
||||
$html = preg_replace('/'.$this->re_space['p'].'+/'.$this->re_space['m'], chr(32), $html); // replace multiple spaces with a single space
|
||||
// trim string
|
||||
$html = $this->stringTrim($html);
|
||||
@ -23079,11 +23077,11 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
|
||||
$nextstr = preg_split('/'.$this->re_space['p'].'+/'.$this->re_space['m'], $dom[$nkey]['value']);
|
||||
if (isset($nextstr[0]) AND $same_textdir) {
|
||||
$wadj += $this->GetStringWidth($nextstr[0], $tmp_fontname, $tmp_fontstyle, $tmp_fontsize);
|
||||
}
|
||||
if (isset($nextstr[1])) {
|
||||
$write_block = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
++$nkey;
|
||||
}
|
||||
}
|
||||
@ -23094,6 +23092,9 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
|
||||
if ($numblks > 1) {
|
||||
// try to split on blank spaces
|
||||
$wadj = ($cwa - $strlinelen + $this->GetStringWidth($nextstr[($numblks - 1)]));
|
||||
} else {
|
||||
// set the entire block on new line
|
||||
$wadj = $this->GetStringWidth($nextstr[0]);
|
||||
}
|
||||
}
|
||||
// check for reversed text direction
|
||||
@ -24401,7 +24402,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
|
||||
break;
|
||||
}
|
||||
case 'sub': {
|
||||
$this->SetXY($this->GetX(), $this->GetY() - ((0.3 * $parent['fontsize'])/$this->k));
|
||||
$this->SetXY($this->GetX(), $this->GetY() - ((0.3 * $parent['fontsize']) / $this->k));
|
||||
break;
|
||||
}
|
||||
case 'div': {
|
||||
|
Loading…
Reference in New Issue
Block a user