30
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-05-31 21:30:47 +00:00

6.0.020 (2013-06-04)

- The method addTTFfont() was fixed (Bug item #813 Undefined offset).
This commit is contained in:
nicolaasuni 2013-06-04 22:06:38 +01:00
parent e27aa651bb
commit 57959d4027
6 changed files with 22 additions and 19 deletions

View File

@ -1,3 +1,6 @@
6.0.020 (2013-06-04)
- The method addTTFfont() was fixed (Bug item #813 Undefined offset).
6.0.019 (2013-06-04) 6.0.019 (2013-06-04)
- The magic constant __DIR__ was replaced with dirname(__FILE__) for php 5.2 compatibility. - The magic constant __DIR__ was replaced with dirname(__FILE__) for php 5.2 compatibility.
- The exceptions raised by file_exists() function were suppressed. - The exceptions raised by file_exists() function were suppressed.

View File

@ -8,7 +8,7 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 6.0.019 Version: 6.0.020
Release date: 2013-06-04 Release date: 2013-06-04
Author: Nicola Asuni Author: Nicola Asuni

View File

@ -1,6 +1,6 @@
{ {
"name": "tecnick.com/tcpdf", "name": "tecnick.com/tcpdf",
"version": "6.0.019", "version": "6.0.020",
"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,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf_fonts.php // File name : tcpdf_fonts.php
// Version : 1.0.006 // Version : 1.0.007
// Begin : 2008-01-01 // Begin : 2008-01-01
// Last Update : 2013-05-13 // Last Update : 2013-06-04
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -42,7 +42,7 @@
* @class TCPDF_FONTS * @class TCPDF_FONTS
* Font methods for TCPDF library. * Font methods for TCPDF library.
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @version 1.0.006 * @version 1.0.007
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF_FONTS { class TCPDF_FONTS {
@ -426,14 +426,14 @@ class TCPDF_FONTS {
$offset = $table['loca']['offset']; $offset = $table['loca']['offset'];
if ($short_offset) { if ($short_offset) {
// short version // short version
$tot_num_glyphs = ($table['loca']['length'] / 2); // numGlyphs + 1 $tot_num_glyphs = floor($table['loca']['length'] / 2); // numGlyphs + 1
for ($i = 0; $i < $tot_num_glyphs; ++$i) { for ($i = 0; $i < $tot_num_glyphs; ++$i) {
$indexToLoc[$i] = TCPDF_STATIC::_getUSHORT($font, $offset) * 2; $indexToLoc[$i] = TCPDF_STATIC::_getUSHORT($font, $offset) * 2;
$offset += 2; $offset += 2;
} }
} else { } else {
// long version // long version
$tot_num_glyphs = ($table['loca']['length'] / 4); // numGlyphs + 1 $tot_num_glyphs = floor($table['loca']['length'] / 4); // numGlyphs + 1
for ($i = 0; $i < $tot_num_glyphs; ++$i) { for ($i = 0; $i < $tot_num_glyphs; ++$i) {
$indexToLoc[$i] = TCPDF_STATIC::_getULONG($font, $offset); $indexToLoc[$i] = TCPDF_STATIC::_getULONG($font, $offset);
$offset += 4; $offset += 4;
@ -621,7 +621,7 @@ class TCPDF_FONTS {
$length = TCPDF_STATIC::_getUSHORT($font, $offset); $length = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2; $offset += 2;
$offset += 2; // skip version/language $offset += 2; // skip version/language
$segCount = (TCPDF_STATIC::_getUSHORT($font, $offset) / 2); $segCount = floor(TCPDF_STATIC::_getUSHORT($font, $offset) / 2);
$offset += 2; $offset += 2;
$offset += 6; // skip searchRange, entrySelector, rangeShift $offset += 6; // skip searchRange, entrySelector, rangeShift
$endCount = array(); // array of end character codes for each segment $endCount = array(); // array of end character codes for each segment
@ -645,7 +645,7 @@ class TCPDF_FONTS {
$idRangeOffset[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); $idRangeOffset[$k] = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2; $offset += 2;
} }
$gidlen = ($length / 2) - 8 - (4 * $segCount); $gidlen = (floor($length / 2) - 8 - (4 * $segCount));
$glyphIdArray = array(); // glyph index array $glyphIdArray = array(); // glyph index array
for ($k = 0; $k < $gidlen; ++$k) { for ($k = 0; $k < $gidlen; ++$k) {
$glyphIdArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); $glyphIdArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset);
@ -656,7 +656,7 @@ class TCPDF_FONTS {
if ($idRangeOffset[$k] == 0) { if ($idRangeOffset[$k] == 0) {
$g = ($idDelta[$k] + $c) % 65536; $g = ($idDelta[$k] + $c) % 65536;
} else { } else {
$gid = (($idRangeOffset[$k] / 2) + ($c - $startCount[$k]) - ($segCount - $k)); $gid = (floor($idRangeOffset[$k] / 2) + ($c - $startCount[$k]) - ($segCount - $k));
$g = ($glyphIdArray[$gid] + $idDelta[$k]) % 65536; $g = ($glyphIdArray[$gid] + $idDelta[$k]) % 65536;
} }
if ($g < 0) { if ($g < 0) {
@ -978,7 +978,7 @@ class TCPDF_FONTS {
$offset = $table['loca']['offset']; $offset = $table['loca']['offset'];
if ($short_offset) { if ($short_offset) {
// short version // short version
$tot_num_glyphs = ($table['loca']['length'] / 2); // numGlyphs + 1 $tot_num_glyphs = floor($table['loca']['length'] / 2); // numGlyphs + 1
for ($i = 0; $i < $tot_num_glyphs; ++$i) { for ($i = 0; $i < $tot_num_glyphs; ++$i) {
$indexToLoc[$i] = TCPDF_STATIC::_getUSHORT($font, $offset) * 2; $indexToLoc[$i] = TCPDF_STATIC::_getUSHORT($font, $offset) * 2;
$offset += 2; $offset += 2;
@ -1089,7 +1089,7 @@ class TCPDF_FONTS {
$length = TCPDF_STATIC::_getUSHORT($font, $offset); $length = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2; $offset += 2;
$offset += 2; // skip version/language $offset += 2; // skip version/language
$segCount = (TCPDF_STATIC::_getUSHORT($font, $offset) / 2); $segCount = floor(TCPDF_STATIC::_getUSHORT($font, $offset) / 2);
$offset += 2; $offset += 2;
$offset += 6; // skip searchRange, entrySelector, rangeShift $offset += 6; // skip searchRange, entrySelector, rangeShift
$endCount = array(); // array of end character codes for each segment $endCount = array(); // array of end character codes for each segment
@ -1113,7 +1113,7 @@ class TCPDF_FONTS {
$idRangeOffset[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); $idRangeOffset[$k] = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2; $offset += 2;
} }
$gidlen = ($length / 2) - 8 - (4 * $segCount); $gidlen = (floor($length / 2) - 8 - (4 * $segCount));
$glyphIdArray = array(); // glyph index array $glyphIdArray = array(); // glyph index array
for ($k = 0; $k < $gidlen; ++$k) { for ($k = 0; $k < $gidlen; ++$k) {
$glyphIdArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); $glyphIdArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset);
@ -1125,7 +1125,7 @@ class TCPDF_FONTS {
if ($idRangeOffset[$k] == 0) { if ($idRangeOffset[$k] == 0) {
$g = ($idDelta[$k] + $c) % 65536; $g = ($idDelta[$k] + $c) % 65536;
} else { } else {
$gid = (($idRangeOffset[$k] / 2) + ($c - $startCount[$k]) - ($segCount - $k)); $gid = (floor($idRangeOffset[$k] / 2) + ($c - $startCount[$k]) - ($segCount - $k));
$g = ($glyphIdArray[$gid] + $idDelta[$k]) % 65536; $g = ($glyphIdArray[$gid] + $idDelta[$k]) % 65536;
} }
if ($g < 0) { if ($g < 0) {
@ -1288,7 +1288,7 @@ class TCPDF_FONTS {
$length = 0; $length = 0;
} }
if ($short_offset) { if ($short_offset) {
$loca .= pack('n', ($offset / 2)); $loca .= pack('n', floor($offset / 2));
} else { } else {
$loca .= pack('N', $offset); $loca .= pack('N', $offset);
} }

View File

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

View File

@ -1,7 +1,7 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 6.0.019 // Version : 6.0.020
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2013-06-04 // Last Update : 2013-06-04
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
@ -139,7 +139,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.019 * @version 6.0.020
*/ */
// TCPDF configuration // TCPDF configuration
@ -163,7 +163,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.019 * @version 6.0.020
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF { class TCPDF {