From 075083159a9e7f93339926bceec6fd2fbd85c9a3 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Sat, 22 Jun 2024 15:33:32 +0200 Subject: [PATCH 01/15] qual: use getDolGlobalString() for product/class/product.class.php (#30106) * qual: use getDolGlobalString() for product/class/product.class.php * better fix * fix phan warning Avoid function calls in a FOR loop test part --- htdocs/product/class/product.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3486a962ee6..8bb7a61876a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1035,7 +1035,7 @@ class Product extends CommonObject // phpcs:enable global $conf; if (isModEnabled('barcode') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { - $module = strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM); + $module = strtolower(getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')); $dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); foreach ($dirsociete as $dirroot) { @@ -2750,7 +2750,8 @@ class Product extends CommonObject // Load multiprices array if (getDolGlobalString('PRODUIT_MULTIPRICES') && empty($ignore_price_load)) { // prices per segment - for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + $produit_multiprices_limit = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 1; $i <= $produit_multiprices_limit; $i++) { $sql = "SELECT price, price_ttc, price_min, price_min_ttc,"; $sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly"; $sql .= " ,price_label"; @@ -2866,7 +2867,8 @@ class Product extends CommonObject return -1; } } elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') && empty($ignore_price_load)) { // prices per customer and quantity - for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + $produit_multiprices_limit = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 1; $i <= $produit_multiprices_limit; $i++) { $sql = "SELECT price, price_ttc, price_min, price_min_ttc,"; $sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly"; $sql .= " FROM ".$this->db->prefix()."product_price"; @@ -5922,7 +5924,7 @@ class Product extends CommonObject $stock_sending_client = $this->stats_expedition['qty']; } if (isModEnabled("supplier_order")) { - $filterStatus = !getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK') ? '3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; + $filterStatus = getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK', '3,4'); if (isset($includedraftpoforvirtual)) { $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them } @@ -6481,7 +6483,7 @@ class Product extends CommonObject } } - $maxpricesupplier *= $conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE; + $maxpricesupplier *= getDolGlobalString('PRODUCT_MINIMUM_RECOMMENDED_PRICE'); } } From 0f1ae4269172552e42cb727c7fd183fabd0e0018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 22 Jun 2024 15:36:10 +0200 Subject: [PATCH 02/15] fix phan (#30113) * fix phan * Update project.class.php * Update project.class.php * try to fix * try to fix * try to fix * try to fix * try to fix --- dev/tools/phan/baseline.txt | 2 +- htdocs/core/lib/images.lib.php | 2 -- htdocs/projet/class/project.class.php | 9 ++++++--- htdocs/societe/class/companypaymentmode.class.php | 8 ++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index d353040f25f..5177edcc758 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -1203,7 +1203,7 @@ return [ 'htdocs/projet/card.php' => ['PhanEmptyFQSENInClasslike', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeObjectUnsetDeclaredProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/projet/class/api_projects.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/projet/class/project.class.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypePossiblyInvalidDimOffset'], + 'htdocs/projet/class/project.class.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypePossiblyInvalidDimOffset', 'PhanPluginSuspiciousParamPosition'], 'htdocs/projet/class/projectstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/projet/class/task.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/class/taskstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 1960730c938..f1301d5d6dc 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -1,6 +1,4 @@ * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2024 MDW diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index fef5cafc92b..26641c1cf86 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2497,11 +2497,14 @@ class Project extends CommonObject } $return .= ''.dol_print_date($this->date_end, 'day').''; }*/ - if (property_exists($this, 'thirdparty') && is_object($this->thirdparty)) { + if (property_exists($this, 'thirdparty') && !is_null($this->thirdparty) && is_object($this->thirdparty) && $this->thirdparty instanceof Societe) { $return .= '
'.$this->thirdparty->getNomUrl(1); - $return .= '
'; - $return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone', $this->thirdparty->phone, 0, 'marginleftonly'); $return .= '
'; + if (!empty($this->thirdparty->phone)) { + $return .= '
'; + $return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone', $this->thirdparty->phone, 0, 'marginleftonly'); + $return .= '
'; + } } if (!empty($arraydata['assignedusers'])) { $return .= '
'; diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index c6bf2a70fc8..8da42abd054 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -1,7 +1,7 @@ - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -301,7 +301,7 @@ class CompanyPaymentMode extends CommonObject // For backward compatibility $this->iban = $this->iban_prefix; - $this->date_modification = $this->tmps; + $this->date_modification = $this->tms; //if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines(); return $result; From 9b6586ea648bc77a0a99c600e9613e222a98e4d2 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Sat, 22 Jun 2024 15:40:26 +0200 Subject: [PATCH 03/15] qual: phpdoc for ProductCombination.class.php (#30105) * qual: phpdoc for ProductCombination.class.php * use array_map to cast array values upstream * phpdoc * fix phan warning Avoid function calls in a FOR loop test part --- .../class/ProductCombination.class.php | 36 ++++++++++--------- htdocs/variants/combinations.php | 17 +++++---- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 868d8ff6566..4eb52c81e84 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -204,7 +204,8 @@ class ProductCombination if ($fk_price_level > 0) { $combination_price_levels[$fk_price_level] = ProductCombinationLevel::createFromParent($this->db, $this, $fk_price_level); } else { - for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + $produit_multiprices_limit = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 1; $i <= $produit_multiprices_limit; $i++) { $combination_price_levels[$i] = ProductCombinationLevel::createFromParent($this->db, $this, $i); } } @@ -553,7 +554,8 @@ class ProductCombination // MultiPrix if (getDolGlobalString('PRODUIT_MULTIPRICES')) { - for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + $produit_multiprices_limit = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 1; $i <= $produit_multiprices_limit; $i++) { if ($parent->multiprices[$i] != '' || isset($this->combination_price_levels[$i]->variation_price)) { $new_type = empty($parent->multiprices_base_type[$i]) ? 'HT' : $parent->multiprices_base_type[$i]; $new_min_price = $parent->multiprices_min[$i]; @@ -744,16 +746,16 @@ class ProductCombination * [...] * ) * - * @param User $user Object user - * @param Product $product Parent product - * @param array $combinations Attribute and value combinations. + * @param User $user User + * @param Product $product Parent Product + * @param array $combinations Attribute and value combinations. * @param array> $variations Price and weight variations (example: $variations[fk_product_attribute][fk_product_attribute_value]['weight']) - * @param bool|array $price_var_percent Is the price variation a relative variation? - * @param bool|float $forced_pricevar If the price variation is forced - * @param bool|float $forced_weightvar If the weight variation is forced - * @param bool|string $forced_refvar If the reference is forced - * @param string $ref_ext External reference - * @return int<-1,1> Return integer <0 KO, >0 OK + * @param bool|bool[] $price_var_percent Is the price variation value a relative variation (in %)? (it is an array if global constant "PRODUIT_MULTIPRICES" is on) + * @param false|float|float[] $forced_pricevar Value of the price variation if it is forced ; in currency or percent. (it is an array if global constant "PRODUIT_MULTIPRICES" is on) + * @param false|float $forced_weightvar Value of the weight variation if it is forced + * @param false|string $forced_refvar Value of the reference if it is forced + * @param string $ref_ext External reference + * @return int<-1,1> Return integer <0 KO, >0 OK */ public function createProductCombination(User $user, Product $product, array $combinations, array $variations, $price_var_percent = false, $forced_pricevar = false, $forced_weightvar = false, $forced_refvar = false, $ref_ext = '') { @@ -846,8 +848,9 @@ class ProductCombination $price_impact[1] += (float) price2num($variations[$currcombattr][$currcombval]['price']); // Manage Price levels - if ($conf->global->PRODUIT_MULTIPRICES) { - for ($i = 2; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + if (getDolGlobalString('PRODUIT_MULTIPRICES')) { + $produit_multiprices_limit = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 2; $i <= $produit_multiprices_limit; $i++) { $price_impact[$i] += (float) price2num($variations[$currcombattr][$currcombval]['price']); } } @@ -874,8 +877,9 @@ class ProductCombination $newcomb->variation_ref_ext = $this->db->escape($ref_ext); // Init price level - if ($conf->global->PRODUIT_MULTIPRICES) { - for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + if (getDolGlobalString('PRODUIT_MULTIPRICES')) { + $produit_multiprices_limit = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 1; $i <= $produit_multiprices_limit; $i++) { $productCombinationLevel = new ProductCombinationLevel($this->db); $productCombinationLevel->fk_product_attribute_combination = $newcomb->id; $productCombinationLevel->fk_price_level = $i; @@ -1300,7 +1304,7 @@ class ProductCombinationLevel $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE fk_product_attribute_combination = ".(int) $fk_product_attribute_combination; - $sql .= " AND fk_price_level > ".intval($conf->global->PRODUIT_MULTIPRICES_LIMIT); + $sql .= " AND fk_price_level > ".(int) getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); $res = $this->db->query($sql); return $res ? 1 : -1; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 39c40a40816..1130451a633 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -40,8 +40,12 @@ $weight_impact = GETPOSTFLOAT('weight_impact', 2); $price_impact_percent = (bool) GETPOST('price_impact_percent'); $price_impact = $price_impact_percent ? GETPOSTFLOAT('price_impact', 2) : GETPOSTFLOAT('price_impact', 'MU'); +// for PRODUIT_MULTIPRICES $level_price_impact = GETPOST('level_price_impact', 'array'); +$level_price_impact = array_map('price2num', $level_price_impact); +$level_price_impact = array_map('floatval', $level_price_impact); $level_price_impact_percent = GETPOST('level_price_impact_percent', 'array'); +$level_price_impact_percent = array_map('boolval', $level_price_impact_percent); $form = new Form($db); @@ -154,10 +158,7 @@ if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST( $weight_impact = price2num($weight_impact); $price_impact = price2num($price_impact); - // for conf PRODUIT_MULTIPRICES - if (getDolGlobalString('PRODUIT_MULTIPRICES')) { - $level_price_impact = array_map('price2num', $level_price_impact); - } else { + if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { $level_price_impact = array(1 => $price_impact); $level_price_impact_percent = array(1 => $price_impact_percent); } @@ -280,15 +281,13 @@ if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST( // for conf PRODUIT_MULTIPRICES if (getDolGlobalString('PRODUIT_MULTIPRICES')) { - $level_price_impact = array_map('price2num', $level_price_impact); - - $prodcomb->variation_price = (float) $level_price_impact[1]; - $prodcomb->variation_price_percentage = (bool) $level_price_impact_percent[1]; + $prodcomb->variation_price = $level_price_impact[1]; + $prodcomb->variation_price_percentage = $level_price_impact_percent[1]; } else { $level_price_impact = array(1 => $price_impact); $level_price_impact_percent = array(1 => $price_impact_percent); - $prodcomb->variation_price = (float) $price_impact; + $prodcomb->variation_price = $price_impact; $prodcomb->variation_price_percentage = $price_impact_percent; } From 4dcf9b015da9e560b80b8904684ab691ab670b3c Mon Sep 17 00:00:00 2001 From: thibdrev Date: Sat, 22 Jun 2024 15:41:13 +0200 Subject: [PATCH 04/15] qual: use getDolGlobalString() in products/card.php (#30107) * qual: use getDolGlobalString() in products/card.php * fix phan warning phan / Run phan: htdocs/product/card.php#L693 card.php: PhanNonClassMethodCall: Call to method getNextValue on non-class type ?object * phan fix * try phan fix * fix phan warning Avoid function calls in a FOR loop test part --- htdocs/product/card.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c418ac59c21..c7235dcd684 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -134,7 +134,7 @@ if (!empty($user->socid)) { } // Load object modCodeProduct -$module = (getDolGlobalString('PRODUCT_CODEPRODUCT_ADDON') ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard'); +$module = getDolGlobalString('PRODUCT_CODEPRODUCT_ADDON', 'mod_codeproduct_leopard'); if (substr($module, 0, 16) == 'mod_codeproduct_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module) - 4); } @@ -672,7 +672,8 @@ if (empty($reshook)) { // MultiPrix if (getDolGlobalString('PRODUIT_MULTIPRICES')) { - for ($i = 2; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + $produit_multiprices_limit = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 2; $i <= $produit_multiprices_limit; $i++) { if (GETPOSTISSET("price_".$i)) { $object->multiprices["$i"] = price2num(GETPOST("price_".$i), 'MU'); $object->multiprices_base_type["$i"] = GETPOST("multiprices_base_type_".$i); @@ -690,6 +691,7 @@ if (empty($reshook)) { if (!$ref && getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) { // Generate ref... + '@phan-var ModeleProductCode $modCodeProduct'; $ref = $modCodeProduct->getNextValue($object, $type); } @@ -1067,7 +1069,7 @@ if (empty($reshook)) { $price_base_type = $object->price_base_type; // If multiprice - if ($conf->global->PRODUIT_MULTIPRICES && $soc->price_level) { + if (getDolGlobalString('PRODUIT_MULTIPRICES') && $soc->price_level) { $pu_ht = $object->multiprices[$soc->price_level]; $pu_ttc = $object->multiprices_ttc[$soc->price_level]; $price_base_type = $object->multiprices_base_type[$soc->price_level]; @@ -1279,7 +1281,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-card'); // Load object modBarCodeProduct $res = 0; if (isModEnabled('barcode') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { - $module = strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM); + $module = strtolower(getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')); $dirbarcode = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); foreach ($dirbarcode as $dirroot) { $res = dol_include_once($dirroot.$module.'.php'); @@ -1323,7 +1325,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Load object modCodeProduct - $module = (getDolGlobalString('PRODUCT_CODEPRODUCT_ADDON') ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard'); + $module = getDolGlobalString('PRODUCT_CODEPRODUCT_ADDON', 'mod_codeproduct_leopard'); if (substr($module, 0, 16) == 'mod_codeproduct_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module) - 4); } @@ -1440,7 +1442,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } '; } - if (isset($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) && getDolGlobalString('PRODUCTBATCH_SN_ADDON') == 'mod_sn_advanced') { + if (getDolGlobalString('PRODUCTBATCH_SN_USE_PRODUCT_MASKS') && getDolGlobalString('PRODUCTBATCH_SN_ADDON') == 'mod_sn_advanced') { print ' if (this.value == 2) { $("#field_mask, #mask_option").toggleClass("hideobject"); @@ -1581,7 +1583,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''.$langs->trans("Weight").''; print img_picto('', 'fa-balance-scale', 'class="pictofixedwidth"'); print ''; - print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ? GETPOST('weight_units', 'alpha') : (!getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT') ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2); + print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ? GETPOST('weight_units', 'alpha') : (!getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT') ? 0 : getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT')), 0, 2); print ''; } @@ -1614,7 +1616,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Net Measure print ''.$langs->trans("NetMeasure").''; print ''; - print $formproduct->selectMeasuringUnits("net_measure_units", '', GETPOSTISSET('net_measure_units') ? GETPOST('net_measure_units', 'alpha') : (!getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT') ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 0); + print $formproduct->selectMeasuringUnits("net_measure_units", '', GETPOSTISSET('net_measure_units') ? GETPOST('net_measure_units', 'alpha') : (!getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT') ? 0 : getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT')), 0, 0); print ''; } } @@ -1623,7 +1625,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if (getDolGlobalString('PRODUCT_USE_UNITS')) { print ''.$langs->trans('DefaultUnitToShow').''; print ''; - print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit, 'units'); + print $form->selectUnits(empty($line->fk_unit) ? getDolGlobalString('PRODUCT_USE_UNITS') : $line->fk_unit, 'units'); print ''; } @@ -1671,7 +1673,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Note (private, no output on invoices, propales...) - //if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) available in create mode + //if (!empty(getDolGlobalString('MAIN_DISABLE_NOTES_TAB'))) available in create mode //{ print ''.$langs->trans("NoteNotVisibleOnBill").''; @@ -1714,7 +1716,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Price print ''.$langs->trans("SellingPrice").''; print ''; - print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE, "price_base_type"); + print $form->selectPriceBaseType(getDolGlobalString('PRODUCT_PRICE_BASE_TYPE'), "price_base_type"); print ''; // Min price From 6deb1d9e645be0e931f7313855ca58e32d1203fc Mon Sep 17 00:00:00 2001 From: MaximilienR-easya <122890855+MaximilienR-easya@users.noreply.github.com> Date: Sat, 22 Jun 2024 15:46:53 +0200 Subject: [PATCH 05/15] clean code openid connect (#30119) * clean openid connect * clean openid connect * phan * Forget a include due to a next PR --- .../core/login/functions_openid_connect.php | 199 ++++++++++-------- 1 file changed, 114 insertions(+), 85 deletions(-) diff --git a/htdocs/core/login/functions_openid_connect.php b/htdocs/core/login/functions_openid_connect.php index 47cc12689ae..81b829b1890 100644 --- a/htdocs/core/login/functions_openid_connect.php +++ b/htdocs/core/login/functions_openid_connect.php @@ -2,6 +2,7 @@ /* Copyright (C) 2022 Jeritiana Ravelojaona * Copyright (C) 2023-2024 Solution Libre SAS * Copyright (C) 2024 MDW + * Copyright (C) 2024 Maximilien Rozniecki * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +20,7 @@ /** * \file htdocs/core/login/functions_openid_connect.php - * \ingroup core + * \ingroup openid_connect * \brief OpenID Connect: Authorization Code flow authentication * * See https://github.com/Dolibarr/dolibarr/issues/22740 for more information about setup openid_connect @@ -38,7 +39,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; */ function check_user_password_openid_connect($usertotest, $passwordtotest, $entitytotest) { - global $db, $conf, $langs; + global $db; // Force master entity in transversal mode $entity = $entitytotest; @@ -46,8 +47,6 @@ function check_user_password_openid_connect($usertotest, $passwordtotest, $entit $entity = 1; } - $login = ''; - dol_syslog("functions_openid_connect::check_user_password_openid_connect usertotest=".$usertotest." passwordtotest=".preg_replace('/./', '*', $passwordtotest)." entitytotest=".$entitytotest); // Step 1 is done by user: request an authorization code @@ -55,93 +54,123 @@ function check_user_password_openid_connect($usertotest, $passwordtotest, $entit if (GETPOSTISSET('username')) { // OIDC does not require credentials here: pass on to next auth handler $_SESSION["dol_loginmesg"] = "Not an OpenID Connect flow"; - dol_syslog("functions_openid_connect::check_user_password_openid_connect not an OIDC flow"); + dol_syslog("functions_openid_connect::check_user_password_openid_connect::not an OIDC flow"); + return false; } elseif (!GETPOSTISSET('state')) { // No state received $_SESSION["dol_loginmesg"] = "Error in OAuth 2.0 flow (no state received)"; - } elseif (GETPOSTISSET('code')) { - $auth_code = GETPOST('code', 'aZ09'); - $state = GETPOST('state', 'aZ09'); - dol_syslog('functions_openid_connect::check_user_password_openid_connect code='.$auth_code.' state='.$state); - - if ($state === hash('sha256', session_id())) { - // Step 2: turn the authorization code into an access token, using client_secret - $auth_param = [ - 'grant_type' => 'authorization_code', - 'client_id' => getDolGlobalString('MAIN_AUTHENTICATION_OIDC_CLIENT_ID'), - 'client_secret' => getDolGlobalString('MAIN_AUTHENTICATION_OIDC_CLIENT_SECRET'), - 'code' => $auth_code, - 'redirect_uri' => getDolGlobalString('MAIN_AUTHENTICATION_OIDC_REDIRECT_URL') - ]; - - $token_response = getURLContent($conf->global->MAIN_AUTHENTICATION_OIDC_TOKEN_URL, 'POST', http_build_query($auth_param)); - $token_content = json_decode($token_response['content']); - dol_syslog("functions_openid_connect::check_user_password_openid_connect /token=".print_r($token_response, true), LOG_DEBUG); - - if (property_exists($token_content, 'access_token')) { - // Step 3: retrieve user info using token - $userinfo_headers = array('Authorization: Bearer '.$token_content->access_token); - $userinfo_response = getURLContent($conf->global->MAIN_AUTHENTICATION_OIDC_USERINFO_URL, 'GET', '', 1, $userinfo_headers); - $userinfo_content = json_decode($userinfo_response['content']); - - dol_syslog("functions_openid_connect::check_user_password_openid_connect /userinfo=".print_r($userinfo_response, true), LOG_DEBUG); - - // Get the user attribute (claim) matching the Dolibarr login - $login_claim = 'email'; // default - if (getDolGlobalString('MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM')) { - $login_claim = getDolGlobalString('MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM'); - } - - if (property_exists($userinfo_content, $login_claim)) { - // Success: retrieve claim to return to Dolibarr as login - $sql = 'SELECT login, entity, datestartvalidity, dateendvalidity'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'user'; - $sql .= " WHERE login = '".$db->escape($userinfo_content->$login_claim)."'"; - $sql .= ' AND entity IN (0,'.(array_key_exists('dol_entity', $_SESSION) ? ((int) $_SESSION["dol_entity"]) : 1).')'; - - dol_syslog("functions_openid::check_user_password_openid", LOG_DEBUG); - - $resql = $db->query($sql); - if ($resql) { - $obj = $db->fetch_object($resql); - if ($obj) { - // Note: Test on date validity is done later natively with isNotIntoValidityDateRange() by core after calling checkLoginPassEntity() that call this method - $login = $obj->login; - } - } - } elseif ($userinfo_content->error) { - // Got user info response but content is an error - $_SESSION["dol_loginmesg"] = "Error in OAuth 2.0 flow (".$userinfo_content->error_description.")"; - } elseif ($userinfo_response['http_code'] == 200) { - // Claim does not exist - $_SESSION["dol_loginmesg"] = "OpenID Connect claim not found: ".$login_claim; - } elseif ($userinfo_response['curl_error_no']) { - // User info request error - $_SESSION["dol_loginmesg"] = "Network error: ".$userinfo_response['curl_error_msg']." (".$userinfo_response['curl_error_no'].")"; - } else { - // Other user info request error - $_SESSION["dol_loginmesg"] = "Userinfo request error (".$userinfo_response['http_code'].")"; - } - } elseif ($token_content->error) { - // Got token response but content is an error - $_SESSION["dol_loginmesg"] = "Error in OAuth 2.0 flow (".$token_content->error_description.")"; - } elseif ($token_response['curl_error_no']) { - // Token request error - $_SESSION["dol_loginmesg"] = "Network error: ".$token_response['curl_error_msg']." (".$token_response['curl_error_no'].")"; - } else { - // Other token request error - $_SESSION["dol_loginmesg"] = "Token request error (".$token_response['http_code'].")"; - } - } else { - // No code received - $_SESSION["dol_loginmesg"] = "Error in OAuth 2.0 flow (state does not match)"; - } - } else { + dol_syslog("functions_openid_connect::check_user_password_openid_connect::no state received", LOG_ERR); + return false; + } elseif (!GETPOSTISSET('code')) { // No code received $_SESSION["dol_loginmesg"] = "Error in OAuth 2.0 flow (no code received)"; + dol_syslog("functions_openid_connect::check_user_password_openid_connect::no code received", LOG_ERR); + return false; } - dol_syslog("functions_openid_connect::check_user_password_openid_connect END"); + $auth_code = GETPOST('code', 'aZ09'); + $state = GETPOST('state', 'aZ09'); + dol_syslog('functions_openid_connect::check_user_password_openid_connect code='.$auth_code.' state='.$state); - return !empty($login) ? $login : false; + if ($state !== hash('sha256', session_id())) { + // State does not match + $_SESSION["dol_loginmesg"] = "Error in OAuth 2.0 flow (state does not match)"; + dol_syslog("functions_openid_connect::check_user_password_openid_connect::state does not match", LOG_ERR); + return false; + } + + // Step 2: turn the authorization code into an access token, using client_secret + $auth_param = [ + 'grant_type' => 'authorization_code', + 'client_id' => getDolGlobalString('MAIN_AUTHENTICATION_OIDC_CLIENT_ID'), + 'client_secret' => getDolGlobalString('MAIN_AUTHENTICATION_OIDC_CLIENT_SECRET'), + 'code' => $auth_code, + 'redirect_uri' => getDolGlobalString('MAIN_AUTHENTICATION_OIDC_REDIRECT_URL') + ]; + + $token_response = getURLContent(getDolGlobalString('MAIN_AUTHENTICATION_OIDC_TOKEN_URL'), 'POST', http_build_query($auth_param), 1, array(), array('https'), 2); + $token_content = json_decode($token_response['content']); + dol_syslog("functions_openid_connect::check_user_password_openid_connect /token=".print_r($token_response, true), LOG_DEBUG); + + if ($token_response['curl_error_no']) { + // Token request error + $_SESSION["dol_loginmesg"] = "Network error: ".$token_response['curl_error_msg']." (".$token_response['curl_error_no'].")"; + dol_syslog("functions_openid_connect::check_user_password_openid_connect::".$_SESSION["dol_loginmesg"], LOG_ERR); + return false; + } elseif ($token_response['http_code'] >= 400 && $token_response['http_code'] < 500) { + // HTTP Error + $_SESSION["dol_loginmesg"] = "Error in OAuth 2.0 flow (".$token_response['content'].")"; + dol_syslog("functions_openid_connect::check_user_password_openid_connect::".$token_response['content'], LOG_ERR); + return false; + } elseif ($token_content->error) { + // Got token response but content is an error + $_SESSION["dol_loginmesg"] = "Error in OAuth 2.0 flow (".$token_content->error_description.")"; + dol_syslog("functions_openid_connect::check_user_password_openid_connect::".$token_content->error_description, LOG_ERR); + return false; + } elseif (!property_exists($token_content, 'access_token')) { + // Other token request error + $_SESSION["dol_loginmesg"] = "Token request error (".$token_response['http_code'].")"; + dol_syslog("functions_openid_connect::check_user_password_openid_connect::".$_SESSION["dol_loginmesg"], LOG_ERR); + return false; + } + + // Step 3: retrieve user info using token + $userinfo_headers = array('Authorization: Bearer '.$token_content->access_token); + $userinfo_response = getURLContent(getDolGlobalString('MAIN_AUTHENTICATION_OIDC_USERINFO_URL'), 'GET', '', 1, $userinfo_headers, array('https'), 2); + $userinfo_content = json_decode($userinfo_response['content']); + + dol_syslog("functions_openid_connect::check_user_password_openid_connect /userinfo=".print_r($userinfo_response, true), LOG_DEBUG); + + // Get the user attribute (claim) matching the Dolibarr login + $login_claim = 'email'; // default + if (getDolGlobalString('MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM')) { + $login_claim = getDolGlobalString('MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM'); + } + + if ($userinfo_response['curl_error_no']) { + // User info request error + $_SESSION["dol_loginmesg"] = "Network error: ".$userinfo_response['curl_error_msg']." (".$userinfo_response['curl_error_no'].")"; + dol_syslog("functions_openid_connect::check_user_password_openid_connect::".$_SESSION["dol_loginmesg"], LOG_ERR); + return false; + } elseif ($userinfo_response['http_code'] >= 400 && $userinfo_response['http_code'] < 500) { + // HTTP Error + $_SESSION["dol_loginmesg"] = "OpenID Connect user info error: " . $userinfo_response['content']; + dol_syslog("functions_openid_connect::check_user_password_openid_connect::".$userinfo_response['content'], LOG_ERR); + return false; + } elseif ($userinfo_content->error) { + // Got user info response but content is an error + $_SESSION["dol_loginmesg"] = "Error in OAuth 2.0 flow (".$userinfo_content->error_description.")"; + dol_syslog("functions_openid_connect::check_user_password_openid_connect::".$userinfo_content->error_description, LOG_ERR); + return false; + } elseif (!property_exists($userinfo_content, $login_claim)) { + // Other user info request error + $_SESSION["dol_loginmesg"] = "Userinfo request error (".$userinfo_response['http_code'].")"; + dol_syslog("functions_openid_connect::check_user_password_openid_connect::".$_SESSION["dol_loginmesg"], LOG_ERR); + return false; + } + + // Success: retrieve claim to return to Dolibarr as login + $sql = 'SELECT login, entity, datestartvalidity, dateendvalidity'; + $sql .= ' FROM '.MAIN_DB_PREFIX.'user'; + $sql .= " WHERE login = '".$db->escape($userinfo_content->$login_claim)."'"; + $sql .= ' AND entity IN (0,'.(array_key_exists('dol_entity', $_SESSION) ? ((int) $_SESSION["dol_entity"]) : 1).')'; + + dol_syslog("functions_openid::check_user_password_openid", LOG_DEBUG); + + $resql = $db->query($sql); + if (!$resql) { + dol_syslog("functions_openid_connect::check_user_password_openid_connect::Error with sql query (".$db->error().")"); + return false; + } + $obj = $db->fetch_object($resql); + if (!$obj) { + dol_syslog("functions_openid_connect::check_user_password_openid_connect::Error no result from the query"); + return false; + } + + $_SESSION['OPENID_CONNECT'] = true; + + // Note: Test on date validity is done later natively with isNotIntoValidityDateRange() by core after calling checkLoginPassEntity() that call this method + dol_syslog("functions_openid_connect::check_user_password_openid_connect END"); + return $obj->login; } From 0acb61367405668eb2a32bd6c915fdccb7425a6f Mon Sep 17 00:00:00 2001 From: thibdrev Date: Sat, 22 Jun 2024 15:47:31 +0200 Subject: [PATCH 06/15] qual: use getDolGlobalString() for /product/price.php (#30114) * qual: use getDolGlobalString() for /product/price.php * phan fix * fiw phan warning Avoid function calls in a FOR loop test part --- htdocs/product/price.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index fd7dccc9e2f..c71a853e535 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -205,7 +205,8 @@ if (empty($reshook)) { if (!$error) { if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { - for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + $produit_multiprices_limit = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 1; $i <= $produit_multiprices_limit; $i++) { // Force the update of the price of the product using the new VAT if ($object->multiprices_base_type[$i] == 'HT') { $oldprice = $object->multiprices[$i]; @@ -298,7 +299,8 @@ if (empty($reshook)) { //Shall we generate prices using price rules? $object->price_autogen = (int) (GETPOST('usePriceRules') == 'on'); - for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + $produit_multiprices_limit = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 1; $i <= $produit_multiprices_limit; $i++) { if (!isset($newprice[$i])) { continue; } @@ -1069,7 +1071,8 @@ if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUS print ''.$langs->trans("MinPrice").''; print ''; - for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + $produit_multiprices_limit = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 1; $i <= $produit_multiprices_limit; $i++) { print ''; // Label of price @@ -1086,7 +1089,7 @@ if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUS print ''; } else { print $langs->trans("SellingPrice").' '.$i; - if (!empty($conf->global->$keyforlabel)) { + if (!empty(getDolGlobalString('$keyforlabel'))) { print ' - '.$langs->trans(getDolGlobalString($keyforlabel)); } } @@ -1119,7 +1122,7 @@ if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUS // Price by quantity if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { // TODO Fix the form included into a tr instead of a td print ''.$langs->trans("PriceByQuantity").' '.$i; - if (!empty($conf->global->$keyforlabel)) { + if (!empty(getDolGlobalString('$keyforlabel'))) { print ' - '.$langs->trans(getDolGlobalString($keyforlabel)); } print ''; @@ -1611,7 +1614,8 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print ''; - for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + $produit_multiprices_limit = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 1; $i <= $produit_multiprices_limit; $i++) { print ''; print ''; $keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.$i; From 7ad21964e23f3328088894629bd041983459b99f Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 22 Jun 2024 15:50:27 +0200 Subject: [PATCH 07/15] QUAL #30122 (#30131) --- htdocs/comm/propal/class/propal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a3d9343cad7..2247065c0a6 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -4330,7 +4330,7 @@ class PropaleLigne extends CommonObjectLine $sql .= " '".$this->db->escape($this->localtax1_type)."',"; $sql .= " '".$this->db->escape($this->localtax2_type)."',"; $sql .= " ".(price2num($this->subprice) !== '' ? price2num($this->subprice, 'MU') : "null").","; - $sql .= " ".price2num($this->remise_percent, 3).","; + $sql .= " ".price2num($this->remise_percent).","; $sql .= " ".(isset($this->info_bits) ? ((int) $this->info_bits) : "null").","; $sql .= " ".price2num($this->total_ht, 'MT').","; $sql .= " ".price2num($this->total_tva, 'MT').","; From 4c3b2a0e99bb65f46dc0ddb3f950921a1997f473 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Sat, 22 Jun 2024 15:52:10 +0200 Subject: [PATCH 08/15] Fix webhook list of trigger to add picto of trigger codes (#30124) Co-authored-by: Hystepik --- htdocs/webhook/class/target.class.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index bf85177ad4f..d48af47c683 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -210,9 +210,22 @@ class Target extends CommonObject */ public function initListOfTriggers() { + $entitytoicon = array( + 'societe' => 'company', + 'facture' => 'bill', + 'commande' => 'order', + 'order_supplier' => 'supplier_order', + 'proposal_supplier' => 'supplier_proposal', + 'invoice_supplier' => 'supplier_invoice', + 'facturerec' => 'bill', + 'ficheinter' => 'intervention', + 'shipping' => 'shipment', + 'contrat' => 'contract', + 'recruitment' => 'recruitmentjobposition', + ); // Define the array $arrayofkeyval for $this->fields["trigger_codes"] if (!empty($this->fields["trigger_codes"]['arrayofkeyval']) && is_array($this->fields["trigger_codes"]['arrayofkeyval']) && !empty($this->fields["trigger_codes"]["multiinput"])) { - $sql = "SELECT c.code, c.label FROM ".MAIN_DB_PREFIX."c_action_trigger as c ORDER BY c.rang DESC"; + $sql = "SELECT c.code, c.label, c.elementtype FROM ".MAIN_DB_PREFIX."c_action_trigger as c ORDER BY c.rang ASC"; $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); @@ -220,7 +233,8 @@ class Target extends CommonObject $arraytrigger = array(); while ($i < $num) { $obj = $this->db->fetch_object($resql); - $arraytrigger[$obj->code] = $obj->label.' ('.$obj->code.')'; + $elementtype = (!empty($entitytoicon[$obj->elementtype]) ? $entitytoicon[$obj->elementtype] : $obj->elementtype); + $arraytrigger[$obj->code] = img_object("", $elementtype).' '.$obj->label.' ('.$obj->code.')'; $i++; } $this->fields["trigger_codes"]['arrayofkeyval'] = $arraytrigger; From f15133562da73fb8af71040bc26ee954f28501b6 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Sat, 22 Jun 2024 15:56:58 +0200 Subject: [PATCH 09/15] Update llx_c_socialnetworks.sql LinkedIn link (#30121) Wrong link for LinkedIn social network --- htdocs/install/mysql/data/llx_c_socialnetworks.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_socialnetworks.sql b/htdocs/install/mysql/data/llx_c_socialnetworks.sql index a5800230cab..a7eae8b3996 100644 --- a/htdocs/install/mysql/data/llx_c_socialnetworks.sql +++ b/htdocs/install/mysql/data/llx_c_socialnetworks.sql @@ -39,7 +39,7 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'github', 'GitHub', 'https://www.github.com/{socialid}', '', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'googleplus', 'GooglePlus', 'https://www.googleplus.com/{socialid}', 'fa-google-plus', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'instagram', 'Instagram', 'https://www.instagram.com/{socialid}', 'fa-instagram', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'linkedin', 'LinkedIn', 'https://www.linkedin.com/{socialid}', 'fa-linkedin', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'linkedin', 'LinkedIn', 'https://www.linkedin.com/in/{socialid}', 'fa-linkedin', 1); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'mastodon', 'Mastodon', '{socialid}', '', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'meetup', 'Meetup', '{socialid}', 'fa-meetup', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'periscope', 'Periscope', '{socialid}', '', 0); From ce3735932edeaa2d60f4ca72a0c65b430b24f796 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Sat, 22 Jun 2024 16:01:56 +0200 Subject: [PATCH 10/15] Fix display button when ia module was enabled (#30104) --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 00fa9cd1eb1..49bf0825b16 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -4625,7 +4625,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties $formmail->withlayout = 1; $showlinktolayout = $formmail->withlayout; $showlinktoai = ($formmail->withaiprompt && isModEnabled('ai')) ? 'textgenerationwebpage' : ''; - if ($action == 'createcontainer' && $showlinktolayout && $showlinktoai) { + if (($action == 'createcontainer' && $showlinktolayout) || ($action == 'createcontainer' && $showlinktoai)) { print ''; if ($conf->browser->layout == 'phone') { print $form->textwithpicto('', $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution'); From 3438de91f23bcbea54df590fe9c13f45cc4a4829 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Sat, 22 Jun 2024 16:03:17 +0200 Subject: [PATCH 11/15] qual: use getDolGlobalString() for product/admin/price_rules.php (#30112) * qual: use getDolGlobalString() for product/admin/price_rules.php * fix phan warning Avoid function calls in a FOR loop test part --- htdocs/product/admin/price_rules.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/product/admin/price_rules.php b/htdocs/product/admin/price_rules.php index c953e38e925..cd499559fd7 100644 --- a/htdocs/product/admin/price_rules.php +++ b/htdocs/product/admin/price_rules.php @@ -46,7 +46,8 @@ if ($action == 'update') { $var_min_percent = GETPOST('var_min_percent', 'array'); $fk_level = GETPOST('fk_level', 'array'); - for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { + $produit_multiprices_limit = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 1; $i <= $produit_multiprices_limit; $i++) { $check = isset($var_min_percent[$i]); if ($i != 1) { @@ -71,7 +72,7 @@ if ($action == 'update') { $check1 = true; $check2 = $i_var_min_percent; } else { - $check1 = $i_fk_level >= 1 && $i_fk_level <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; + $check1 = $i_fk_level >= 1 && $i_fk_level <= $produit_multiprices_limit; $check2 = $i_var_percent && ($i_var_min_percent || (string) $i_var_min_percent === '0'); } @@ -145,7 +146,8 @@ print ''.$langs->trans("MultiPriceRuleDesc").'global->PRODUIT_MULTIPRICES_LIMIT; $i++) { +$produit_multiprices_limit = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); +for ($i = 1; $i <= $produit_multiprices_limit; $i++) { $price_options[$i] = $langs->trans('SellingPrice').' '.$i; } ?> @@ -160,13 +162,13 @@ for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { trans('PercentDiscountOver', $langs->trans('SellingPrice').' 1') ?> - global->PRODUIT_MULTIPRICES_LIMIT; $i++) : ?> + trans('SellingPrice').' '.$i; // Label of price $keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.$i; - if (!empty($conf->global->$keyforlabel)) { + if (!empty(getDolGlobalString('$keyforlabel'))) { print ' - '.$langs->trans(getDolGlobalString($keyforlabel)); } ?> From b43fc088b42c7604dbbefbccb913673b8848c675 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Sat, 22 Jun 2024 16:05:30 +0200 Subject: [PATCH 12/15] qual: fix PHAN warnings for compta/facture/card.php (#30110) htdocs/compta/facture/card.php 1133 TypeError PhanTypeMismatchProperty Assigning $originentity of type non-empty-array|non-empty-string to property but \Facture->entity is int htdocs/compta/facture/card.php 1968 TypeError PhanTypeMismatchProperty Assigning price2num($retained_warranty) of type string to property but \Facture->retained_warranty is float --- htdocs/compta/facture/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a4179d43000..c6889525e63 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1041,7 +1041,7 @@ if (empty($reshook)) { $db->begin(); $error = 0; - $originentity = GETPOST('originentity'); + $originentity = GETPOSTINT('originentity'); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); if ($ret < 0) { @@ -1965,7 +1965,7 @@ if (empty($reshook)) { if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) { $retained_warranty = GETPOSTINT('retained_warranty'); if (price2num($retained_warranty) > 0) { - $object->retained_warranty = price2num($retained_warranty); + $object->retained_warranty = (float) price2num($retained_warranty); } if (GETPOSTINT('retained_warranty_fk_cond_reglement') > 0) { @@ -3367,7 +3367,7 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; + print ''; if (!empty($currency_tx)) { print ''; } From b0116fd9fa787dfa5efdf02eba805feb5c8d556c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= <81741011+altairis-noe@users.noreply.github.com> Date: Sat, 22 Jun 2024 16:08:26 +0200 Subject: [PATCH 13/15] NEW: redirect to expedition card if global search has unique result (#30108) --- htdocs/expedition/list.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index c5e83bb7f6f..e9569c98b46 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -517,8 +517,8 @@ if (empty($reshook)) { if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode(strval($limit)); } - if ($sall) { - $param .= "&sall=".urlencode($sall); + if ($search_all) { + $param .= "&search_all=".urlencode($search_all); } if ($search_ref_exp) { $param .= "&search_ref_exp=".urlencode($search_ref_exp); @@ -642,7 +642,6 @@ $formcompany = new FormCompany($db); $shipment = new Expedition($db); $helpurl = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'; -llxHeader('', $langs->trans('ListOfSendings'), $helpurl); $sql = 'SELECT'; if ($search_all || $search_user > 0) { @@ -887,6 +886,16 @@ $num = $db->num_rows($resql); $arrayofselected = is_array($toselect) ? $toselect : array(); +// Redirect to expedition card if there is only one result for global search +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".DOL_URL_ROOT.'/expedition/card.php?id='.$id); + exit; +} + +llxHeader('', $langs->trans('ListOfSendings'), $helpurl); + $expedition = new Expedition($db); if ($socid > 0) { From d67069611b3a336d3ad865dcfca5cef4df695d6b Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Sat, 22 Jun 2024 16:11:53 +0200 Subject: [PATCH 14/15] Fix banner for paymentok page (#30095) Co-authored-by: Hystepik --- htdocs/public/payment/paymentok.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index e3a416d364f..082ac3c4d1d 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -141,6 +141,16 @@ if (empty($validpaymentmethod)) { httponly_accessforbidden('No valid payment mode'); } +// Common variables +$creditor = $mysoc->name; +$paramcreditor = 'ONLINE_PAYMENT_CREDITOR'; +$paramcreditorlong = 'ONLINE_PAYMENT_CREDITOR_'.$suffix; +if (getDolGlobalString($paramcreditorlong)) { + $creditor = getDolGlobalString($paramcreditorlong); // use label long of the seller to show +} elseif (getDolGlobalString($paramcreditor)) { + $creditor = getDolGlobalString($paramcreditor); // use label short of the seller to show +} + $ispaymentok = false; // If payment is ok @@ -238,6 +248,12 @@ if (empty($doactionsthenredirect)) { print ''; } print ''; + } elseif ($creditor) { + print '
'; + print '
'; + print $creditor; + print '
'; + print '
'; } if (getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT')) { print '
'; From 7c9107acc08271224edb422421a63ee14dd9ae16 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Sat, 22 Jun 2024 16:16:11 +0200 Subject: [PATCH 15/15] New TCPDF v6.7.5 (#29903) * New TCPDF v6.7.5 Update TCPDF to the last one * Fix PHAN * Fix PHAN --- dev/dolibarr_changes.txt | 39 +- .../expedition/doc/pdf_espadon.modules.php | 2 +- .../modules/hrm/doc/pdf_standard.modules.php | 2 +- .../movement/doc/pdf_standard.modules.php | 2 +- .../product/doc/pdf_standard.modules.php | 2 +- .../stock/doc/pdf_standard.modules.php | 2 +- .../includes/tecnickcom/tcpdf/CHANGELOG.TXT | 181 +- htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT | 2 +- htdocs/includes/tecnickcom/tcpdf/README.md | 7 +- htdocs/includes/tecnickcom/tcpdf/VERSION | 2 +- .../includes/tecnickcom/tcpdf/composer.json | 93 +- .../tecnickcom/tcpdf/config/tcpdf_config.php | 8 + .../tcpdf/fonts/dejavu-fonts-ttf-2.33/AUTHORS | 53 + .../tcpdf/fonts/dejavu-fonts-ttf-2.33/BUGS | 3 + .../tcpdf/fonts/dejavu-fonts-ttf-2.33/LICENSE | 99 + .../tcpdf/fonts/dejavu-fonts-ttf-2.33/NEWS | 1315 ++++ .../tcpdf/fonts/dejavu-fonts-ttf-2.33/README | 59 + .../fonts/dejavu-fonts-ttf-2.33/langcover.txt | 242 + .../fonts/dejavu-fonts-ttf-2.33/unicover.txt | 215 + .../tcpdf/fonts/dejavu-fonts-ttf-2.34/AUTHORS | 54 + .../tcpdf/fonts/dejavu-fonts-ttf-2.34/BUGS | 3 + .../tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE | 99 + .../tcpdf/fonts/dejavu-fonts-ttf-2.34/NEWS | 1373 ++++ .../tcpdf/fonts/dejavu-fonts-ttf-2.34/README | 59 + .../fonts/dejavu-fonts-ttf-2.34/langcover.txt | 249 + .../fonts/dejavu-fonts-ttf-2.34/unicover.txt | 226 + .../tcpdf/fonts/freefont-20100919/CREDITS | 2 +- .../tcpdf/fonts/freefont-20120503/CREDITS | 2 +- .../tcpdf/include/barcodes/datamatrix.php | 120 +- .../tcpdf/include/barcodes/pdf417.php | 42 +- .../tcpdf/include/barcodes/qrcode.php | 410 +- .../tecnickcom/tcpdf/include/tcpdf_colors.php | 24 +- .../tcpdf/include/tcpdf_filters.php | 52 +- .../tecnickcom/tcpdf/include/tcpdf_fonts.php | 227 +- .../tecnickcom/tcpdf/include/tcpdf_images.php | 37 +- .../tecnickcom/tcpdf/include/tcpdf_static.php | 670 +- .../tecnickcom/tcpdf/scripts/doctum.php | 34 + htdocs/includes/tecnickcom/tcpdf/tcpdf.php | 5813 ++++++++--------- .../tecnickcom/tcpdf/tcpdf_autoconfig.php | 4 + .../tecnickcom/tcpdf/tcpdf_barcodes_1d.php | 149 +- .../tecnickcom/tcpdf/tcpdf_barcodes_2d.php | 46 +- .../tecnickcom/tcpdf/tcpdf_import.php | 4 +- .../tecnickcom/tcpdf/tcpdf_parser.php | 42 +- 43 files changed, 8025 insertions(+), 4044 deletions(-) create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/AUTHORS create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/BUGS create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/LICENSE create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/NEWS create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/README create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/langcover.txt create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/unicover.txt create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/AUTHORS create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/BUGS create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/NEWS create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/README create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/langcover.txt create mode 100644 htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/unicover.txt create mode 100644 htdocs/includes/tecnickcom/tcpdf/scripts/doctum.php diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index d2f4c1c35ba..9f748af3c10 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -113,24 +113,9 @@ PHP TCPDF: to * @public -* Replace in tcpdf.php: - if (isset($this->imagekeys)) { - foreach($this->imagekeys as $file) { - unlink($file); - } - } -with - if (isset($this->imagekeys)) { - foreach($this->imagekeys as $file) { - // DOL CHANGE If we keep this, source image files are physically destroyed - // unlink($file); - } - } - * Replace in tcpdf.php: $preserve = array( 'file_id', - 'internal_encoding', 'state', 'bufferlen', 'buffer', @@ -138,7 +123,6 @@ with with $preserve = array( 'file_id', - 'internal_encoding', 'state', 'bufferlen', 'buffer', @@ -147,16 +131,16 @@ with 'imagekeys', * Replace in tcpdf.php: - if (!@TCPDF_STATIC::file_exists($file)) { + if (!@this->fileExists($file)) { return false; } with - if (!@TCPDF_STATIC::file_exists($file)) { + if (!@this->fileExists($file)) { // DOL CHANGE If we keep this, the image is not visible on pages after the first one. - //var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file))); + //var_dump($file.' '.(!@this->fileExists($file))); //return false; $tfile = str_replace(' ', '%20', $file); - if (@TCPDF_STATIC::file_exists($tfile)) { + if (@this->fileExists($tfile)) { $file = $tfile; } } @@ -191,7 +175,7 @@ with } elseif (strpos($filename, '://') === false) -* To avoid to have QRcode changed because generated with a random mask, replace: +* In tecnickcom/tcpdf/include/barcodes/qrcode.php To avoid to have QRcode changed because generated with a random mask, replace: define('QR_FIND_FROM_RANDOM', 2); with define('QR_FIND_FROM_RANDOM', false); @@ -215,19 +199,6 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php - protected $default_monospaced_font = 'courier'; + protected $default_monospaced_font = 'freemono'; -* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning - of the function, replace: - - $roman = ''; - - with: - - $roman = ''; - if ($number >= 4000) { - // do not represent numbers above 4000 in Roman numerals - return strval($number); - } - * Add this at begin of tcpdf_autoconfig.php // @CHANGE LDR DOCUMENT_ROOT fix for IIS Webserver diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 25d455b4b00..17051e0c90e 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -943,7 +943,7 @@ class pdf_espadon extends ModelePdfExpedition if (empty($hidetop)) { if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } diff --git a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard.modules.php index 8c624b85a0d..0fd40330124 100644 --- a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/hrm/doc/pdf_standard.modules.php @@ -252,7 +252,7 @@ class pdf_standard extends ModelePDFEvaluation $tab_top = 65; $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell(190, 4, $outputlangs->transnoentities("Notes") . ":", 0, 'L', 0, '', 12, $tab_top); + $pdf->MultiCell(190, 4, $outputlangs->transnoentities("Notes") . ":", 0, 'L', 0, 0, 12, $tab_top); $tab_top += 4; $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxnotes + 1, $tab_top + 1, dol_htmlentitiesbr($object->note_public), 0, 1); diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index bdc78c71778..9f12209a783 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -813,7 +813,7 @@ class pdf_standard extends ModelePDFMovement //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index da0260b6627..828688b2743 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -635,7 +635,7 @@ class pdf_standard extends ModelePDFProduct //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index b3da2673106..21e3e2ffdf2 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -610,7 +610,7 @@ class pdf_standard extends ModelePDFStock //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } diff --git a/htdocs/includes/tecnickcom/tcpdf/CHANGELOG.TXT b/htdocs/includes/tecnickcom/tcpdf/CHANGELOG.TXT index 3bdae3e2450..4a845350ee0 100644 --- a/htdocs/includes/tecnickcom/tcpdf/CHANGELOG.TXT +++ b/htdocs/includes/tecnickcom/tcpdf/CHANGELOG.TXT @@ -1,16 +1,189 @@ -6.2.25 +6.7.5 (2024-04-20) + - Update GitHub actions + - fix: CSV-2024-22640 (#712) + +6.7.4 (2024-03-24) + - Upgrade tcpdf tag encryption algorithm. + - Fix regression issue #699. + - Fix security issue. + - [BREAKING CHANGE] The tcpdf HTML tag syntax has changed, see example_049.php. + - New K_ALLOWED_TCPDF_TAGS configuration constant to set the allowed methods for the tcdpf HTML tag. + - Raised minimum PHP version to PHP 5.5.0. + +6.6.5 (2023-09-02) + - Fix corrupted file. + - Fix GitHub automation tests. + - Fix SPDX license ID (#591) + - Fix warning "array offset on value of type null" (#620) + - Improve the README about the status of this library (#589) + - Fix deprecation warning with PHP 8.1 (#614) + - Fixes for PHP 8.2 in tcpdf_fonts.php (#632) + - Fix some php 8+ edge cases (#630) + - Fix composite glyph output (#581) + - Fix "access array offset on value of type bool" with PDF/A (#583) + - Fix non-numeric value warning (#627) + - Fix issues with S25 barcode (#611) + - Fix return type annotations (#613) + - Fix some inconsistencies in type hints (#598) + +6.6.2 (2022-12-17) + - Ensure pregSplit return type is always array. + - Add ability to run tests on various operating systems (#566) + - Avoid a deprecated error from PHP8.1 (#573) + +6.6.1 (2022-12-12) + - Add PHPStan and fix level 1 errors (#307) + +6.6.0 (2022-12-06) + - Multi-byte character support for filename during output (#561). (#562) + - Fix garbage collection (#509) + - FIX: PDF417 corrupt output problem, solution set bcmath scale parameter to zero (#534) + - Fix TypeError: count() in PHP8 (#556) + - Fix-getHTMLFontUnits (#547) + - Improved embedded image in HTML allowing src="data:..." format (#552) + - Fix image abscissa when in RTL (#510) + - fix: php 8.1 notices (#548) + - Optimize PNG files (#563) + - Update documentation for a known issue. (#569) + - Fix for PHP 8.1 (#571) + +6.5.0 (2022-08-12) + - encodeUrlQuery takes into account the port (#493) + - Fixing undefined offset error in writeHTML() when last DOM element ha… + - correct some type hints (#495) + - fix: php 8.1 notices (#481) + - Fixed: null check for PHP 8.1 (#476) + - Fix Infinite Loop in Multicell with Auto Page Breaks Off (#473) + - GetCssBorderStyle Has Problem When !important Is Specified (#467) + - Support Apache 2.4 directives in htaccess file (#530) + - Remove examples from dist package (#542) + +6.4.4 (2021-12-31) + - PHP 8.1 fixes + +6.4.3 (2021-12-28) + - Fix MultiCell PHPDoc typehint (#407) + - Fix type hint for \TCPDF_STATIC::_freadint (#414) + - Footer and Header font phpdoc fixes + constructor $pdfa phpdoc fix + setHeaderData lw param fix (#402) + - Fix text-annotation state options (#412) + - Fix - Named links have been broken. This fixes. (#415) + - Fixed type in comment for $lw header image logo width in mm + - Change Set to set. Fixes #419 (#421) + - Fix failing tests and failing tests not marking exit code as 1 (#426) + - Fix phpdoc and prefer null as default value (#444) + - Run on PHP 8.1 normally and add nightly PHP as allowed to fail (#452) + - Fix AES128 encryption if the OpenSSL extension is installed (#453) + - Explicitly cast values to int for imagesetpixel (#460) + - Fix cell_height_ratio type (#405) + - Leave &NBSP; lowercase when using text-transform (#403) + +6.4.2 (2021-07-20) + - Fix PHP 8.1 type error with TCPDF_STATIC::pregSplit on preg_split + - Fix a PHP array offset error + - Fixed phpdoc blocks + - Drop a PHP 4 polyfill and add a .gitattributes file + - Added a test-suite + - Removed pointless assignments + - Fix docblock spelling error + - Update version info + - Fix color being filled to type 0 with PHP 8 + - Fix warnings for undefined tags for $lineStyle + - Normalized composer.json + - Allowed transparency in PDF/A-2 and PDF/A-3 + - Add a TCPDF composer example + - Fixed implicit conversion from float to int for PHP 8.1 + - Removed status.txt from font directories, because of filesize + - Fixed type hints + - Removed "U" modifier from regexes + +6.4.1 (2021-03-27) + - Update tcpdf version (no code changes) + +6.4.0 (2021-03-27) + - allow styles on
tags + - check if file exists before calling unlink + - Fix image file type for urls with query params + - Fix SVGPath should accept 1.19.30 (equiv 1.19,.30) compacted values list + - Fix Second parameter of TCPDF::cell() must be a number + - PHP 8.0 function signature fixes + - Fix vulnerability to roman numeral bombs + - Optimized a regular expression + - Cache file get contents calls + - Remove mb_internal encoding handling + +6.3.5 (2020-02-14) + - Fixed curly braces in pdf417 + - Fixed a syntax error issue when accessing an index of a casted variable + +6.3.4 (2020-02-12) + - Check if imagekeys exist + - Unlink only images in cache + +6.3.3 (2020-02-12) + - Fixed PHP 7.4 - cannot use array offset on integers + - Fixed PDF/A-3B validation issue caused by missing pdfaSchema:property. + - Removed backup changelog files from repo + - Prevents the deletion of non-existent files in /tmp + - Prevent crash in case of no list access in cache path + - Check existence of file before delete it + - Fixed erase users pictures + - Fixed problem with $imagekeys undefined or unlinked + - Fix SVGPath elliptical arc with rx/ry=0 + z should return to initial point + - Fixed PHP 7.4 errors + - handle integers for pages + - Fixed background image doesn't work in RTL + - Fixed PDF/A validity + - Fixed datamatrix.php for PHP 7.4 + - Fixed deprecated PHP features + +6.3.2 (2019-09-20) + - Update ICC profile + +6.3.1 (2019-09-20) + - Fix reported version + - Fix Undefined property: GLPIPDF::$imagekeys + +6.3.0 (2019-09-19) + - fix SpotColor handling in HTML + - Add an additional empty test to prevent error in PHP 7.2 + - Fix the documentation how to calculate the cell height + - Drop duplicated array indices + - Fix TCPDF_STATIC::fileGetContents() + - Introduce other version of pdfA (2 and 3) + - Add UF and AFRelationship missing + - Fix performance issue of cloned instances + - Change glob to readdir which performs better + - URI in PDF can result in E_NOTICE + - Fix a warning for PHP 7.4 + - Fixed gradient offsets for percentage-based stops. + - Fixed file_get_contents return value should also be checked for a non-empty string + - Fix Array and string offset access syntax with curly braces is deprecated + - Fix PHP Warning: chr() expects parameter 1 to be int + - Add a VERSION file + +6.2.26 (2018-10-16) + - Update sRGB.icc with the one from the Debian package icc-profiles-free + - Fix unsupported operand types error when codepoints arrays are merged + +6.2.25 (2018-09-23) - Fix support for image URLs. 6.2.24 - Support remote urls when checking if file exists. -6.2.23 +6.2.23 (2018-09-22) - Simplify file_exists function. -6.2.22 +6.2.22 (2018-09-14) + - Fixes on `include/tcpdf_images.php`, `include/tcpdf_static.php` and `tcpdf.php` about file handling + +6.2.21 (2018-09-14) + - _no code changes_ + +6.2.20 (2018-09-14) - Fix for security vulnerability: Using the phar:// wrapper it was possible to trigger the unserialization of user provided data. -6.2.19 +6.2.19 (2018-09-14) - Merge various fixes for PHP 7.3 compatibility and security. 6.2.13 (2016-06-10) diff --git a/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT b/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT index 49147d01a71..ec7968a7e22 100644 --- a/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT +++ b/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT @@ -7,7 +7,7 @@ published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - 2002-2019 Nicola Asuni - Tecnick.com LTD + 2002-2024 Nicola Asuni - Tecnick.com LTD ********************************************************************** ********************************************************************** diff --git a/htdocs/includes/tecnickcom/tcpdf/README.md b/htdocs/includes/tecnickcom/tcpdf/README.md index 734b9879faa..f59f663399c 100644 --- a/htdocs/includes/tecnickcom/tcpdf/README.md +++ b/htdocs/includes/tecnickcom/tcpdf/README.md @@ -6,15 +6,14 @@ * **category** Library * **author** Nicola Asuni -* **copyright** 2002-2019 Nicola Asuni - Tecnick.com LTD +* **copyright** 2002-2024 Nicola Asuni - Tecnick.com LTD * **license** http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT) * **link** http://www.tcpdf.org * **source** https://github.com/tecnickcom/TCPDF -## IMPORTANT -A new version of this library is under development at https://github.com/tecnickcom/tc-lib-pdf and as a consequence this version will not receive any additional development or support. -This version should be considered obsolete, new projects should use the new version as soon it will become stable. +## NOTE +A new version of this library is under development at https://github.com/tecnickcom/tc-lib-pdf and as a consequence this library is in support only mode. diff --git a/htdocs/includes/tecnickcom/tcpdf/VERSION b/htdocs/includes/tecnickcom/tcpdf/VERSION index 91e4a9f2622..c56facf898c 100644 --- a/htdocs/includes/tecnickcom/tcpdf/VERSION +++ b/htdocs/includes/tecnickcom/tcpdf/VERSION @@ -1 +1 @@ -6.3.2 +6.7.5 diff --git a/htdocs/includes/tecnickcom/tcpdf/composer.json b/htdocs/includes/tecnickcom/tcpdf/composer.json index 70416fd3513..7389d0900ba 100644 --- a/htdocs/includes/tecnickcom/tcpdf/composer.json +++ b/htdocs/includes/tecnickcom/tcpdf/composer.json @@ -1,47 +1,52 @@ { - "name": "tecnickcom/tcpdf", - "version": "6.3.2", - "homepage": "http://www.tcpdf.org/", - "type": "library", - "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", - "keywords": [ - "PDF", - "tcpdf", - "PDFD32000-2008", - "qrcode", - "datamatrix", - "pdf417", - "barcodes" - ], - "license": "LGPL-3.0", - "authors": [ - { - "name": "Nicola Asuni", - "email": "info@tecnick.com", - "role": "lead" + "name": "tecnickcom/tcpdf", + "type": "library", + "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", + "keywords": [ + "PDF", + "tcpdf", + "PDFD32000-2008", + "qrcode", + "datamatrix", + "pdf417", + "barcodes" + ], + "homepage": "http://www.tcpdf.org/", + "version": "6.7.5", + "license": "LGPL-3.0-or-later", + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "require": { + "php": ">=5.5.0" + }, + "autoload": { + "classmap": [ + "config", + "include", + "tcpdf.php", + "tcpdf_parser.php", + "tcpdf_import.php", + "tcpdf_barcodes_1d.php", + "tcpdf_barcodes_2d.php", + "include/tcpdf_colors.php", + "include/tcpdf_filters.php", + "include/tcpdf_font_data.php", + "include/tcpdf_fonts.php", + "include/tcpdf_images.php", + "include/tcpdf_static.php", + "include/barcodes/datamatrix.php", + "include/barcodes/pdf417.php", + "include/barcodes/qrcode.php" + ] + }, + "archive": { + "exclude": [ + "/examples" + ] } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "classmap": [ - "config", - "include", - "tcpdf.php", - "tcpdf_parser.php", - "tcpdf_import.php", - "tcpdf_barcodes_1d.php", - "tcpdf_barcodes_2d.php", - "include/tcpdf_colors.php", - "include/tcpdf_filters.php", - "include/tcpdf_font_data.php", - "include/tcpdf_fonts.php", - "include/tcpdf_images.php", - "include/tcpdf_static.php", - "include/barcodes/datamatrix.php", - "include/barcodes/pdf417.php", - "include/barcodes/qrcode.php" - ] - } } diff --git a/htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php b/htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php index 92317b121ef..9888a6778b0 100644 --- a/htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php +++ b/htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php @@ -212,6 +212,14 @@ define('K_THAI_TOPCHARS', true); */ define('K_TCPDF_CALLS_IN_HTML', false); +/** + * List of TCPDF methods that are allowed to be called using HTML syntax. + * Note: each method name must end with surrounded with | (pipe) character. + * The constant K_TCPDF_CALLS_IN_HTML must be set to true. + * IMPORTANT: For security reason, disable this feature if you are allowing user HTML content. + */ +define('K_ALLOWED_TCPDF_TAGS', ''); + /** * If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution. */ diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/AUTHORS b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/AUTHORS new file mode 100644 index 00000000000..48073dad73f --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/AUTHORS @@ -0,0 +1,53 @@ +abysta at yandex.ru +Adrian Schroeter +Aleksey Chalabyan +Andrey Valentinovich Panov +Ben Laenen +Besarion Gugushvili +Bhikkhu Pesala +Clayborne Arevalo +Dafydd Harries +Danilo Segan +Davide Viti +David Jez +David Lawrence Ramsey +Denis Jacquerye +Dwayne Bailey +Eugeniy Meshcheryakov +Gee Fung Sit +Heikki Lindroos +James Cloos +James Crippen +John Karp +Keenan Pepper +Lars Naesbye Christensen +Lior Halphon +MaEr +Mashrab Kuvatov +Max Berger +Mederic Boquien +Michael Everson +MihailJP +Misu Moldovan +Nguyen Thai Ngoc Duy +Nicolas Mailhot +Norayr Chilingarian +Ognyan Kulev +Ondrej Koala Vacha +Peter Cernak +Remy Oudompheng +Roozbeh Pournader +Rouben Hakobian +Sahak Petrosyan +Sander Vesik +Stepan Roh +Stephen Hartke +Steve Tinney +Tavmjong Bah +Thomas Henlich +Tim May +Valentin Stoykov +Vasek Stodulka +Wesley Transue + +$Id: AUTHORS 2461 2011-02-18 16:38:20Z ben_laenen $ diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/BUGS b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/BUGS new file mode 100644 index 00000000000..49b36de5536 --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/BUGS @@ -0,0 +1,3 @@ +See http://dejavu.sourceforge.net/wiki/index.php/Bugs + +$Id: BUGS 80 2004-11-13 13:12:02Z src $ diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/LICENSE b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/LICENSE new file mode 100644 index 00000000000..254e2cc42a6 --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/LICENSE @@ -0,0 +1,99 @@ +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. +Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. + +Arev Fonts Copyright +------------------------------ + +Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and +associated documentation files (the "Font Software"), to reproduce +and distribute the modifications to the Bitstream Vera Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to +the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Tavmjong Bah" or the word "Arev". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Tavmjong Bah Arev" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the name of Tavmjong Bah shall not +be used in advertising or otherwise to promote the sale, use or other +dealings in this Font Software without prior written authorization +from Tavmjong Bah. For further information, contact: tavmjong @ free +. fr. + +$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $ diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/NEWS b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/NEWS new file mode 100644 index 00000000000..87e3d5e53a0 --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/NEWS @@ -0,0 +1,1315 @@ +Changes from 2.32 to 2.33 + +* added Old Italic block to Sans (by MaEr) +* added U+051E, U+051F to Sans (by MaEr) +* added U+01BA, U+0372-U+0373, U+0376-U+0377, U+03CF, U+1D00-U+1D01, + U+1D03-U+1D07, U+1D0A-U+1D13, U+1D15, U+1D18-U+1D1C, U+1D20-U+1D2B, + U+1D2F, U+1D3D, U+1D5C-U+1D61, U+1D66-U+1D6B, U+1DB8, U+1E9C-U+1E9D, + U+1EFA-U+1EFB, U+2C60-U+2C61, U+2C63, U+A726-U+A73C, U+A73E-U+A73F, + U+A746-U+A747, U+A74A-U+A74B, U+A74E+U+A74F, U+A768-U+A769, U+A77B-U+A77C, + U+A780-U+A787, U+A790-U+A791, U+A7FA-U+A7FF to Serif (by Gee Fung Sit 薛至峰) +* added alternate forms to U+014A and U+01B7 in Serif (by Gee Fung Sit 薛至峰) +* typographical improvements to U+0166-U+0167, U+0197, U+01B5-U+01B6, U+01BB, + U+0222-U+0223, U+023D, U+0250-U+0252, U+026E, U+0274, U+028F, U+029F, + U+02A3-U+02A5, U+02AB, U+03FE-U+03FF, U+1D02, U+1D14, U+1D1D-U+1D1F, U+1D3B, + U+1D43-U+1D46, U+1D59, U+1D9B, U+2C71, U+2C73 in Serif (by Gee Fung Sit 薛至峰) +* fixed bugs #31762 and #34700 plus other small fixes (wrong direction, + duplicate points, etc.) for Sans and Serif (by Gee Fung Sit 薛至峰) +* added U+204B to Mono (by Gee Fung Sit 薛至峰) +* added U+26E2 to Sans (by Gee Fung Sit 薛至峰) +* added Playing Cards block (U+1F0A0-U+1F0DF) to Sans (by Gee Fung Sit 薛至峰) +* emoticons in Sans: replace U+2639-U+263B with better versions, add + U+1F601-U+1F610, U+1F612-U+1F614, U+1F616, U+1F618, U+1F61A, U+1F61C-U+1F61E, + U+1F620-U+1F624, U+1F625, U+1F628-U+1F62B, U+1F62D, U+1F630-U+1F633, + U+1F635-U+1F640 (by Ben Laenen and Denis Jacquerye) +* added U+A78E, U+A790-U+A791 to Sans and Mono (by Denis Jacquerye) +* added U+A7FA to Sans (by Denis Jacquerye) +* subscripts: added U+2095-U+209C to Sans, Serif and Mono, adjusted + U+1D49-U+1D4A in Sans and Mono (by Denis Jacquerye) +* added U+0243 to Mono (by Denis Jacquerye) +* adjusted U+0307 to match dot of i, replaced dotaccent U+02D9 with U+0307 in +most dependencies in Sans (by Denis Jacquerye) +* adjusted anchors of f and added them to long s in Sans (by Denis Jacquerye) +* added anchors to precomposed dependencies of D and d (by Denis Jacquerye) +* added debug glyphs U+F002 and U+F003 which will show current point size (by + Ben Laenen) +* use correct version for Serbian italic be (by Eugeniy Meshcheryakov) +* added pictograms U+1F42D-U+1F42E, U+1F431, U+1F435 (by Denis Jacquerye) +* improved Hebrew in Sans (by Lior Halphon) +* improved Armenian in Sans, and added Armenian in Serif and Mono (by Rouben + Hakobian (Tarumian), Aleksey Chalabyan and Norayr Chilingarian) +* remove "locl" feature for Romanian for S/T/s/t with cedilla/comma accent (by + Ben Laenen) +* replace wrong "dflt" script tag in Mono with "DFLT" (by Ben Laenen) + +Changes from 2.31 to 2.32 + +* added to Sans: Latin small letter p with stroke (U+1D7D), Latin capital + letter p with stroke through descender (U+A750), Latin small letter p with + stroke through descender (U+A751), Latin capital letter thorn with stroke + (U+A764), Latin small letter thorn with stroke (U+A765), Latin capital letter + thorn with stroke through descender (U+A766), Latin small letter thorn with + stroke through descender (U+A767), Latin capital letter q with stroke through + descender (U+A756), Latin small letter q with stroke through descender + (U+A757), Latin capital letter p with flourish (U+A752), Latin small letter p + with flourish (U+A753) (by Ben Laenen) +* add new Indian rupee symbol (U+20B9) to Sans, Serif and Mono (although + standardization in Unicode not complete yet, UTC did assign this code point) + (by Ben Laenen) +* Sans: adjusted U+0E3F, U+20AB, U+20AD-U+20AE, U+20B1, U+20B5, U+20B8 to have + them take up the same width as digits (by Gee Fung Sit 薛至峰) +* added U+23E8 to Sans (by Thomas Henlich) +* fixed numerous bugs (#22579, #28189, #28977, N'Ko in Windows, fixed U+FB4F, + anchors for U+0332-U+0333, made extensions in Misc. Technical connect, and + other small fixes) (by Gee Fung Sit 薛至峰) +* added looptail g as stylistic variant to Serif (by Gee Fung Sit 薛至峰) +* added the remaining precomposed characters in Latin Extended Additional in + Serif (by Gee Fung Sit 薛至峰) +* added Georgian Mkhedruli (U+10D0-U+10FC) to Sans ExtraLight (by Besarion + Gugushvili) +* fix spacing in hinting of U+042E (Ю) in Mono (by Ben Laenen) +* replaced U+2650 and minor changes to U+2640-U+2642, U+2699, U+26A2-U+26A5, + U+26B2-U+26B5, U+26B8 in Sans (by Gee Fung Sit 薛至峰) +* added U+1E9C-U+1E9D, U+1EFA-U+1EFB, U+2028-U+2029, U+20B8, U+2150-U+2152, + U+2189, U+26C0-U+26C3, U+A722-U+A725, U+1F030-U+1F093 to Sans (by Gee Fung + Sit 薛至峰) +* added U+1E9C-U+1E9E, U+1EFA-U+1EFB, U+2028-U+2029, U+20B8, U+2181-U+2182, + U+2185 U+A722-U+A725, to Sans ExtraLight (by Gee Fung Sit 薛至峰) +* added U+20B8, U+22A2-U+22A5, U+A722-U+A725 to Mono (by Gee Fung Sit 薛至峰) +* added U+02CD, U+01BF, U+01F7, U+0222-U+0223, U+0243-U+0244, U+0246-U+024F, + U+2150-U+2152, U+2189, U+239B-U+23AD and U+A73D to Serif (by Gee Fung Sit + 薛至峰) + +Changes from 2.30 to 2.31 + +* fixed bug where Serif Condensed Italic wouldn't get proper subfamily tags (by + Ben Laenen) +* added math operators U+2234-U+2237 to Mono (by Ben Laenen) +* removed buggy instructions of U+032D (by Eugeniy Meshcheryakov) +* added U+2C70, U+2C7E, U+2C7F to Sans and Sans Mono (by Denis Jacquerye) +* added U+2C7D to Sans Mono (by Denis Jacquerye) +* added U+2C6D, U+2C70-2C73, U+2C7E-2C7F to Serif (by Denis Jacquerye) +* added extremas to alpha U+03B1 in Serif-Italic (by Denis Jacquerye) +* added U+4A4, U+4A5 to Mono (by Andrey V. Panov) +* added Arabic letters U+0657, U+0670, U+0688-U+0690, U+0693-U+0694, + U+0696-U+0697, U+0699-U+06A0, U+06A2-U+06A3, U+06A5, U+06A7-U+06A8, + U+06AA-U+06AE, U+06B0-U+06B4, U+06B6-U+06B9, U+06BB-U+06BE and their + contextual forms to Sans (by MihailJP) +* added U+A78D LATIN CAPITAL LETTER TURNED H for coming Unicode 6.0 (by Denis + Jacquerye) + +Changes from 2.29 to 2.30 + +* added U+0462-U+0463 to Mono (by Denis Jacquerye) +* corrected U+1E53 in Serif (by Gee Fung Sit) +* added U+1E4C-U+1E4D to Mono and Serif (by Gee Fung Sit) +* added U+1E78-U+1E79 to Mono (by Gee Fung Sit) +* fixed missing diacritics in Latin Extended Additional in Sans ExtraLight + (moved stacked diacritics out of PUA in the process) (by Gee Fung Sit) +* fixed anchors on U+1E78 in Serif (by Gee Fung Sit) +* added U+1DC4-U+1DC9 to Serif (by Denis Jacquerye) +* renamed above-mark to above-mark in Serif-Italic (by Denis Jacquerye) +* added U+1DC4-U+1DC9 to context class for dotless substitution (by Denis + Jacquerye) +* changed Doubleacute to Doublegrave in Sans ExtraLight (by Gee Fung Sit) +* removed redundant reference in U+01FB in Sans Oblique (by Gee Fung Sit) +* added U+A726-U+A727 to Mono (Denis Jacquerye) +* changed U+04BE and U+04BF according to recommedations of Sasha Ankwab in Sans + (by Andrey V. Panov) +* remove "Symbol Charset" from set of codepages in Sans (by Eugeniy + Meshcheryakov) + +Changes from 2.28 to 2.29 + +* modified U+10FB in Sans to be a mirror image of U+2056, since U+10FB is not + Georgian-specific (by Roozbeh Pournader) +* added U+2B1F, U+2B24, U+2B53, U+2B54 in Sans (by Roozbeh Pournader) +* fixed TUR opentype language tag to TRK in Serif (bug 19825) (by Ben Laenen) +* early implementation of Abkhaz letter U+0524-U+0525 in Sans + (by Michael Everson and abysta) +* flipped U+1D538 in Sans (by Gee Fung Sit) +* added U+26B3-U+26B8, U+1D7D8-U+1D7E1 in Sans (by Gee Fung Sit) +* corrected U+1D7A9 in Sans Bold Oblique (by Gee Fung Sit) +* Fixed U+0649 to be dual-joining in Sans Mono (by Roozbeh Pournader) +* Remove unnecessary 'isol' feature from Sans Mono (by Roozbeh Pournader) +* Remove 'cmap' mappings for U+066E, U+066F, U+067C, U+067D, U+0681, U+0682, + U+0685, U+0692, U+06A1, U+06B5, U+06BA, U+06C6, U+06CE, and U+06D5 + in Sans Mono (bug 20323) (by Roozbeh Pournader) +* add half brackets (U+2E22 - U+2E25, by Steve Tinney) + +Changes from 2.27 to 2.28 + +* added U+A789, U+A78A in Sans and Sans Mono (by Denis Jacquerye) +* modified U+02D6, U+02D7, U+02EE in Sans and Sans Mono (by Denis Jacquerye) +* added U+1E9E (German capital ß) to Sans and Serif (by Denis Jacquerye) +* adjusted width of U+01B7-U+01B9 in Serif Italic (by Denis Jacquerye) +* modified U+021C, U+021D in Sans (by Denis Jacquerye) +* added U+021C, U+021D in Mono (by Denis Jacquerye) +* added U+F428 (Georgian Nuskhuri "f") in private use area (by Besarion + Gugushvili) +* updated Georgian mkhedruli (U+10D0-U+10FA) with new version (by Besarion + Gugushvili) +* updated Georgian asomtavruli (U+10A0-U+10C5) with new version (by Besarion + Gugushvili) +* added Georgian nuskhuri (U+2D00-U+2D25) (by Besarion Gugushvili) +* added Georgian mtavruli in private use area (U+F400-U+F426) (by Besarion + Gugushvili) +* added mark anchors above to Cyrillic U+0430-U+0438, U+043A-U+044F, + U+0454-U+0455 in Mono (by Ben Laenen) +* modified/moved up U+0318-U+0319, U+031C-U+031F, U+0329-U+032A, U+032C-U+032D, + U+0339-U+033B, U+0348 and U+0353 in Sans to prevent cut-off (by Gee Fung Sit) +* added U+035A to Sans (by Gee Fung Sit) +* updated fontconfig files (by Nicolas Mailhot) +* added U+2032-2037 to Mono (by Denis Jacquerye) +* added Ogham to Sans ExtraLight (by Gee Fung Sit) +* added U+2C6F, U+2C79, U+2C7C-2C7D to Mono (by Gee Fung Sit) +* added U+210F to Serif and Sans ExtraLight (by Gee Fung Sit) +* changed U+210F to a more common glyph in Sans and Mono (by Gee Fung Sit) + +Changes from 2.26 to 2.27 + +* added some of Michael Everson's new Cyrillic glyphs to Sans (by Wesley + Transue) +* removed blank glyph at U+05EF from Sans Bold Oblique (by Gee Fung Sit) +* small adjustments to existing tone bars in Sans and Mono (by Gee Fung Sit) +* added U+0372-U+0373, U+0376-U+0377, U+03CF, U+A668-U+A66E, U+A708-U+A711, + U+A71B-U+A71F to Sans (by Gee Fung Sit) +* copied U+02E5-U+02E9 over from Sans to fix inconsistencies in Serif (by Gee + Fung Sit) +* added U+021C-U+021D, U+0370-U+0371, U+037B-U+037D, U+0470-U+0471, + U+0510-U+0515, U+051A-U+051D, U+1E9F, U+2C64, U+2C6E-U+2C6F, U+2C79, + U+2C7C-U+2C7D, U+A644-U+A647, U+A650-U+A651, U+A654-U+A657, U+A708-U+A716, + U+A71B-U+A71F to Serif (by Gee Fung Sit) +* added U+A708-U+A716, U+A71B-U+A71F to Mono (by Gee Fung Sit) +* added anchors to U+017F (ſ) and fixed U+1E9B (ẛ) in Serif (by Gee Fung Sit) +* made U+0325 smaller in Sans Bold and Serif to match Sans Book (by Gee Fung + Sit) +* fixes to U+02F3 (moved up), U+228F-U+2294 (more square-like) and + U+22CE-U+22CF (stroke width) in Sans (by Gee Fung Sit) +* replaced U+2202 ∂ (Sans and Mono) and U+221D ∝, U+221E ∞ (Sans) with glyphs + from Arev (with small changes) (by Gee Fung Sit) +* added U+22B0-U+22B1, U+22C7, U+22D0-U+22D5 from Arev to Sans to complete the + block (by Gee Fung Sit) +* added U+0514-U+0515 to Sans ExtraLight (by Gee Fung Sit) +* skewed U+A78C in all Oblique/Italic fonts (by Gee Fung Sit) +* moved U+2215 to U+2044 in Sans and Serif and replaced U+2215 with reference + to U+002F in all fonts (by Gee Fung Sit) +* added U+2C6E to Mono (by Denis Jacquerye) +* added U+A782 and U+A783 in Sans (by Wesley Transue) +* added U+0244, U+024C-024D, U+2C64 in Sans Mono (by Denis Jacquerye) +* modified U+01AE in Sans Mono (by Denis Jacquerye) +* added U+2C7A to all fonts (by Gee Fung Sit) +* italicized/small changes to U+2C76 in Serif (Bold) Italic (by Gee Fung Sit) +* improved outlines of U+2C68, U+2C6A, U+2C6C in Serif (Bold) Italic (by Gee + Fung Sit) +* rounded U+2C77 at the bottom in Serif (by Gee Fung Sit) +* added joining behavior for tone letters (U+02E5-U+02E9) in Sans (bug #15669) + (by Gee Fung Sit) +* fixed outline of y.alt in Sans Regular (by Denis Jacquerye) +* changed references of U+1D5A8, U+1D5C5, U+1D5DC, U+1D5F9, U+1D610, U+1D62D, + U+1D644 and U+1D661 to stylistic alternates to have a better distinction (by + Gee Fung Sit) +* hinted I.alt in Sans Regular (by Gee Fung Sit) +* added U+0487, completing Cyrillic block (by Gee Fung Sit) +* extended the bar of U+0463 to the right and moved the anchor (by Gee Fung + Sit) +* added anchors to glyphs in Cyrillic block (by Gee Fung Sit) +* added (preliminary) hints to tone letter forms (U+02E5.5, U+02E9.1, stem) in + Sans Book (by Gee Fung Sit) + +Changes from 2.25 to 2.26 + +- added glyphs for Cyrillic-B to Sans (by Wesley Transue) +- added U+0370-U+0371 to Sans (by Wesley Transue) +- added U+019C, U+01A2-U+01A3, U+01A6, U+01E4-U+01E5, U+024C-U+024D, U+0285, + U+0290, U+02A0, U+0370-U+0371, U+03F1, U+03FC to Sans ExtraLight (by Wesley + Transue) +- added U+20A0-U+20A5, U+20A7-U+20B3, U+2105, U+210D, U+210F, U+2115, U+2117, + U+2119-U+211A, U+211D, U+2124, U+212E, U+2200-U+2204 to Mono (by Heikki + Lindroos) +- added U+01BA and U+01BF to Mono (by Heikki Lindroos) +- merged OpenType "aalt" feature in Latin in Sans (by Denis Jacquerye) +- added alternative shape for y in Sans (by Denis Jacquerye) +- added saltillo (U+A78B-U+A78C) to all faces (by James Cloos) +- changed U+047C-U+047D to references instead of outlines in Sans (by Wesley + Transue) +- added Latin letter tresillo U+A72A-U+A72B to Sans (by Wesley Transue) +- added U+A734-U+A737 to Sans (by Wesley Transue) +- added U+2053 to Serif and fixed it bug:9425 in Sans (by Gee Fung Sit) +- removed problematic hints for U+0423 bug:10025 (by Gee Fung Sit) +- added U+27C5-U+27C6 bug:10255 to all faces (by Gee Fung Sit) +- fixed width of U+2016 in Sans Oblique (by Gee Fung Sit) +- added U+2016, U+2032-U+2038, U+2042, U+2045-U+2046, U+204B-U+204F, + U+2051-U+2052, U+2057 to Serif (by Gee Fung Sit) +- made U+2140 bigger to match other n-ary operators (by Gee Fung Sit) +- added U+0606-U+0607, U+0609-U+060A to Sans (by Gee Fung Sit) +- added U+221B-U+221C to Mono (by Gee Fung Sit) +- small adjustments to U+221B-U+221C in Sans and Serif (by Gee Fung Sit) +- update U+04B4-U+04B5 in Serif (by Andrey V. Panov) +- increased max-storage value from maxp table to 153 (by Andrey V. Panov) +- added U+0472-U+0473, U+0510-U+0511, U+051A-U+051D, U+0606-U+0607, + U+0609-U+060A, U+1E26-U+1E27, U+1E54-U+1E55, U+1E7C-U+1E7D, U+1E8C-U+1E8D, + U+1E90-U+1E91, U+1E97-U+1E99, U+1E9F, U+1EAC-U+1EAD, U+1EB6-U+1EB7, + U+1EC6-U+1EC7, U+1ED8-U+1EDD, U+1EE0-U+1EE3, U+1EE8-U+1EEB, U+1EEE-U+1EF1 to + Mono (by Gee Fung Sit) +- added locl rules for S/T cedilla for Romanian and Moldavian so they get + rendered as S/T with comma accent (see Redhat bug #455981) (by Ben Laenen) +- removed ligature rule from Armenian U+0587 bug:16113 (by Gee Fung Sit) + +Changes from 2.24 to 2.25 + +- moved/added U+2E18 (by Gee Fung Sit) +- added empty glyph for U+2064 in Sans and Serif (by Gee Fung Sit) +- added U+22CE-U+22CF to Sans (by Gee Fung Sit) +- Sans Oblique and Bold Oblique, Serif: reverted digits hinting instructions back to before revision 1590, which fixed mistaken debian bug #471024. This fixes Debian bug #411308. The original bug was in freetype not in the fonts (by Denis Jacquerye) +- added U+A726-U+A729, U+A730-U+A733, U+A738-U+A73F, U+A746-U+A74B, U+A74E-U+A74F, U+A780-U+A781, U+A7FB-U+A7FF to Sans (by Gee Fung Sit) +- added Macedonian italic glyph shape for U+0453 in Serif (by Ben Laenen) +- changed descenders in U+0446, U+0449, U+0497, U+04A3, U+04AD (by Andrey V. Panov) +- updated main SFD files to SplineFontDB 3.0 (Denis Jacquerye and Gee Fung Sit) +- moved U+0561 2 up since it wasn't aligned with the baseline well (by Ben Laenen) +- added U+2E2E to Sans (by Gee Fung Sit) +- replaced U+2699 with simpler version in Sans (by Gee Fung Sit) +- added a lot of hinting instructions to Latin Extended B, Greek and Coptic glyphs Sans Book (by Wesley Transue) +- differentiated U+2219 from U+22C5 and adjusted affected references in Sans and Mono (by Gee Fung Sit) +- made Hebrew narrower in Sans Bold and Sans Bold Oblique (by Denis Jacquerye) +- added Kurdish and Chuvash letters from Unicode 5.1 Cyrillic Extended block (by Wesley Transue) +- added U+1E9F, U+A644-U+A647, U+A64C-U+A64D, U+A650-U+A651, U+A654-U+A655, U+A712U+A716 to Sans (by Gee Fung Sit) +- added several glyphs to Sans ExtraLight (by Gee Fung Sit) +- added hinting instructions to U+046A-U+046B, U+0508-U+0509, U+050B, U+0512-U+0513 in Sans Book (by Wesley Transue) +- corrected width of U+027E in Sans Book (by Gee Fung Sit) +- added U+2C79, U+2C7B-U+2C7D to Sans (by Gee Fung Sit) +- added a bunch of glyphs+small corrections to Sans Light (by Gee Fung Sit) +- added U+0496, U+0497, U+04B0, U+04B1 (by Andrey V. Panov) +- updated U+0493, U+049B, U+04B3, U+04B7, U+04F7 (by Andrey V. Panov) +- further improvements in extended Cyrillic (by Andrey V. Panov) + +Changes from 2.23 to 2.24 + +- instructions for U+05C0 ׀, U+05C3 ׃, U+05F3 ׳, and U+05F4 ״ in DejaVu + Sans. (by Wesley Transue) +- instructions for U+2116 in Sans (by Andrey V. Panov) +- Unicode 5.1 update: moved U+F208 to U+2C6D, U+F25F to U+2C71, added + U+2C6E-U+2C6F, U+2C72-U+2C73, updated outline of U+2C71 in Sans. (by + Denis Jacquerye) +- updated and instructed U+0401 in Sans (by Andrey V. Panov) +- fixed the bug in Sans faces where U+02EC ˬ faced the wrong direction. + Also, added a few more glyph instructions. (by Wesley Transue) +- removed OS2Sub and OS2Strike that weren't intentional in Sans + ExtraLight. (by Denis Jacquerye) +- updated instructions for U+401, U+44F in Serif Book. (by Andrey V. + Panov) +- instructions for U+02C4 ˄, U+02C5 ˅, U+03D8 Ϙ, U+03D9 ϙ, U+0494 Ҕ, and + U+0495 ҕ in Sans Book. (by Wesley Transue) +- instructions for U+01A6 Ʀ, U+0238 ȸ, U+0239 ȹ, U+02EC ˬ, and U+05C6 ׆ + in Sans Book. (by Wesley Transue) +- DejaVuSans.sfd DejaVuSerif.sfd: updated instructions for U+447 and + U+451 using code generated with xgridfit (by Andrey V. Panov) +- instructions for a few glyphs in the Latin Extended-B Block, Greek + Block, Cyrillic Block, and N'Ko block. (by Wesley Transue) +- updated sfdnormalize.pl, and SFD files to new SFD format with empty + lines. (by Denis Jacquerye) + +Changes from 2.22 to 2.23 + +- fixed bug which made Condensed fonts appear instead of normal width ones +- added U+20DB, U+20DC, and U+20E1 to Sans (by Roozbeh Pournader) +- added hinting instructions to U+01A7, U+01AA-U+01AC, U+01AE-U+01AF, + U+01BC-U+01BD, U+01BF, U+01F7, U+0277, U+027F, U+0285-U+0286, U+0297, U+02AF, + U+02B4-U+02B5, U+02BD, U+030D, U+0311, U+0329, U+04A0-U+04A1 in Sans Book (by + Wesley Transue) +- modified hinting instructions of U+04A2 in Sans Book (by Wesley Transue) +- added hinting instructions to U+237D, U+2423 in Mono Book and Mono Bold (by + Wesley Transue) +- added mathematical alphanumeric symbols to all styles (by Max Berger) +- added Unicode 5.1 U+2E18 as U+2E18.u51 (not yet usable) to Sans (by Roozbeh + Pournader) +- dereferenced all glyphs with mixed references and outlines (by Denis + Jacquerye) +- removed non-zero width from U+0344 in Sans (by Denis Jacquerye) + +Changes from 2.21 to 2.22 + +- directory structure has changed, we now use the Makefile +- modified Armenian U+0565 in Sans (by Սահակ Պետրոսյան) +- added double struck letters and numbers U+2102, U+210D, U+2115, + U+2119-U+211A, U+211D, U+2124, U+213C-U+2140, U+2145-U+2149, U+1D538-U+1D539, + U+1D53B-U+1D53E, U+1D540-U+1D544, U+1D546, U+1D54A-U+1D550, U+1D552-U+1D56B, + U+1D7D8-U+1D7E1 to Serif (by Stephen Hartke) +- added letterlike symbols U+2103, U+2109, U+2127, U+214B, U+2141-U+2144 to + Serif (by Ben Laenen) +- fixed outline direction of U+2143 in Sans Bold/Bold Oblique (by Ben Laenen) +- added arrow set in Serif: arrows: U+2194-U+21FF; dingbats: U+27A1; + supplemental arrows A: U+27F0-U+27FF; supplemental arrows B: U+2900-U+2975, + U+297A; miscellaneous symbols and arrows: U+2B00-U+2B11 (by Ben Laenen) +- added U+0180, U+01DE, U+01E0-01E1, U+022A, U+022C, U+0230, U+1E08-U+1E09, + U+1E10-U+1E11, U+1EB0-U+1EB1 to Mono (by Denis Jacquerye) +- adjusted U+01D5, U+01D7, U+01D9, U+1DB in Mono (by Denis Jacquerye) +- added Ogham in Sans (by Wesley Transue) +- added Yijing Hexagram Symbols in Sans (by Wesley Transue) +- hinting instructions added to Cyrillic U+0460, U+04A6-U+04A7, U+04AC-U+04AD, + U+04C7-U+04C8, U+04F6-U+04F7, U+04FA-U+04FB, U+050C-U+050D in Sans Book (by + Wesley Transue) +- adjusted Cyrillic letters U+042A, U+044A, U+044C, U+0459-U+045B, U+0462, + U+048C-U+048D in Serif (by Andrey V. Panov) +- hinting instructions added to Lao U+0EB7 in Sans (by Wesley Transue) +- added Roman numerals and Claudian letter U+2160-U+2184 in Serif (by Ben + Laenen) +- added U+FFF9-U+FFFD to Sans, Serif and Mono (by Lars Næsbye Christensen) +- added mathematical symbols to Serif: U+2200, U+2203-U+2204, U+2213-U+2214, + U+2217-U+2218, U+2223-U+2226, U+2250-U+2255, U+2295-U+22AF, U+22C5 (by Ben + Laenen) +- modified bullet symbol U+2219 in Serif (by Ben Laenen) + +Changes from 2.20 to 2.21 + +- added U+FE20-U+FE23 (half diacritics) to Sans (by Denis Jacquerye) +- added anchor "half" to position right half of double marks, U+FE21 or U+FE23 + to Sans (by Denis Jacquerye) +- shifted U+0360 up to avoid collision with some outlines in Sans (by Denis + Jacquerye) +- added anchor above-mark anchor to U+035D, U+035E, U+0360, U+0361 in Sans (by + Denis Jacquerye) +- added instructions for ff, ffi, ffl ligatures in Serif Bold (by Eugeniy + Meshcheryakov) +- added instructions to some N'Ko glyphs (by Wesley Transue) +- added instructions to some Lao glyphs (by Wesley Transue) +- cleaning up 'liga' Standard Ligature in Latin, in Sans and Sans Mono (by + Denis Jacquerye) +- added U+046A, U+046B (big yus) in Serif (by Andrey V. Panov) +- added box drawing symbols to Sans and Serif (by Lars Næsbye Christensen) +- added Makefile to improve font and packages generating (by Nicolas Mailhot) + +Changes from 2.19 to 2.20 + +- removed TeX and TeXData tags from all sfd files (by Eugeniy Meshcheryakov) +- removed all 'frac' lookups (by Eugeniy Meshcheryakov) +- fixed duplicate glyph names (by Eugeniy Meshcheryakov) +- removed standard ligatures with U+00B7 in Mono (by Eugeniy Meshcheryakov) +- use reference to U+002D in U+00AD in Sans Oblique, and adjust instructions + (by Eugeniy Meshcheryakov) +- updated Cyrillic in Sans Extra Light (by Andrey V. Panov) +- added instructions to N'Ko U+07C1-U+07C6, U+07CA, U+07CE-U+07CF, U+07D1, + U+07D3-U+07D4, U+07D8, U+07DB and U+07EB in Sans (by Wesley Transue) +- added instructions to Lao U+0E8A, U+0E95, U+0E97, U+EA5, U+0EB4 and U+0EB5 + (by Wesley Transue) +- adjusted instructions for Hebrew glyphs (by Denis Jacquerye) +- added instructions for U+0265 in Sans Bold (by Denis Jacquerye) +- fix U+1D68 in Sans: it had the shape of delta, where it should be a rho (by + Ben Laenen) +- remove U+1D5C glyph in Sans Oblique (it was empty) (by Ben Laenen) +- fix instructions of U+01AD in Sans Bold (by Ben Laenen) +- fix instructions of U+042D in Serif (by Ben Laenen) +- remove buggy instructions of U+2328 in Serif (by Ben Laenen) +- corrected width of U+2C75-U+2C76 in Sans Bold and Serif Bold (by Gee Fung Sit) +- added U+2C75-U+2C77 to Mono (by Gee Fung Sit) + +Changes from 2.18 to 2.19 + +- fixed misplaced symbols (U+2325,2326) in Sans Oblique (by John Karp) +- added Mark to Base anchors: 'cedilla' for combining cedilla and + 'above-legacy' for stacking above precomposed glyphs (just a,e,i,o,u with + macron for now) in Sans (by Denis Jacquerye). +- added contextual substitution for Case and Dotless forms in all Sans variants + (by Denis Jacquerye). +- renamed 'ccmp' lookups for RTL and Basic (LGC, etc.) (by Denis Jacquerye) +- added anchor 'cedilla' for vowels in Sans. (by Denis Jacquerye) +- extended contextual dotless and case substitutions to handle both below and + above diacritics (by Denis Jacquerye) +- renamed Dotless and Case Form GSUB lookups in Sans with meaningful names (by + Denis Jacquerye) + +Changes from 2.17 to 2.18 + +- Re-encoded the source files for Full Unicode (by Ben Laenen) +- Re-enabled the "ff", "fl", "fi", "ffl", "ffi" ligatures by default in Serif + (by Ben Laenen) +- Disabled the "fi", "ffi" ligatures for languages with dotless i in Serif (by + Ben Laenen) +- added Tifinagh to Sans Book and Bold, U+2D30-U+2D65, U+2D6F, partially hinted + in Sans Book. (by Denis Jacquerye) +- added Tai Xuan Jing Symbols (U+1D300-1D356) to Sans (by Remy Oudompheng) +- added double-struck letters (U+1D538-U+1D56B minus reserved code points) to + Sans (by Gee Fung Sit) +- added U+22EE-U+22F1 to Sans (by Gee Fung Sit) +- added U+2C67-U+2C6C, U+2C75-U+2C77 to Serif (by Gee Fung Sit) +- italicized various glyphs in Latin Extended-B, IPA Extensions, Spacing + Modifier Letters, Phonetic Extension (Supplement) and Super- and Subscripts + in Serif Oblique fonts (by Gee Fung Sit) +- modified outlines, bearings of Hebrew U+05D6, U+05D8, U+05DB, U+05DE, U+05E0, + U+05E1, U+05E2, U+05EA in Sans Book and Oblique, adjusted hinting in Book + based on Yotam Benshalom's comments. (by Denis Jacquerye) +- added Braille Patterns (U+2800-U+28FF) to Serif fonts (by Gee Fung Sit) +- added N'Ko to Sans Book and Bold: U+07C0-U+07E7, U+07EB-U+07F5, U+07F8-U+07FA + (by Eugeniy Meshcheryakov) +- added U+0ED8 (Lao digit 8) to Sans (by Remy Oudompheng) +- added Lao diacritics U+0EB0-0EB9, U+0EBB-0EBC, U+0EC8-0ECD to Mono (by Remy + Oudompheng) +- renamed Serif [Bold] Oblique, make it Italic (by Eugeniy Meshcheryakov) +- added U+29FA-U+29FB to Sans and Sans Mono (by Gee Fung Sit) +- swapped glyphs for Eng U+014A from Sami Eng to African Eng, the latter being + more common (by Denis Jacquerye) +- swapped ae U+00E6 and ae.alt in Serif Italics fonts, thus fixing #8213 (by + Denis Jacquerye) +- minor improvements to Misc. Symbols in Sans (by Gee Fung Sit) +- minor improvements and additions to Sans ExtraLight (by Gee Fung Sit) +- improved instructions for various Cyrillic letters (by Eugeniy Meshcheryakov) +- fixed hinting of theta and chi in Sans Book (by Ben Laenen) +- added Georgian Mkhedruli to Sans, Serif and Mono, ASumtavruli to Sans and + Serif (by Besarion Gugushvili) + +Changes from 2.16 to 2.17 + +- Sans fonts: fix position for certain combinations of Arabic fatha, kasra, + shadda, damma, kasratan, dammatan, fathatan and hamza (by Ben Laenen) +- added 'ae.alt' to Serif Oblique fonts, with design matching shape of italic + 'a' instead of slanted 'a', see bug #8213 (by Denis Jacquerye) +- added super- and subscripts to Serif and Mono: U+1D2C-U+1D2E, U+1D30-U+1D3C, + U+1D3E-U+1D42, U+1D62-U+1D65, U+1D78, U+2071, U+207A-U+207E, U+208A-U+208E, + U+2090-U+2094 (by Gee Fung Sit) + +Changes from 2.15 to 2.16 + +- fixed hinting instructions for digits in DejaVu Sans Oblique, Bold Oblique, + and Serif Book to not change glyph width (by Eugeniy Meshcheryakov) +- added instructions for U+0404, U+0411, U+0413, U+0414, U+0417-U+041B, U+041F, + U+0423, U+0424, U+0426-U+0429, U+042C, U+042E, U+042F, U+0490 in Serif Bold + (by Eugeniy Meshcheryakov) +- added U+0220 and Eng.alt to Serif fonts (by Denis Jacquerye) +- added U+232C, U+2394, U+23E3 to Sans fonts (by John Karp) +- added U+230C-U+230F, U+231C-U+231F to Sans fonts, fixing bug:9547 + (by John Karp) +- adjusted dot below, dot above, dieresis above, dieresis below in Sans fonts + (by Denis Jacquerye) +- added U+2300, U+2301, U+2303, U+2304, U+2305, U+2307, U+2326, U+2327, U+232B, + arrow.base to Sans fonts (by John Karp) +- adjusted dot and dieresis below and above in Serif fonts (by Denis Jacquerye) +- added U+1E1C-U+1E1D to Serif fonts (by Denis Jacquerye) +- added U+22BE, U+22BF (by Wesley Transue) +- added U+2324; modified U+2325: more standard proportions, and matches U+2324 + and U+2387; added U+2387 : flipped U+2325 with standard arrowhead + (by John Karp) +- added Lao digits U+0ED0-0ED7, U+0ED9 (by Remy Oudompheng) +- added to Mono in Arabic block : U+060C, U+0615, U+061B, U+061F, + U+0621-U+063A, U+0640-0655, U+065A, U+0660-066F, U+0674, U+0679-0687, U+0691, + U+0692, U+0698, U+06A1, U+06A4, U+06A9, U+06AF, U+06B5, U+06BA, U+06BE, + U+06C6, U+06CC, U+06CE, U+06D5, U+06F0-06F9 (by Remy Oudompheng) +- added to Mono in Arabic Presentations Forms-A : U+FB52-FB81, U+FB8A-FB95, + U+FB9E, U+FB9F, U+FBAA-FBAD, U+FBE8, U+FBE9, U+FBFC-FBFF (by Remy Oudompheng) +- added to Mono in Arabic Presentations Forms-B : U+FE70-FE74, U+FE76-FEFC, + U+FEFF (by Remy Oudompheng) +- added U+05BA, U+05BE, U+05F3, U+05F4, U+FB1E, U+FB21-U+FB28, U+FB4F to Sans + (by Eugeniy Meshcheryakov) +- added U+2102 to Mono (by Eugeniy Meshcheryakov) +- added U+2983-U+2984 to Sans (by Gee Fung Sit) +- added U+2A2F to Sans, Serif and Mono (by Gee Fung Sit) +- added U+2373-2375, U+237A to Sans (by John Karp) +- converted kern pairs to kern classes with Tavmjong Bah's scripts + (by Denis Jacquerye) +- set ScriptLang of kerning classes to just latn because of Pango bug + (by Denis Jacquerye) +- added DNK to ScriptLang latn otherwise it is excluded, and SRB and MDK to + cyrl (by Denis Jacquerye) +- removed flag 0x80 in generate.pe, otherwise it generates kerning tables some + systems don't like; thus loosing Apple tables (by Denis Jacquerye) +- removed ligature for precomposed legacy characters of Sans Oblique fonts + (by Denis Jacquerye) +- added bearings to en dash U+2013, em dash U+2014 and figure dash U+2012 + by making dashes shorter, preserving character width (by Denis Jacquerye) +- reduced U+031C, U+0325 (ring below), U+0339 to be entirely visible; + added instructions in Sans Book; changed U+1e00-U+1e01 to use new ring below + (by Denis Jacquerye) +- adjusted circumflex below on U+1E12-U+1E13, U+1E18-U+1E19, U+1E3C-U+1E3D, + U+1E4A-U+1E4B, U+1E70-U+1E71, U+1E76-U+1E77 in Sans fonts (by Denis Jacquerye) +- Added U+0ED4, U+0ED5 to DejaVu Sans (by Remy Oudompheng) +- Lao-specific anchors (by Remy Oudompheng) +- added alternate I to match the small capital in Sans (by Gee Fung Sit) + +Changes from 2.14 to 2.15 + +- improved hinting in Sans Oblique to deal with some spacing and inconsistency + issues (by Ben Laenen) +- added anchors to Mono Book, and added GPOS rules for combining diacritics to + show up as zero width glyphs (by Ben Laenen) +- removed U+F21C (PUA), it was copy of U+2C64 from Latin Extended C (by Eugeniy + Meshcheryakov) +- added U+27E6-U+27E7 to Sans (by Gee Fung Sit) +- added U+1407, U+1409, U+140C-U+141B, U+141D-U+1425, U+1427-U+142E, + U+1435-U+1438, U+143A-U+1449, U+1452, U+1454, U+1457-U+1465, U+1467-U+146A, + U+1471, U+1474-U+1482, U+1484-U+1488, U+148F, U+1492, U+14A0, U+14A2, U+14A9, + U+14AC-U+14BA, U+14BC, U+14BD, U+14C6, U+14C9-U+14CF, U+14D1, U+14D2, U+14D9, + U+14DC-U+14E9, U+14EC, U+14F3, U+14F6-U+1504, U+1506, U+1507, U+1510-U+1525, + U+152C, U+152F-U+153D, U+1540, U+1541, U+154E, U+154F, U+1552, U+155B, U+155C, + U+1568, U+1569, U+1574-U+157B, U+157D, U+15A7-U+15AE, U+1646, U+1647 (by + Eugeniy Meshcheryakov) +- fixed several contours to not intersect, use horizontal or vertical tangents, + use integer coordinates, etc in Sans Book (by Denis Jacquerye) +- added U+0496-U+0497 in Serif (by Andrey V. Panov) + +Changes from 2.13 to 2.14 + +- added Philippine peso glyph U+20B1 (by Clayborne Arevalo) +- made U+2012 have the same width as digits, according to Unicode 5.0, + page 206 (by Roozbeh Pournader) +- made all of the "above" combining characters remove the dot of "i", + "j", etc (Soft_Dotted characters), according to Unicode 5.0, + page 228 (by Roozbeh Pournader) +- made U+012F, U+03F3, U+0456, U+0458, U+1E2D, and U+1ECB (all fonts + except Mono), U+0249, U+2148, and U+2149 (Sans and Sans Condensed), + U+0268 (Sans ExtraLight, Serif and Serif Condensed), and U+029D (Serif + and Serif Condensed) respect the Soft_Dotted property (by Roozbeh + Pournader) +- added U+223E, U+223F, U+2240, U+22C2, U+22C3 to Sans (by Remy Oudompheng) +- added U+203D to Serif (by Gee Fung Sit) +- added zero-width glyphs for U+2061-U+2063 to Sans and Serif (by Gee + Fung Sit) +- changed isolated forms of Arabic waw (U+0648, U+0624 and U+06C6) (bug #9432) + (by Ben Laenen) +- added Lao consonants U+0E81, U+0E82, U+0E84, U+0E87, U+0E88, U+0E8A, + U+0E8D, U+0E94-0E97, U+0E99-0E9F, U+0EA1-0EA3, U+0EA5, U+0EA7, U+0EAA, + U+0EAB, U+0EAD-0EAF to Sans Mono (by Remy Oudompheng) +- added U+0200-U+0217, U+0226-U+0229, U+02F3, U+1E00-U+1E07, + U+1E0A-U+1E0B, U+1E18-U+1E1F, U+1E22-U+1E23, U+1E28-U+1E2D, + U+1E3A-U+1E3B, U+1E40, U+1E48-U+1E49, U+1E56, U+1E58-U+1E59, + U+1E5E-U+1E5F, U+1E60, U+1E68-U+1E6B, U+1E6E-U+1E6F, U+1E72-U+1E77, + U+1E86-U+1E8B, U+1E92-U+1E96, U+1EA0-U+1EA1, U+1EF4-U+1EF5 to Mono + (by Ben Laenen) +- renamed uppercase variants of diacritics (macron, breve, double grave, + double acute, inverted breve, dot above) to "uni03XX.case" in Mono + (by Ben Laenen) +- moved uppercase variants of diacritics up in Mono so they properly + vertically align on capitals (by Ben Laenen) +- precomposed glyphs with macron, breve, double grave, double acute, + inverted breve, dot above, macron below, breve below, inverted breve + below, dot below, cedilla, caron below, circumflex below, diaeresis + below, tilde below now reference to combining diacritics instead of + space modifiers in Mono (by Ben Laenen) +- made ring below (U+0325), and half rings below (U+031C and U+0339) + smaller in Mono (by Ben Laenen) +- added U+205F to all fonts (by Roozbeh Pournader) +- added U+035E-U+035F to Sans (by Roozbeh Pournader) +- added empty glyphs for U+034F, U+202A-U+202E, U+2060, U+206A-206F, + U+FE00-U+FE0F to non-Mono fonts (by Roozbeh Pournader) +- added U+2101, U+2107-U+2108, U+210B, U+210C, U+2110, U+2112, U+211B, + U+211F, U+2123, U+2125, U+2128-U+2129, U+212C-U+212D, U+212F, + U+2130-U+2131, U+2133, U+2136-U+213A, U+2141-U+2144, U+2B00-U+2B11, + U+2B20-U+2B23 to Sans (by John Karp) +- reshaped omega (U+03C9) in Mono (by Ben Laenen) +- added U+2205, U+22C6, U+2300-U+2301, U+2303-U+2306, U+230C-U+230F, + U+2312-U+2315, U+231C-U+231F, U+2335, U+2337-U+233E, U+2341-U+2344, + U+2347-U+2348, U+234B-U+234D, U+2349-U+2350, U+2352-U+2354, + U+2357-U+2359, U+235A-U+235C, U+235E-U+2360, U+2363-U+2365, + U+2368-U+2369, U+236B-U+2370, U+2373-U+237A, U+2380-U+2383, + U+2388-U+238B, U+2395 in Mono (by Ben Laenen) + +Changes from 2.12 to 2.13 + +- adjusted U+0198B, U+01B3-U+01B4 in Sans, hinted U+01B4 in Sans Book + (by Denis Jacquerye) +- added U+27F0-U+27FF, U+2906-U+2907, U+290A-U+290B, U+2940-U+2941 to Sans + (by Denis Jacquerye) +- added U+01E6-U+01E9, U+01EE-U+01EF, U+01F4-U+01F5, U+01FC-U+01FF, + U+021E-U+021F, U+0245, U+02BD, U+02C9, U+1E9B, U+2045-U+2046, U+2213, U+22C5, + U+22EF to Sans Mono (by Roozbeh Pournader) +- added U+04FA-U+04FD to Sans (by Michael Everson) +- removed U+2329 and U+232A because of their CJK properties, added U+27E8 + and U+27E9 in their stead, fixing part of bug #9038 (by Roozbeh Pournader) +- corrected and improvised U+0466-U+0469, U+046E-U+0471, U+047C-U+047D, U+0482, + U+0484-U+0486, U+0492-U+0493, U+04B0-U+04B1, U+050C-U+050D, and U+204A + in Sans (by Michael Everson) +- added instructions for U+0402, U+0409, U+040A, U+040B, U+044D, U+040F, + U+0452, U+0459-U+045B, U+045F to Sans Book (by Eugeniy Meshcheryakov) +- made italic shape for U+431, U+432, U+437, U+43B, U+43C, U+43D, U+444, U+447, + U+44D, U+44F, U+459, U+45A in SerifOblique and SerifBoldOblique + (by Andrey V. Panov) +- modified U+024C to match glyph in Unicode chart, fixing bug #9039 + (by Denis Jacquerye) +- made some canonically equivalent characters share the same glyph: + U+02B9 = U+0374, U+0343 = U+0313, and U+0387 = U+00B7 also adjusting U+02BA + to look like double U+02B9, fixing parts of bug #9038 (by Roozbeh Pournader) +- changed shapes for U+0478 and U+0479 in Sans to those in the Unicode charts, + based on a recent decision by Unicode Technical Committee to only use + the digraph form (by Michael Everson) +- adjusted width of NBSP U+00A0 and NNBSP U+202F, fixing bug #8401 + (by Denis Jacquerye) +- fixed several contours to not intersect, use horizontal or vertical tangents, + use integer coordinates, etc (by Roozbeh Pournader and Denis Jacquerye) +- added U+1402, U+1430, U+144D, U+146C, U+148A, U+14A4, U+14C1, U+14D4, U+14EE, + U+1527, U+1545, U+157E, U+158E, U+15AF to Sans (by Eugeniy Meshcheryakov) +- enlarged width of U+459 and U+45A in Serif (by Andrey V. Panov) +- made traditional shape for U+452, U+45B (by Andrey V. Panov) +- added euro sign U+20AC to Sans ExtraLight, making fontconfig recognize + the font as supporting English (by Denis Jacquerye) + +Changes from 2.11 to 2.12 + +- added U+0180 to Serif (by Denis Jacquerye) +- improved and/or hinted Armenian letters U+0542, U+0546, U+0562, + U+0563, U+0564, U+0577, U+0582 in Sans (by Ben Laenen) +- added U+4FE-U+4FF, U+512-U+513, U+2114, U+214E, U+26B2 to Sans + (by Gee Fung Sit) +- adjusted U+0496-U+0497, U+049A-U+04A1 in Sans to match U+0416, + U+041A, U+0436 and U+043A (by Gee Fung Sit) +- Mathematical Operators in Sans: changed U+22C0-U+22C1 to match + other n-ary operators, adjusted U+2203-U+2204, changed U+2220 in + Sans to match the style of U+2221 (by Gee Fung Sit) +- added U+1401, U+1403-U+1406, U+140A, U+140B, U+1426, U+142F, + U+1431-U+1434, U+1438, U+1439, U+1449, U+144A, U+144C, + U+144E-U+1451, U+1455, U+1456, U+1466, U+146B, U+146D-U+1470, + U+1472, U+1473, U+1483, U+1489, U+148B-U+148E, U+1490, U+1491, + U+14A1, U+14A3, U+14A5-U+14A8, U+14AA, U+14AB, U+14BB, U+14C0, + U+14C2-U+14C5, U+14C7, U+14C8, U+14D0, U+14D3, U+14D5-U+14D8, + U+14DA, U+14DB, U+14EA, U+14ED, U+14EF-U+14F2, U+14F4, U+14F5, + U+1405, U+1526, U+1528-U+152B, U+152D, U+152E, U+153E, + U+1542-U+1544, U+1546-U+154D, U+1550, U+1553, U+1555-U+155A, + U+1567, U+156A, U+157C, U+157F-U+1585, U+158A-U+158D, + U+158F-U+1596, U+15A0-U+15A6, U+15DE, U+15E1, U+166E-U+1676 to + Sans (by Eugeniy Meshcheryakov) +- re-enabled Latin ligatures fi, ffi, fl, ffl and ff in Sans + (by Ben Laenen) +- made italic shape for U+436, U+44A, U+44B, U+44C, U+44E, U+45F, + U+463 in SerifOblique and SerifBoldOblique (by Andrey V. Panov) +- fixed sub- and superscript metrics in Condensed Sans (bug #8848) + (by Ben Laenen) +- added U+474, U+475 in Serif (by Andrey V. Panov) +- hinted Greek glyphs U+03B7, U+30B8, U+03B9, U+03C1, U+03C3, + U+03C6 in Mono Book (by Ben Laenen) + +Changes from 2.10 to 2.11 + +- added instructions for Hebrew glyphs (Sans Book, by Eugeniy + Meshcheryakov) +- changed U+01A6 (Latin Yr) after bug #8212, in Sans, Serif and + Sans Mono fonts (by Denis Jacquerye). +- removed instruction for U+2600-U+26A1 (by Mederic Boquien) +- added U+202F and set width of U+00A0 (nobreakingspace) to the + same as U+0020, space (by Denis Jacquerye). +- added and improved instructions for various Cyrillic letters + (by Eugeniy Meshcheryakov) +- Changed U+416, U+42F, U+427 (non-Bold), U+436, U+447 (non-Bold), + U+44F, U+437 (Bold), corrected U+40F, U+414, U+424, U+426, U+429, + U+434, U+438 (Bold), U+446, U+449, U+44D (non-Bold), U+45F in + Sans Mono (by Andrey V. Panov) +- made small corrections to Cyrillic, most appreciable to U+409, + U+413, U+41B, U+427 and U+433, U+434, U+43B, U+447, U+459 + (upright fonts) to Serif (by Andrey V. Panov) +- adjusted bearings of U+410, U+416, U+41A, U+42F, U+436, U+43A, + U+443, U+44F in Serif (by Andrey V. Panov) +- enlarged width of U+44A, U+44B, U+44C, U+463 in Serif + (by Andrey V. Panov) +- added ligature "iacute" as "afii10103" (U+456) "acutecomb" in + Serif (by Andrey V. Panov) +- made italic shape to U+446, U+448, U+449 in Serif (by Andrey V. + Panov) +- added "afii10831" (U+F6C7), "afii10832" (U+F6C8) in Serif (by + Andrey V. Panov) +- new minimum version of fontforge is 20061014 (by Ben Laenen) + +Changes from 2.9 to 2.10: + +- added U+0242, U+024A-U+024B, U+024E-U+024F, U+037C-U+037D, U+0E3F, + U+1D2C-U+1D2E, U+1D30-U+1D42, U+1D5D-U+1D6A, U+1D78, U+1DB8, + U+2090-U+2094, U+20D0-U+20D1, U+2C60-U+2C66, U+2C6B-U+2C6C, U+2C74 and + U+FB29 to Sans (by Gee Fung Sit) +- added Lao glyphs : U+0E81-0E82, U+E084, U+0E87-0E88, U+0E8A, U+0E8D, + U+0E94-0E97, U+0E99-0E9F, U+0EA1-0EA3, U+0EA5, U+0EA7, U+0EAA-0EAB, + U+0EAD-0EB9, U+0EBB-0EBD, U+0EC0-0EC4, U+0EC6, U+0EC8-0ECD, U+0EDC-0EDD + (by Remy Oudompheng) +- fixed U+0193 not showing in Windows (bug #7897) (by Ben Laenen) +- changes to U+222B-222D in Sans Mono (by Remy Oudompheng) +- ported the three remaining currency symbols from Arev (U+20B0, + U+20B2-U+20B3), and replaced one (U+20AF) in Sans (by Lars Naesbye + Christensen) +- corrected U+20A5 in Sans (by Gee Fung Sit) +- merged Double-Struck Letters from Arev: U+2102, U+210D, U+2115, + U+2119-U+211A, U+2124, U+213C-U+2140 (by Gee Fung Sit) +- added U+2308-U+230B and U+2329-U+232A to Sans Mono and Serif faces, + fixed incorrect direction of U+2329 in Sans faces, and improved + U+2308-U+230B in Sans faces per Ben Laenen's suggestions (by David + Lawrence Ramsey) +- added U+06D5 and final form of it (needed for Kurdish) (by Ben Laenen) +- added two special glyphs U+F000 and U+F001 in Sans Book that show the + current ppem size (horizontal and vertical) (by Ben Laenen) +- added U+2318 and U+2325 to Sans Mono faces, based on the Sans versions + (by David Lawrence Ramsey) +- added U+2B14-U+2B1A to all faces except Sans ExtraLight (by David + Lawrence Ramsey) +- respaced all Geometric Shapes characters in Serif faces to match those + in Sans faces again, respaced U+23CF in Sans, Sans ExtraLight, and + Serif faces to match U+25A0 (or Sans in Sans ExtraLight's case) again, + and respaced U+2B12-U+2B13 in Sans and Serif faces to match U+25A1 + again (by David Lawrence Ramsey) +- corrected width of Modifier Small Letters U+1D43-1D5B in Sans Oblique + and U+1D9B-U+1DBF in Sans Oblique and Sans Bold Oblique (by Gee Fung Sit) +- added a bunch of glyphs to Sans ExtraLight (see SVN for details) (by + Gee Fung Sit) +- adjusted Cyrillic descenders in Sans ExtraLight to sync with Sans (by + Gee Fung Sit) +- added U+0242, U+0245 to Serif (by Gee Fung Sit) +- replaced the SHPIX routines which gave them bad spacing at certain + sizes in FreeType for A, V, Z, v and z in Sans Bold (by Ben Laenen) + +Changes from 2.8 to 2.9: + +- DejaVuSansExtraLight.sfd: changed family name from "DejaVu Sans" to + "DejaVu Sans Light" (in case we add a Light weight variant), so legacy + apps that understand only 4 styles are happy. (by Denis Jacquerye) +- added Name ID 16, aka preferred family name, and Name ID 17, aka + preferred style name, so contemporary apps that understand more that 4 + styles can use big fonts families "DejaVu Sans" and "DejaVu Serif". For + those, Extralight and Condensed are just styles not different families. + (by Denis Jacquerye) +- added U+22B6-22BD, U+22C0-22C1, U+22D6-22D7 to Sans. (by Remy Oudompheng) +- added U+037B, U+2184, U+2C67-U+2C6A and U+2C75-U+2C77 to Sans (by Gee + Fung Sit) +- adjusted asteriskmath (U+2217) for consistency with other mathematical + operators in Sans (by Ben Laenen) +- hinted some Armenian capitals in Sans Book (by Ben Laenen) +- added U+0246 - U+0249 (by Ben Laenen) +- BUGFIX : swapped U+224E and U+224F, in Sans, Sans Condensed and Sans Mono + (by Remy Oudompheng) +- adjusted U+20B5 (by Mederic Boquien) +- swapped U+21DA and U+21DB which were in wrong order (by Heikki Lindroos) +- added U+222E-2233, U+239B-23AD, U+2A00-2A02, U+2A0F-2A1C to Sans (by Remy + Oudompheng) +- added U+239B-23AD to Mono (by Remy Oudompheng) +- added U+2024-2025 to Serif (by Mederic Boquien) +- added U+222C-222D, U+2A0C-2A0E to Serif (by Remy Oudompheng) +- added U+2190-21FF to Mono (by Heikki Lindroos) +- added Hebrew glyphs - U+05B0-U+05BD, U+05BF-U+05C3, U+05C6, U+05C7, + U+05D0-U+05EA, U+05F0-U+05F2, U+FB1F, U+FB20, U+FB2A-U+FB36, + U+FB38-U+FB3C, U+FB3E, U+FB40, U+FB41, U+FB43, U+FB44, U+FB46-U+FB4E (by + Gee Fung Sit and Eugeniy Meshcheryakov) +- adjustments for Cyrillic in Sans (by Andrey V. Panov) +- made italic shape for U+0434, U+0456, U+0457 in SerifOblique and Serif + Bold Oblique (by Andrey V. Panov) + +Changes from 2.7 to 2.8: + +- fixed instructions for U+0423, U+0427, U+0447, U+0448 in Serif, so they + look good at large sizes too (by Eugeniy Meshcheryakov) +- added U+FB00 and U+FB03 to U+FB06 to Serif typefaces (by Heikki Lindroos) +- added U+26B0-U+26B1, U+2701-U+2704, U+2706-U+2709, U+270C-U+2727, U+2729 + to U+274B, U+274D, U+274F to U+2752, U+2756, U+2758-U+275E, U+2761 to + U+2775 (by Heikki Lindroos) +- added and improved instructions for Cyrillic letters in Mono and Serif + (Book, by Eugeniy Meshcheryakov) +- rotated U+26B0 (was too small in mono) (by Gee Fung Sit) +- adjusted U+1EDA-U+1EDD, U+1EE8-U+1EEB, capitals using capital specific + accent and moved diacritics to match position on U+00F2 (ograve), etc. + (by Denis Jacquerye) +- added U+20D6, U+20D7 to Sans (by Gee Fung Sit) +- made Armenian ligatures discretionary since the Firefox ligature problem + still isn't fixed (by Ben Laenen) +- moved Armenian hyphen U+058A to a higher position (bug #7436) (by Ben + Laenen) +- hinted Greek glyphs in Sans Bold (by Ben Laenen) +- enabled Arabic lam-alif ligatures when diacritics are used (by Ben Laenen) + +Changes from 2.6 to 2.7: + +- added glyphs needed for Kurdish: U+0695, U+06B5, U+06C6, U+06CE and their + init/medi/fina forms in Sans (by Ben Laenen) +- added U+02CD, U+01F8 - U+01F9, U+1E3E - U+1E3F, U+1E30 - U+1E35, U+1EBC - + U+1EBD, U+1EF8 - U+1EF9 (includes glyphs needed for Yoruba, Maori, Guarani + and Twi) (by Ben Laenen) +- added U+22C8-22CC, U+29CE-29D5, U+2A7D-2AA0, U+2AAE-2ABA, U+2AF9-2AFA to + Sans (by Remy Oudompheng) +- adjusted diacritics on Vietnamese, Pinyin and other characters: + U+01A0-U+01A1, U+01AF-U+01B0, U+01D5-U+01DC, U+01DE-01E1, U+01FA-U+01FB + U+022A-U+022D, U+0230-U+0231, U+1E14-U+1E17, U+1E4C-U+1E53, U+1E78-U+1E7B, + U+1EA4-U+1EF1 in Sans (Book, Bold and Oblique) (by Denis Jacquerye) +- added basic arrows U+2190-U+2193 in Serif, which completes MES-1 compliance + for Serif (by Ben Laenen) +- added U+01E4, U+01E5, U+01FA, U+01FB, U+02BD, U+02C9 and U+02EE to Serif + (by Ben Laenen) +- fixed U+0209 in Serif Bold Oblique (by Ben Laenen) +- adjusted Box Drawing block characters U+2500-257F in Mono to fit character + cell, shifting them up by 416 (Denis Jacquerye) +- redid U+0194 in Sans (by Ben Laenen) +- added U+2217-2218, U+2295-22A1 to Mono (by Remy Oudompheng) +- added U+0462 to Serif (by Andrey V. Panov) +- added U+226C, U+228C-228E, U+2293-2294, U+22F2-22FF to Sans (by Remy + Oudompheng) +- adjusted U+2208-220D in Sans (by Remy Oudompheng) +- improved some Cyrillic glyphs in Mono (by Andrey V. Panov), rewritten + instructions for changed glyphs (by Eugeniy Meshcheryakov) +- added U+1E0E-1E0F, U+1E8E-1E8F to Mono fonts (by Denis Jacquerye). (bug + #7166) +- renamed 'Dotabove' to 'Dotaccent' in Mono Sans Oblique to match other fonts + (by Denis Jacquerye). +- added U+200B-U+200F in Sans faces and Serif faces, U+200B and U+200C were + in Sans already (by Lars Naesbye Christensen) +- added U+2601-U+262F, U+263D, U+263E, U+2648-U+265F, U+2668, U+2670-U+268B, + U+2690-U+269C, U+26A0, U+26A1, U+2794, U+2798-U+27AF, U+27B1-U+27BE to Mono + (by Heikki Lindroos) +- replaced the references with unshifted ones for both κ U+03BA and к U+043A + in Mono Book (by Denis Jacquerye) +- fixing glyph for U+04ED in Mono Book, consisted only of dieresis (by Andrey + V. Panov). + +Changes from 2.5 to 2.6: + +- redid U+2032 - U+2037, U+2057 based on Arev in Sans (by Gee Fung Sit) +- added U+0195, corrected U+039E, U+204B in Sans ExtraLight (by Gee Fung Sit) +- added instructions for some Cyrillic letters in Sans Bold (by Eugeniy + Meshcheryakov) +- added vulgar fractions U+2153-U+215F for Serif, made with references (by + Lars Naesbye Christensen) +- added U+228F-2292, U+2299-22AF, U+22B2-22B5, U+22CD, U+22D8-22ED to Sans + (by Remy Oudompheng) +- added U+2208-220D, U+2238-223D, U+2278-2281, U+228A-228B, U+228F-2292, + U+22CD, U+22DA-22E9 to Mono (by Remy Oudompheng) +- fixed misplaced dot in U+2250 in Mono (by Remy Oudompheng) +- added instructions for some Cyrillic letters in Mono Book and Bold(by + Eugeniy Meshcheryakov) +- minor changes to U+2241, U+2261-2263, U+22A4, U+22A5 in Sans (by Remy + Oudompheng) +- added hinting instructions to lowercase Armenian glyphs in Sans Book (by + Ben Laenen) +- changed U+2208, U+220B to match U+2209 and U+220C in Sans Bold (by Remy + Oudompheng) +- added Braille patterns U+2800-U+28FF to Sans (by Mederic Boquien) +- added instructions for some Cyrillic letters in Serif Book (by Eugeniy + Meshcheryakov) +- renamed BoldOblique fonts to Bold Oblique in TTF Name as originally in + Bitstream Vera fonts (by Denis Jacquerye) +- added hinting instructions to some Latin-B Extended and IPA characters in + Sans Book (by Denis Jacquerye and Ben Laenen) +- adjusted bearings, replaced diacritics, hinted hook and horn for + Vietnamese in Sans Book (by Denis Jacquerye) +- made FAX, TM, TEL, etc. discritionary ligatures in Sans and Serif fonts + (by Denis Jacquerye) +- removed ligatures of precomposed characters in Sans and Serif fonts (by + Denis Jacquerye) +- added U+F208, U+F20A, U+F215-F217, U+F21A-F21B, U+F25F in PUA (from SIL's + PUA, probably in Unicode 5.0): U+0243, U+0244, U+0245, U+024C, U+024D, + U+2C64, (U+2C6D), (U+2C71) +- modified some glyphs in Serif Oblique to make them more italic (by Denis + Jacquerye) + +Changes from 2.4 to 2.5: + +- fixed excessive kerning bug that occurs with Pango (by Denis Jacquerye) +- added U+20AF to Sans and Serif (by Lars Naesbye Christensen) +- regenerated Condensed faces (by Ben Laenen) +- added U+035C-U+035D to Sans, fixed U+0361 (by Denis Jacquerye) +- integrated 255 characters from Arev fonts: Latin Extended-B, Spacing + Modifiers, Combining Diacritical Marks, Cyrillic, Cyrillic supplement, + General Punctuation, Letterlike Symbols, Arrows, Mathematical Operators, + Miscellaneous Technical, Dingbats, Alphabetic Presentation Forms (by Denis + Jacquerye) +- added basic Cyrillic and basic Greek to Sans ExtraLight (by Denis Jacquerye) +- added U+0498, U+049A, U+04AA, U+04AB, U+04AF to Serif (by Eugeniy + Meshcheryakov) +- added U+0494, U+0495, U+0498, U+0499, U+04AA, U+04AB, U+04C3, U+04C4, + U+04C7, U+04C8 to Mono (by Eugeniy Meshcheryakov) +- adjusted weight of U+0256, U+0257, U+0260, U+0272, U+0273, U+0277, U+029B, + U+02A0 and modifed U+028B and U+027A in Mono (by Denis Jacquerye) +- added U+2000-200A to Mono (by Denis Jacquerye) +- added vulgar fractions U+2153 - U+215F to Mono (by Gee Fung Sit) +- adapted metrics of Arabic glyphs so they stay above cut-off height in Sans + (by Ben Laenen) +- fixed mkmk anchors for Arabic diacritics so they stack properly in Sans (by + Ben Laenen) +- fixed weight of lowercase upsilon in Sans Bold, make small adjustment to + lowercase omega in Sans (by Ben Laenen) +- added U+210E (by Mederic Boquien) +- unslanted U+2201, U+221B and U+221C in Sans Oblique (by Mederic Boquien) +- added several mathematical relation symbols to Sans and Mono (U+2241-224C, + U+2250-2255, U+2260-2269, U+226E-2277, U+2282-2287) modified U+223C to match + other tildes, and U+2282-2284 to have the same shape. (by Remy Oudompheng) +- made U+2234-U+2237 refer to U+2219 instead of U+00B7 in Sans (by Mederic + Boquien) +- added U+2238-223B, U+226A-226B, U+2278-2281, U+2288-228B to Sans (by Remy + Oudompheng) +- unslanted and changed reference of U+22C5 from U+00B7 to U+2219 in Sans (by + Mederic Boquien) +- added U+224D-225F, U+226D, U+22C6 to Sans and unslanted U+2219 in Sans + Oblique. (by Remy Oudompheng) +- added U+224D-225F, U+226D to Mono, shifted U+2266-2269 higher upwards and + unslanted U+2219 in Oblique. (by Remy Oudompheng) +- merged Coptic glyphs from Arev 0.2 (by Lars Naesbye Christensen) +- fixed and adjusted various Cyrillic glyphs in Serif (by Andrey V. Panov) +- made fi, fl... ligatures discretionary ligatures (by Ben Laenen) + +Changes from 2.3 to 2.4: + +- added U+04A2, U+04A3, U+04AC - U+04AF, U+04BA, U+04BB, U+04C0 - + U+04C2, U+04CB, U+04CD, U+04D8 - U+04DF, U+04E2 - U+04E5, U+04E8 - U+04F5, + U+04F6 - U+04F9 to Mono (by Eugeniy Meshcheryakov) +- added U+048C, U+048D, U+0494, U+0495, U+049E - U+04A7, U+04AC - + U+04AE, U+04B4- U+04B7, U+04BA, U+04BB, U+04C0 - U+04C4, U+04C7, U+04C8, + U+04CB, U+04CC, U+04D8 - U+04DF, U+04E2 - U+04E5, U+04EC - U+04F9 to Serif + (by Eugeniy Meshcheryakov) +- added U+2134 to Sans (by Gee Fung Sit) +- added U+2080 - U+2089 to all faces (by Gee Fung Sit) +- several minor corrections to Sans (by Gee Fung Sit) +- major corrections to Sans Condensed (by Gee Fung Sit) +- corrected Superscripts and Subscripts in Sans (by Gee Fung Sit) +- corrected anchors of U+0316-U+0319 (by Denis Jacquerye) +- Verajja integrated (by Stepan Roh) +- copied U+2328, U+2600, U+2639-U+263C, U+263F-U+2647, U+2660-U+2667, + and U+2669-U+266F from Sans to Serif, and copied scaled-down versions of + them to Sans Mono (by David Lawrence Ramsey) +- added U+20B4 to all faces (by Eugeniy Meshcheryakov) +- added more minor positional adjustments to U+2638 in all faces to + match the other miscellaneous symbols in Verajja, and rescale it in Sans + Mono so that it looks better (by David Lawrence Ramsey) +- added U+2242, U+2243 and U+22A4 (by Mederic Boquien) +- corrected U+2245 in Sans (by Mederic Boquien) +- added U+0221, U+0234-0236 (by Denis Jacquerye) +- added in Arabic block to Sans: U+060C, U+0615, U+061B, U+061F, U+0621 +- U+063A, U+0640 - U+0655, U+0660 - U+066F, U+0679 - U+0687, U+0698, U+06A1, + U+06A9, U+06AF, U+06BA, U+06BF, U+06CC, U+06F0 - U+06F9 (by Ben Laenen) +- added in Arabic Presentation Forms A to Sans: U+FB52 - U+FB81, U+FB8A +- U+FB95, U+FB9E - U+FB9F, U+FBE8 - U+FBE9, U+FBFC - U+FBFF (by Ben Laenen) +- added complete Arabic Presentation Forms B to Sans: U+FE70 - U+FE74, + U+FE76 - U+FEFC, U+FEFF (by Ben Laenen) +- added complete Greek Extended block to Mono (by Ben Laenen) +- modified Greek capitals with tonos in Mono (by Ben Laenen) +- added U+01C4-01CC, U+01D5, U+01DE, U+01E0-U+01E1, U+01E6-U+01E9, + U+01EE-U+01F5, U+01F8-U+0217, U+021E-U+021F, U+0226-U+022A, U+022C to Serif + (by Denis Jacquerye) +- adjusted U+043B and U+044F in Serif (by Denis Jacquerye) +- added U+2000-U+200A (by Denis Jacquerye) +- added U+1E00-U+1E0B, U+1E0E-U+1E11, U+1E14-U+1E1C, U+1E1E-U+1E23, + U+1E26-U+1E2D, U+1E30-U+1E35, U+1E3A-U+1E3B, U+1E3E-U+1E40, U+1E48-U+1E49, + U+1E50-U+1E56, U+1E58-U+1E59, U+1E5E-U+1E60, U+1E68-U+1E6B, U+1E6E-U+1E6F, + U+1E72-U+1E7D, U+1E86-U+1E9B, U+1EA0-U+1EA3, U+1EAC-U+1EB7, U+1EBA-U+1EBD, + U+1EC6-U+1ECF, U+1ED8-U+1ED9, U+1EE6-U+1EE7, U+1EF4-U+1EF9 to Serif (by + Denis Jacquerye) +- added U+048E, U+048F, U+049C-U+049F, U+04B8, U+04B9, U+04BC-U+04BF, + U+04C3, U+04C4 to Sans (by Eugeniy Meshcheryakov) +- added DejaVu Sans Extra Light (by Denis Jacquerye) +- Adjusted underline position for (hopefully) improved legibility in + Sans, Serif, Mono (Tim May) +- added auto-generated DejaVu LGC (by Stepan Roh) + +Changes from 2.2 to 2.3: + +- fixed bug U+042B and U+044B behave badly in Sans Bold or Oblique (by + Keenan Pepper) +- added and improved TrueType instructions and related settings (by + Keenan Pepper) +- added U+04D0-U+04D7, U+04E6, U+04E7 to Mono (by Eugeniy Meshcheryakov) +- added U+048A - U+048D, U+0498, U+0499, U+04AA, U+04AB, U+04B0, U+04B1, + U+04C0, U+04C9, U+04CA, U+04CE, U+04CD, U+04DA, U+04DB, U+04DE, U+04DF, + U+04E2 - U+04E5, U+04EC - U+04F8, U+04F9 to Sans (by Eugeniy Meshcheryakov) +- added U+04E0, U+04E1 to all faces (by Eugeniy Meshcheryakov) +- added Greek Extended to Sans and Serif: U+1F00-U+1F15, U+1F18-U+1F1D, + U+1F20-U+1F45, U+1F48-U+1F4D, U+1F50-U+1F57, U+1F59, U+1F5B, U+1F5D, + U+1F5F-U+1F7D, U+1F80-U+1FB4, U+1FB6-U+1FC4, U+1FC6-U+1FD3, U+1FD6-U+1FDB, + U+1FDD-U+1FEF, U+1FF2-U+1FF4, U+1FF6-U+1FFE (by Ben Laenen) +- added Greek variant letterforms, archaic letters and symbols to Mono: + U+03D0-U+03E1, U+03F0-U+03FF (by Ben Laenen) +- added Armenian block and Armenian ligatures to Sans (U+0531 - U+0556, + U+0559 - U+055F, U+0561 - U+0587, U+0589 - U+058A, U+FB13 - U+FB17) (by Ben + Laenen) +- redid some Greek characters in Sans and Mono to make them look better + and to correct some errors (by Ben Laenen) +- added U+27E0 to all faces (by David Lawrence Ramsey) +- added underscore (U+005F) consistency fixes: extended the Sans Mono + and Sans Mono Oblique underscores to touch both horizontal edges, and + reduced the height of the Sans Bold Oblique underscore to match the Sans + Bold underscore (by David Lawrence Ramsey) +- added underscore (U+005F) derivatives and consistency fixes for them: + made U+0332 a reference to underscore at Denis Jacquerye's suggestion; made + U+0333 two references to underscore; made U+033F two references to U+203E; + added U+2017 as two references to underscore, and made U+0333 a reference to + it; and added U+203E as a reference to underscore, and made U+0305 a + reference to it (by David Lawrence Ramsey) +- added U+201B, U+2220, U+2320-U+2321, U+23AE, U+23CF, all remaining + Geometric Shapes glyphs (U+25A0-U+25C9, U+25CB-U+25D7, U+25D9-U+25E5, + U+25E7-U+25FF), and U+2B12-U+2B13 to all faces (by David Lawrence Ramsey) +- added minor positional adjustments to U+2638 in all faces (by David + Lawrence Ramsey) +- added U+201F to Sans Mono and Serif faces (by David Lawrence Ramsey) +- added U+01B7, U+01F6, U+0464 - U+0465, U+2160 - U+2180, U+2183, + U+220A, U+220D, U+2329, U+232A, U+2422, U+27E8 - U+27EB, U+2680 - U+2685 to + Sans (by Gee Fung Sit ???) +- added U+2116 to Sans and Serif (by Gee Fung Sit) +- changed florin sign U+0192 in Sans (by Gee Fung Sit) +- added anchor points to some glyphs (by Denis Jacquerye) +- adjusted height of IPA superscripts U+02B0-02B8, U+02C0-02C1, + U+02E0-02E4, U+207F to match with height of U+00B2 (by Denis Jacquerye) +- added U+0184-U+0185, U+019C, U+019F, U+01A0-U+01A3, U+01A6, U+01AA, + U+01AF-U+01B0, U+01B2-U+01B4, U+01B7-U+01B8, U+01BC-U+01BC, U+0224-U+0225, + U+023A-U+0240, U+1D16-U+1D17, U+1D1D-U+1D1E, U+1D43-U+1D5B, U+1D7B, + U+1D85,U+1D9B-1DB7, U+1DB9-U+1DBF, U+20A6 to all fonts (by Denis Jacquerye) +- added added U+0182, U+018B, U+018E, U+01A0-U+01A1, U+01B1, U+01B9, + U+01C0-U+01C3, U+0238-U+0239, U+1D02, U+1D08-U+1D09, U+1D14, U+1D1F, U+1D77 + to Serif and Mono (by Denis Jacquerye) +- added U+0181, U+0183, U+0187-U+0188, U+018A-U+018F, U+0191, U+0193, + U+0195-U+019B, U+019D-U+019E, U+01A4-U+01A5, U+01AC-U+01AE, U+01B5-U+01B6, + U+01B9, U+01BB, U+01F6 to Serif (by Denis Jacquerye) +- added U+0181, U+0187-U+0188, U+018A, U+018D, U+018F, U+0191, U+0193, + U+0195-U+019F, U+01A4-01A5, U+01AC-01AD, U+01B5-U+01B6, U+1BB, U+01F6, + U+01D7-U+01DC, U+0238-U+0239, U+0241 to Mono (by Denis Jacquerye) +- added to Mono and Serif (by Denis Jacquerye) + +Changes from 2.1 to 2.2: + +- reworked the vertical orientation of the Blocks Elements characters + in all faces to remove their overly large descenders, in order to fix + problems with e.g. terminal emulators (by David Lawrence Ramsey) +- copied bullet in Sans faces to Serif faces for consistency (by David + Lawrence Ramsey) +- added U+2023, U+25D8, U+25E6, and U+29EB to all faces (by David + Lawrence Ramsey) +- added U+1EB8, U+1EB9, U+1ECA - U+1ECD, U+1EE4, U+1EE5 (by Tim May) +- added U+01DD, U+02BE, U+02BF, U+02D3 to all, changed U+02D2 in + non-Condensed and U+1EE5 in Serif (by Tim May) +- fixed U+01CE, replacing wrong circumflex by caron (by Denis Jacquerye) +- added anchor points to some glyphs (by Denis Jacquerye) +- added U+20B5 (by Denis Jacquerye) +- added U+0181 - U+0183, U+0187, U+0188, U+018A - U+018D, U+0191, + U+0193, U+0195 - U+019B, U+019D, U+019E, U+01A4, U+01A7 - U+01A9, U+01AB - + U+01AE, U+01B1, U+01B5, U+01B6, U+01BB, U+01C0 - U+01C3, U+01F1 - U+01F3, + U+0238, U+0239, U+1D02, U+1D08, U+1D09, U+1D14, U+1D1F, U+1D77, U+2103, + U+2126, U+2127, U+212A, U+212B, U+2132, U+214B, U+2210, U+2217, U+2218, + U+2A0C - U+2A0E, U+FB00, U+FB03 and U+FB04 to Sans (by Gee Fung Sit) +- added U+01A9, U+01C3 and U+2126 to Mono and Serif (by Gee Fung Sit) +- adjusted bearings of U+028B in Sans (by Gee Fung Sit) +- added U+018F, U+0494-U+0497, U+04A0-U+04A7, U+04AC-U+04AF, + U+04B4-U+04B7, U+04BA-U+04BB, U+04C1-U+04C2, U+04C5-U+04C8, U+04CB-U+04CC, + U+04D0-U+04D9, U+04DC-U+04DD, U+04E6-U+04EB to Sans (by Eugeniy + Meshcheryakov) +- replaced with references U+0391-U+0393, U+0395-U+0397, U+0399, U+039A, + U+039C, U+039D, U+039F-U+03A1, U+03A4, U+03A5, U+03A7, U+03BF, U+03DC, + U+0405, U+0406, U+0408, U+0410, U+0412, U+0415, U+0417, U+041A, + U+041C-U+041E, U+0420-U+0422, U+0425, U+0430, U+0435, U+043E, U+0440, + U+0441, U+0443, U+0445, U+0455-U+0458 in Serif and Mono (by Eugeniy + Meshcheryakov) +- added U+04D0-U+04D7, U+04E6-U+04EB to Serif (by Eugeniy Meshcheryakov) +- added U+212A and U+212B to the rest of the faces (by Lars Naesbye + Christensen) +- added U+2318 and U+2325 to Sans and Serif (by Lars Naesbye Christensen) +- added and improved TrueType instructions and related settings (by + Keenan Pepper) +- completed basic Greek alphabet: added U+0374-U+0375, U+037A, U+037E, + U+0384-U+038A, U+038C, U+038E-U+0390, U+03AC-U+03BF, U+03C1-U+03CE (by Ben + Laenen) +- added U+2070 and U+2074-U+2079 (by Mederic Boquien) + +Changes from 2.0 to 2.1: + +*** Be aware that names of some TTF files changed since version 2.0. *** + +- added U+0323, U+1E0C, U+1E0D, U+1E24, U+1E25, U+1E36 - U+1E39, U+1E42, + U+1E43, U+1E46, U+1E47, U+1E5A - U+1E5D, U+1E62, U+1E63, U+1E6C, U+1E6D, + U+1E7E, U+1E7F (by Tim May) +- fixed bug where GNOME applications used Mono Bold Oblique instead of + Mono Oblique (by Keenan Pepper) +- added and improved TrueType instructions and related settings (by + Keenan Pepper) +- added U+1E41, U+1E57, U+1E61 (by Sander Vesik) +- added U+0189, U+0309, U+0313, U+0314, U+031A, U+031B, U+0327, U+0328, + U+032B, U+0333, U+033C (by Denis Jacquerye) +- adjusted and fixed U+0186, U+0254, U+0291, U+0316 - U+0319, U+031C - + U+0320, U+0323 - U+0326, U+0329 - U+032A, U+032C - U+0332, U+0339 - U+033B, + U+033E, U+033F (by Denis Jacquerye) +- fixed U+1E12, U+1E3C, U+1E4A, U+1E70 to have normal below diacritics + (by Denis Jacquerye) +- fixed U+1E82, U+1E84 and U+1EF2 to have uppercase above diacritics (by + Denis Jacquerye) +- added anchor points to some glyphs (by Denis Jacquerye) +- dropped "-Roman" from font names - affects both internal TTF names and + names of generated files (by Stepan Roh) +- attempt to fix bug Vertical spacing too big for Mono by exchanging + LineGap and OS2TypoLinegap values (proofed by Stefan Rank) +- added Greek capitals U+0391 - U+03A1, U+03A3 - U+03A9, U+03AA, U+03AB + in Mono (by Ben Laenen) +- added the per ten thousand sign U+2031 (by Mederic Boquien) +- added U+2207, U+221D, U+221F, U+2227 - U+222A, and U+2261 (by David + Lawrence Ramsey) +- new logo (by Gee Fung Sit) +- added U+0180, U+018E, U+201F, U+2024, U+2025, U+203D, U+2200, U+2203, + U+2213, U+222C, U+222D, U+2263 to Sans (by Gee Fung Sit) + +Changes from 1.15 to 2.0: + +- "Italized" basic glyphs in all Serif Oblique and their Condensed faces + (by David Jez) +- added and improved TrueType instructions and related settings (by Keenan + Pepper) +- added anchor points to some glyphs (by Denis Jacquerye) +- many new spacing and combining accents (by Denis Jacquerye) +- smart substitutions for transforming i and j to dottless form and for + using uppercase diacritics (by Denis Jacquerye) +- fixed remaining erroneously slanted characters in Serif Oblique faces (by + David Lawrence Ramsey) +- copied bullet in Sans faces to Sans Oblique faces for consistency (by + David Lawrence Ramsey) +- added U+203C and U+2047-U+2049 (by David Lawrence Ramsey) +- added Greek glyphs to Serif (by Ben Laenen, Condensed merge by David Jez) +- fixed bug LTR glyphs behaving like RTL (by Ben Laenen) +- fixed wrong glyph directions (by David Jez) +- fixed repositioned accents in Condensed faces (by David Jez) + +Changes from 1.14 to 1.15: + +- added and improved TrueType instructions and related settings (by Keenan + Pepper) +- fixed U+2302, U+2319 (by David Lawrence Ramsey) +- fixed yet another monospace bug (by Stepan Roh) +- fixed potential "too big ascender/descender" bug (by Stepan Roh) +- fixed U+026E and U+028E (by Denis Jacquerye) +- added U+0186, U+0190, U+0300 - U+0304, U+0306 - U+0308, U+030A - U+030C, + U+0321, U+0322 (by Denis Jacquerye) +- added rest of Block Elements: U+2591 - U+2593 (by David Lawrence Ramsey) +- added U+2311, U+237D and U+2638 (by David Lawrence Ramsey) +- added U+01CD - U+01D4 (by Denis Jacquerye) +- fixed accents of U+00F2 - U+00F6 by replacing them with references in Mono + Bold (by David Jez) +- added U+0490, U+0491 (by Eugeniy Meshcheryakov) +- added hints to U+0404 and U+0454 in Sans (by Eugeniy Meshcheryakov) +- completed Greek glyphs from U+0370 to U+03CF in Serif (by Ben Laenen) +- fixed shape of U+0255 in Sans Bold and Sans Bold Oblique (by Denis + Jacquerye) + +Changes from 1.13 to 1.14: + +- fixed bug where Mono faces were not recognized as fixed pitch in Windows + by correcting Venda glyphs (by David Jez) +- added and improved TrueType instructions (by Keenan Pepper) +- added 6 Uzbekian glyphs (by Mashrab Kuvatov) +- added Greek glyphs to Sans and Serif, changed pi and omega to fit in (by + Ben Laenen) +- added IPA and related superscript glyphs (by Denis Jacquerye) +- fixed buggy Venda glyphs (by David Lawrence Ramsey and Stepan Roh) +- added U+2302, U+2310, U+2319 (by David Lawrence Ramsey) +- fixed slanted U+00AC in Serif Oblique faces (by David Lawrence Ramsey) +- added 29 glyphs from Block Elements (by David Lawrence Ramsey) + +Changes from 1.12 to 1.13: + +- removed all stems (PS hints) (requested by David Jez) +- added U+01D6, U+01DF, U+022B, U+022D and U+0231 (by Sander Vesik) +- added 10 Venda glyphs (by Dwayne Bailey) +- fixed bug when fonts had no name on Microsoft Windows (by Stepan Roh) +- updated 'missing' glyph U+FFFD (by David Jez) +- set TTF flag fsType to 'Installable Embedding' (= unrestricted usage) + (idea by C. Tiffany) + +Changes from 1.11 to 1.12: + +- added long s (by James Cloos) +- prettier comma accent in gcommaaccent (by David Jez) +- added Hbar, hbar, kgreenlandic, napostrophe, Eng, eng, Tbar, tbar, + afii57929 (by David Jez) +- changed Iogonek, iogonek, IJ, ij to look better (by David Jez) +- glyph uni0237 renamed to dotlessj (requested by David Jez) +- fixed accents for dcaron, lcaron, tcaron, Uogonek, uogonek in Serif (by + David Jez) +- added U+2500 - U+257F box drawing glyphs to Sans Mono (by David Jez) +- fixed accents in Wcircumflex, Ycircumflex and Zdotaccent (by David Jez) +- extra kerning for F (by Sander Vesik) +- added 'missing' glyph U+FFFD (by David Jez) + +Changes from 1.10 to 1.11: + +- kerning updates (by Sander Vesik) +- added Iogonek, iogonek, IJ, ij, Uogonek, uogonek (from SuSE standard fonts + by Adrian Schroeter, SuSE AG) +- added Gcommaaccent, gcommaaccent, Kcommaaccent, kcommaaccent, + Lcommaaccent, lcommaaccent, Ncommaaccent, ncommaaccent, Rcommaaccent, + rcommaaccent (by Stepan Roh) + +Changes from 1.9 to 1.10: + +- added U+022E, U+022F (by Sander Vesik) +- kerning updates for DejaVu Sans (by Sander Vesik) +- fixed too wide cyrillic glyphs in DejaVu Sans Mono (by Valentin Stoykov) +- fixed ligatures bug in Mono (by Stepan Roh) + +Changes from 1.8 to 1.9: + +- integrated Arev Cyrillics (by Danilo Segan) +- added U+01EA, U+01EB, U+01EC, U+01ED (by Sander Vesik) + +Changes from 1.7 to 1.8: + +- fixed accents in Serif Oblique and Serif Bold Oblique (by Stepan Roh) + +Changes from 1.6 to 1.7: + +- added automatically generated Condensed typefaces (by Stepan Roh) + +Changes from 1.5 to 1.6: + +- monospace bug fixed (by Stepan Roh) +- incorrect Bitstream foundry assigned by fontconfig and KDE Font Installer +fixed (by Stepan Roh) +- added automatically generated Oblique version of Serif typefaces (by +Stepan Roh) +- corrected cyrillic D and d (by Danilo Segan and David Jez) +- fixed accents position in Oblique version of Serif typefaces (by Danilo +Segan and Sander Vesik) +- fixed incorrect computation of OS2Win* fields (by Stepan Roh) +- added visiblespace U+2423 (by David Jez) +- fixed 'line height' bug by fixing ascender and descender values (by David +Jez and Stepan Roh) +- fixed part of 'worse than Vera' bug (by Peter Cernak) +- smaller comma accent U+0326 (by David Jez) + +Changes from 1.4 to 1.5: + +- added Cyrillics (96 characters) and Dcroat to the rest of typefaces (by +Danilo Segan) +- fixed bugs in some Cyrillic characters, some of them reported by Sander +Vesik (by Danilo Segan) +- added U+0100, U+0101, U+0112, U+0113, U+012A, U+012B, U+014C, U+014D, +U+016A, U+016B, U+01E2, U+01E3, U+0232 and U+0233 (by Sander Vesik) +- added Romanian characters (by Misu Moldovan) +- added U+0108, U+0109, U+010A, U+010B, U+0114, U+0115, U+0116, U+0117, +U+011C, U+011D, U+0120, U+0121, U+0124, U+0125, U+0128, U+0129, U+012C, +U+012D, U+0134, U+0135, U+014E, U+014F, U+0150, U+0151, U+015C, U+015D, +U+0168, U+0169, U+016C, U+016D, U+0170, U+0171 and U+0237 (by James +Crippen) +- added U+02BB, U+2010, U+2011, U+2012 and U+2015 (by Stepan Roh) + +Changes from 1.3 to 1.4: + +- added Polish characters (Aogonek, aogonek, Eogonek, eogonek, Nacute, +nacute, Sacute, sacute, Zacute, zacute, Zdotaccent, zdotaccent) (by Stepan +Roh) + +Changes from 1.2 to 1.3: + +- added Cyrillics (96 characters) and Dcroat to Sans typefaces (by Danilo +Segan from his BePa fonts) + +Changes from 1.1 to 1.2: + +- added Ldot, ldot, Wcircumflex, wcircumflex, Ycircumflex, ycircumflex, + Wgrave, wgrave, Wacute, wacute, Wdieresis, wdieresis, Ygrave and ygrave + (from The Olwen Font Family 0.2 by Dafydd Harries) + +Changes from 1.0 to 1.1: + +- added Lacute, lacute, Lcaron, lcaron, Racute and racute (by Peter Cernak) + +Changes from 0.9.4 to 1.0: + +- none, just changed version and updated README + +Changes from 0.9.3 to 0.9.4: + +- fixed TTF generation (kerning tables were missing) + +Changes from 0.9.2 to 0.9.3: + +- kerning of added characters +- proper caron shape for dcaron in Mono (by Ondrej Koala Vacha) +- minor visual changes + +Changes from 0.9.1 to 0.9.2: + +- internal bugged version + +Changes from 0.9 to 0.9.1: + +- proper caron shape for dcaron and tcaron +- minor visual changes + +$Id: NEWS 2471 2011-02-27 14:25:15Z ben_laenen $ diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/README b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/README new file mode 100644 index 00000000000..0f2079a9f38 --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/README @@ -0,0 +1,59 @@ +DejaVu fonts 2.33 (c)2004-2011 DejaVu fonts team +------------------------------------------------ + +The DejaVu fonts are a font family based on the Bitstream Vera Fonts +(http://gnome.org/fonts/). Its purpose is to provide a wider range of +characters (see status.txt for more information) while maintaining the +original look and feel. + +DejaVu fonts are based on Bitstream Vera fonts version 1.10. + +Available fonts (Sans = sans serif, Mono = monospaced): + +DejaVu Sans Mono +DejaVu Sans Mono Bold +DejaVu Sans Mono Bold Oblique +DejaVu Sans Mono Oblique +DejaVu Sans +DejaVu Sans Bold +DejaVu Sans Bold Oblique +DejaVu Sans Oblique +DejaVu Sans ExtraLight (experimental) +DejaVu Serif +DejaVu Serif Bold +DejaVu Serif Bold Italic (experimental) +DejaVu Serif Italic (experimental) +DejaVu Sans Condensed (experimental) +DejaVu Sans Condensed Bold (experimental) +DejaVu Sans Condensed Bold Oblique (experimental) +DejaVu Sans Condensed Oblique (experimental) +DejaVu Serif Condensed (experimental) +DejaVu Serif Condensed Bold (experimental) +DejaVu Serif Condensed Bold Italic (experimental) +DejaVu Serif Condensed Italic (experimental) + +All fonts are also available as derivative called DejaVu LGC with support +only for Latin, Greek and Cyrillic scripts. + +For license information see LICENSE. What's new is described in NEWS. Known +bugs are in BUGS. All authors are mentioned in AUTHORS. + +Fonts are published in source form as SFD files (Spline Font Database from +FontForge - http://fontforge.sf.net/) and in compiled form as TTF files +(TrueType fonts). + +For more information go to http://dejavu.sourceforge.net/. + +Characters from Arev fonts, Copyright (c) 2006 by Tavmjong Bah: +--------------------------- +U+01BA, U+01BF, U+01F7, U+021C-U+021D, U+0220, U+0222-U+0223, +U+02B9, U+02BA, U+02BD, U+02C2-U+02C5, U+02d4-U+02D5, +U+02D7, U+02EC-U+02EE, U+0346-U+034E, U+0360, U+0362, +U+03E2-03EF, U+0460-0463, U+0466-U+0486, U+0488-U+0489, U+04A8-U+04A9, +U+0500-U+050F, U+2055-205E, U+20B0, U+20B2-U+20B3, U+2102, U+210D, U+210F, +U+2111, U+2113, U+2115, U+2118-U+211A, U+211C-U+211D, U+2124, U+2135, +U+213C-U+2140, U+2295-U+2298, U+2308-U+230B, U+26A2-U+26B1, U+2701-U+2704, +U+2706-U+2709, U+270C-U+274B, U+2758-U+275A, U+2761-U+2775, U+2780-U+2794, +U+2798-U+27AF, U+27B1-U+27BE, U+FB05-U+FB06 + +$Id: README 2471 2011-02-27 14:25:15Z ben_laenen $ diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/langcover.txt b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/langcover.txt new file mode 100644 index 00000000000..f503448771f --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/langcover.txt @@ -0,0 +1,242 @@ +This is the language coverage file for DejaVu fonts +($Id$) + + Sans Serif Sans Mono +aa Afar 100% (62/62) 100% (62/62) 100% (62/62) +ab Abkhazia 100% (90/90) 93% (84/90) 84% (76/90) +af Afrikaans 100% (69/69) 100% (69/69) 100% (69/69) +ak Akan 100% (73/73) 100% (73/73) 100% (73/73) +am Amharic (0/264) (0/264) (0/264) +an Aragonese 100% (66/66) 100% (66/66) 100% (66/66) +ar Arabic 100% (125/125) (0/125) 100% (125/125) +as Assamese (0/64) (0/64) (0/64) +ast Asturian/Bable/Leonese/Asturleonese 100% (66/66) 100% (66/66) 100% (66/66) +av Avaric 100% (67/67) 100% (67/67) 100% (67/67) +ay Aymara 100% (60/60) 100% (60/60) 100% (60/60) +az-az Azerbaijani in Azerbaijan 100% (66/66) 100% (66/66) 100% (66/66) +az-ir Azerbaijani in Iran 100% (130/130) (0/130) 100% (130/130) +ba Bashkir 100% (82/82) 100% (82/82) 97% (80/82) +be Byelorussian 100% (68/68) 100% (68/68) 100% (68/68) +ber-dz Berber in Algeria 100% (70/70) 100% (70/70) 100% (70/70) +ber-ma Berber in Morocco 100% (32/32) (0/32) (0/32) +bg Bulgarian 100% (60/60) 100% (60/60) 100% (60/60) +bh Bihari (Devanagari script) (0/68) (0/68) (0/68) +bho Bhojpuri (Devanagari script) (0/68) (0/68) (0/68) +bi Bislama 100% (58/58) 100% (58/58) 100% (58/58) +bin Edo or Bini 100% (78/78) 100% (78/78) 100% (78/78) +bm Bambara 100% (60/60) 100% (60/60) 100% (60/60) +bn Bengali (0/63) (0/63) (0/63) +bo Tibetan (0/95) (0/95) (0/95) +br Breton 100% (64/64) 100% (64/64) 100% (64/64) +bs Bosnian 100% (62/62) 100% (62/62) 100% (62/62) +bua Buriat (Buryat) 100% (70/70) 100% (70/70) 100% (70/70) +byn Blin/Bilin (0/255) (0/255) (0/255) +ca Catalan 100% (74/74) 100% (74/74) 100% (74/74) +ce Chechen 100% (67/67) 100% (67/67) 100% (67/67) +ch Chamorro 100% (58/58) 100% (58/58) 100% (58/58) +chm Mari (Lower Cheremis / Upper Cheremis) 100% (76/76) 100% (76/76) 100% (76/76) +chr Cherokee (0/85) (0/85) (0/85) +co Corsican 100% (84/84) 100% (84/84) 100% (84/84) +crh Crimean Tatar/Crimean Turkish 100% (68/68) 100% (68/68) 100% (68/68) +cs Czech 100% (82/82) 100% (82/82) 100% (82/82) +csb Kashubian 100% (74/74) 100% (74/74) 100% (74/74) +cu Old Church Slavonic 100% (103/103) 86% (89/103) 78% (81/103) +cv Chuvash 100% (74/74) 100% (74/74) 100% (74/74) +cy Welsh 100% (78/78) 100% (78/78) 100% (78/78) +da Danish 100% (70/70) 100% (70/70) 100% (70/70) +de German 100% (59/59) 100% (59/59) 100% (59/59) +dv Divehi/Dhivehi/Maldivian (0/49) (0/49) (0/49) +dz Dzongkha (0/95) (0/95) (0/95) +ee Ewe 100% (99/99) 100% (99/99) 100% (99/99) +el Greek 100% (69/69) 100% (69/69) 100% (69/69) +en English 100% (72/72) 100% (72/72) 100% (72/72) +eo Esperanto 100% (64/64) 100% (64/64) 100% (64/64) +es Spanish 100% (66/66) 100% (66/66) 100% (66/66) +et Estonian 100% (64/64) 100% (64/64) 100% (64/64) +eu Basque 100% (56/56) 100% (56/56) 100% (56/56) +fa Persian 100% (129/129) (0/129) 100% (129/129) +fat Fanti 100% (73/73) 100% (73/73) 100% (73/73) +ff Fulah (Fula) 100% (62/62) 100% (62/62) 100% (62/62) +fi Finnish 100% (62/62) 100% (62/62) 100% (62/62) +fil Filipino 100% (84/84) 100% (84/84) 100% (84/84) +fj Fijian 100% (52/52) 100% (52/52) 100% (52/52) +fo Faroese 100% (68/68) 100% (68/68) 100% (68/68) +fr French 100% (84/84) 100% (84/84) 100% (84/84) +fur Friulian 100% (66/66) 100% (66/66) 100% (66/66) +fy Frisian 100% (75/75) 100% (75/75) 100% (75/75) +ga Irish 100% (80/80) 100% (80/80) 100% (80/80) +gd Scots Gaelic 100% (70/70) 100% (70/70) 100% (70/70) +gez Ethiopic (Geez) (0/218) (0/218) (0/218) +gl Galician 100% (66/66) 100% (66/66) 100% (66/66) +gn Guarani 100% (70/70) 100% (70/70) 100% (70/70) +gu Gujarati (0/68) (0/68) (0/68) +gv Manx Gaelic 100% (54/54) 100% (54/54) 100% (54/54) +ha Hausa 100% (60/60) 100% (60/60) 100% (60/60) +haw Hawaiian 100% (63/63) 100% (63/63) 100% (63/63) +he Hebrew 100% (27/27) (0/27) (0/27) +hi Hindi (Devanagari script) (0/68) (0/68) (0/68) +hne Chhattisgarhi (0/68) (0/68) (0/68) +ho Hiri Motu 100% (52/52) 100% (52/52) 100% (52/52) +hr Croatian 100% (62/62) 100% (62/62) 100% (62/62) +hsb Upper Sorbian 100% (72/72) 100% (72/72) 100% (72/72) +ht Haitian/Haitian Creole 100% (56/56) 100% (56/56) 100% (56/56) +hu Hungarian 100% (70/70) 100% (70/70) 100% (70/70) +hy Armenian 100% (77/77) 100% (77/77) 100% (77/77) +hz Herero 100% (57/57) 100% (57/57) 100% (57/57) +ia Interlingua 100% (52/52) 100% (52/52) 100% (52/52) +id Indonesian 100% (54/54) 100% (54/54) 100% (54/54) +ie Interlingue 100% (52/52) 100% (52/52) 100% (52/52) +ig Igbo 100% (58/58) 100% (58/58) 100% (58/58) +ii Sichuan Yi/Nuosu (0/1165) (0/1165) (0/1165) +ik Inupiaq (Inupiak, Eskimo) 100% (68/68) 100% (68/68) 100% (68/68) +io Ido 100% (52/52) 100% (52/52) 100% (52/52) +is Icelandic 100% (70/70) 100% (70/70) 100% (70/70) +it Italian 100% (72/72) 100% (72/72) 100% (72/72) +iu Inuktitut 100% (161/161) (0/161) (0/161) +ja Japanese (0/6537) (0/6537) (0/6537) +jv Javanese 100% (56/56) 100% (56/56) 100% (56/56) +ka Georgian 100% (33/33) 100% (33/33) 100% (33/33) +kaa Kara-Kalpak (Karakalpak) 100% (78/78) 100% (78/78) 100% (78/78) +kab Kabyle 100% (70/70) 100% (70/70) 100% (70/70) +ki Kikuyu 100% (56/56) 100% (56/56) 100% (56/56) +kj Kuanyama/Kwanyama 100% (52/52) 100% (52/52) 100% (52/52) +kk Kazakh 100% (77/77) 100% (77/77) 100% (77/77) +kl Greenlandic 100% (81/81) 100% (81/81) 100% (81/81) +km Central Khmer (0/63) (0/63) (0/63) +kn Kannada (0/70) (0/70) (0/70) +ko Korean (0/2443) (0/2443) (0/2443) +kok Kokani (Devanagari script) (0/68) (0/68) (0/68) +kr Kanuri 100% (56/56) 100% (56/56) 100% (56/56) +ks Kashmiri 98% (143/145) (0/145) 97% (141/145) +ku-am Kurdish in Armenia 100% (64/64) 100% (64/64) 100% (64/64) +ku-iq Kurdish in Iraq 100% (32/32) (0/32) 87% (28/32) +ku-ir Kurdish in Iran 100% (32/32) (0/32) 87% (28/32) +ku-tr Kurdish in Turkey 100% (62/62) 100% (62/62) 100% (62/62) +kum Kumyk 100% (66/66) 100% (66/66) 100% (66/66) +kv Komi (Komi-Permyak/Komi-Siryan) 100% (70/70) 100% (70/70) 100% (70/70) +kw Cornish 100% (64/64) 100% (64/64) 100% (64/64) +kwm Kwambi 100% (52/52) 100% (52/52) 100% (52/52) +ky Kirgiz 100% (70/70) 100% (70/70) 100% (70/70) +la Latin 100% (68/68) 100% (68/68) 100% (68/68) +lah Lahnda 98% (143/145) (0/145) 97% (141/145) +lb Luxembourgish (Letzeburgesch) 100% (75/75) 100% (75/75) 100% (75/75) +lez Lezghian (Lezgian) 100% (67/67) 100% (67/67) 100% (67/67) +lg Ganda 100% (54/54) 100% (54/54) 100% (54/54) +li Limburgan/Limburger/Limburgish 100% (62/62) 100% (62/62) 100% (62/62) +ln Lingala 100% (81/81) 100% (81/81) 100% (81/81) +lo Lao 100% (55/55) (0/55) 83% (46/55) +lt Lithuanian 100% (70/70) 100% (70/70) 100% (70/70) +lv Latvian 100% (78/78) 100% (78/78) 100% (78/78) +mai Maithili (Devanagari script) (0/68) (0/68) (0/68) +mg Malagasy 100% (56/56) 100% (56/56) 100% (56/56) +mh Marshallese 100% (62/62) 100% (62/62) 100% (62/62) +mi Maori 100% (64/64) 100% (64/64) 100% (64/64) +mk Macedonian 100% (42/42) 100% (42/42) 100% (42/42) +ml Malayalam (0/68) (0/68) (0/68) +mn-cn Mongolian in China (0/130) (0/130) (0/130) +mn-mn Mongolian in Mongolia 100% (70/70) 100% (70/70) 100% (70/70) +mo Moldavian 100% (128/128) 100% (128/128) 100% (128/128) +mr Marathi (Devanagari script) (0/68) (0/68) (0/68) +ms Malay 100% (52/52) 100% (52/52) 100% (52/52) +mt Maltese 100% (72/72) 100% (72/72) 100% (72/72) +my Burmese (Myanmar) (0/48) (0/48) (0/48) +na Nauru 100% (60/60) 100% (60/60) 100% (60/60) +nb Norwegian Bokmal 100% (70/70) 100% (70/70) 100% (70/70) +nds Low Saxon 100% (59/59) 100% (59/59) 100% (59/59) +ne Nepali (Devanagari script) (0/68) (0/68) (0/68) +ng Ndonga 100% (52/52) 100% (52/52) 100% (52/52) +nl Dutch 100% (82/82) 100% (82/82) 100% (82/82) +nn Norwegian Nynorsk 100% (76/76) 100% (76/76) 100% (76/76) +no Norwegian (Bokmal) 100% (70/70) 100% (70/70) 100% (70/70) +nr Ndebele, South 100% (52/52) 100% (52/52) 100% (52/52) +nso Northern Sotho 100% (58/58) 100% (58/58) 100% (58/58) +nv Navajo/Navaho 100% (72/72) 100% (72/72) 100% (72/72) +ny Chichewa 100% (54/54) 100% (54/54) 100% (54/54) +oc Occitan 100% (70/70) 100% (70/70) 100% (70/70) +om Oromo or Galla 100% (52/52) 100% (52/52) 100% (52/52) +or Oriya (0/68) (0/68) (0/68) +os Ossetic 100% (66/66) 100% (66/66) 100% (66/66) +ota Ottoman Turkish 100% (37/37) (0/37) 97% (36/37) +pa Panjabi/Punjabi (0/63) (0/63) (0/63) +pa-pk Panjabi/Punjabi in Pakistan 98% (143/145) (0/145) 97% (141/145) +pap-an Papiamento in Netherlands Antilles 100% (72/72) 100% (72/72) 100% (72/72) +pap-aw Papiamento in Aruba 100% (54/54) 100% (54/54) 100% (54/54) +pl Polish 100% (70/70) 100% (70/70) 100% (70/70) +ps-af Pashto in Afghanistan 95% (47/49) (0/49) 77% (38/49) +ps-pk Pashto in Pakistan 93% (46/49) (0/49) 75% (37/49) +pt Portuguese 100% (82/82) 100% (82/82) 100% (82/82) +qu Quechua 100% (55/55) 100% (55/55) 100% (55/55) +rm Rhaeto-Romance (Romansch) 100% (66/66) 100% (66/66) 100% (66/66) +rn Rundi 100% (52/52) 100% (52/52) 100% (52/52) +ro Romanian 100% (62/62) 100% (62/62) 100% (62/62) +ru Russian 100% (66/66) 100% (66/66) 100% (66/66) +rw Kinyarwanda 100% (52/52) 100% (52/52) 100% (52/52) +sa Sanskrit (Devanagari script) (0/68) (0/68) (0/68) +sah Yakut 100% (76/76) 100% (76/76) 100% (76/76) +sc Sardinian 100% (62/62) 100% (62/62) 100% (62/62) +sco Scots 100% (56/56) 100% (56/56) 100% (56/56) +sd Sindhi 100% (54/54) (0/54) 79% (43/54) +se North Sami 100% (66/66) 100% (66/66) 100% (66/66) +sel Selkup (Ostyak-Samoyed) 100% (66/66) 100% (66/66) 100% (66/66) +sg Sango 100% (72/72) 100% (72/72) 100% (72/72) +sh Serbo-Croatian 100% (156/156) 100% (156/156) 98% (154/156) +shs Secwepemctsin 100% (48/48) 100% (48/48) 100% (48/48) +si Sinhala/Sinhalese (0/73) (0/73) (0/73) +sid Sidamo (0/281) (0/281) (0/281) +sk Slovak 100% (86/86) 100% (86/86) 100% (86/86) +sl Slovenian 100% (62/62) 100% (62/62) 100% (62/62) +sm Samoan 100% (53/53) 100% (53/53) 100% (53/53) +sma South Sami 100% (60/60) 100% (60/60) 100% (60/60) +smj Lule Sami 100% (60/60) 100% (60/60) 100% (60/60) +smn Inari Sami 100% (68/68) 100% (68/68) 100% (68/68) +sms Skolt Sami 100% (80/80) 100% (80/80) 97% (78/80) +sn Shona 100% (52/52) 100% (52/52) 100% (52/52) +so Somali 100% (52/52) 100% (52/52) 100% (52/52) +sq Albanian 100% (56/56) 100% (56/56) 100% (56/56) +sr Serbian 100% (60/60) 100% (60/60) 100% (60/60) +ss Swati 100% (52/52) 100% (52/52) 100% (52/52) +st Sotho, Southern 100% (52/52) 100% (52/52) 100% (52/52) +su Sundanese 100% (54/54) 100% (54/54) 100% (54/54) +sv Swedish 100% (68/68) 100% (68/68) 100% (68/68) +sw Swahili 100% (52/52) 100% (52/52) 100% (52/52) +syr Syriac (0/45) (0/45) (0/45) +ta Tamil (0/48) (0/48) (0/48) +te Telugu (0/70) (0/70) (0/70) +tg Tajik 100% (78/78) 100% (78/78) 97% (76/78) +th Thai 1% (1/74) (0/74) (0/74) +ti-er Eritrean Tigrinya (0/255) (0/255) (0/255) +ti-et Ethiopian Tigrinya (0/281) (0/281) (0/281) +tig Tigre (0/221) (0/221) (0/221) +tk Turkmen 100% (68/68) 100% (68/68) 100% (68/68) +tl Tagalog 100% (84/84) 100% (84/84) 100% (84/84) +tn Tswana 100% (58/58) 100% (58/58) 100% (58/58) +to Tonga 100% (53/53) 100% (53/53) 100% (53/53) +tr Turkish 100% (70/70) 100% (70/70) 100% (70/70) +ts Tsonga 100% (52/52) 100% (52/52) 100% (52/52) +tt Tatar 100% (76/76) 100% (76/76) 100% (76/76) +tw Twi 100% (73/73) 100% (73/73) 100% (73/73) +ty Tahitian 100% (65/65) 100% (65/65) 100% (65/65) +tyv Tuvinian 100% (70/70) 100% (70/70) 100% (70/70) +ug Uighur 100% (125/125) (0/125) 100% (125/125) +uk Ukrainian 100% (72/72) 100% (72/72) 100% (72/72) +ur Urdu 98% (143/145) (0/145) 97% (141/145) +uz Uzbek 100% (52/52) 100% (52/52) 100% (52/52) +ve Venda 100% (62/62) 100% (62/62) 100% (62/62) +vi Vietnamese 100% (194/194) 100% (194/194) 76% (148/194) +vo Volapuk 100% (54/54) 100% (54/54) 100% (54/54) +vot Votic 100% (62/62) 100% (62/62) 100% (62/62) +wa Walloon 100% (70/70) 100% (70/70) 100% (70/70) +wal Wolaitta/Wolaytta (0/281) (0/281) (0/281) +wen Sorbian languages (lower and upper) 100% (76/76) 100% (76/76) 100% (76/76) +wo Wolof 100% (66/66) 100% (66/66) 100% (66/66) +xh Xhosa 100% (52/52) 100% (52/52) 100% (52/52) +yap Yapese 100% (58/58) 100% (58/58) 100% (58/58) +yi Yiddish 100% (27/27) (0/27) (0/27) +yo Yoruba 100% (119/119) 100% (119/119) 100% (119/119) +za Zhuang/Chuang 100% (52/52) 100% (52/52) 100% (52/52) +zh-cn Chinese (simplified) 0% (2/6765) 0% (2/6765) 0% (2/6765) +zh-hk Chinese Hong Kong Supplementary Character Set (0/2213) (0/2213) (0/2213) +zh-mo Chinese in Macau (0/2213) (0/2213) (0/2213) +zh-sg Chinese in Singapore 0% (2/6765) 0% (2/6765) 0% (2/6765) +zh-tw Chinese (traditional) (0/13063) (0/13063) (0/13063) +zu Zulu 100% (52/52) 100% (52/52) 100% (52/52) diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/unicover.txt b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/unicover.txt new file mode 100644 index 00000000000..42c212253f8 --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33/unicover.txt @@ -0,0 +1,215 @@ +This is the Unicode coverage file for DejaVu fonts +($Id$) + +Control and similar characters are discounted from totals. + + Sans Serif Sans Mono +U+0000 Basic Latin 100% (95/95) 100% (95/95) 100% (95/95) +U+0080 Latin-1 Supplement 100% (96/96) 100% (96/96) 100% (96/96) +U+0100 Latin Extended-A 100% (128/128) 100% (128/128) 100% (128/128) +U+0180 Latin Extended-B 100% (208/208) 100% (208/208) 86% (180/208) +U+0250 IPA Extensions 100% (96/96) 100% (96/96) 100% (96/96) +U+02b0 Spacing Modifier Letters 78% (63/80) 57% (46/80) 60% (48/80) +U+0300 Combining Diacritical Marks 83% (93/112) 60% (68/112) 59% (67/112) +U+0370 Greek and Coptic 100% (134/134) 89% (120/134) 82% (110/134) +U+0400 Cyrillic 100% (256/256) 78% (200/256) 70% (180/256) +U+0500 Cyrillic Supplement 95% (38/40) 25% (10/40) 15% (6/40) +U+0530 Armenian 100% (86/86) 100% (86/86) 100% (86/86) +U+0590 Hebrew 62% (54/87) (0/87) (0/87) +U+0600 Arabic 63% (161/252) (0/252) 39% (99/252) +U+0700 Syriac (0/77) (0/77) (0/77) +U+0750 Arabic Supplement (0/48) (0/48) (0/48) +U+0780 Thaana (0/50) (0/50) (0/50) +U+07c0 NKo 91% (54/59) (0/59) (0/59) +U+0800 Samaritan (0/61) (0/61) (0/61) +U+0840 Mandaic (0/29) (0/29) (0/29) +U+0900 Devanagari (0/127) (0/127) (0/127) +U+0980 Bengali (0/92) (0/92) (0/92) +U+0a00 Gurmukhi (0/79) (0/79) (0/79) +U+0a80 Gujarati (0/83) (0/83) (0/83) +U+0b00 Oriya (0/90) (0/90) (0/90) +U+0b80 Tamil (0/72) (0/72) (0/72) +U+0c00 Telugu (0/93) (0/93) (0/93) +U+0c80 Kannada (0/86) (0/86) (0/86) +U+0d00 Malayalam (0/98) (0/98) (0/98) +U+0d80 Sinhala (0/80) (0/80) (0/80) +U+0e00 Thai 1% (1/87) (0/87) (0/87) +U+0e80 Lao 100% (65/65) (0/65) 70% (46/65) +U+0f00 Tibetan (0/211) (0/211) (0/211) +U+1000 Myanmar (0/160) (0/160) (0/160) +U+10a0 Georgian 100% (83/83) 100% (83/83) 54% (45/83) +U+1100 Hangul Jamo (0/256) (0/256) (0/256) +U+1200 Ethiopic (0/358) (0/358) (0/358) +U+1380 Ethiopic Supplement (0/26) (0/26) (0/26) +U+13a0 Cherokee (0/85) (0/85) (0/85) +U+1400 Unified Canadian Aboriginal Syllabics 63% (404/640) (0/640) (0/640) +U+1680 Ogham 100% (29/29) (0/29) (0/29) +U+16a0 Runic (0/81) (0/81) (0/81) +U+1700 Tagalog (0/20) (0/20) (0/20) +U+1720 Hanunoo (0/23) (0/23) (0/23) +U+1740 Buhid (0/20) (0/20) (0/20) +U+1760 Tagbanwa (0/18) (0/18) (0/18) +U+1780 Khmer (0/114) (0/114) (0/114) +U+1800 Mongolian (0/156) (0/156) (0/156) +U+18b0 Unified Canadian Aboriginal Syllabics Extended (0/70) (0/70) (0/70) +U+1900 Limbu (0/66) (0/66) (0/66) +U+1950 Tai Le (0/35) (0/35) (0/35) +U+1980 New Tai Lue (0/83) (0/83) (0/83) +U+19e0 Khmer Symbols (0/32) (0/32) (0/32) +U+1a00 Buginese (0/30) (0/30) (0/30) +U+1a20 Tai Tham (0/127) (0/127) (0/127) +U+1b00 Balinese (0/121) (0/121) (0/121) +U+1b80 Sundanese (0/55) (0/55) (0/55) +U+1bc0 Batak (0/56) (0/56) (0/56) +U+1c00 Lepcha (0/74) (0/74) (0/74) +U+1c50 Ol Chiki (0/48) (0/48) (0/48) +U+1cd0 Vedic Extensions (0/35) (0/35) (0/35) +U+1d00 Phonetic Extensions 82% (106/128) 86% (111/128) 48% (62/128) +U+1d80 Phonetic Extensions Supplement 59% (38/64) 59% (38/64) 57% (37/64) +U+1dc0 Combining Diacritical Marks Supplement 13% (6/43) 13% (6/43) (0/43) +U+1e00 Latin Extended Additional 98% (252/256) 98% (252/256) 71% (182/256) +U+1f00 Greek Extended 100% (233/233) 100% (233/233) 100% (233/233) +U+2000 General Punctuation 100% (107/107) 81% (87/107) 48% (52/107) +U+2070 Superscripts and Subscripts 100% (42/42) 100% (42/42) 100% (42/42) +U+20a0 Currency Symbols 92% (24/26) 26% (7/26) 92% (24/26) +U+20d0 Combining Diacritical Marks for Symbols 21% (7/33) (0/33) (0/33) +U+2100 Letterlike Symbols 93% (75/80) 40% (32/80) 21% (17/80) +U+2150 Number Forms 94% (55/58) 94% (55/58) 22% (13/58) +U+2190 Arrows 100% (112/112) 100% (112/112) 100% (112/112) +U+2200 Mathematical Operators 100% (256/256) 39% (100/256) 62% (159/256) +U+2300 Miscellaneous Technical 26% (65/244) 14% (35/244) 47% (117/244) +U+2400 Control Pictures 5% (2/39) 2% (1/39) 2% (1/39) +U+2440 Optical Character Recognition (0/11) (0/11) (0/11) +U+2460 Enclosed Alphanumerics 6% (10/160) (0/160) (0/160) +U+2500 Box Drawing 100% (128/128) 100% (128/128) 100% (128/128) +U+2580 Block Elements 100% (32/32) 100% (32/32) 100% (32/32) +U+25a0 Geometric Shapes 100% (96/96) 100% (96/96) 100% (96/96) +U+2600 Miscellaneous Symbols 73% (187/256) 11% (30/256) 58% (149/256) +U+2700 Dingbats 91% (174/191) 0% (1/191) 75% (144/191) +U+27c0 Miscellaneous Mathematical Symbols-A 19% (9/46) 10% (5/46) 10% (5/46) +U+27f0 Supplemental Arrows-A 100% (16/16) 100% (16/16) (0/16) +U+2800 Braille Patterns 100% (256/256) 100% (256/256) (0/256) +U+2900 Supplemental Arrows-B 4% (6/128) 100% (128/128) (0/128) +U+2980 Miscellaneous Mathematical Symbols-B 10% (13/128) 0% (1/128) 2% (3/128) +U+2a00 Supplemental Mathematical Operators 28% (72/256) 1% (4/256) 0% (1/256) +U+2b00 Miscellaneous Symbols and Arrows 40% (35/87) 31% (27/87) 10% (9/87) +U+2c00 Glagolitic (0/94) (0/94) (0/94) +U+2c60 Latin Extended-C 96% (31/32) 81% (26/32) 43% (14/32) +U+2c80 Coptic (0/121) (0/121) (0/121) +U+2d00 Georgian Supplement (0/38) 100% (38/38) (0/38) +U+2d30 Tifinagh 96% (55/57) (0/57) (0/57) +U+2d80 Ethiopic Extended (0/79) (0/79) (0/79) +U+2de0 Cyrillic Extended-A (0/32) (0/32) (0/32) +U+2e00 Supplemental Punctuation 12% (6/50) 12% (6/50) 12% (6/50) +U+2e80 CJK Radicals Supplement (0/115) (0/115) (0/115) +U+2f00 Kangxi Radicals (0/214) (0/214) (0/214) +U+2ff0 Ideographic Description Characters (0/12) (0/12) (0/12) +U+3000 CJK Symbols and Punctuation (0/64) (0/64) (0/64) +U+3040 Hiragana (0/93) (0/93) (0/93) +U+30a0 Katakana (0/96) (0/96) (0/96) +U+3100 Bopomofo (0/41) (0/41) (0/41) +U+3130 Hangul Compatibility Jamo (0/94) (0/94) (0/94) +U+3190 Kanbun (0/16) (0/16) (0/16) +U+31a0 Bopomofo Extended (0/27) (0/27) (0/27) +U+31c0 CJK Strokes (0/36) (0/36) (0/36) +U+31f0 Katakana Phonetic Extensions (0/16) (0/16) (0/16) +U+3200 Enclosed CJK Letters and Months (0/254) (0/254) (0/254) +U+3300 CJK Compatibility (0/256) (0/256) (0/256) +U+3400 CJK Unified Ideographs Extension A (0/0) (0/0) (0/0) +U+4dc0 Yijing Hexagram Symbols 100% (64/64) (0/64) (0/64) +U+4e00 CJK Unified Ideographs (0/0) (0/0) (0/0) +U+a000 Yi Syllables (0/1165) (0/1165) (0/1165) +U+a490 Yi Radicals (0/55) (0/55) (0/55) +U+a4d0 Lisu (0/48) (0/48) (0/48) +U+a500 Vai (0/300) (0/300) (0/300) +U+a640 Cyrillic Extended-B 38% (31/80) 12% (10/80) (0/80) +U+a6a0 Bamum (0/88) (0/88) (0/88) +U+a700 Modifier Tone Letters 62% (20/32) 62% (20/32) 62% (20/32) +U+a720 Latin Extended-D 48% (62/129) 42% (55/129) 10% (14/129) +U+a800 Syloti Nagri (0/44) (0/44) (0/44) +U+a830 Common Indic Number Forms (0/10) (0/10) (0/10) +U+a840 Phags-pa (0/56) (0/56) (0/56) +U+a880 Saurashtra (0/81) (0/81) (0/81) +U+a8e0 Devanagari Extended (0/28) (0/28) (0/28) +U+a900 Kayah Li (0/48) (0/48) (0/48) +U+a930 Rejang (0/37) (0/37) (0/37) +U+a960 Hangul Jamo Extended-A (0/29) (0/29) (0/29) +U+a980 Javanese (0/91) (0/91) (0/91) +U+aa00 Cham (0/83) (0/83) (0/83) +U+aa60 Myanmar Extended-A (0/28) (0/28) (0/28) +U+aa80 Tai Viet (0/72) (0/72) (0/72) +U+ab00 Ethiopic Extended-A (0/33) (0/33) (0/33) +U+abc0 Meetei Mayek (0/56) (0/56) (0/56) +U+ac00 Hangul Syllables (0/0) (0/0) (0/0) +U+d7b0 Hangul Jamo Extended-B (0/72) (0/72) (0/72) +U+d800 High Surrogates (0/0) (0/0) (0/0) +U+db80 High Private Use Surrogates (0/0) (0/0) (0/0) +U+dc00 Low Surrogates (0/0) (0/0) (0/0) +U+e000 Private Use Area (0/0) (0/0) (0/0) +U+f900 CJK Compatibility Ideographs (0/470) (0/470) (0/470) +U+fb00 Alphabetic Presentation Forms 100% (58/58) 12% (7/58) 3% (2/58) +U+fb50 Arabic Presentation Forms-A 16% (98/611) (0/611) 11% (72/611) +U+fe00 Variation Selectors 100% (16/16) 100% (16/16) (0/16) +U+fe10 Vertical Forms (0/10) (0/10) (0/10) +U+fe20 Combining Half Marks 57% (4/7) (0/7) (0/7) +U+fe30 CJK Compatibility Forms (0/32) (0/32) (0/32) +U+fe50 Small Form Variants (0/26) (0/26) (0/26) +U+fe70 Arabic Presentation Forms-B 100% (141/141) (0/141) 100% (141/141) +U+ff00 Halfwidth and Fullwidth Forms (0/225) (0/225) (0/225) +U+fff0 Specials 100% (5/5) 100% (5/5) 100% (5/5) +U+10000 Linear B Syllabary (0/88) (0/88) (0/88) +U+10080 Linear B Ideograms (0/123) (0/123) (0/123) +U+10100 Aegean Numbers (0/57) (0/57) (0/57) +U+10140 Ancient Greek Numbers (0/75) (0/75) (0/75) +U+10190 Ancient Symbols (0/12) (0/12) (0/12) +U+101d0 Phaistos Disc (0/46) (0/46) (0/46) +U+10280 Lycian (0/29) (0/29) (0/29) +U+102a0 Carian (0/49) (0/49) (0/49) +U+10300 Old Italic 100% (35/35) (0/35) (0/35) +U+10330 Gothic (0/27) (0/27) (0/27) +U+10380 Ugaritic (0/31) (0/31) (0/31) +U+103a0 Old Persian (0/50) (0/50) (0/50) +U+10400 Deseret (0/80) (0/80) (0/80) +U+10450 Shavian (0/48) (0/48) (0/48) +U+10480 Osmanya (0/40) (0/40) (0/40) +U+10800 Cypriot Syllabary (0/55) (0/55) (0/55) +U+10840 Imperial Aramaic (0/31) (0/31) (0/31) +U+10900 Phoenician (0/29) (0/29) (0/29) +U+10920 Lydian (0/27) (0/27) (0/27) +U+10a00 Kharoshthi (0/65) (0/65) (0/65) +U+10a60 Old South Arabian (0/32) (0/32) (0/32) +U+10b00 Avestan (0/61) (0/61) (0/61) +U+10b40 Inscriptional Parthian (0/30) (0/30) (0/30) +U+10b60 Inscriptional Pahlavi (0/27) (0/27) (0/27) +U+10c00 Old Turkic (0/73) (0/73) (0/73) +U+10e60 Rumi Numeral Symbols (0/31) (0/31) (0/31) +U+11000 Brahmi (0/108) (0/108) (0/108) +U+11080 Kaithi (0/66) (0/66) (0/66) +U+12000 Cuneiform (0/879) (0/879) (0/879) +U+12400 Cuneiform Numbers and Punctuation (0/103) (0/103) (0/103) +U+13000 Egyptian Hieroglyphs (0/1071) (0/1071) (0/1071) +U+16800 Bamum Supplement (0/569) (0/569) (0/569) +U+1b000 Kana Supplement (0/2) (0/2) (0/2) +U+1d000 Byzantine Musical Symbols (0/246) (0/246) (0/246) +U+1d100 Musical Symbols (0/220) (0/220) (0/220) +U+1d200 Ancient Greek Musical Notation (0/70) (0/70) (0/70) +U+1d300 Tai Xuan Jing Symbols 100% (87/87) (0/87) (0/87) +U+1d360 Counting Rod Numerals (0/18) (0/18) (0/18) +U+1d400 Mathematical Alphanumeric Symbols 11% (117/996) 5% (55/996) 6% (62/996) +U+1f000 Mahjong Tiles (0/44) (0/44) (0/44) +U+1f030 Domino Tiles 100% (100/100) (0/100) (0/100) +U+1f0a0 Playing Cards 100% (59/59) (0/59) (0/59) +U+1f100 Enclosed Alphanumeric Supplement (0/169) (0/169) (0/169) +U+1f200 Enclosed Ideographic Supplement (0/57) (0/57) (0/57) +U+1f300 Miscellaneous Symbols And Pictographs 0% (4/529) (0/529) (0/529) +U+1f600 Emoticons 80% (51/63) (0/63) (0/63) +U+1f680 Transport And Map Symbols (0/70) (0/70) (0/70) +U+1f700 Alchemical Symbols (0/116) (0/116) (0/116) +U+20000 CJK Unified Ideographs Extension B (0/0) (0/0) (0/0) +U+2a700 CJK Unified Ideographs Extension C (0/0) (0/0) (0/0) +U+2b740 CJK Unified Ideographs Extension D (0/0) (0/0) (0/0) +U+2f800 CJK Compatibility Ideographs Supplement (0/542) (0/542) (0/542) +U+e0000 Tags (0/98) (0/98) (0/98) +U+e0100 Variation Selectors Supplement (0/240) (0/240) (0/240) +U+f0000 Supplementary Private Use Area-A (0/0) (0/0) (0/0) +U+100000 Supplementary Private Use Area-B (0/0) (0/0) (0/0) diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/AUTHORS b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/AUTHORS new file mode 100644 index 00000000000..94df1e3902f --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/AUTHORS @@ -0,0 +1,54 @@ +abysta at yandex.ru +Adrian Schroeter +Aleksey Chalabyan +Andrey Valentinovich Panov +Ben Laenen +Besarion Gugushvili +Bhikkhu Pesala +Clayborne Arevalo +Dafydd Harries +Danilo Segan +Davide Viti +David Jez +David Lawrence Ramsey +Denis Jacquerye +Dwayne Bailey +Eugeniy Meshcheryakov +Gee Fung Sit +Heikki Lindroos +James Cloos +James Crippen +John Karp +Keenan Pepper +Lars Naesbye Christensen +Lior Halphon +MaEr +Mashrab Kuvatov +Max Berger +Mederic Boquien +Michael Everson +MihailJP +Misu Moldovan +Nguyen Thai Ngoc Duy +Nicolas Mailhot +Norayr Chilingarian +Ognyan Kulev +Ondrej Koala Vacha +Peter Cernak +Remy Oudompheng +Roozbeh Pournader +Rouben Hakobian +Sahak Petrosyan +Sander Vesik +Stepan Roh +Stephen Hartke +Steve Tinney +Tavmjong Bah +Thomas Henlich +Tim May +Valentin Stoykov +Vasek Stodulka +Wesley Transue +Yoshiki Ohshima + +$Id: AUTHORS 2495 2011-11-14 22:56:26Z noct_dreamer $ diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/BUGS b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/BUGS new file mode 100644 index 00000000000..49b36de5536 --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/BUGS @@ -0,0 +1,3 @@ +See http://dejavu.sourceforge.net/wiki/index.php/Bugs + +$Id: BUGS 80 2004-11-13 13:12:02Z src $ diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE new file mode 100644 index 00000000000..254e2cc42a6 --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE @@ -0,0 +1,99 @@ +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. +Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. + +Arev Fonts Copyright +------------------------------ + +Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and +associated documentation files (the "Font Software"), to reproduce +and distribute the modifications to the Bitstream Vera Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to +the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Tavmjong Bah" or the word "Arev". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Tavmjong Bah Arev" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the name of Tavmjong Bah shall not +be used in advertising or otherwise to promote the sale, use or other +dealings in this Font Software without prior written authorization +from Tavmjong Bah. For further information, contact: tavmjong @ free +. fr. + +$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $ diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/NEWS b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/NEWS new file mode 100644 index 00000000000..c846d498cdb --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/NEWS @@ -0,0 +1,1373 @@ +Changes from 2.33 to 2.34 +* Sans, SansMono, Serif: unlinked references of U+2596 for bug 50848 + (by Denis Jacquerye) +* Sans, SansMono, Serif: added U+A7AA (by Denis Jacquerye) +* Sans, SansMono, Serif: added U+2A6A, U+2A6B, U+2E1F based on U+223B + (by Denis Jacquerye) +* Sans, Serif: removed superfluous ligature definitions for ffl und ffi + (bug 55363) (by Gee Fung Sit 薛至峰) +* Sans, Serif: swapped glyphs for U+25D2 and U+25D3 (bug 55197) + (by Gee Fung Sit 薛至峰) +* Sans, Serif: added U+A740, U+A741 (by Denis Jacquerye) +* Sans: added U+20BA Turkish Lira sign (by Denis Jacquerye) +* Sans: replaced Georgian Asomtavruli U+10A0-U+10C5 and Mkhedruli U+10D0-U+10FC + with new version (by Besarion Gugushvili) +* Sans: added Georgian Nuskhuri U+2D00-U+U+2D25 (by Besarion Gugushvili) +* Sans: added Private Use Area glyphs for Georgian U+F400-U+F441 + (by Besarion Gugushvili) +* Sans: tweaked U+0250, U+0254 (by Denis Jacquerye) +* Sans: adjusted hinting of U+032C-U+032D, avoiding problem on some platforms + (by Denis Jacquerye) +* Sans: added U+A7A0-U+A7A9, pre-1921 Latvian letters with oblique stroke + (by Denis Jacquerye) +* Sans: added anchors to U+2C6D (by Denis Jacquerye) +* Sans: added cedilla anchor to some Latin characters (by Denis Jacquerye) +* Sans: added ogonek anchor to A, E, O, U, Y (by Denis Jacquerye) +* Sans: adjusted ogonek reference in U+0172, U+01EA, U+01EB + (by Denis Jacquerye) +* Sans: added anchors to U+0104, U+0105 (by Denis Jacquerye) +* Sans: added U+1F600, U+1F611, U+1F615, U+1F617, U+1F619, U+1F61B, U+1F61F, + U+1F626-U+1F627, U+1F62E-U+1F62F, U+1F634 (by Gee Fung Sit 薛至峰) +* Sans: replaced U+27A1 with mirror image of U+2B05 for consistency + (by Gee Fung Sit 薛至峰) +* Sans: copied hints from U+14A3, U+14A7 to U+2142-U+2143 + (by Gee Fung Sit 薛至峰) +* Sans: added Lisu block (by Gee Fung Sit 薛至峰) +* Sans: typographical improvements to U+0166-U+0167, U+02A6, U+02AA + (by Gee Fung Sit 薛至峰) +* Sans: slightly change hinting of "2" to fix bug 37395 (by Ben Laenen) +* Sans: fixed U+1444 which had wrong top dot that shouldn't be there + (by Denis Jacquerye) +* Sans: added anchors for diacritics to U+01B7, U+01B8, U+01B9, U+0292 + (by Denis Jacquerye) +* Sans: added U+01B7, U+01B8 to context for case diacritics above +* SansMono: fixed U+0574 (by Ruben Hakobian) +* SansMono: added U+2016, U+27C2 (by Yoshiki Ohshima) +* SansMono: added U+02CE, U+02CF (by Denis Jacquerye) +* SansMono: added U+2148, U+27E6-U+27E7, U+2B05-U+2B0D, U+1D55A + (by Gee Fung Sit 薛至峰) +* Serif: added U+02BA, U+02C2-U+02C5, U+02CA-U+02CB, U+02D7, U+02F3, U+02F7, + U+046C-U+046D, U+0476-U+0477, U+1D7C-U+1D7F, U+20B8, U+2132, U+214E, U+2C7B + to Serif (by Gee Fung Sit 薛至峰) +* Serif: typographic improvements to U+0194, U+01B1, U+0263, U+028A, U+02A6, + U+02A8, U+02AA, U+02E0, U+03DC, U+1D3B, U+1D7B (by Gee Fung Sit 薛至峰) +* Serif: added small cap versions of q, x (in italic styles), delta, theta, xi, + sigma, phi, omega, not wired in yet (by Gee Fung Sit 薛至峰) +* Serif: added anchors to U+0234-U+0236 (by Gee Fung Sit 薛至峰) +* Serif: added U+02EC, U+02EF, U+02F0, U+0360 (by Denis Jacquerye) + +Changes from 2.32 to 2.33 + +* added Old Italic block to Sans (by MaEr) +* added U+051E, U+051F to Sans (by MaEr) +* added U+01BA, U+0372-U+0373, U+0376-U+0377, U+03CF, U+1D00-U+1D01, + U+1D03-U+1D07, U+1D0A-U+1D13, U+1D15, U+1D18-U+1D1C, U+1D20-U+1D2B, + U+1D2F, U+1D3D, U+1D5C-U+1D61, U+1D66-U+1D6B, U+1DB8, U+1E9C-U+1E9D, + U+1EFA-U+1EFB, U+2C60-U+2C61, U+2C63, U+A726-U+A73C, U+A73E-U+A73F, + U+A746-U+A747, U+A74A-U+A74B, U+A74E+U+A74F, U+A768-U+A769, U+A77B-U+A77C, + U+A780-U+A787, U+A790-U+A791, U+A7FA-U+A7FF to Serif (by Gee Fung Sit 薛至峰) +* added alternate forms to U+014A and U+01B7 in Serif (by Gee Fung Sit 薛至峰) +* typographical improvements to U+0166-U+0167, U+0197, U+01B5-U+01B6, U+01BB, + U+0222-U+0223, U+023D, U+0250-U+0252, U+026E, U+0274, U+028F, U+029F, + U+02A3-U+02A5, U+02AB, U+03FE-U+03FF, U+1D02, U+1D14, U+1D1D-U+1D1F, U+1D3B, + U+1D43-U+1D46, U+1D59, U+1D9B, U+2C71, U+2C73 in Serif (by Gee Fung Sit 薛至峰) +* fixed bugs #31762 and #34700 plus other small fixes (wrong direction, + duplicate points, etc.) for Sans and Serif (by Gee Fung Sit 薛至峰) +* added U+204B to Mono (by Gee Fung Sit 薛至峰) +* added U+26E2 to Sans (by Gee Fung Sit 薛至峰) +* added Playing Cards block (U+1F0A0-U+1F0DF) to Sans (by Gee Fung Sit 薛至峰) +* emoticons in Sans: replace U+2639-U+263B with better versions, add + U+1F601-U+1F610, U+1F612-U+1F614, U+1F616, U+1F618, U+1F61A, U+1F61C-U+1F61E, + U+1F620-U+1F624, U+1F625, U+1F628-U+1F62B, U+1F62D, U+1F630-U+1F633, + U+1F635-U+1F640 (by Ben Laenen and Denis Jacquerye) +* added U+A78E, U+A790-U+A791 to Sans and Mono (by Denis Jacquerye) +* added U+A7FA to Sans (by Denis Jacquerye) +* subscripts: added U+2095-U+209C to Sans, Serif and Mono, adjusted + U+1D49-U+1D4A in Sans and Mono (by Denis Jacquerye) +* added U+0243 to Mono (by Denis Jacquerye) +* adjusted U+0307 to match dot of i, replaced dotaccent U+02D9 with U+0307 in +most dependencies in Sans (by Denis Jacquerye) +* adjusted anchors of f and added them to long s in Sans (by Denis Jacquerye) +* added anchors to precomposed dependencies of D and d (by Denis Jacquerye) +* added debug glyphs U+F002 and U+F003 which will show current point size (by + Ben Laenen) +* use correct version for Serbian italic be (by Eugeniy Meshcheryakov) +* added pictograms U+1F42D-U+1F42E, U+1F431, U+1F435 (by Denis Jacquerye) +* improved Hebrew in Sans (by Lior Halphon) +* improved Armenian in Sans, and added Armenian in Serif and Mono (by Rouben + Hakobian (Tarumian), Aleksey Chalabyan and Norayr Chilingarian) +* remove "locl" feature for Romanian for S/T/s/t with cedilla/comma accent (by + Ben Laenen) +* replace wrong "dflt" script tag in Mono with "DFLT" (by Ben Laenen) + +Changes from 2.31 to 2.32 + +* added to Sans: Latin small letter p with stroke (U+1D7D), Latin capital + letter p with stroke through descender (U+A750), Latin small letter p with + stroke through descender (U+A751), Latin capital letter thorn with stroke + (U+A764), Latin small letter thorn with stroke (U+A765), Latin capital letter + thorn with stroke through descender (U+A766), Latin small letter thorn with + stroke through descender (U+A767), Latin capital letter q with stroke through + descender (U+A756), Latin small letter q with stroke through descender + (U+A757), Latin capital letter p with flourish (U+A752), Latin small letter p + with flourish (U+A753) (by Ben Laenen) +* add new Indian rupee symbol (U+20B9) to Sans, Serif and Mono (although + standardization in Unicode not complete yet, UTC did assign this code point) + (by Ben Laenen) +* Sans: adjusted U+0E3F, U+20AB, U+20AD-U+20AE, U+20B1, U+20B5, U+20B8 to have + them take up the same width as digits (by Gee Fung Sit 薛至峰) +* added U+23E8 to Sans (by Thomas Henlich) +* fixed numerous bugs (#22579, #28189, #28977, N'Ko in Windows, fixed U+FB4F, + anchors for U+0332-U+0333, made extensions in Misc. Technical connect, and + other small fixes) (by Gee Fung Sit 薛至峰) +* added looptail g as stylistic variant to Serif (by Gee Fung Sit 薛至峰) +* added the remaining precomposed characters in Latin Extended Additional in + Serif (by Gee Fung Sit 薛至峰) +* added Georgian Mkhedruli (U+10D0-U+10FC) to Sans ExtraLight (by Besarion + Gugushvili) +* fix spacing in hinting of U+042E (Ю) in Mono (by Ben Laenen) +* replaced U+2650 and minor changes to U+2640-U+2642, U+2699, U+26A2-U+26A5, + U+26B2-U+26B5, U+26B8 in Sans (by Gee Fung Sit 薛至峰) +* added U+1E9C-U+1E9D, U+1EFA-U+1EFB, U+2028-U+2029, U+20B8, U+2150-U+2152, + U+2189, U+26C0-U+26C3, U+A722-U+A725, U+1F030-U+1F093 to Sans (by Gee Fung + Sit 薛至峰) +* added U+1E9C-U+1E9E, U+1EFA-U+1EFB, U+2028-U+2029, U+20B8, U+2181-U+2182, + U+2185 U+A722-U+A725, to Sans ExtraLight (by Gee Fung Sit 薛至峰) +* added U+20B8, U+22A2-U+22A5, U+A722-U+A725 to Mono (by Gee Fung Sit 薛至峰) +* added U+02CD, U+01BF, U+01F7, U+0222-U+0223, U+0243-U+0244, U+0246-U+024F, + U+2150-U+2152, U+2189, U+239B-U+23AD and U+A73D to Serif (by Gee Fung Sit + 薛至峰) + +Changes from 2.30 to 2.31 + +* fixed bug where Serif Condensed Italic wouldn't get proper subfamily tags (by + Ben Laenen) +* added math operators U+2234-U+2237 to Mono (by Ben Laenen) +* removed buggy instructions of U+032D (by Eugeniy Meshcheryakov) +* added U+2C70, U+2C7E, U+2C7F to Sans and Sans Mono (by Denis Jacquerye) +* added U+2C7D to Sans Mono (by Denis Jacquerye) +* added U+2C6D, U+2C70-2C73, U+2C7E-2C7F to Serif (by Denis Jacquerye) +* added extremas to alpha U+03B1 in Serif-Italic (by Denis Jacquerye) +* added U+4A4, U+4A5 to Mono (by Andrey V. Panov) +* added Arabic letters U+0657, U+0670, U+0688-U+0690, U+0693-U+0694, + U+0696-U+0697, U+0699-U+06A0, U+06A2-U+06A3, U+06A5, U+06A7-U+06A8, + U+06AA-U+06AE, U+06B0-U+06B4, U+06B6-U+06B9, U+06BB-U+06BE and their + contextual forms to Sans (by MihailJP) +* added U+A78D LATIN CAPITAL LETTER TURNED H for coming Unicode 6.0 (by Denis + Jacquerye) + +Changes from 2.29 to 2.30 + +* added U+0462-U+0463 to Mono (by Denis Jacquerye) +* corrected U+1E53 in Serif (by Gee Fung Sit) +* added U+1E4C-U+1E4D to Mono and Serif (by Gee Fung Sit) +* added U+1E78-U+1E79 to Mono (by Gee Fung Sit) +* fixed missing diacritics in Latin Extended Additional in Sans ExtraLight + (moved stacked diacritics out of PUA in the process) (by Gee Fung Sit) +* fixed anchors on U+1E78 in Serif (by Gee Fung Sit) +* added U+1DC4-U+1DC9 to Serif (by Denis Jacquerye) +* renamed above-mark to above-mark in Serif-Italic (by Denis Jacquerye) +* added U+1DC4-U+1DC9 to context class for dotless substitution (by Denis + Jacquerye) +* changed Doubleacute to Doublegrave in Sans ExtraLight (by Gee Fung Sit) +* removed redundant reference in U+01FB in Sans Oblique (by Gee Fung Sit) +* added U+A726-U+A727 to Mono (Denis Jacquerye) +* changed U+04BE and U+04BF according to recommedations of Sasha Ankwab in Sans + (by Andrey V. Panov) +* remove "Symbol Charset" from set of codepages in Sans (by Eugeniy + Meshcheryakov) + +Changes from 2.28 to 2.29 + +* modified U+10FB in Sans to be a mirror image of U+2056, since U+10FB is not + Georgian-specific (by Roozbeh Pournader) +* added U+2B1F, U+2B24, U+2B53, U+2B54 in Sans (by Roozbeh Pournader) +* fixed TUR opentype language tag to TRK in Serif (bug 19825) (by Ben Laenen) +* early implementation of Abkhaz letter U+0524-U+0525 in Sans + (by Michael Everson and abysta) +* flipped U+1D538 in Sans (by Gee Fung Sit) +* added U+26B3-U+26B8, U+1D7D8-U+1D7E1 in Sans (by Gee Fung Sit) +* corrected U+1D7A9 in Sans Bold Oblique (by Gee Fung Sit) +* Fixed U+0649 to be dual-joining in Sans Mono (by Roozbeh Pournader) +* Remove unnecessary 'isol' feature from Sans Mono (by Roozbeh Pournader) +* Remove 'cmap' mappings for U+066E, U+066F, U+067C, U+067D, U+0681, U+0682, + U+0685, U+0692, U+06A1, U+06B5, U+06BA, U+06C6, U+06CE, and U+06D5 + in Sans Mono (bug 20323) (by Roozbeh Pournader) +* add half brackets (U+2E22 - U+2E25, by Steve Tinney) + +Changes from 2.27 to 2.28 + +* added U+A789, U+A78A in Sans and Sans Mono (by Denis Jacquerye) +* modified U+02D6, U+02D7, U+02EE in Sans and Sans Mono (by Denis Jacquerye) +* added U+1E9E (German capital ß) to Sans and Serif (by Denis Jacquerye) +* adjusted width of U+01B7-U+01B9 in Serif Italic (by Denis Jacquerye) +* modified U+021C, U+021D in Sans (by Denis Jacquerye) +* added U+021C, U+021D in Mono (by Denis Jacquerye) +* added U+F428 (Georgian Nuskhuri "f") in private use area (by Besarion + Gugushvili) +* updated Georgian mkhedruli (U+10D0-U+10FA) with new version (by Besarion + Gugushvili) +* updated Georgian asomtavruli (U+10A0-U+10C5) with new version (by Besarion + Gugushvili) +* added Georgian nuskhuri (U+2D00-U+2D25) (by Besarion Gugushvili) +* added Georgian mtavruli in private use area (U+F400-U+F426) (by Besarion + Gugushvili) +* added mark anchors above to Cyrillic U+0430-U+0438, U+043A-U+044F, + U+0454-U+0455 in Mono (by Ben Laenen) +* modified/moved up U+0318-U+0319, U+031C-U+031F, U+0329-U+032A, U+032C-U+032D, + U+0339-U+033B, U+0348 and U+0353 in Sans to prevent cut-off (by Gee Fung Sit) +* added U+035A to Sans (by Gee Fung Sit) +* updated fontconfig files (by Nicolas Mailhot) +* added U+2032-2037 to Mono (by Denis Jacquerye) +* added Ogham to Sans ExtraLight (by Gee Fung Sit) +* added U+2C6F, U+2C79, U+2C7C-2C7D to Mono (by Gee Fung Sit) +* added U+210F to Serif and Sans ExtraLight (by Gee Fung Sit) +* changed U+210F to a more common glyph in Sans and Mono (by Gee Fung Sit) + +Changes from 2.26 to 2.27 + +* added some of Michael Everson's new Cyrillic glyphs to Sans (by Wesley + Transue) +* removed blank glyph at U+05EF from Sans Bold Oblique (by Gee Fung Sit) +* small adjustments to existing tone bars in Sans and Mono (by Gee Fung Sit) +* added U+0372-U+0373, U+0376-U+0377, U+03CF, U+A668-U+A66E, U+A708-U+A711, + U+A71B-U+A71F to Sans (by Gee Fung Sit) +* copied U+02E5-U+02E9 over from Sans to fix inconsistencies in Serif (by Gee + Fung Sit) +* added U+021C-U+021D, U+0370-U+0371, U+037B-U+037D, U+0470-U+0471, + U+0510-U+0515, U+051A-U+051D, U+1E9F, U+2C64, U+2C6E-U+2C6F, U+2C79, + U+2C7C-U+2C7D, U+A644-U+A647, U+A650-U+A651, U+A654-U+A657, U+A708-U+A716, + U+A71B-U+A71F to Serif (by Gee Fung Sit) +* added U+A708-U+A716, U+A71B-U+A71F to Mono (by Gee Fung Sit) +* added anchors to U+017F (ſ) and fixed U+1E9B (ẛ) in Serif (by Gee Fung Sit) +* made U+0325 smaller in Sans Bold and Serif to match Sans Book (by Gee Fung + Sit) +* fixes to U+02F3 (moved up), U+228F-U+2294 (more square-like) and + U+22CE-U+22CF (stroke width) in Sans (by Gee Fung Sit) +* replaced U+2202 ∂ (Sans and Mono) and U+221D ∝, U+221E ∞ (Sans) with glyphs + from Arev (with small changes) (by Gee Fung Sit) +* added U+22B0-U+22B1, U+22C7, U+22D0-U+22D5 from Arev to Sans to complete the + block (by Gee Fung Sit) +* added U+0514-U+0515 to Sans ExtraLight (by Gee Fung Sit) +* skewed U+A78C in all Oblique/Italic fonts (by Gee Fung Sit) +* moved U+2215 to U+2044 in Sans and Serif and replaced U+2215 with reference + to U+002F in all fonts (by Gee Fung Sit) +* added U+2C6E to Mono (by Denis Jacquerye) +* added U+A782 and U+A783 in Sans (by Wesley Transue) +* added U+0244, U+024C-024D, U+2C64 in Sans Mono (by Denis Jacquerye) +* modified U+01AE in Sans Mono (by Denis Jacquerye) +* added U+2C7A to all fonts (by Gee Fung Sit) +* italicized/small changes to U+2C76 in Serif (Bold) Italic (by Gee Fung Sit) +* improved outlines of U+2C68, U+2C6A, U+2C6C in Serif (Bold) Italic (by Gee + Fung Sit) +* rounded U+2C77 at the bottom in Serif (by Gee Fung Sit) +* added joining behavior for tone letters (U+02E5-U+02E9) in Sans (bug #15669) + (by Gee Fung Sit) +* fixed outline of y.alt in Sans Regular (by Denis Jacquerye) +* changed references of U+1D5A8, U+1D5C5, U+1D5DC, U+1D5F9, U+1D610, U+1D62D, + U+1D644 and U+1D661 to stylistic alternates to have a better distinction (by + Gee Fung Sit) +* hinted I.alt in Sans Regular (by Gee Fung Sit) +* added U+0487, completing Cyrillic block (by Gee Fung Sit) +* extended the bar of U+0463 to the right and moved the anchor (by Gee Fung + Sit) +* added anchors to glyphs in Cyrillic block (by Gee Fung Sit) +* added (preliminary) hints to tone letter forms (U+02E5.5, U+02E9.1, stem) in + Sans Book (by Gee Fung Sit) + +Changes from 2.25 to 2.26 + +- added glyphs for Cyrillic-B to Sans (by Wesley Transue) +- added U+0370-U+0371 to Sans (by Wesley Transue) +- added U+019C, U+01A2-U+01A3, U+01A6, U+01E4-U+01E5, U+024C-U+024D, U+0285, + U+0290, U+02A0, U+0370-U+0371, U+03F1, U+03FC to Sans ExtraLight (by Wesley + Transue) +- added U+20A0-U+20A5, U+20A7-U+20B3, U+2105, U+210D, U+210F, U+2115, U+2117, + U+2119-U+211A, U+211D, U+2124, U+212E, U+2200-U+2204 to Mono (by Heikki + Lindroos) +- added U+01BA and U+01BF to Mono (by Heikki Lindroos) +- merged OpenType "aalt" feature in Latin in Sans (by Denis Jacquerye) +- added alternative shape for y in Sans (by Denis Jacquerye) +- added saltillo (U+A78B-U+A78C) to all faces (by James Cloos) +- changed U+047C-U+047D to references instead of outlines in Sans (by Wesley + Transue) +- added Latin letter tresillo U+A72A-U+A72B to Sans (by Wesley Transue) +- added U+A734-U+A737 to Sans (by Wesley Transue) +- added U+2053 to Serif and fixed it bug:9425 in Sans (by Gee Fung Sit) +- removed problematic hints for U+0423 bug:10025 (by Gee Fung Sit) +- added U+27C5-U+27C6 bug:10255 to all faces (by Gee Fung Sit) +- fixed width of U+2016 in Sans Oblique (by Gee Fung Sit) +- added U+2016, U+2032-U+2038, U+2042, U+2045-U+2046, U+204B-U+204F, + U+2051-U+2052, U+2057 to Serif (by Gee Fung Sit) +- made U+2140 bigger to match other n-ary operators (by Gee Fung Sit) +- added U+0606-U+0607, U+0609-U+060A to Sans (by Gee Fung Sit) +- added U+221B-U+221C to Mono (by Gee Fung Sit) +- small adjustments to U+221B-U+221C in Sans and Serif (by Gee Fung Sit) +- update U+04B4-U+04B5 in Serif (by Andrey V. Panov) +- increased max-storage value from maxp table to 153 (by Andrey V. Panov) +- added U+0472-U+0473, U+0510-U+0511, U+051A-U+051D, U+0606-U+0607, + U+0609-U+060A, U+1E26-U+1E27, U+1E54-U+1E55, U+1E7C-U+1E7D, U+1E8C-U+1E8D, + U+1E90-U+1E91, U+1E97-U+1E99, U+1E9F, U+1EAC-U+1EAD, U+1EB6-U+1EB7, + U+1EC6-U+1EC7, U+1ED8-U+1EDD, U+1EE0-U+1EE3, U+1EE8-U+1EEB, U+1EEE-U+1EF1 to + Mono (by Gee Fung Sit) +- added locl rules for S/T cedilla for Romanian and Moldavian so they get + rendered as S/T with comma accent (see Redhat bug #455981) (by Ben Laenen) +- removed ligature rule from Armenian U+0587 bug:16113 (by Gee Fung Sit) + +Changes from 2.24 to 2.25 + +- moved/added U+2E18 (by Gee Fung Sit) +- added empty glyph for U+2064 in Sans and Serif (by Gee Fung Sit) +- added U+22CE-U+22CF to Sans (by Gee Fung Sit) +- Sans Oblique and Bold Oblique, Serif: reverted digits hinting instructions back to before revision 1590, which fixed mistaken debian bug #471024. This fixes Debian bug #411308. The original bug was in freetype not in the fonts (by Denis Jacquerye) +- added U+A726-U+A729, U+A730-U+A733, U+A738-U+A73F, U+A746-U+A74B, U+A74E-U+A74F, U+A780-U+A781, U+A7FB-U+A7FF to Sans (by Gee Fung Sit) +- added Macedonian italic glyph shape for U+0453 in Serif (by Ben Laenen) +- changed descenders in U+0446, U+0449, U+0497, U+04A3, U+04AD (by Andrey V. Panov) +- updated main SFD files to SplineFontDB 3.0 (Denis Jacquerye and Gee Fung Sit) +- moved U+0561 2 up since it wasn't aligned with the baseline well (by Ben Laenen) +- added U+2E2E to Sans (by Gee Fung Sit) +- replaced U+2699 with simpler version in Sans (by Gee Fung Sit) +- added a lot of hinting instructions to Latin Extended B, Greek and Coptic glyphs Sans Book (by Wesley Transue) +- differentiated U+2219 from U+22C5 and adjusted affected references in Sans and Mono (by Gee Fung Sit) +- made Hebrew narrower in Sans Bold and Sans Bold Oblique (by Denis Jacquerye) +- added Kurdish and Chuvash letters from Unicode 5.1 Cyrillic Extended block (by Wesley Transue) +- added U+1E9F, U+A644-U+A647, U+A64C-U+A64D, U+A650-U+A651, U+A654-U+A655, U+A712U+A716 to Sans (by Gee Fung Sit) +- added several glyphs to Sans ExtraLight (by Gee Fung Sit) +- added hinting instructions to U+046A-U+046B, U+0508-U+0509, U+050B, U+0512-U+0513 in Sans Book (by Wesley Transue) +- corrected width of U+027E in Sans Book (by Gee Fung Sit) +- added U+2C79, U+2C7B-U+2C7D to Sans (by Gee Fung Sit) +- added a bunch of glyphs+small corrections to Sans Light (by Gee Fung Sit) +- added U+0496, U+0497, U+04B0, U+04B1 (by Andrey V. Panov) +- updated U+0493, U+049B, U+04B3, U+04B7, U+04F7 (by Andrey V. Panov) +- further improvements in extended Cyrillic (by Andrey V. Panov) + +Changes from 2.23 to 2.24 + +- instructions for U+05C0 ׀, U+05C3 ׃, U+05F3 ׳, and U+05F4 ״ in DejaVu + Sans. (by Wesley Transue) +- instructions for U+2116 in Sans (by Andrey V. Panov) +- Unicode 5.1 update: moved U+F208 to U+2C6D, U+F25F to U+2C71, added + U+2C6E-U+2C6F, U+2C72-U+2C73, updated outline of U+2C71 in Sans. (by + Denis Jacquerye) +- updated and instructed U+0401 in Sans (by Andrey V. Panov) +- fixed the bug in Sans faces where U+02EC ˬ faced the wrong direction. + Also, added a few more glyph instructions. (by Wesley Transue) +- removed OS2Sub and OS2Strike that weren't intentional in Sans + ExtraLight. (by Denis Jacquerye) +- updated instructions for U+401, U+44F in Serif Book. (by Andrey V. + Panov) +- instructions for U+02C4 ˄, U+02C5 ˅, U+03D8 Ϙ, U+03D9 ϙ, U+0494 Ҕ, and + U+0495 ҕ in Sans Book. (by Wesley Transue) +- instructions for U+01A6 Ʀ, U+0238 ȸ, U+0239 ȹ, U+02EC ˬ, and U+05C6 ׆ + in Sans Book. (by Wesley Transue) +- DejaVuSans.sfd DejaVuSerif.sfd: updated instructions for U+447 and + U+451 using code generated with xgridfit (by Andrey V. Panov) +- instructions for a few glyphs in the Latin Extended-B Block, Greek + Block, Cyrillic Block, and N'Ko block. (by Wesley Transue) +- updated sfdnormalize.pl, and SFD files to new SFD format with empty + lines. (by Denis Jacquerye) + +Changes from 2.22 to 2.23 + +- fixed bug which made Condensed fonts appear instead of normal width ones +- added U+20DB, U+20DC, and U+20E1 to Sans (by Roozbeh Pournader) +- added hinting instructions to U+01A7, U+01AA-U+01AC, U+01AE-U+01AF, + U+01BC-U+01BD, U+01BF, U+01F7, U+0277, U+027F, U+0285-U+0286, U+0297, U+02AF, + U+02B4-U+02B5, U+02BD, U+030D, U+0311, U+0329, U+04A0-U+04A1 in Sans Book (by + Wesley Transue) +- modified hinting instructions of U+04A2 in Sans Book (by Wesley Transue) +- added hinting instructions to U+237D, U+2423 in Mono Book and Mono Bold (by + Wesley Transue) +- added mathematical alphanumeric symbols to all styles (by Max Berger) +- added Unicode 5.1 U+2E18 as U+2E18.u51 (not yet usable) to Sans (by Roozbeh + Pournader) +- dereferenced all glyphs with mixed references and outlines (by Denis + Jacquerye) +- removed non-zero width from U+0344 in Sans (by Denis Jacquerye) + +Changes from 2.21 to 2.22 + +- directory structure has changed, we now use the Makefile +- modified Armenian U+0565 in Sans (by Սահակ Պետրոսյան) +- added double struck letters and numbers U+2102, U+210D, U+2115, + U+2119-U+211A, U+211D, U+2124, U+213C-U+2140, U+2145-U+2149, U+1D538-U+1D539, + U+1D53B-U+1D53E, U+1D540-U+1D544, U+1D546, U+1D54A-U+1D550, U+1D552-U+1D56B, + U+1D7D8-U+1D7E1 to Serif (by Stephen Hartke) +- added letterlike symbols U+2103, U+2109, U+2127, U+214B, U+2141-U+2144 to + Serif (by Ben Laenen) +- fixed outline direction of U+2143 in Sans Bold/Bold Oblique (by Ben Laenen) +- added arrow set in Serif: arrows: U+2194-U+21FF; dingbats: U+27A1; + supplemental arrows A: U+27F0-U+27FF; supplemental arrows B: U+2900-U+2975, + U+297A; miscellaneous symbols and arrows: U+2B00-U+2B11 (by Ben Laenen) +- added U+0180, U+01DE, U+01E0-01E1, U+022A, U+022C, U+0230, U+1E08-U+1E09, + U+1E10-U+1E11, U+1EB0-U+1EB1 to Mono (by Denis Jacquerye) +- adjusted U+01D5, U+01D7, U+01D9, U+1DB in Mono (by Denis Jacquerye) +- added Ogham in Sans (by Wesley Transue) +- added Yijing Hexagram Symbols in Sans (by Wesley Transue) +- hinting instructions added to Cyrillic U+0460, U+04A6-U+04A7, U+04AC-U+04AD, + U+04C7-U+04C8, U+04F6-U+04F7, U+04FA-U+04FB, U+050C-U+050D in Sans Book (by + Wesley Transue) +- adjusted Cyrillic letters U+042A, U+044A, U+044C, U+0459-U+045B, U+0462, + U+048C-U+048D in Serif (by Andrey V. Panov) +- hinting instructions added to Lao U+0EB7 in Sans (by Wesley Transue) +- added Roman numerals and Claudian letter U+2160-U+2184 in Serif (by Ben + Laenen) +- added U+FFF9-U+FFFD to Sans, Serif and Mono (by Lars Næsbye Christensen) +- added mathematical symbols to Serif: U+2200, U+2203-U+2204, U+2213-U+2214, + U+2217-U+2218, U+2223-U+2226, U+2250-U+2255, U+2295-U+22AF, U+22C5 (by Ben + Laenen) +- modified bullet symbol U+2219 in Serif (by Ben Laenen) + +Changes from 2.20 to 2.21 + +- added U+FE20-U+FE23 (half diacritics) to Sans (by Denis Jacquerye) +- added anchor "half" to position right half of double marks, U+FE21 or U+FE23 + to Sans (by Denis Jacquerye) +- shifted U+0360 up to avoid collision with some outlines in Sans (by Denis + Jacquerye) +- added anchor above-mark anchor to U+035D, U+035E, U+0360, U+0361 in Sans (by + Denis Jacquerye) +- added instructions for ff, ffi, ffl ligatures in Serif Bold (by Eugeniy + Meshcheryakov) +- added instructions to some N'Ko glyphs (by Wesley Transue) +- added instructions to some Lao glyphs (by Wesley Transue) +- cleaning up 'liga' Standard Ligature in Latin, in Sans and Sans Mono (by + Denis Jacquerye) +- added U+046A, U+046B (big yus) in Serif (by Andrey V. Panov) +- added box drawing symbols to Sans and Serif (by Lars Næsbye Christensen) +- added Makefile to improve font and packages generating (by Nicolas Mailhot) + +Changes from 2.19 to 2.20 + +- removed TeX and TeXData tags from all sfd files (by Eugeniy Meshcheryakov) +- removed all 'frac' lookups (by Eugeniy Meshcheryakov) +- fixed duplicate glyph names (by Eugeniy Meshcheryakov) +- removed standard ligatures with U+00B7 in Mono (by Eugeniy Meshcheryakov) +- use reference to U+002D in U+00AD in Sans Oblique, and adjust instructions + (by Eugeniy Meshcheryakov) +- updated Cyrillic in Sans Extra Light (by Andrey V. Panov) +- added instructions to N'Ko U+07C1-U+07C6, U+07CA, U+07CE-U+07CF, U+07D1, + U+07D3-U+07D4, U+07D8, U+07DB and U+07EB in Sans (by Wesley Transue) +- added instructions to Lao U+0E8A, U+0E95, U+0E97, U+EA5, U+0EB4 and U+0EB5 + (by Wesley Transue) +- adjusted instructions for Hebrew glyphs (by Denis Jacquerye) +- added instructions for U+0265 in Sans Bold (by Denis Jacquerye) +- fix U+1D68 in Sans: it had the shape of delta, where it should be a rho (by + Ben Laenen) +- remove U+1D5C glyph in Sans Oblique (it was empty) (by Ben Laenen) +- fix instructions of U+01AD in Sans Bold (by Ben Laenen) +- fix instructions of U+042D in Serif (by Ben Laenen) +- remove buggy instructions of U+2328 in Serif (by Ben Laenen) +- corrected width of U+2C75-U+2C76 in Sans Bold and Serif Bold (by Gee Fung Sit) +- added U+2C75-U+2C77 to Mono (by Gee Fung Sit) + +Changes from 2.18 to 2.19 + +- fixed misplaced symbols (U+2325,2326) in Sans Oblique (by John Karp) +- added Mark to Base anchors: 'cedilla' for combining cedilla and + 'above-legacy' for stacking above precomposed glyphs (just a,e,i,o,u with + macron for now) in Sans (by Denis Jacquerye). +- added contextual substitution for Case and Dotless forms in all Sans variants + (by Denis Jacquerye). +- renamed 'ccmp' lookups for RTL and Basic (LGC, etc.) (by Denis Jacquerye) +- added anchor 'cedilla' for vowels in Sans. (by Denis Jacquerye) +- extended contextual dotless and case substitutions to handle both below and + above diacritics (by Denis Jacquerye) +- renamed Dotless and Case Form GSUB lookups in Sans with meaningful names (by + Denis Jacquerye) + +Changes from 2.17 to 2.18 + +- Re-encoded the source files for Full Unicode (by Ben Laenen) +- Re-enabled the "ff", "fl", "fi", "ffl", "ffi" ligatures by default in Serif + (by Ben Laenen) +- Disabled the "fi", "ffi" ligatures for languages with dotless i in Serif (by + Ben Laenen) +- added Tifinagh to Sans Book and Bold, U+2D30-U+2D65, U+2D6F, partially hinted + in Sans Book. (by Denis Jacquerye) +- added Tai Xuan Jing Symbols (U+1D300-1D356) to Sans (by Remy Oudompheng) +- added double-struck letters (U+1D538-U+1D56B minus reserved code points) to + Sans (by Gee Fung Sit) +- added U+22EE-U+22F1 to Sans (by Gee Fung Sit) +- added U+2C67-U+2C6C, U+2C75-U+2C77 to Serif (by Gee Fung Sit) +- italicized various glyphs in Latin Extended-B, IPA Extensions, Spacing + Modifier Letters, Phonetic Extension (Supplement) and Super- and Subscripts + in Serif Oblique fonts (by Gee Fung Sit) +- modified outlines, bearings of Hebrew U+05D6, U+05D8, U+05DB, U+05DE, U+05E0, + U+05E1, U+05E2, U+05EA in Sans Book and Oblique, adjusted hinting in Book + based on Yotam Benshalom's comments. (by Denis Jacquerye) +- added Braille Patterns (U+2800-U+28FF) to Serif fonts (by Gee Fung Sit) +- added N'Ko to Sans Book and Bold: U+07C0-U+07E7, U+07EB-U+07F5, U+07F8-U+07FA + (by Eugeniy Meshcheryakov) +- added U+0ED8 (Lao digit 8) to Sans (by Remy Oudompheng) +- added Lao diacritics U+0EB0-0EB9, U+0EBB-0EBC, U+0EC8-0ECD to Mono (by Remy + Oudompheng) +- renamed Serif [Bold] Oblique, make it Italic (by Eugeniy Meshcheryakov) +- added U+29FA-U+29FB to Sans and Sans Mono (by Gee Fung Sit) +- swapped glyphs for Eng U+014A from Sami Eng to African Eng, the latter being + more common (by Denis Jacquerye) +- swapped ae U+00E6 and ae.alt in Serif Italics fonts, thus fixing #8213 (by + Denis Jacquerye) +- minor improvements to Misc. Symbols in Sans (by Gee Fung Sit) +- minor improvements and additions to Sans ExtraLight (by Gee Fung Sit) +- improved instructions for various Cyrillic letters (by Eugeniy Meshcheryakov) +- fixed hinting of theta and chi in Sans Book (by Ben Laenen) +- added Georgian Mkhedruli to Sans, Serif and Mono, ASumtavruli to Sans and + Serif (by Besarion Gugushvili) + +Changes from 2.16 to 2.17 + +- Sans fonts: fix position for certain combinations of Arabic fatha, kasra, + shadda, damma, kasratan, dammatan, fathatan and hamza (by Ben Laenen) +- added 'ae.alt' to Serif Oblique fonts, with design matching shape of italic + 'a' instead of slanted 'a', see bug #8213 (by Denis Jacquerye) +- added super- and subscripts to Serif and Mono: U+1D2C-U+1D2E, U+1D30-U+1D3C, + U+1D3E-U+1D42, U+1D62-U+1D65, U+1D78, U+2071, U+207A-U+207E, U+208A-U+208E, + U+2090-U+2094 (by Gee Fung Sit) + +Changes from 2.15 to 2.16 + +- fixed hinting instructions for digits in DejaVu Sans Oblique, Bold Oblique, + and Serif Book to not change glyph width (by Eugeniy Meshcheryakov) +- added instructions for U+0404, U+0411, U+0413, U+0414, U+0417-U+041B, U+041F, + U+0423, U+0424, U+0426-U+0429, U+042C, U+042E, U+042F, U+0490 in Serif Bold + (by Eugeniy Meshcheryakov) +- added U+0220 and Eng.alt to Serif fonts (by Denis Jacquerye) +- added U+232C, U+2394, U+23E3 to Sans fonts (by John Karp) +- added U+230C-U+230F, U+231C-U+231F to Sans fonts, fixing bug:9547 + (by John Karp) +- adjusted dot below, dot above, dieresis above, dieresis below in Sans fonts + (by Denis Jacquerye) +- added U+2300, U+2301, U+2303, U+2304, U+2305, U+2307, U+2326, U+2327, U+232B, + arrow.base to Sans fonts (by John Karp) +- adjusted dot and dieresis below and above in Serif fonts (by Denis Jacquerye) +- added U+1E1C-U+1E1D to Serif fonts (by Denis Jacquerye) +- added U+22BE, U+22BF (by Wesley Transue) +- added U+2324; modified U+2325: more standard proportions, and matches U+2324 + and U+2387; added U+2387 : flipped U+2325 with standard arrowhead + (by John Karp) +- added Lao digits U+0ED0-0ED7, U+0ED9 (by Remy Oudompheng) +- added to Mono in Arabic block : U+060C, U+0615, U+061B, U+061F, + U+0621-U+063A, U+0640-0655, U+065A, U+0660-066F, U+0674, U+0679-0687, U+0691, + U+0692, U+0698, U+06A1, U+06A4, U+06A9, U+06AF, U+06B5, U+06BA, U+06BE, + U+06C6, U+06CC, U+06CE, U+06D5, U+06F0-06F9 (by Remy Oudompheng) +- added to Mono in Arabic Presentations Forms-A : U+FB52-FB81, U+FB8A-FB95, + U+FB9E, U+FB9F, U+FBAA-FBAD, U+FBE8, U+FBE9, U+FBFC-FBFF (by Remy Oudompheng) +- added to Mono in Arabic Presentations Forms-B : U+FE70-FE74, U+FE76-FEFC, + U+FEFF (by Remy Oudompheng) +- added U+05BA, U+05BE, U+05F3, U+05F4, U+FB1E, U+FB21-U+FB28, U+FB4F to Sans + (by Eugeniy Meshcheryakov) +- added U+2102 to Mono (by Eugeniy Meshcheryakov) +- added U+2983-U+2984 to Sans (by Gee Fung Sit) +- added U+2A2F to Sans, Serif and Mono (by Gee Fung Sit) +- added U+2373-2375, U+237A to Sans (by John Karp) +- converted kern pairs to kern classes with Tavmjong Bah's scripts + (by Denis Jacquerye) +- set ScriptLang of kerning classes to just latn because of Pango bug + (by Denis Jacquerye) +- added DNK to ScriptLang latn otherwise it is excluded, and SRB and MDK to + cyrl (by Denis Jacquerye) +- removed flag 0x80 in generate.pe, otherwise it generates kerning tables some + systems don't like; thus loosing Apple tables (by Denis Jacquerye) +- removed ligature for precomposed legacy characters of Sans Oblique fonts + (by Denis Jacquerye) +- added bearings to en dash U+2013, em dash U+2014 and figure dash U+2012 + by making dashes shorter, preserving character width (by Denis Jacquerye) +- reduced U+031C, U+0325 (ring below), U+0339 to be entirely visible; + added instructions in Sans Book; changed U+1e00-U+1e01 to use new ring below + (by Denis Jacquerye) +- adjusted circumflex below on U+1E12-U+1E13, U+1E18-U+1E19, U+1E3C-U+1E3D, + U+1E4A-U+1E4B, U+1E70-U+1E71, U+1E76-U+1E77 in Sans fonts (by Denis Jacquerye) +- Added U+0ED4, U+0ED5 to DejaVu Sans (by Remy Oudompheng) +- Lao-specific anchors (by Remy Oudompheng) +- added alternate I to match the small capital in Sans (by Gee Fung Sit) + +Changes from 2.14 to 2.15 + +- improved hinting in Sans Oblique to deal with some spacing and inconsistency + issues (by Ben Laenen) +- added anchors to Mono Book, and added GPOS rules for combining diacritics to + show up as zero width glyphs (by Ben Laenen) +- removed U+F21C (PUA), it was copy of U+2C64 from Latin Extended C (by Eugeniy + Meshcheryakov) +- added U+27E6-U+27E7 to Sans (by Gee Fung Sit) +- added U+1407, U+1409, U+140C-U+141B, U+141D-U+1425, U+1427-U+142E, + U+1435-U+1438, U+143A-U+1449, U+1452, U+1454, U+1457-U+1465, U+1467-U+146A, + U+1471, U+1474-U+1482, U+1484-U+1488, U+148F, U+1492, U+14A0, U+14A2, U+14A9, + U+14AC-U+14BA, U+14BC, U+14BD, U+14C6, U+14C9-U+14CF, U+14D1, U+14D2, U+14D9, + U+14DC-U+14E9, U+14EC, U+14F3, U+14F6-U+1504, U+1506, U+1507, U+1510-U+1525, + U+152C, U+152F-U+153D, U+1540, U+1541, U+154E, U+154F, U+1552, U+155B, U+155C, + U+1568, U+1569, U+1574-U+157B, U+157D, U+15A7-U+15AE, U+1646, U+1647 (by + Eugeniy Meshcheryakov) +- fixed several contours to not intersect, use horizontal or vertical tangents, + use integer coordinates, etc in Sans Book (by Denis Jacquerye) +- added U+0496-U+0497 in Serif (by Andrey V. Panov) + +Changes from 2.13 to 2.14 + +- added Philippine peso glyph U+20B1 (by Clayborne Arevalo) +- made U+2012 have the same width as digits, according to Unicode 5.0, + page 206 (by Roozbeh Pournader) +- made all of the "above" combining characters remove the dot of "i", + "j", etc (Soft_Dotted characters), according to Unicode 5.0, + page 228 (by Roozbeh Pournader) +- made U+012F, U+03F3, U+0456, U+0458, U+1E2D, and U+1ECB (all fonts + except Mono), U+0249, U+2148, and U+2149 (Sans and Sans Condensed), + U+0268 (Sans ExtraLight, Serif and Serif Condensed), and U+029D (Serif + and Serif Condensed) respect the Soft_Dotted property (by Roozbeh + Pournader) +- added U+223E, U+223F, U+2240, U+22C2, U+22C3 to Sans (by Remy Oudompheng) +- added U+203D to Serif (by Gee Fung Sit) +- added zero-width glyphs for U+2061-U+2063 to Sans and Serif (by Gee + Fung Sit) +- changed isolated forms of Arabic waw (U+0648, U+0624 and U+06C6) (bug #9432) + (by Ben Laenen) +- added Lao consonants U+0E81, U+0E82, U+0E84, U+0E87, U+0E88, U+0E8A, + U+0E8D, U+0E94-0E97, U+0E99-0E9F, U+0EA1-0EA3, U+0EA5, U+0EA7, U+0EAA, + U+0EAB, U+0EAD-0EAF to Sans Mono (by Remy Oudompheng) +- added U+0200-U+0217, U+0226-U+0229, U+02F3, U+1E00-U+1E07, + U+1E0A-U+1E0B, U+1E18-U+1E1F, U+1E22-U+1E23, U+1E28-U+1E2D, + U+1E3A-U+1E3B, U+1E40, U+1E48-U+1E49, U+1E56, U+1E58-U+1E59, + U+1E5E-U+1E5F, U+1E60, U+1E68-U+1E6B, U+1E6E-U+1E6F, U+1E72-U+1E77, + U+1E86-U+1E8B, U+1E92-U+1E96, U+1EA0-U+1EA1, U+1EF4-U+1EF5 to Mono + (by Ben Laenen) +- renamed uppercase variants of diacritics (macron, breve, double grave, + double acute, inverted breve, dot above) to "uni03XX.case" in Mono + (by Ben Laenen) +- moved uppercase variants of diacritics up in Mono so they properly + vertically align on capitals (by Ben Laenen) +- precomposed glyphs with macron, breve, double grave, double acute, + inverted breve, dot above, macron below, breve below, inverted breve + below, dot below, cedilla, caron below, circumflex below, diaeresis + below, tilde below now reference to combining diacritics instead of + space modifiers in Mono (by Ben Laenen) +- made ring below (U+0325), and half rings below (U+031C and U+0339) + smaller in Mono (by Ben Laenen) +- added U+205F to all fonts (by Roozbeh Pournader) +- added U+035E-U+035F to Sans (by Roozbeh Pournader) +- added empty glyphs for U+034F, U+202A-U+202E, U+2060, U+206A-206F, + U+FE00-U+FE0F to non-Mono fonts (by Roozbeh Pournader) +- added U+2101, U+2107-U+2108, U+210B, U+210C, U+2110, U+2112, U+211B, + U+211F, U+2123, U+2125, U+2128-U+2129, U+212C-U+212D, U+212F, + U+2130-U+2131, U+2133, U+2136-U+213A, U+2141-U+2144, U+2B00-U+2B11, + U+2B20-U+2B23 to Sans (by John Karp) +- reshaped omega (U+03C9) in Mono (by Ben Laenen) +- added U+2205, U+22C6, U+2300-U+2301, U+2303-U+2306, U+230C-U+230F, + U+2312-U+2315, U+231C-U+231F, U+2335, U+2337-U+233E, U+2341-U+2344, + U+2347-U+2348, U+234B-U+234D, U+2349-U+2350, U+2352-U+2354, + U+2357-U+2359, U+235A-U+235C, U+235E-U+2360, U+2363-U+2365, + U+2368-U+2369, U+236B-U+2370, U+2373-U+237A, U+2380-U+2383, + U+2388-U+238B, U+2395 in Mono (by Ben Laenen) + +Changes from 2.12 to 2.13 + +- adjusted U+0198B, U+01B3-U+01B4 in Sans, hinted U+01B4 in Sans Book + (by Denis Jacquerye) +- added U+27F0-U+27FF, U+2906-U+2907, U+290A-U+290B, U+2940-U+2941 to Sans + (by Denis Jacquerye) +- added U+01E6-U+01E9, U+01EE-U+01EF, U+01F4-U+01F5, U+01FC-U+01FF, + U+021E-U+021F, U+0245, U+02BD, U+02C9, U+1E9B, U+2045-U+2046, U+2213, U+22C5, + U+22EF to Sans Mono (by Roozbeh Pournader) +- added U+04FA-U+04FD to Sans (by Michael Everson) +- removed U+2329 and U+232A because of their CJK properties, added U+27E8 + and U+27E9 in their stead, fixing part of bug #9038 (by Roozbeh Pournader) +- corrected and improvised U+0466-U+0469, U+046E-U+0471, U+047C-U+047D, U+0482, + U+0484-U+0486, U+0492-U+0493, U+04B0-U+04B1, U+050C-U+050D, and U+204A + in Sans (by Michael Everson) +- added instructions for U+0402, U+0409, U+040A, U+040B, U+044D, U+040F, + U+0452, U+0459-U+045B, U+045F to Sans Book (by Eugeniy Meshcheryakov) +- made italic shape for U+431, U+432, U+437, U+43B, U+43C, U+43D, U+444, U+447, + U+44D, U+44F, U+459, U+45A in SerifOblique and SerifBoldOblique + (by Andrey V. Panov) +- modified U+024C to match glyph in Unicode chart, fixing bug #9039 + (by Denis Jacquerye) +- made some canonically equivalent characters share the same glyph: + U+02B9 = U+0374, U+0343 = U+0313, and U+0387 = U+00B7 also adjusting U+02BA + to look like double U+02B9, fixing parts of bug #9038 (by Roozbeh Pournader) +- changed shapes for U+0478 and U+0479 in Sans to those in the Unicode charts, + based on a recent decision by Unicode Technical Committee to only use + the digraph form (by Michael Everson) +- adjusted width of NBSP U+00A0 and NNBSP U+202F, fixing bug #8401 + (by Denis Jacquerye) +- fixed several contours to not intersect, use horizontal or vertical tangents, + use integer coordinates, etc (by Roozbeh Pournader and Denis Jacquerye) +- added U+1402, U+1430, U+144D, U+146C, U+148A, U+14A4, U+14C1, U+14D4, U+14EE, + U+1527, U+1545, U+157E, U+158E, U+15AF to Sans (by Eugeniy Meshcheryakov) +- enlarged width of U+459 and U+45A in Serif (by Andrey V. Panov) +- made traditional shape for U+452, U+45B (by Andrey V. Panov) +- added euro sign U+20AC to Sans ExtraLight, making fontconfig recognize + the font as supporting English (by Denis Jacquerye) + +Changes from 2.11 to 2.12 + +- added U+0180 to Serif (by Denis Jacquerye) +- improved and/or hinted Armenian letters U+0542, U+0546, U+0562, + U+0563, U+0564, U+0577, U+0582 in Sans (by Ben Laenen) +- added U+4FE-U+4FF, U+512-U+513, U+2114, U+214E, U+26B2 to Sans + (by Gee Fung Sit) +- adjusted U+0496-U+0497, U+049A-U+04A1 in Sans to match U+0416, + U+041A, U+0436 and U+043A (by Gee Fung Sit) +- Mathematical Operators in Sans: changed U+22C0-U+22C1 to match + other n-ary operators, adjusted U+2203-U+2204, changed U+2220 in + Sans to match the style of U+2221 (by Gee Fung Sit) +- added U+1401, U+1403-U+1406, U+140A, U+140B, U+1426, U+142F, + U+1431-U+1434, U+1438, U+1439, U+1449, U+144A, U+144C, + U+144E-U+1451, U+1455, U+1456, U+1466, U+146B, U+146D-U+1470, + U+1472, U+1473, U+1483, U+1489, U+148B-U+148E, U+1490, U+1491, + U+14A1, U+14A3, U+14A5-U+14A8, U+14AA, U+14AB, U+14BB, U+14C0, + U+14C2-U+14C5, U+14C7, U+14C8, U+14D0, U+14D3, U+14D5-U+14D8, + U+14DA, U+14DB, U+14EA, U+14ED, U+14EF-U+14F2, U+14F4, U+14F5, + U+1405, U+1526, U+1528-U+152B, U+152D, U+152E, U+153E, + U+1542-U+1544, U+1546-U+154D, U+1550, U+1553, U+1555-U+155A, + U+1567, U+156A, U+157C, U+157F-U+1585, U+158A-U+158D, + U+158F-U+1596, U+15A0-U+15A6, U+15DE, U+15E1, U+166E-U+1676 to + Sans (by Eugeniy Meshcheryakov) +- re-enabled Latin ligatures fi, ffi, fl, ffl and ff in Sans + (by Ben Laenen) +- made italic shape for U+436, U+44A, U+44B, U+44C, U+44E, U+45F, + U+463 in SerifOblique and SerifBoldOblique (by Andrey V. Panov) +- fixed sub- and superscript metrics in Condensed Sans (bug #8848) + (by Ben Laenen) +- added U+474, U+475 in Serif (by Andrey V. Panov) +- hinted Greek glyphs U+03B7, U+30B8, U+03B9, U+03C1, U+03C3, + U+03C6 in Mono Book (by Ben Laenen) + +Changes from 2.10 to 2.11 + +- added instructions for Hebrew glyphs (Sans Book, by Eugeniy + Meshcheryakov) +- changed U+01A6 (Latin Yr) after bug #8212, in Sans, Serif and + Sans Mono fonts (by Denis Jacquerye). +- removed instruction for U+2600-U+26A1 (by Mederic Boquien) +- added U+202F and set width of U+00A0 (nobreakingspace) to the + same as U+0020, space (by Denis Jacquerye). +- added and improved instructions for various Cyrillic letters + (by Eugeniy Meshcheryakov) +- Changed U+416, U+42F, U+427 (non-Bold), U+436, U+447 (non-Bold), + U+44F, U+437 (Bold), corrected U+40F, U+414, U+424, U+426, U+429, + U+434, U+438 (Bold), U+446, U+449, U+44D (non-Bold), U+45F in + Sans Mono (by Andrey V. Panov) +- made small corrections to Cyrillic, most appreciable to U+409, + U+413, U+41B, U+427 and U+433, U+434, U+43B, U+447, U+459 + (upright fonts) to Serif (by Andrey V. Panov) +- adjusted bearings of U+410, U+416, U+41A, U+42F, U+436, U+43A, + U+443, U+44F in Serif (by Andrey V. Panov) +- enlarged width of U+44A, U+44B, U+44C, U+463 in Serif + (by Andrey V. Panov) +- added ligature "iacute" as "afii10103" (U+456) "acutecomb" in + Serif (by Andrey V. Panov) +- made italic shape to U+446, U+448, U+449 in Serif (by Andrey V. + Panov) +- added "afii10831" (U+F6C7), "afii10832" (U+F6C8) in Serif (by + Andrey V. Panov) +- new minimum version of fontforge is 20061014 (by Ben Laenen) + +Changes from 2.9 to 2.10: + +- added U+0242, U+024A-U+024B, U+024E-U+024F, U+037C-U+037D, U+0E3F, + U+1D2C-U+1D2E, U+1D30-U+1D42, U+1D5D-U+1D6A, U+1D78, U+1DB8, + U+2090-U+2094, U+20D0-U+20D1, U+2C60-U+2C66, U+2C6B-U+2C6C, U+2C74 and + U+FB29 to Sans (by Gee Fung Sit) +- added Lao glyphs : U+0E81-0E82, U+E084, U+0E87-0E88, U+0E8A, U+0E8D, + U+0E94-0E97, U+0E99-0E9F, U+0EA1-0EA3, U+0EA5, U+0EA7, U+0EAA-0EAB, + U+0EAD-0EB9, U+0EBB-0EBD, U+0EC0-0EC4, U+0EC6, U+0EC8-0ECD, U+0EDC-0EDD + (by Remy Oudompheng) +- fixed U+0193 not showing in Windows (bug #7897) (by Ben Laenen) +- changes to U+222B-222D in Sans Mono (by Remy Oudompheng) +- ported the three remaining currency symbols from Arev (U+20B0, + U+20B2-U+20B3), and replaced one (U+20AF) in Sans (by Lars Naesbye + Christensen) +- corrected U+20A5 in Sans (by Gee Fung Sit) +- merged Double-Struck Letters from Arev: U+2102, U+210D, U+2115, + U+2119-U+211A, U+2124, U+213C-U+2140 (by Gee Fung Sit) +- added U+2308-U+230B and U+2329-U+232A to Sans Mono and Serif faces, + fixed incorrect direction of U+2329 in Sans faces, and improved + U+2308-U+230B in Sans faces per Ben Laenen's suggestions (by David + Lawrence Ramsey) +- added U+06D5 and final form of it (needed for Kurdish) (by Ben Laenen) +- added two special glyphs U+F000 and U+F001 in Sans Book that show the + current ppem size (horizontal and vertical) (by Ben Laenen) +- added U+2318 and U+2325 to Sans Mono faces, based on the Sans versions + (by David Lawrence Ramsey) +- added U+2B14-U+2B1A to all faces except Sans ExtraLight (by David + Lawrence Ramsey) +- respaced all Geometric Shapes characters in Serif faces to match those + in Sans faces again, respaced U+23CF in Sans, Sans ExtraLight, and + Serif faces to match U+25A0 (or Sans in Sans ExtraLight's case) again, + and respaced U+2B12-U+2B13 in Sans and Serif faces to match U+25A1 + again (by David Lawrence Ramsey) +- corrected width of Modifier Small Letters U+1D43-1D5B in Sans Oblique + and U+1D9B-U+1DBF in Sans Oblique and Sans Bold Oblique (by Gee Fung Sit) +- added a bunch of glyphs to Sans ExtraLight (see SVN for details) (by + Gee Fung Sit) +- adjusted Cyrillic descenders in Sans ExtraLight to sync with Sans (by + Gee Fung Sit) +- added U+0242, U+0245 to Serif (by Gee Fung Sit) +- replaced the SHPIX routines which gave them bad spacing at certain + sizes in FreeType for A, V, Z, v and z in Sans Bold (by Ben Laenen) + +Changes from 2.8 to 2.9: + +- DejaVuSansExtraLight.sfd: changed family name from "DejaVu Sans" to + "DejaVu Sans Light" (in case we add a Light weight variant), so legacy + apps that understand only 4 styles are happy. (by Denis Jacquerye) +- added Name ID 16, aka preferred family name, and Name ID 17, aka + preferred style name, so contemporary apps that understand more that 4 + styles can use big fonts families "DejaVu Sans" and "DejaVu Serif". For + those, Extralight and Condensed are just styles not different families. + (by Denis Jacquerye) +- added U+22B6-22BD, U+22C0-22C1, U+22D6-22D7 to Sans. (by Remy Oudompheng) +- added U+037B, U+2184, U+2C67-U+2C6A and U+2C75-U+2C77 to Sans (by Gee + Fung Sit) +- adjusted asteriskmath (U+2217) for consistency with other mathematical + operators in Sans (by Ben Laenen) +- hinted some Armenian capitals in Sans Book (by Ben Laenen) +- added U+0246 - U+0249 (by Ben Laenen) +- BUGFIX : swapped U+224E and U+224F, in Sans, Sans Condensed and Sans Mono + (by Remy Oudompheng) +- adjusted U+20B5 (by Mederic Boquien) +- swapped U+21DA and U+21DB which were in wrong order (by Heikki Lindroos) +- added U+222E-2233, U+239B-23AD, U+2A00-2A02, U+2A0F-2A1C to Sans (by Remy + Oudompheng) +- added U+239B-23AD to Mono (by Remy Oudompheng) +- added U+2024-2025 to Serif (by Mederic Boquien) +- added U+222C-222D, U+2A0C-2A0E to Serif (by Remy Oudompheng) +- added U+2190-21FF to Mono (by Heikki Lindroos) +- added Hebrew glyphs - U+05B0-U+05BD, U+05BF-U+05C3, U+05C6, U+05C7, + U+05D0-U+05EA, U+05F0-U+05F2, U+FB1F, U+FB20, U+FB2A-U+FB36, + U+FB38-U+FB3C, U+FB3E, U+FB40, U+FB41, U+FB43, U+FB44, U+FB46-U+FB4E (by + Gee Fung Sit and Eugeniy Meshcheryakov) +- adjustments for Cyrillic in Sans (by Andrey V. Panov) +- made italic shape for U+0434, U+0456, U+0457 in SerifOblique and Serif + Bold Oblique (by Andrey V. Panov) + +Changes from 2.7 to 2.8: + +- fixed instructions for U+0423, U+0427, U+0447, U+0448 in Serif, so they + look good at large sizes too (by Eugeniy Meshcheryakov) +- added U+FB00 and U+FB03 to U+FB06 to Serif typefaces (by Heikki Lindroos) +- added U+26B0-U+26B1, U+2701-U+2704, U+2706-U+2709, U+270C-U+2727, U+2729 + to U+274B, U+274D, U+274F to U+2752, U+2756, U+2758-U+275E, U+2761 to + U+2775 (by Heikki Lindroos) +- added and improved instructions for Cyrillic letters in Mono and Serif + (Book, by Eugeniy Meshcheryakov) +- rotated U+26B0 (was too small in mono) (by Gee Fung Sit) +- adjusted U+1EDA-U+1EDD, U+1EE8-U+1EEB, capitals using capital specific + accent and moved diacritics to match position on U+00F2 (ograve), etc. + (by Denis Jacquerye) +- added U+20D6, U+20D7 to Sans (by Gee Fung Sit) +- made Armenian ligatures discretionary since the Firefox ligature problem + still isn't fixed (by Ben Laenen) +- moved Armenian hyphen U+058A to a higher position (bug #7436) (by Ben + Laenen) +- hinted Greek glyphs in Sans Bold (by Ben Laenen) +- enabled Arabic lam-alif ligatures when diacritics are used (by Ben Laenen) + +Changes from 2.6 to 2.7: + +- added glyphs needed for Kurdish: U+0695, U+06B5, U+06C6, U+06CE and their + init/medi/fina forms in Sans (by Ben Laenen) +- added U+02CD, U+01F8 - U+01F9, U+1E3E - U+1E3F, U+1E30 - U+1E35, U+1EBC - + U+1EBD, U+1EF8 - U+1EF9 (includes glyphs needed for Yoruba, Maori, Guarani + and Twi) (by Ben Laenen) +- added U+22C8-22CC, U+29CE-29D5, U+2A7D-2AA0, U+2AAE-2ABA, U+2AF9-2AFA to + Sans (by Remy Oudompheng) +- adjusted diacritics on Vietnamese, Pinyin and other characters: + U+01A0-U+01A1, U+01AF-U+01B0, U+01D5-U+01DC, U+01DE-01E1, U+01FA-U+01FB + U+022A-U+022D, U+0230-U+0231, U+1E14-U+1E17, U+1E4C-U+1E53, U+1E78-U+1E7B, + U+1EA4-U+1EF1 in Sans (Book, Bold and Oblique) (by Denis Jacquerye) +- added basic arrows U+2190-U+2193 in Serif, which completes MES-1 compliance + for Serif (by Ben Laenen) +- added U+01E4, U+01E5, U+01FA, U+01FB, U+02BD, U+02C9 and U+02EE to Serif + (by Ben Laenen) +- fixed U+0209 in Serif Bold Oblique (by Ben Laenen) +- adjusted Box Drawing block characters U+2500-257F in Mono to fit character + cell, shifting them up by 416 (Denis Jacquerye) +- redid U+0194 in Sans (by Ben Laenen) +- added U+2217-2218, U+2295-22A1 to Mono (by Remy Oudompheng) +- added U+0462 to Serif (by Andrey V. Panov) +- added U+226C, U+228C-228E, U+2293-2294, U+22F2-22FF to Sans (by Remy + Oudompheng) +- adjusted U+2208-220D in Sans (by Remy Oudompheng) +- improved some Cyrillic glyphs in Mono (by Andrey V. Panov), rewritten + instructions for changed glyphs (by Eugeniy Meshcheryakov) +- added U+1E0E-1E0F, U+1E8E-1E8F to Mono fonts (by Denis Jacquerye). (bug + #7166) +- renamed 'Dotabove' to 'Dotaccent' in Mono Sans Oblique to match other fonts + (by Denis Jacquerye). +- added U+200B-U+200F in Sans faces and Serif faces, U+200B and U+200C were + in Sans already (by Lars Naesbye Christensen) +- added U+2601-U+262F, U+263D, U+263E, U+2648-U+265F, U+2668, U+2670-U+268B, + U+2690-U+269C, U+26A0, U+26A1, U+2794, U+2798-U+27AF, U+27B1-U+27BE to Mono + (by Heikki Lindroos) +- replaced the references with unshifted ones for both κ U+03BA and к U+043A + in Mono Book (by Denis Jacquerye) +- fixing glyph for U+04ED in Mono Book, consisted only of dieresis (by Andrey + V. Panov). + +Changes from 2.5 to 2.6: + +- redid U+2032 - U+2037, U+2057 based on Arev in Sans (by Gee Fung Sit) +- added U+0195, corrected U+039E, U+204B in Sans ExtraLight (by Gee Fung Sit) +- added instructions for some Cyrillic letters in Sans Bold (by Eugeniy + Meshcheryakov) +- added vulgar fractions U+2153-U+215F for Serif, made with references (by + Lars Naesbye Christensen) +- added U+228F-2292, U+2299-22AF, U+22B2-22B5, U+22CD, U+22D8-22ED to Sans + (by Remy Oudompheng) +- added U+2208-220D, U+2238-223D, U+2278-2281, U+228A-228B, U+228F-2292, + U+22CD, U+22DA-22E9 to Mono (by Remy Oudompheng) +- fixed misplaced dot in U+2250 in Mono (by Remy Oudompheng) +- added instructions for some Cyrillic letters in Mono Book and Bold(by + Eugeniy Meshcheryakov) +- minor changes to U+2241, U+2261-2263, U+22A4, U+22A5 in Sans (by Remy + Oudompheng) +- added hinting instructions to lowercase Armenian glyphs in Sans Book (by + Ben Laenen) +- changed U+2208, U+220B to match U+2209 and U+220C in Sans Bold (by Remy + Oudompheng) +- added Braille patterns U+2800-U+28FF to Sans (by Mederic Boquien) +- added instructions for some Cyrillic letters in Serif Book (by Eugeniy + Meshcheryakov) +- renamed BoldOblique fonts to Bold Oblique in TTF Name as originally in + Bitstream Vera fonts (by Denis Jacquerye) +- added hinting instructions to some Latin-B Extended and IPA characters in + Sans Book (by Denis Jacquerye and Ben Laenen) +- adjusted bearings, replaced diacritics, hinted hook and horn for + Vietnamese in Sans Book (by Denis Jacquerye) +- made FAX, TM, TEL, etc. discritionary ligatures in Sans and Serif fonts + (by Denis Jacquerye) +- removed ligatures of precomposed characters in Sans and Serif fonts (by + Denis Jacquerye) +- added U+F208, U+F20A, U+F215-F217, U+F21A-F21B, U+F25F in PUA (from SIL's + PUA, probably in Unicode 5.0): U+0243, U+0244, U+0245, U+024C, U+024D, + U+2C64, (U+2C6D), (U+2C71) +- modified some glyphs in Serif Oblique to make them more italic (by Denis + Jacquerye) + +Changes from 2.4 to 2.5: + +- fixed excessive kerning bug that occurs with Pango (by Denis Jacquerye) +- added U+20AF to Sans and Serif (by Lars Naesbye Christensen) +- regenerated Condensed faces (by Ben Laenen) +- added U+035C-U+035D to Sans, fixed U+0361 (by Denis Jacquerye) +- integrated 255 characters from Arev fonts: Latin Extended-B, Spacing + Modifiers, Combining Diacritical Marks, Cyrillic, Cyrillic supplement, + General Punctuation, Letterlike Symbols, Arrows, Mathematical Operators, + Miscellaneous Technical, Dingbats, Alphabetic Presentation Forms (by Denis + Jacquerye) +- added basic Cyrillic and basic Greek to Sans ExtraLight (by Denis Jacquerye) +- added U+0498, U+049A, U+04AA, U+04AB, U+04AF to Serif (by Eugeniy + Meshcheryakov) +- added U+0494, U+0495, U+0498, U+0499, U+04AA, U+04AB, U+04C3, U+04C4, + U+04C7, U+04C8 to Mono (by Eugeniy Meshcheryakov) +- adjusted weight of U+0256, U+0257, U+0260, U+0272, U+0273, U+0277, U+029B, + U+02A0 and modifed U+028B and U+027A in Mono (by Denis Jacquerye) +- added U+2000-200A to Mono (by Denis Jacquerye) +- added vulgar fractions U+2153 - U+215F to Mono (by Gee Fung Sit) +- adapted metrics of Arabic glyphs so they stay above cut-off height in Sans + (by Ben Laenen) +- fixed mkmk anchors for Arabic diacritics so they stack properly in Sans (by + Ben Laenen) +- fixed weight of lowercase upsilon in Sans Bold, make small adjustment to + lowercase omega in Sans (by Ben Laenen) +- added U+210E (by Mederic Boquien) +- unslanted U+2201, U+221B and U+221C in Sans Oblique (by Mederic Boquien) +- added several mathematical relation symbols to Sans and Mono (U+2241-224C, + U+2250-2255, U+2260-2269, U+226E-2277, U+2282-2287) modified U+223C to match + other tildes, and U+2282-2284 to have the same shape. (by Remy Oudompheng) +- made U+2234-U+2237 refer to U+2219 instead of U+00B7 in Sans (by Mederic + Boquien) +- added U+2238-223B, U+226A-226B, U+2278-2281, U+2288-228B to Sans (by Remy + Oudompheng) +- unslanted and changed reference of U+22C5 from U+00B7 to U+2219 in Sans (by + Mederic Boquien) +- added U+224D-225F, U+226D, U+22C6 to Sans and unslanted U+2219 in Sans + Oblique. (by Remy Oudompheng) +- added U+224D-225F, U+226D to Mono, shifted U+2266-2269 higher upwards and + unslanted U+2219 in Oblique. (by Remy Oudompheng) +- merged Coptic glyphs from Arev 0.2 (by Lars Naesbye Christensen) +- fixed and adjusted various Cyrillic glyphs in Serif (by Andrey V. Panov) +- made fi, fl... ligatures discretionary ligatures (by Ben Laenen) + +Changes from 2.3 to 2.4: + +- added U+04A2, U+04A3, U+04AC - U+04AF, U+04BA, U+04BB, U+04C0 - + U+04C2, U+04CB, U+04CD, U+04D8 - U+04DF, U+04E2 - U+04E5, U+04E8 - U+04F5, + U+04F6 - U+04F9 to Mono (by Eugeniy Meshcheryakov) +- added U+048C, U+048D, U+0494, U+0495, U+049E - U+04A7, U+04AC - + U+04AE, U+04B4- U+04B7, U+04BA, U+04BB, U+04C0 - U+04C4, U+04C7, U+04C8, + U+04CB, U+04CC, U+04D8 - U+04DF, U+04E2 - U+04E5, U+04EC - U+04F9 to Serif + (by Eugeniy Meshcheryakov) +- added U+2134 to Sans (by Gee Fung Sit) +- added U+2080 - U+2089 to all faces (by Gee Fung Sit) +- several minor corrections to Sans (by Gee Fung Sit) +- major corrections to Sans Condensed (by Gee Fung Sit) +- corrected Superscripts and Subscripts in Sans (by Gee Fung Sit) +- corrected anchors of U+0316-U+0319 (by Denis Jacquerye) +- Verajja integrated (by Stepan Roh) +- copied U+2328, U+2600, U+2639-U+263C, U+263F-U+2647, U+2660-U+2667, + and U+2669-U+266F from Sans to Serif, and copied scaled-down versions of + them to Sans Mono (by David Lawrence Ramsey) +- added U+20B4 to all faces (by Eugeniy Meshcheryakov) +- added more minor positional adjustments to U+2638 in all faces to + match the other miscellaneous symbols in Verajja, and rescale it in Sans + Mono so that it looks better (by David Lawrence Ramsey) +- added U+2242, U+2243 and U+22A4 (by Mederic Boquien) +- corrected U+2245 in Sans (by Mederic Boquien) +- added U+0221, U+0234-0236 (by Denis Jacquerye) +- added in Arabic block to Sans: U+060C, U+0615, U+061B, U+061F, U+0621 +- U+063A, U+0640 - U+0655, U+0660 - U+066F, U+0679 - U+0687, U+0698, U+06A1, + U+06A9, U+06AF, U+06BA, U+06BF, U+06CC, U+06F0 - U+06F9 (by Ben Laenen) +- added in Arabic Presentation Forms A to Sans: U+FB52 - U+FB81, U+FB8A +- U+FB95, U+FB9E - U+FB9F, U+FBE8 - U+FBE9, U+FBFC - U+FBFF (by Ben Laenen) +- added complete Arabic Presentation Forms B to Sans: U+FE70 - U+FE74, + U+FE76 - U+FEFC, U+FEFF (by Ben Laenen) +- added complete Greek Extended block to Mono (by Ben Laenen) +- modified Greek capitals with tonos in Mono (by Ben Laenen) +- added U+01C4-01CC, U+01D5, U+01DE, U+01E0-U+01E1, U+01E6-U+01E9, + U+01EE-U+01F5, U+01F8-U+0217, U+021E-U+021F, U+0226-U+022A, U+022C to Serif + (by Denis Jacquerye) +- adjusted U+043B and U+044F in Serif (by Denis Jacquerye) +- added U+2000-U+200A (by Denis Jacquerye) +- added U+1E00-U+1E0B, U+1E0E-U+1E11, U+1E14-U+1E1C, U+1E1E-U+1E23, + U+1E26-U+1E2D, U+1E30-U+1E35, U+1E3A-U+1E3B, U+1E3E-U+1E40, U+1E48-U+1E49, + U+1E50-U+1E56, U+1E58-U+1E59, U+1E5E-U+1E60, U+1E68-U+1E6B, U+1E6E-U+1E6F, + U+1E72-U+1E7D, U+1E86-U+1E9B, U+1EA0-U+1EA3, U+1EAC-U+1EB7, U+1EBA-U+1EBD, + U+1EC6-U+1ECF, U+1ED8-U+1ED9, U+1EE6-U+1EE7, U+1EF4-U+1EF9 to Serif (by + Denis Jacquerye) +- added U+048E, U+048F, U+049C-U+049F, U+04B8, U+04B9, U+04BC-U+04BF, + U+04C3, U+04C4 to Sans (by Eugeniy Meshcheryakov) +- added DejaVu Sans Extra Light (by Denis Jacquerye) +- Adjusted underline position for (hopefully) improved legibility in + Sans, Serif, Mono (Tim May) +- added auto-generated DejaVu LGC (by Stepan Roh) + +Changes from 2.2 to 2.3: + +- fixed bug U+042B and U+044B behave badly in Sans Bold or Oblique (by + Keenan Pepper) +- added and improved TrueType instructions and related settings (by + Keenan Pepper) +- added U+04D0-U+04D7, U+04E6, U+04E7 to Mono (by Eugeniy Meshcheryakov) +- added U+048A - U+048D, U+0498, U+0499, U+04AA, U+04AB, U+04B0, U+04B1, + U+04C0, U+04C9, U+04CA, U+04CE, U+04CD, U+04DA, U+04DB, U+04DE, U+04DF, + U+04E2 - U+04E5, U+04EC - U+04F8, U+04F9 to Sans (by Eugeniy Meshcheryakov) +- added U+04E0, U+04E1 to all faces (by Eugeniy Meshcheryakov) +- added Greek Extended to Sans and Serif: U+1F00-U+1F15, U+1F18-U+1F1D, + U+1F20-U+1F45, U+1F48-U+1F4D, U+1F50-U+1F57, U+1F59, U+1F5B, U+1F5D, + U+1F5F-U+1F7D, U+1F80-U+1FB4, U+1FB6-U+1FC4, U+1FC6-U+1FD3, U+1FD6-U+1FDB, + U+1FDD-U+1FEF, U+1FF2-U+1FF4, U+1FF6-U+1FFE (by Ben Laenen) +- added Greek variant letterforms, archaic letters and symbols to Mono: + U+03D0-U+03E1, U+03F0-U+03FF (by Ben Laenen) +- added Armenian block and Armenian ligatures to Sans (U+0531 - U+0556, + U+0559 - U+055F, U+0561 - U+0587, U+0589 - U+058A, U+FB13 - U+FB17) (by Ben + Laenen) +- redid some Greek characters in Sans and Mono to make them look better + and to correct some errors (by Ben Laenen) +- added U+27E0 to all faces (by David Lawrence Ramsey) +- added underscore (U+005F) consistency fixes: extended the Sans Mono + and Sans Mono Oblique underscores to touch both horizontal edges, and + reduced the height of the Sans Bold Oblique underscore to match the Sans + Bold underscore (by David Lawrence Ramsey) +- added underscore (U+005F) derivatives and consistency fixes for them: + made U+0332 a reference to underscore at Denis Jacquerye's suggestion; made + U+0333 two references to underscore; made U+033F two references to U+203E; + added U+2017 as two references to underscore, and made U+0333 a reference to + it; and added U+203E as a reference to underscore, and made U+0305 a + reference to it (by David Lawrence Ramsey) +- added U+201B, U+2220, U+2320-U+2321, U+23AE, U+23CF, all remaining + Geometric Shapes glyphs (U+25A0-U+25C9, U+25CB-U+25D7, U+25D9-U+25E5, + U+25E7-U+25FF), and U+2B12-U+2B13 to all faces (by David Lawrence Ramsey) +- added minor positional adjustments to U+2638 in all faces (by David + Lawrence Ramsey) +- added U+201F to Sans Mono and Serif faces (by David Lawrence Ramsey) +- added U+01B7, U+01F6, U+0464 - U+0465, U+2160 - U+2180, U+2183, + U+220A, U+220D, U+2329, U+232A, U+2422, U+27E8 - U+27EB, U+2680 - U+2685 to + Sans (by Gee Fung Sit ???) +- added U+2116 to Sans and Serif (by Gee Fung Sit) +- changed florin sign U+0192 in Sans (by Gee Fung Sit) +- added anchor points to some glyphs (by Denis Jacquerye) +- adjusted height of IPA superscripts U+02B0-02B8, U+02C0-02C1, + U+02E0-02E4, U+207F to match with height of U+00B2 (by Denis Jacquerye) +- added U+0184-U+0185, U+019C, U+019F, U+01A0-U+01A3, U+01A6, U+01AA, + U+01AF-U+01B0, U+01B2-U+01B4, U+01B7-U+01B8, U+01BC-U+01BC, U+0224-U+0225, + U+023A-U+0240, U+1D16-U+1D17, U+1D1D-U+1D1E, U+1D43-U+1D5B, U+1D7B, + U+1D85,U+1D9B-1DB7, U+1DB9-U+1DBF, U+20A6 to all fonts (by Denis Jacquerye) +- added added U+0182, U+018B, U+018E, U+01A0-U+01A1, U+01B1, U+01B9, + U+01C0-U+01C3, U+0238-U+0239, U+1D02, U+1D08-U+1D09, U+1D14, U+1D1F, U+1D77 + to Serif and Mono (by Denis Jacquerye) +- added U+0181, U+0183, U+0187-U+0188, U+018A-U+018F, U+0191, U+0193, + U+0195-U+019B, U+019D-U+019E, U+01A4-U+01A5, U+01AC-U+01AE, U+01B5-U+01B6, + U+01B9, U+01BB, U+01F6 to Serif (by Denis Jacquerye) +- added U+0181, U+0187-U+0188, U+018A, U+018D, U+018F, U+0191, U+0193, + U+0195-U+019F, U+01A4-01A5, U+01AC-01AD, U+01B5-U+01B6, U+1BB, U+01F6, + U+01D7-U+01DC, U+0238-U+0239, U+0241 to Mono (by Denis Jacquerye) +- added to Mono and Serif (by Denis Jacquerye) + +Changes from 2.1 to 2.2: + +- reworked the vertical orientation of the Blocks Elements characters + in all faces to remove their overly large descenders, in order to fix + problems with e.g. terminal emulators (by David Lawrence Ramsey) +- copied bullet in Sans faces to Serif faces for consistency (by David + Lawrence Ramsey) +- added U+2023, U+25D8, U+25E6, and U+29EB to all faces (by David + Lawrence Ramsey) +- added U+1EB8, U+1EB9, U+1ECA - U+1ECD, U+1EE4, U+1EE5 (by Tim May) +- added U+01DD, U+02BE, U+02BF, U+02D3 to all, changed U+02D2 in + non-Condensed and U+1EE5 in Serif (by Tim May) +- fixed U+01CE, replacing wrong circumflex by caron (by Denis Jacquerye) +- added anchor points to some glyphs (by Denis Jacquerye) +- added U+20B5 (by Denis Jacquerye) +- added U+0181 - U+0183, U+0187, U+0188, U+018A - U+018D, U+0191, + U+0193, U+0195 - U+019B, U+019D, U+019E, U+01A4, U+01A7 - U+01A9, U+01AB - + U+01AE, U+01B1, U+01B5, U+01B6, U+01BB, U+01C0 - U+01C3, U+01F1 - U+01F3, + U+0238, U+0239, U+1D02, U+1D08, U+1D09, U+1D14, U+1D1F, U+1D77, U+2103, + U+2126, U+2127, U+212A, U+212B, U+2132, U+214B, U+2210, U+2217, U+2218, + U+2A0C - U+2A0E, U+FB00, U+FB03 and U+FB04 to Sans (by Gee Fung Sit) +- added U+01A9, U+01C3 and U+2126 to Mono and Serif (by Gee Fung Sit) +- adjusted bearings of U+028B in Sans (by Gee Fung Sit) +- added U+018F, U+0494-U+0497, U+04A0-U+04A7, U+04AC-U+04AF, + U+04B4-U+04B7, U+04BA-U+04BB, U+04C1-U+04C2, U+04C5-U+04C8, U+04CB-U+04CC, + U+04D0-U+04D9, U+04DC-U+04DD, U+04E6-U+04EB to Sans (by Eugeniy + Meshcheryakov) +- replaced with references U+0391-U+0393, U+0395-U+0397, U+0399, U+039A, + U+039C, U+039D, U+039F-U+03A1, U+03A4, U+03A5, U+03A7, U+03BF, U+03DC, + U+0405, U+0406, U+0408, U+0410, U+0412, U+0415, U+0417, U+041A, + U+041C-U+041E, U+0420-U+0422, U+0425, U+0430, U+0435, U+043E, U+0440, + U+0441, U+0443, U+0445, U+0455-U+0458 in Serif and Mono (by Eugeniy + Meshcheryakov) +- added U+04D0-U+04D7, U+04E6-U+04EB to Serif (by Eugeniy Meshcheryakov) +- added U+212A and U+212B to the rest of the faces (by Lars Naesbye + Christensen) +- added U+2318 and U+2325 to Sans and Serif (by Lars Naesbye Christensen) +- added and improved TrueType instructions and related settings (by + Keenan Pepper) +- completed basic Greek alphabet: added U+0374-U+0375, U+037A, U+037E, + U+0384-U+038A, U+038C, U+038E-U+0390, U+03AC-U+03BF, U+03C1-U+03CE (by Ben + Laenen) +- added U+2070 and U+2074-U+2079 (by Mederic Boquien) + +Changes from 2.0 to 2.1: + +*** Be aware that names of some TTF files changed since version 2.0. *** + +- added U+0323, U+1E0C, U+1E0D, U+1E24, U+1E25, U+1E36 - U+1E39, U+1E42, + U+1E43, U+1E46, U+1E47, U+1E5A - U+1E5D, U+1E62, U+1E63, U+1E6C, U+1E6D, + U+1E7E, U+1E7F (by Tim May) +- fixed bug where GNOME applications used Mono Bold Oblique instead of + Mono Oblique (by Keenan Pepper) +- added and improved TrueType instructions and related settings (by + Keenan Pepper) +- added U+1E41, U+1E57, U+1E61 (by Sander Vesik) +- added U+0189, U+0309, U+0313, U+0314, U+031A, U+031B, U+0327, U+0328, + U+032B, U+0333, U+033C (by Denis Jacquerye) +- adjusted and fixed U+0186, U+0254, U+0291, U+0316 - U+0319, U+031C - + U+0320, U+0323 - U+0326, U+0329 - U+032A, U+032C - U+0332, U+0339 - U+033B, + U+033E, U+033F (by Denis Jacquerye) +- fixed U+1E12, U+1E3C, U+1E4A, U+1E70 to have normal below diacritics + (by Denis Jacquerye) +- fixed U+1E82, U+1E84 and U+1EF2 to have uppercase above diacritics (by + Denis Jacquerye) +- added anchor points to some glyphs (by Denis Jacquerye) +- dropped "-Roman" from font names - affects both internal TTF names and + names of generated files (by Stepan Roh) +- attempt to fix bug Vertical spacing too big for Mono by exchanging + LineGap and OS2TypoLinegap values (proofed by Stefan Rank) +- added Greek capitals U+0391 - U+03A1, U+03A3 - U+03A9, U+03AA, U+03AB + in Mono (by Ben Laenen) +- added the per ten thousand sign U+2031 (by Mederic Boquien) +- added U+2207, U+221D, U+221F, U+2227 - U+222A, and U+2261 (by David + Lawrence Ramsey) +- new logo (by Gee Fung Sit) +- added U+0180, U+018E, U+201F, U+2024, U+2025, U+203D, U+2200, U+2203, + U+2213, U+222C, U+222D, U+2263 to Sans (by Gee Fung Sit) + +Changes from 1.15 to 2.0: + +- "Italized" basic glyphs in all Serif Oblique and their Condensed faces + (by David Jez) +- added and improved TrueType instructions and related settings (by Keenan + Pepper) +- added anchor points to some glyphs (by Denis Jacquerye) +- many new spacing and combining accents (by Denis Jacquerye) +- smart substitutions for transforming i and j to dottless form and for + using uppercase diacritics (by Denis Jacquerye) +- fixed remaining erroneously slanted characters in Serif Oblique faces (by + David Lawrence Ramsey) +- copied bullet in Sans faces to Sans Oblique faces for consistency (by + David Lawrence Ramsey) +- added U+203C and U+2047-U+2049 (by David Lawrence Ramsey) +- added Greek glyphs to Serif (by Ben Laenen, Condensed merge by David Jez) +- fixed bug LTR glyphs behaving like RTL (by Ben Laenen) +- fixed wrong glyph directions (by David Jez) +- fixed repositioned accents in Condensed faces (by David Jez) + +Changes from 1.14 to 1.15: + +- added and improved TrueType instructions and related settings (by Keenan + Pepper) +- fixed U+2302, U+2319 (by David Lawrence Ramsey) +- fixed yet another monospace bug (by Stepan Roh) +- fixed potential "too big ascender/descender" bug (by Stepan Roh) +- fixed U+026E and U+028E (by Denis Jacquerye) +- added U+0186, U+0190, U+0300 - U+0304, U+0306 - U+0308, U+030A - U+030C, + U+0321, U+0322 (by Denis Jacquerye) +- added rest of Block Elements: U+2591 - U+2593 (by David Lawrence Ramsey) +- added U+2311, U+237D and U+2638 (by David Lawrence Ramsey) +- added U+01CD - U+01D4 (by Denis Jacquerye) +- fixed accents of U+00F2 - U+00F6 by replacing them with references in Mono + Bold (by David Jez) +- added U+0490, U+0491 (by Eugeniy Meshcheryakov) +- added hints to U+0404 and U+0454 in Sans (by Eugeniy Meshcheryakov) +- completed Greek glyphs from U+0370 to U+03CF in Serif (by Ben Laenen) +- fixed shape of U+0255 in Sans Bold and Sans Bold Oblique (by Denis + Jacquerye) + +Changes from 1.13 to 1.14: + +- fixed bug where Mono faces were not recognized as fixed pitch in Windows + by correcting Venda glyphs (by David Jez) +- added and improved TrueType instructions (by Keenan Pepper) +- added 6 Uzbekian glyphs (by Mashrab Kuvatov) +- added Greek glyphs to Sans and Serif, changed pi and omega to fit in (by + Ben Laenen) +- added IPA and related superscript glyphs (by Denis Jacquerye) +- fixed buggy Venda glyphs (by David Lawrence Ramsey and Stepan Roh) +- added U+2302, U+2310, U+2319 (by David Lawrence Ramsey) +- fixed slanted U+00AC in Serif Oblique faces (by David Lawrence Ramsey) +- added 29 glyphs from Block Elements (by David Lawrence Ramsey) + +Changes from 1.12 to 1.13: + +- removed all stems (PS hints) (requested by David Jez) +- added U+01D6, U+01DF, U+022B, U+022D and U+0231 (by Sander Vesik) +- added 10 Venda glyphs (by Dwayne Bailey) +- fixed bug when fonts had no name on Microsoft Windows (by Stepan Roh) +- updated 'missing' glyph U+FFFD (by David Jez) +- set TTF flag fsType to 'Installable Embedding' (= unrestricted usage) + (idea by C. Tiffany) + +Changes from 1.11 to 1.12: + +- added long s (by James Cloos) +- prettier comma accent in gcommaaccent (by David Jez) +- added Hbar, hbar, kgreenlandic, napostrophe, Eng, eng, Tbar, tbar, + afii57929 (by David Jez) +- changed Iogonek, iogonek, IJ, ij to look better (by David Jez) +- glyph uni0237 renamed to dotlessj (requested by David Jez) +- fixed accents for dcaron, lcaron, tcaron, Uogonek, uogonek in Serif (by + David Jez) +- added U+2500 - U+257F box drawing glyphs to Sans Mono (by David Jez) +- fixed accents in Wcircumflex, Ycircumflex and Zdotaccent (by David Jez) +- extra kerning for F (by Sander Vesik) +- added 'missing' glyph U+FFFD (by David Jez) + +Changes from 1.10 to 1.11: + +- kerning updates (by Sander Vesik) +- added Iogonek, iogonek, IJ, ij, Uogonek, uogonek (from SuSE standard fonts + by Adrian Schroeter, SuSE AG) +- added Gcommaaccent, gcommaaccent, Kcommaaccent, kcommaaccent, + Lcommaaccent, lcommaaccent, Ncommaaccent, ncommaaccent, Rcommaaccent, + rcommaaccent (by Stepan Roh) + +Changes from 1.9 to 1.10: + +- added U+022E, U+022F (by Sander Vesik) +- kerning updates for DejaVu Sans (by Sander Vesik) +- fixed too wide cyrillic glyphs in DejaVu Sans Mono (by Valentin Stoykov) +- fixed ligatures bug in Mono (by Stepan Roh) + +Changes from 1.8 to 1.9: + +- integrated Arev Cyrillics (by Danilo Segan) +- added U+01EA, U+01EB, U+01EC, U+01ED (by Sander Vesik) + +Changes from 1.7 to 1.8: + +- fixed accents in Serif Oblique and Serif Bold Oblique (by Stepan Roh) + +Changes from 1.6 to 1.7: + +- added automatically generated Condensed typefaces (by Stepan Roh) + +Changes from 1.5 to 1.6: + +- monospace bug fixed (by Stepan Roh) +- incorrect Bitstream foundry assigned by fontconfig and KDE Font Installer +fixed (by Stepan Roh) +- added automatically generated Oblique version of Serif typefaces (by +Stepan Roh) +- corrected cyrillic D and d (by Danilo Segan and David Jez) +- fixed accents position in Oblique version of Serif typefaces (by Danilo +Segan and Sander Vesik) +- fixed incorrect computation of OS2Win* fields (by Stepan Roh) +- added visiblespace U+2423 (by David Jez) +- fixed 'line height' bug by fixing ascender and descender values (by David +Jez and Stepan Roh) +- fixed part of 'worse than Vera' bug (by Peter Cernak) +- smaller comma accent U+0326 (by David Jez) + +Changes from 1.4 to 1.5: + +- added Cyrillics (96 characters) and Dcroat to the rest of typefaces (by +Danilo Segan) +- fixed bugs in some Cyrillic characters, some of them reported by Sander +Vesik (by Danilo Segan) +- added U+0100, U+0101, U+0112, U+0113, U+012A, U+012B, U+014C, U+014D, +U+016A, U+016B, U+01E2, U+01E3, U+0232 and U+0233 (by Sander Vesik) +- added Romanian characters (by Misu Moldovan) +- added U+0108, U+0109, U+010A, U+010B, U+0114, U+0115, U+0116, U+0117, +U+011C, U+011D, U+0120, U+0121, U+0124, U+0125, U+0128, U+0129, U+012C, +U+012D, U+0134, U+0135, U+014E, U+014F, U+0150, U+0151, U+015C, U+015D, +U+0168, U+0169, U+016C, U+016D, U+0170, U+0171 and U+0237 (by James +Crippen) +- added U+02BB, U+2010, U+2011, U+2012 and U+2015 (by Stepan Roh) + +Changes from 1.3 to 1.4: + +- added Polish characters (Aogonek, aogonek, Eogonek, eogonek, Nacute, +nacute, Sacute, sacute, Zacute, zacute, Zdotaccent, zdotaccent) (by Stepan +Roh) + +Changes from 1.2 to 1.3: + +- added Cyrillics (96 characters) and Dcroat to Sans typefaces (by Danilo +Segan from his BePa fonts) + +Changes from 1.1 to 1.2: + +- added Ldot, ldot, Wcircumflex, wcircumflex, Ycircumflex, ycircumflex, + Wgrave, wgrave, Wacute, wacute, Wdieresis, wdieresis, Ygrave and ygrave + (from The Olwen Font Family 0.2 by Dafydd Harries) + +Changes from 1.0 to 1.1: + +- added Lacute, lacute, Lcaron, lcaron, Racute and racute (by Peter Cernak) + +Changes from 0.9.4 to 1.0: + +- none, just changed version and updated README + +Changes from 0.9.3 to 0.9.4: + +- fixed TTF generation (kerning tables were missing) + +Changes from 0.9.2 to 0.9.3: + +- kerning of added characters +- proper caron shape for dcaron in Mono (by Ondrej Koala Vacha) +- minor visual changes + +Changes from 0.9.1 to 0.9.2: + +- internal bugged version + +Changes from 0.9 to 0.9.1: + +- proper caron shape for dcaron and tcaron +- minor visual changes + +$Id: NEWS 2535 2013-08-25 15:21:17Z moyogo $ diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/README b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/README new file mode 100644 index 00000000000..162a89345bf --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/README @@ -0,0 +1,59 @@ +DejaVu fonts 2.34 (c)2004-2013 DejaVu fonts team +------------------------------------------------ + +The DejaVu fonts are a font family based on the Bitstream Vera Fonts +(http://gnome.org/fonts/). Its purpose is to provide a wider range of +characters (see status.txt for more information) while maintaining the +original look and feel. + +DejaVu fonts are based on Bitstream Vera fonts version 1.10. + +Available fonts (Sans = sans serif, Mono = monospaced): + +DejaVu Sans Mono +DejaVu Sans Mono Bold +DejaVu Sans Mono Bold Oblique +DejaVu Sans Mono Oblique +DejaVu Sans +DejaVu Sans Bold +DejaVu Sans Bold Oblique +DejaVu Sans Oblique +DejaVu Sans ExtraLight (experimental) +DejaVu Serif +DejaVu Serif Bold +DejaVu Serif Bold Italic (experimental) +DejaVu Serif Italic (experimental) +DejaVu Sans Condensed (experimental) +DejaVu Sans Condensed Bold (experimental) +DejaVu Sans Condensed Bold Oblique (experimental) +DejaVu Sans Condensed Oblique (experimental) +DejaVu Serif Condensed (experimental) +DejaVu Serif Condensed Bold (experimental) +DejaVu Serif Condensed Bold Italic (experimental) +DejaVu Serif Condensed Italic (experimental) + +All fonts are also available as derivative called DejaVu LGC with support +only for Latin, Greek and Cyrillic scripts. + +For license information see LICENSE. What's new is described in NEWS. Known +bugs are in BUGS. All authors are mentioned in AUTHORS. + +Fonts are published in source form as SFD files (Spline Font Database from +FontForge - http://fontforge.sf.net/) and in compiled form as TTF files +(TrueType fonts). + +For more information go to http://dejavu.sourceforge.net/. + +Characters from Arev fonts, Copyright (c) 2006 by Tavmjong Bah: +--------------------------- +U+01BA, U+01BF, U+01F7, U+021C-U+021D, U+0220, U+0222-U+0223, +U+02B9, U+02BA, U+02BD, U+02C2-U+02C5, U+02d4-U+02D5, +U+02D7, U+02EC-U+02EE, U+0346-U+034E, U+0360, U+0362, +U+03E2-03EF, U+0460-0463, U+0466-U+0486, U+0488-U+0489, U+04A8-U+04A9, +U+0500-U+050F, U+2055-205E, U+20B0, U+20B2-U+20B3, U+2102, U+210D, U+210F, +U+2111, U+2113, U+2115, U+2118-U+211A, U+211C-U+211D, U+2124, U+2135, +U+213C-U+2140, U+2295-U+2298, U+2308-U+230B, U+26A2-U+26B1, U+2701-U+2704, +U+2706-U+2709, U+270C-U+274B, U+2758-U+275A, U+2761-U+2775, U+2780-U+2794, +U+2798-U+27AF, U+27B1-U+27BE, U+FB05-U+FB06 + +$Id: README 2535 2013-08-25 15:21:17Z moyogo $ diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/langcover.txt b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/langcover.txt new file mode 100644 index 00000000000..4db5bca5dff --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/langcover.txt @@ -0,0 +1,249 @@ +This is the language coverage file for DejaVu fonts +($Id: langcover.txt 2538 2013-08-25 16:02:56Z moyogo $) + + Sans Serif Sans Mono +aa Afar 100% (62/62) 100% (62/62) 100% (62/62) +ab Abkhazia 100% (90/90) 93% (84/90) 84% (76/90) +af Afrikaans 100% (69/69) 100% (69/69) 100% (69/69) +ak Akan 100% (73/73) 100% (73/73) 100% (73/73) +am Amharic (0/264) (0/264) (0/264) +an Aragonese 100% (66/66) 100% (66/66) 100% (66/66) +ar Arabic 100% (36/36) (0/36) 100% (36/36) +as Assamese (0/64) (0/64) (0/64) +ast Asturian/Bable/Leonese/Asturleonese 100% (70/70) 100% (70/70) 100% (70/70) +av Avaric 100% (67/67) 100% (67/67) 100% (67/67) +ay Aymara 100% (60/60) 100% (60/60) 100% (60/60) +az-az Azerbaijani in Azerbaijan 100% (66/66) 100% (66/66) 100% (66/66) +az-ir Azerbaijani in Iran 100% (40/40) (0/40) 100% (40/40) +ba Bashkir 100% (82/82) 100% (82/82) 97% (80/82) +be Byelorussian 100% (68/68) 100% (68/68) 100% (68/68) +ber-dz Berber in Algeria 100% (70/70) 100% (70/70) 100% (70/70) +ber-ma Berber in Morocco 100% (32/32) (0/32) (0/32) +bg Bulgarian 100% (60/60) 100% (60/60) 100% (60/60) +bh Bihari (Devanagari script) (0/68) (0/68) (0/68) +bho Bhojpuri (Devanagari script) (0/68) (0/68) (0/68) +bi Bislama 100% (58/58) 100% (58/58) 100% (58/58) +bin Edo or Bini 100% (78/78) 100% (78/78) 100% (78/78) +bm Bambara 100% (60/60) 100% (60/60) 100% (60/60) +bn Bengali (0/63) (0/63) (0/63) +bo Tibetan (0/95) (0/95) (0/95) +br Breton 100% (64/64) 100% (64/64) 100% (64/64) +brx Bodo (Devanagari script) (0/82) (0/82) (0/82) +bs Bosnian 100% (62/62) 100% (62/62) 100% (62/62) +bua Buriat (Buryat) 100% (70/70) 100% (70/70) 100% (70/70) +byn Blin/Bilin (0/255) (0/255) (0/255) +ca Catalan 100% (74/74) 100% (74/74) 100% (74/74) +ce Chechen 100% (67/67) 100% (67/67) 100% (67/67) +ch Chamorro 100% (58/58) 100% (58/58) 100% (58/58) +chm Mari (Lower Cheremis / Upper Cheremis) 100% (76/76) 100% (76/76) 100% (76/76) +chr Cherokee (0/85) (0/85) (0/85) +co Corsican 100% (84/84) 100% (84/84) 100% (84/84) +crh Crimean Tatar/Crimean Turkish 100% (68/68) 100% (68/68) 100% (68/68) +cs Czech 100% (82/82) 100% (82/82) 100% (82/82) +csb Kashubian 100% (74/74) 100% (74/74) 100% (74/74) +cu Old Church Slavonic 100% (103/103) 90% (93/103) 78% (81/103) +cv Chuvash 100% (74/74) 100% (74/74) 100% (74/74) +cy Welsh 100% (78/78) 100% (78/78) 100% (78/78) +da Danish 100% (70/70) 100% (70/70) 100% (70/70) +de German 100% (59/59) 100% (59/59) 100% (59/59) +doi Dogri (0/85) (0/85) (0/85) +dv Divehi/Dhivehi/Maldivian (0/49) (0/49) (0/49) +dz Dzongkha (0/95) (0/95) (0/95) +ee Ewe 100% (99/99) 100% (99/99) 100% (99/99) +el Greek 100% (69/69) 100% (69/69) 100% (69/69) +en English 100% (72/72) 100% (72/72) 100% (72/72) +eo Esperanto 100% (64/64) 100% (64/64) 100% (64/64) +es Spanish 100% (66/66) 100% (66/66) 100% (66/66) +et Estonian 100% (64/64) 100% (64/64) 100% (64/64) +eu Basque 100% (56/56) 100% (56/56) 100% (56/56) +fa Persian 100% (40/40) (0/40) 100% (40/40) +fat Fanti 100% (73/73) 100% (73/73) 100% (73/73) +ff Fulah (Fula) 100% (62/62) 100% (62/62) 100% (62/62) +fi Finnish 100% (62/62) 100% (62/62) 100% (62/62) +fil Filipino 100% (84/84) 100% (84/84) 100% (84/84) +fj Fijian 100% (52/52) 100% (52/52) 100% (52/52) +fo Faroese 100% (68/68) 100% (68/68) 100% (68/68) +fr French 100% (84/84) 100% (84/84) 100% (84/84) +fur Friulian 100% (66/66) 100% (66/66) 100% (66/66) +fy Frisian 100% (75/75) 100% (75/75) 100% (75/75) +ga Irish 100% (80/80) 100% (80/80) 100% (80/80) +gd Scots Gaelic 100% (70/70) 100% (70/70) 100% (70/70) +gez Ethiopic (Geez) (0/218) (0/218) (0/218) +gl Galician 100% (66/66) 100% (66/66) 100% (66/66) +gn Guarani 100% (70/70) 100% (70/70) 100% (70/70) +gu Gujarati (0/68) (0/68) (0/68) +gv Manx Gaelic 100% (54/54) 100% (54/54) 100% (54/54) +ha Hausa 100% (60/60) 100% (60/60) 100% (60/60) +haw Hawaiian 100% (63/63) 100% (63/63) 100% (63/63) +he Hebrew 100% (27/27) (0/27) (0/27) +hi Hindi (Devanagari script) (0/68) (0/68) (0/68) +hne Chhattisgarhi (0/68) (0/68) (0/68) +ho Hiri Motu 100% (52/52) 100% (52/52) 100% (52/52) +hr Croatian 100% (62/62) 100% (62/62) 100% (62/62) +hsb Upper Sorbian 100% (72/72) 100% (72/72) 100% (72/72) +ht Haitian/Haitian Creole 100% (56/56) 100% (56/56) 100% (56/56) +hu Hungarian 100% (70/70) 100% (70/70) 100% (70/70) +hy Armenian 100% (77/77) 100% (77/77) 100% (77/77) +hz Herero 100% (57/57) 100% (57/57) 100% (57/57) +ia Interlingua 100% (52/52) 100% (52/52) 100% (52/52) +id Indonesian 100% (54/54) 100% (54/54) 100% (54/54) +ie Interlingue 100% (52/52) 100% (52/52) 100% (52/52) +ig Igbo 100% (58/58) 100% (58/58) 100% (58/58) +ii Sichuan Yi/Nuosu (0/1165) (0/1165) (0/1165) +ik Inupiaq (Inupiak, Eskimo) 100% (68/68) 100% (68/68) 100% (68/68) +io Ido 100% (52/52) 100% (52/52) 100% (52/52) +is Icelandic 100% (70/70) 100% (70/70) 100% (70/70) +it Italian 100% (72/72) 100% (72/72) 100% (72/72) +iu Inuktitut 100% (161/161) (0/161) (0/161) +ja Japanese (0/6537) (0/6537) (0/6537) +jv Javanese 100% (56/56) 100% (56/56) 100% (56/56) +ka Georgian 100% (33/33) 100% (33/33) 100% (33/33) +kaa Kara-Kalpak (Karakalpak) 100% (78/78) 100% (78/78) 100% (78/78) +kab Kabyle 100% (70/70) 100% (70/70) 100% (70/70) +ki Kikuyu 100% (56/56) 100% (56/56) 100% (56/56) +kj Kuanyama/Kwanyama 100% (52/52) 100% (52/52) 100% (52/52) +kk Kazakh 100% (77/77) 100% (77/77) 100% (77/77) +kl Greenlandic 100% (81/81) 100% (81/81) 100% (81/81) +km Central Khmer (0/63) (0/63) (0/63) +kn Kannada (0/70) (0/70) (0/70) +ko Korean (0/2443) (0/2443) (0/2443) +kok Kokani (Devanagari script) (0/68) (0/68) (0/68) +kr Kanuri 100% (56/56) 100% (56/56) 100% (56/56) +ks Kashmiri 78% (26/33) (0/33) 69% (23/33) +ku-am Kurdish in Armenia 100% (64/64) 100% (64/64) 100% (64/64) +ku-iq Kurdish in Iraq 100% (32/32) (0/32) 87% (28/32) +ku-ir Kurdish in Iran 100% (32/32) (0/32) 87% (28/32) +ku-tr Kurdish in Turkey 100% (62/62) 100% (62/62) 100% (62/62) +kum Kumyk 100% (66/66) 100% (66/66) 100% (66/66) +kv Komi (Komi-Permyak/Komi-Siryan) 100% (70/70) 100% (70/70) 100% (70/70) +kw Cornish 100% (64/64) 100% (64/64) 100% (64/64) +kwm Kwambi 100% (52/52) 100% (52/52) 100% (52/52) +ky Kirgiz 100% (70/70) 100% (70/70) 100% (70/70) +la Latin 100% (68/68) 100% (68/68) 100% (68/68) +lah Lahnda 92% (25/27) (0/27) 85% (23/27) +lb Luxembourgish (Letzeburgesch) 100% (75/75) 100% (75/75) 100% (75/75) +lez Lezghian (Lezgian) 100% (67/67) 100% (67/67) 100% (67/67) +lg Ganda 100% (54/54) 100% (54/54) 100% (54/54) +li Limburgan/Limburger/Limburgish 100% (62/62) 100% (62/62) 100% (62/62) +ln Lingala 100% (81/81) 100% (81/81) 100% (81/81) +lo Lao 100% (55/55) (0/55) 83% (46/55) +lt Lithuanian 100% (70/70) 100% (70/70) 100% (70/70) +lv Latvian 100% (78/78) 100% (78/78) 100% (78/78) +mai Maithili (Devanagari script) (0/68) (0/68) (0/68) +mg Malagasy 100% (56/56) 100% (56/56) 100% (56/56) +mh Marshallese 100% (62/62) 100% (62/62) 100% (62/62) +mi Maori 100% (64/64) 100% (64/64) 100% (64/64) +mk Macedonian 100% (42/42) 100% (42/42) 100% (42/42) +ml Malayalam (0/68) (0/68) (0/68) +mn-cn Mongolian in China (0/130) (0/130) (0/130) +mn-mn Mongolian in Mongolia 100% (70/70) 100% (70/70) 100% (70/70) +mni Maniputi (0/78) (0/78) (0/78) +mo Moldavian 100% (128/128) 100% (128/128) 100% (128/128) +mr Marathi (Devanagari script) (0/68) (0/68) (0/68) +ms Malay 100% (52/52) 100% (52/52) 100% (52/52) +mt Maltese 100% (72/72) 100% (72/72) 100% (72/72) +my Burmese (Myanmar) (0/48) (0/48) (0/48) +na Nauru 100% (60/60) 100% (60/60) 100% (60/60) +nb Norwegian Bokmal 100% (70/70) 100% (70/70) 100% (70/70) +nds Low Saxon 100% (59/59) 100% (59/59) 100% (59/59) +ne Nepali (0/72) (0/72) (0/72) +ng Ndonga 100% (52/52) 100% (52/52) 100% (52/52) +nl Dutch 100% (82/82) 100% (82/82) 100% (82/82) +nn Norwegian Nynorsk 100% (76/76) 100% (76/76) 100% (76/76) +no Norwegian (Bokmal) 100% (70/70) 100% (70/70) 100% (70/70) +nqo N'Ko 91% (54/59) (0/59) (0/59) +nr Ndebele, South 100% (52/52) 100% (52/52) 100% (52/52) +nso Northern Sotho 100% (58/58) 100% (58/58) 100% (58/58) +nv Navajo/Navaho 100% (72/72) 100% (72/72) 100% (72/72) +ny Chichewa 100% (54/54) 100% (54/54) 100% (54/54) +oc Occitan 100% (70/70) 100% (70/70) 100% (70/70) +om Oromo or Galla 100% (52/52) 100% (52/52) 100% (52/52) +or Oriya (0/68) (0/68) (0/68) +os Ossetic 100% (66/66) 100% (66/66) 100% (66/66) +ota Ottoman Turkish 100% (37/37) (0/37) 97% (36/37) +pa Panjabi/Punjabi (0/63) (0/63) (0/63) +pa-pk Panjabi/Punjabi in Pakistan 92% (25/27) (0/27) 85% (23/27) +pap-an Papiamento in Netherlands Antilles 100% (72/72) 100% (72/72) 100% (72/72) +pap-aw Papiamento in Aruba 100% (54/54) 100% (54/54) 100% (54/54) +pes Western Farsi 100% (40/40) (0/40) 100% (40/40) +pl Polish 100% (70/70) 100% (70/70) 100% (70/70) +prs Dari/Eastern Farsi 100% (40/40) (0/40) 100% (40/40) +ps-af Pashto in Afghanistan 95% (47/49) (0/49) 77% (38/49) +ps-pk Pashto in Pakistan 93% (46/49) (0/49) 75% (37/49) +pt Portuguese 100% (82/82) 100% (82/82) 100% (82/82) +qu Quechua 100% (55/55) 100% (55/55) 100% (55/55) +rm Rhaeto-Romance (Romansch) 100% (66/66) 100% (66/66) 100% (66/66) +rn Rundi 100% (52/52) 100% (52/52) 100% (52/52) +ro Romanian 100% (62/62) 100% (62/62) 100% (62/62) +ru Russian 100% (66/66) 100% (66/66) 100% (66/66) +rw Kinyarwanda 100% (52/52) 100% (52/52) 100% (52/52) +sa Sanskrit (Devanagari script) (0/68) (0/68) (0/68) +sah Yakut 100% (76/76) 100% (76/76) 100% (76/76) +sat Santali (Devanagari script) (0/70) (0/70) (0/70) +sc Sardinian 100% (62/62) 100% (62/62) 100% (62/62) +sco Scots 100% (56/56) 100% (56/56) 100% (56/56) +sd Sindhi 100% (54/54) (0/54) 79% (43/54) +se North Sami 100% (66/66) 100% (66/66) 100% (66/66) +sel Selkup (Ostyak-Samoyed) 100% (66/66) 100% (66/66) 100% (66/66) +sg Sango 100% (72/72) 100% (72/72) 100% (72/72) +sh Serbo-Croatian 100% (156/156) 100% (156/156) 98% (154/156) +shs Secwepemctsin 100% (48/48) 100% (48/48) 100% (48/48) +si Sinhala/Sinhalese (0/73) (0/73) (0/73) +sid Sidamo (0/281) (0/281) (0/281) +sk Slovak 100% (86/86) 100% (86/86) 100% (86/86) +sl Slovenian 100% (62/62) 100% (62/62) 100% (62/62) +sm Samoan 100% (53/53) 100% (53/53) 100% (53/53) +sma South Sami 100% (60/60) 100% (60/60) 100% (60/60) +smj Lule Sami 100% (60/60) 100% (60/60) 100% (60/60) +smn Inari Sami 100% (68/68) 100% (68/68) 100% (68/68) +sms Skolt Sami 100% (80/80) 100% (80/80) 97% (78/80) +sn Shona 100% (52/52) 100% (52/52) 100% (52/52) +so Somali 100% (52/52) 100% (52/52) 100% (52/52) +sq Albanian 100% (56/56) 100% (56/56) 100% (56/56) +sr Serbian 100% (60/60) 100% (60/60) 100% (60/60) +ss Swati 100% (52/52) 100% (52/52) 100% (52/52) +st Sotho, Southern 100% (52/52) 100% (52/52) 100% (52/52) +su Sundanese 100% (54/54) 100% (54/54) 100% (54/54) +sv Swedish 100% (68/68) 100% (68/68) 100% (68/68) +sw Swahili 100% (52/52) 100% (52/52) 100% (52/52) +syr Syriac (0/45) (0/45) (0/45) +ta Tamil (0/48) (0/48) (0/48) +te Telugu (0/70) (0/70) (0/70) +tg Tajik 100% (78/78) 100% (78/78) 97% (76/78) +th Thai 1% (1/74) (0/74) (0/74) +ti-er Eritrean Tigrinya (0/255) (0/255) (0/255) +ti-et Ethiopian Tigrinya (0/281) (0/281) (0/281) +tig Tigre (0/221) (0/221) (0/221) +tk Turkmen 100% (68/68) 100% (68/68) 100% (68/68) +tl Tagalog 100% (84/84) 100% (84/84) 100% (84/84) +tn Tswana 100% (58/58) 100% (58/58) 100% (58/58) +to Tonga 100% (53/53) 100% (53/53) 100% (53/53) +tr Turkish 100% (70/70) 100% (70/70) 100% (70/70) +ts Tsonga 100% (52/52) 100% (52/52) 100% (52/52) +tt Tatar 100% (76/76) 100% (76/76) 100% (76/76) +tw Twi 100% (73/73) 100% (73/73) 100% (73/73) +ty Tahitian 100% (65/65) 100% (65/65) 100% (65/65) +tyv Tuvinian 100% (70/70) 100% (70/70) 100% (70/70) +ug Uyghur 87% (29/33) (0/33) 78% (26/33) +uk Ukrainian 100% (72/72) 100% (72/72) 100% (72/72) +ur Urdu 92% (25/27) (0/27) 85% (23/27) +uz Uzbek 100% (52/52) 100% (52/52) 100% (52/52) +ve Venda 100% (62/62) 100% (62/62) 100% (62/62) +vi Vietnamese 100% (194/194) 100% (194/194) 76% (148/194) +vo Volapuk 100% (54/54) 100% (54/54) 100% (54/54) +vot Votic 100% (62/62) 100% (62/62) 100% (62/62) +wa Walloon 100% (70/70) 100% (70/70) 100% (70/70) +wal Wolaitta/Wolaytta (0/281) (0/281) (0/281) +wen Sorbian languages (lower and upper) 100% (76/76) 100% (76/76) 100% (76/76) +wo Wolof 100% (66/66) 100% (66/66) 100% (66/66) +xh Xhosa 100% (52/52) 100% (52/52) 100% (52/52) +yap Yapese 100% (58/58) 100% (58/58) 100% (58/58) +yi Yiddish 100% (27/27) (0/27) (0/27) +yo Yoruba 100% (119/119) 100% (119/119) 100% (119/119) +za Zhuang/Chuang 100% (52/52) 100% (52/52) 100% (52/52) +zh-cn Chinese (simplified) 0% (2/6765) 0% (2/6765) 0% (2/6765) +zh-hk Chinese Hong Kong Supplementary Character Set (0/2213) (0/2213) (0/2213) +zh-mo Chinese in Macau (0/2213) (0/2213) (0/2213) +zh-sg Chinese in Singapore 0% (2/6765) 0% (2/6765) 0% (2/6765) +zh-tw Chinese (traditional) (0/13063) (0/13063) (0/13063) +zu Zulu 100% (52/52) 100% (52/52) 100% (52/52) diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/unicover.txt b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/unicover.txt new file mode 100644 index 00000000000..c86c056299c --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/unicover.txt @@ -0,0 +1,226 @@ +This is the Unicode coverage file for DejaVu fonts +($Id: unicover.txt 2538 2013-08-25 16:02:56Z moyogo $) + +Control and similar characters are discounted from totals. + + Sans Serif Sans Mono +U+0000 Basic Latin 100% (95/95) 100% (95/95) 100% (95/95) +U+0080 Latin-1 Supplement 100% (96/96) 100% (96/96) 100% (96/96) +U+0100 Latin Extended-A 100% (128/128) 100% (128/128) 100% (128/128) +U+0180 Latin Extended-B 100% (208/208) 100% (208/208) 86% (180/208) +U+0250 IPA Extensions 100% (96/96) 100% (96/96) 100% (96/96) +U+02b0 Spacing Modifier Letters 78% (63/80) 73% (59/80) 62% (50/80) +U+0300 Combining Diacritical Marks 83% (93/112) 61% (69/112) 59% (67/112) +U+0370 Greek and Coptic 100% (134/134) 89% (120/134) 82% (110/134) +U+0400 Cyrillic 100% (256/256) 79% (204/256) 70% (180/256) +U+0500 Cyrillic Supplement 95% (38/40) 25% (10/40) 15% (6/40) +U+0530 Armenian 98% (86/87) 98% (86/87) 98% (86/87) +U+0590 Hebrew 62% (54/87) (0/87) (0/87) +U+0600 Arabic 63% (161/253) (0/253) 39% (99/253) +U+0700 Syriac (0/77) (0/77) (0/77) +U+0750 Arabic Supplement (0/48) (0/48) (0/48) +U+0780 Thaana (0/50) (0/50) (0/50) +U+07c0 NKo 91% (54/59) (0/59) (0/59) +U+0800 Samaritan (0/61) (0/61) (0/61) +U+0840 Mandaic (0/29) (0/29) (0/29) +U+08a0 Arabic Extended-A (0/39) (0/39) (0/39) +U+0900 Devanagari (0/127) (0/127) (0/127) +U+0980 Bengali (0/92) (0/92) (0/92) +U+0a00 Gurmukhi (0/79) (0/79) (0/79) +U+0a80 Gujarati (0/84) (0/84) (0/84) +U+0b00 Oriya (0/90) (0/90) (0/90) +U+0b80 Tamil (0/72) (0/72) (0/72) +U+0c00 Telugu (0/93) (0/93) (0/93) +U+0c80 Kannada (0/86) (0/86) (0/86) +U+0d00 Malayalam (0/98) (0/98) (0/98) +U+0d80 Sinhala (0/80) (0/80) (0/80) +U+0e00 Thai 1% (1/87) (0/87) (0/87) +U+0e80 Lao 97% (65/67) (0/67) 68% (46/67) +U+0f00 Tibetan (0/211) (0/211) (0/211) +U+1000 Myanmar (0/160) (0/160) (0/160) +U+10a0 Georgian 94% (83/88) 94% (83/88) 51% (45/88) +U+1100 Hangul Jamo (0/256) (0/256) (0/256) +U+1200 Ethiopic (0/358) (0/358) (0/358) +U+1380 Ethiopic Supplement (0/26) (0/26) (0/26) +U+13a0 Cherokee (0/85) (0/85) (0/85) +U+1400 Unified Canadian Aboriginal Syllabics 63% (404/640) (0/640) (0/640) +U+1680 Ogham 100% (29/29) (0/29) (0/29) +U+16a0 Runic (0/81) (0/81) (0/81) +U+1700 Tagalog (0/20) (0/20) (0/20) +U+1720 Hanunoo (0/23) (0/23) (0/23) +U+1740 Buhid (0/20) (0/20) (0/20) +U+1760 Tagbanwa (0/18) (0/18) (0/18) +U+1780 Khmer (0/114) (0/114) (0/114) +U+1800 Mongolian (0/156) (0/156) (0/156) +U+18b0 Unified Canadian Aboriginal Syllabics Extended (0/70) (0/70) (0/70) +U+1900 Limbu (0/66) (0/66) (0/66) +U+1950 Tai Le (0/35) (0/35) (0/35) +U+1980 New Tai Lue (0/83) (0/83) (0/83) +U+19e0 Khmer Symbols (0/32) (0/32) (0/32) +U+1a00 Buginese (0/30) (0/30) (0/30) +U+1a20 Tai Tham (0/127) (0/127) (0/127) +U+1b00 Balinese (0/121) (0/121) (0/121) +U+1b80 Sundanese (0/64) (0/64) (0/64) +U+1bc0 Batak (0/56) (0/56) (0/56) +U+1c00 Lepcha (0/74) (0/74) (0/74) +U+1c50 Ol Chiki (0/48) (0/48) (0/48) +U+1cc0 Sundanese Supplement (0/8) (0/8) (0/8) +U+1cd0 Vedic Extensions (0/39) (0/39) (0/39) +U+1d00 Phonetic Extensions 82% (106/128) 89% (115/128) 48% (62/128) +U+1d80 Phonetic Extensions Supplement 59% (38/64) 59% (38/64) 57% (37/64) +U+1dc0 Combining Diacritical Marks Supplement 13% (6/43) 13% (6/43) (0/43) +U+1e00 Latin Extended Additional 98% (252/256) 98% (252/256) 71% (182/256) +U+1f00 Greek Extended 100% (233/233) 100% (233/233) 100% (233/233) +U+2000 General Punctuation 100% (107/107) 81% (87/107) 49% (53/107) +U+2070 Superscripts and Subscripts 100% (42/42) 100% (42/42) 100% (42/42) +U+20a0 Currency Symbols 92% (25/27) 29% (8/27) 88% (24/27) +U+20d0 Combining Diacritical Marks for Symbols 21% (7/33) (0/33) (0/33) +U+2100 Letterlike Symbols 93% (75/80) 42% (34/80) 22% (18/80) +U+2150 Number Forms 94% (55/58) 94% (55/58) 22% (13/58) +U+2190 Arrows 100% (112/112) 100% (112/112) 100% (112/112) +U+2200 Mathematical Operators 100% (256/256) 39% (100/256) 62% (159/256) +U+2300 Miscellaneous Technical 26% (65/244) 14% (35/244) 47% (117/244) +U+2400 Control Pictures 5% (2/39) 2% (1/39) 2% (1/39) +U+2440 Optical Character Recognition (0/11) (0/11) (0/11) +U+2460 Enclosed Alphanumerics 6% (10/160) (0/160) (0/160) +U+2500 Box Drawing 100% (128/128) 100% (128/128) 100% (128/128) +U+2580 Block Elements 100% (32/32) 100% (32/32) 100% (32/32) +U+25a0 Geometric Shapes 100% (96/96) 100% (96/96) 100% (96/96) +U+2600 Miscellaneous Symbols 73% (187/256) 11% (30/256) 58% (149/256) +U+2700 Dingbats 91% (174/191) 0% (1/191) 75% (144/191) +U+27c0 Miscellaneous Mathematical Symbols-A 18% (9/48) 10% (5/48) 16% (8/48) +U+27f0 Supplemental Arrows-A 100% (16/16) 100% (16/16) (0/16) +U+2800 Braille Patterns 100% (256/256) 100% (256/256) (0/256) +U+2900 Supplemental Arrows-B 4% (6/128) 100% (128/128) (0/128) +U+2980 Miscellaneous Mathematical Symbols-B 10% (13/128) 0% (1/128) 2% (3/128) +U+2a00 Supplemental Mathematical Operators 28% (74/256) 2% (6/256) 1% (3/256) +U+2b00 Miscellaneous Symbols and Arrows 40% (35/87) 31% (27/87) 20% (18/87) +U+2c00 Glagolitic (0/94) (0/94) (0/94) +U+2c60 Latin Extended-C 96% (31/32) 84% (27/32) 43% (14/32) +U+2c80 Coptic (0/123) (0/123) (0/123) +U+2d00 Georgian Supplement 95% (38/40) 95% (38/40) (0/40) +U+2d30 Tifinagh 93% (55/59) (0/59) (0/59) +U+2d80 Ethiopic Extended (0/79) (0/79) (0/79) +U+2de0 Cyrillic Extended-A (0/32) (0/32) (0/32) +U+2e00 Supplemental Punctuation 11% (7/60) 11% (7/60) 11% (7/60) +U+2e80 CJK Radicals Supplement (0/115) (0/115) (0/115) +U+2f00 Kangxi Radicals (0/214) (0/214) (0/214) +U+2ff0 Ideographic Description Characters (0/12) (0/12) (0/12) +U+3000 CJK Symbols and Punctuation (0/64) (0/64) (0/64) +U+3040 Hiragana (0/93) (0/93) (0/93) +U+30a0 Katakana (0/96) (0/96) (0/96) +U+3100 Bopomofo (0/41) (0/41) (0/41) +U+3130 Hangul Compatibility Jamo (0/94) (0/94) (0/94) +U+3190 Kanbun (0/16) (0/16) (0/16) +U+31a0 Bopomofo Extended (0/27) (0/27) (0/27) +U+31c0 CJK Strokes (0/36) (0/36) (0/36) +U+31f0 Katakana Phonetic Extensions (0/16) (0/16) (0/16) +U+3200 Enclosed CJK Letters and Months (0/254) (0/254) (0/254) +U+3300 CJK Compatibility (0/256) (0/256) (0/256) +U+3400 CJK Unified Ideographs Extension A (0/0) (0/0) (0/0) +U+4dc0 Yijing Hexagram Symbols 100% (64/64) (0/64) (0/64) +U+4e00 CJK Unified Ideographs (0/0) (0/0) (0/0) +U+a000 Yi Syllables (0/1165) (0/1165) (0/1165) +U+a490 Yi Radicals (0/55) (0/55) (0/55) +U+a4d0 Lisu 100% (48/48) (0/48) (0/48) +U+a500 Vai (0/300) (0/300) (0/300) +U+a640 Cyrillic Extended-B 34% (31/89) 11% (10/89) (0/89) +U+a6a0 Bamum (0/88) (0/88) (0/88) +U+a700 Modifier Tone Letters 62% (20/32) 62% (20/32) 62% (20/32) +U+a720 Latin Extended-D 55% (75/134) 43% (58/134) 11% (15/134) +U+a800 Syloti Nagri (0/44) (0/44) (0/44) +U+a830 Common Indic Number Forms (0/10) (0/10) (0/10) +U+a840 Phags-pa (0/56) (0/56) (0/56) +U+a880 Saurashtra (0/81) (0/81) (0/81) +U+a8e0 Devanagari Extended (0/28) (0/28) (0/28) +U+a900 Kayah Li (0/48) (0/48) (0/48) +U+a930 Rejang (0/37) (0/37) (0/37) +U+a960 Hangul Jamo Extended-A (0/29) (0/29) (0/29) +U+a980 Javanese (0/91) (0/91) (0/91) +U+aa00 Cham (0/83) (0/83) (0/83) +U+aa60 Myanmar Extended-A (0/28) (0/28) (0/28) +U+aa80 Tai Viet (0/72) (0/72) (0/72) +U+aae0 Meetei Mayek Extensions (0/23) (0/23) (0/23) +U+ab00 Ethiopic Extended-A (0/32) (0/32) (0/32) +U+abc0 Meetei Mayek (0/56) (0/56) (0/56) +U+ac00 Hangul Syllables (0/0) (0/0) (0/0) +U+d7b0 Hangul Jamo Extended-B (0/72) (0/72) (0/72) +U+d800 High Surrogates (0/0) (0/0) (0/0) +U+db80 High Private Use Surrogates (0/0) (0/0) (0/0) +U+dc00 Low Surrogates (0/0) (0/0) (0/0) +U+e000 Private Use Area (0/0) (0/0) (0/0) +U+f900 CJK Compatibility Ideographs (0/472) (0/472) (0/472) +U+fb00 Alphabetic Presentation Forms 100% (58/58) 12% (7/58) 3% (2/58) +U+fb50 Arabic Presentation Forms-A 16% (98/611) (0/611) 11% (72/611) +U+fe00 Variation Selectors 100% (16/16) 100% (16/16) (0/16) +U+fe10 Vertical Forms (0/10) (0/10) (0/10) +U+fe20 Combining Half Marks 57% (4/7) (0/7) (0/7) +U+fe30 CJK Compatibility Forms (0/32) (0/32) (0/32) +U+fe50 Small Form Variants (0/26) (0/26) (0/26) +U+fe70 Arabic Presentation Forms-B 100% (141/141) (0/141) 100% (141/141) +U+ff00 Halfwidth and Fullwidth Forms (0/225) (0/225) (0/225) +U+fff0 Specials 100% (5/5) 100% (5/5) 100% (5/5) +U+10000 Linear B Syllabary (0/88) (0/88) (0/88) +U+10080 Linear B Ideograms (0/123) (0/123) (0/123) +U+10100 Aegean Numbers (0/57) (0/57) (0/57) +U+10140 Ancient Greek Numbers (0/75) (0/75) (0/75) +U+10190 Ancient Symbols (0/12) (0/12) (0/12) +U+101d0 Phaistos Disc (0/46) (0/46) (0/46) +U+10280 Lycian (0/29) (0/29) (0/29) +U+102a0 Carian (0/49) (0/49) (0/49) +U+10300 Old Italic 100% (35/35) (0/35) (0/35) +U+10330 Gothic (0/27) (0/27) (0/27) +U+10380 Ugaritic (0/31) (0/31) (0/31) +U+103a0 Old Persian (0/50) (0/50) (0/50) +U+10400 Deseret (0/80) (0/80) (0/80) +U+10450 Shavian (0/48) (0/48) (0/48) +U+10480 Osmanya (0/40) (0/40) (0/40) +U+10800 Cypriot Syllabary (0/55) (0/55) (0/55) +U+10840 Imperial Aramaic (0/31) (0/31) (0/31) +U+10900 Phoenician (0/29) (0/29) (0/29) +U+10920 Lydian (0/27) (0/27) (0/27) +U+10980 Meroitic Hieroglyphs (0/32) (0/32) (0/32) +U+109a0 Meroitic Cursive (0/26) (0/26) (0/26) +U+10a00 Kharoshthi (0/65) (0/65) (0/65) +U+10a60 Old South Arabian (0/32) (0/32) (0/32) +U+10b00 Avestan (0/61) (0/61) (0/61) +U+10b40 Inscriptional Parthian (0/30) (0/30) (0/30) +U+10b60 Inscriptional Pahlavi (0/27) (0/27) (0/27) +U+10c00 Old Turkic (0/73) (0/73) (0/73) +U+10e60 Rumi Numeral Symbols (0/31) (0/31) (0/31) +U+11000 Brahmi (0/108) (0/108) (0/108) +U+11080 Kaithi (0/66) (0/66) (0/66) +U+110d0 Sora Sompeng (0/35) (0/35) (0/35) +U+11100 Chakma (0/67) (0/67) (0/67) +U+11180 Sharada (0/83) (0/83) (0/83) +U+11680 Takri (0/66) (0/66) (0/66) +U+12000 Cuneiform (0/879) (0/879) (0/879) +U+12400 Cuneiform Numbers and Punctuation (0/103) (0/103) (0/103) +U+13000 Egyptian Hieroglyphs (0/1071) (0/1071) (0/1071) +U+16800 Bamum Supplement (0/569) (0/569) (0/569) +U+16f00 Miao (0/133) (0/133) (0/133) +U+1b000 Kana Supplement (0/2) (0/2) (0/2) +U+1d000 Byzantine Musical Symbols (0/246) (0/246) (0/246) +U+1d100 Musical Symbols (0/220) (0/220) (0/220) +U+1d200 Ancient Greek Musical Notation (0/70) (0/70) (0/70) +U+1d300 Tai Xuan Jing Symbols 100% (87/87) (0/87) (0/87) +U+1d360 Counting Rod Numerals (0/18) (0/18) (0/18) +U+1d400 Mathematical Alphanumeric Symbols 11% (117/996) 5% (55/996) 6% (63/996) +U+1ee00 Arabic Mathematical Alphabetic Symbols (0/143) (0/143) (0/143) +U+1f000 Mahjong Tiles (0/44) (0/44) (0/44) +U+1f030 Domino Tiles 100% (100/100) (0/100) (0/100) +U+1f0a0 Playing Cards 100% (59/59) (0/59) (0/59) +U+1f100 Enclosed Alphanumeric Supplement (0/171) (0/171) (0/171) +U+1f200 Enclosed Ideographic Supplement (0/57) (0/57) (0/57) +U+1f300 Miscellaneous Symbols And Pictographs 0% (4/533) (0/533) (0/533) +U+1f600 Emoticons 82% (63/76) (0/76) (0/76) +U+1f680 Transport And Map Symbols (0/70) (0/70) (0/70) +U+1f700 Alchemical Symbols (0/116) (0/116) (0/116) +U+20000 CJK Unified Ideographs Extension B (0/0) (0/0) (0/0) +U+2a700 CJK Unified Ideographs Extension C (0/0) (0/0) (0/0) +U+2b740 CJK Unified Ideographs Extension D (0/0) (0/0) (0/0) +U+2f800 CJK Compatibility Ideographs Supplement (0/542) (0/542) (0/542) +U+e0000 Tags (0/98) (0/98) (0/98) +U+e0100 Variation Selectors Supplement (0/240) (0/240) (0/240) +U+f0000 Supplementary Private Use Area-A (0/0) (0/0) (0/0) +U+100000 Supplementary Private Use Area-B (0/0) (0/0) (0/0) diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-20100919/CREDITS b/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-20100919/CREDITS index 66396e721b2..0b69784b5fd 100644 --- a/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-20100919/CREDITS +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-20100919/CREDITS @@ -352,7 +352,7 @@ please contact mssridhar AT vsnl.com. Noah Levitt found out that the Sinhalese fonts available on the site are released under GNU GPL, or, -precisely, "Public Domain under GNU Licence Produced by DMS +precisely, "Public Domain under GNU Licence Produced by DMS Electronics for The Sri Lanka Tipitaka Project" (taken from the font comment), and took the effort of recoding the font to Unicode. diff --git a/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-20120503/CREDITS b/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-20120503/CREDITS index 06d280e934d..f4430ecf937 100644 --- a/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-20120503/CREDITS +++ b/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-20120503/CREDITS @@ -357,7 +357,7 @@ please contact mssridhar AT vsnl.com. Noah Levitt found out that the Sinhalese fonts available on the site are released under GNU GPL, or, -precisely, "Public Domain under GNU Licence Produced by DMS +precisely, "Public Domain under GNU Licence Produced by DMS Electronics for The Sri Lanka Tipitaka Project" (taken from the font comment), and took the effort of recoding the font to Unicode. diff --git a/htdocs/includes/tecnickcom/tcpdf/include/barcodes/datamatrix.php b/htdocs/includes/tecnickcom/tcpdf/include/barcodes/datamatrix.php index 783f99da4cd..d1cc6d2a90e 100644 --- a/htdocs/includes/tecnickcom/tcpdf/include/barcodes/datamatrix.php +++ b/htdocs/includes/tecnickcom/tcpdf/include/barcodes/datamatrix.php @@ -229,7 +229,7 @@ class Datamatrix { /** * This is the class constructor. * Creates a datamatrix object - * @param $code (string) Code to represent using Datamatrix. + * @param string $code Code to represent using Datamatrix. * @public */ public function __construct($code) { @@ -355,11 +355,11 @@ class Datamatrix { /** * Product of two numbers in a Power-of-Two Galois Field - * @param $a (int) first number to multiply. - * @param $b (int) second number to multiply. - * @param $log (array) Log table. - * @param $alog (array) Anti-Log table. - * @param $gf (array) Number of Factors of the Reed-Solomon polynomial. + * @param int $a first number to multiply. + * @param int $b second number to multiply. + * @param array $log Log table. + * @param array $alog Anti-Log table. + * @param int $gf Number of Factors of the Reed-Solomon polynomial. * @return int product * @protected */ @@ -372,12 +372,12 @@ class Datamatrix { /** * Add error correction codewords to data codewords array (ANNEX E). - * @param $wd (array) Array of datacodewords. - * @param $nb (int) Number of blocks. - * @param $nd (int) Number of data codewords per block. - * @param $nc (int) Number of correction codewords per block. - * @param $gf (int) numner of fields on log/antilog table (power of 2). - * @param $pp (int) The value of its prime modulus polynomial (301 for ECC200). + * @param array $wd Array of datacodewords. + * @param int $nb Number of blocks. + * @param int $nd Number of data codewords per block. + * @param int $nc Number of correction codewords per block. + * @param int $gf numner of fields on log/antilog table (power of 2). + * @param int $pp The value of its prime modulus polynomial (301 for ECC200). * @return array data codewords + error codewords * @protected */ @@ -438,9 +438,9 @@ class Datamatrix { /** * Return the 253-state codeword - * @param $cwpad (int) Pad codeword. - * @param $cwpos (int) Number of data codewords from the beginning of encoded data. - * @return pad codeword + * @param int $cwpad Pad codeword. + * @param int $cwpos Number of data codewords from the beginning of encoded data. + * @return int pad codeword * @protected */ protected function get253StateCodeword($cwpad, $cwpos) { @@ -453,9 +453,9 @@ class Datamatrix { /** * Return the 255-state codeword - * @param $cwpad (int) Pad codeword. - * @param $cwpos (int) Number of data codewords from the beginning of encoded data. - * @return pad codeword + * @param int $cwpad Pad codeword. + * @param int $cwpos Number of data codewords from the beginning of encoded data. + * @return int pad codeword * @protected */ protected function get255StateCodeword($cwpad, $cwpos) { @@ -468,8 +468,8 @@ class Datamatrix { /** * Returns true if the char belongs to the selected mode - * @param $chr (int) Character (byte) to check. - * @param $mode (int) Current encoding mode. + * @param int $chr Character (byte) to check. + * @param int $mode Current encoding mode. * @return boolean true if the char is of the selected mode. * @protected */ @@ -514,9 +514,9 @@ class Datamatrix { /** * The look-ahead test scans the data to be encoded to find the best mode (Annex P - steps from J to S). - * @param $data (string) data to encode - * @param $pos (int) current position - * @param $mode (int) current encoding mode + * @param string $data data to encode + * @param int $pos current position + * @param int $mode current encoding mode * @return int encoding mode * @protected */ @@ -646,8 +646,8 @@ class Datamatrix { /** * Get the switching codeword to a new encoding mode (latch codeword) - * @param $mode (int) New encoding mode. - * @return (int) Switch codeword. + * @param int $mode New encoding mode. + * @return int Switch codeword. * @protected */ protected function getSwitchEncodingCodeword($mode) { @@ -685,8 +685,8 @@ class Datamatrix { /** * Choose the minimum matrix size and return the max number of data codewords. - * @param $numcw (int) Number of current codewords. - * @return number of data codewords in matrix + * @param int $numcw Number of current codewords. + * @return int number of data codewords in matrix * @protected */ protected function getMaxDataCodewords($numcw) { @@ -700,7 +700,7 @@ class Datamatrix { /** * Get high level encoding using the minimum symbol data characters for ECC 200 - * @param $data (string) data to encode + * @param string $data data to encode * @return array of codewords * @protected */ @@ -778,7 +778,7 @@ class Datamatrix { if (isset($this->chset['SH1'][$chr])) { $temp_cw[] = 0; // shift 1 $shiftset = $this->chset['SH1']; - } elseif (isset($chr, $this->chset['SH2'][$chr])) { + } elseif (isset($this->chset['SH2'][$chr])) { $temp_cw[] = 1; // shift 2 $shiftset = $this->chset['SH2']; } elseif (($enc == ENC_C40) AND isset($this->chset['S3C'][$chr])) { @@ -970,13 +970,13 @@ class Datamatrix { /** * Places "chr+bit" with appropriate wrapping within array[]. * (Annex F - ECC 200 symbol character placement) - * @param $marr (array) Array of symbols. - * @param $nrow (int) Number of rows. - * @param $ncol (int) Number of columns. - * @param $row (int) Row number. - * @param $col (int) Column number. - * @param $chr (int) Char byte. - * @param $bit (int) Bit. + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $row Row number. + * @param int $col Column number. + * @param int $chr Char byte. + * @param int $bit Bit. * @return array * @protected */ @@ -996,12 +996,12 @@ class Datamatrix { /** * Places the 8 bits of a utah-shaped symbol character. * (Annex F - ECC 200 symbol character placement) - * @param $marr (array) Array of symbols. - * @param $nrow (int) Number of rows. - * @param $ncol (int) Number of columns. - * @param $row (int) Row number. - * @param $col (int) Column number. - * @param $chr (int) Char byte. + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $row Row number. + * @param int $col Column number. + * @param int $chr Char byte. * @return array * @protected */ @@ -1020,10 +1020,10 @@ class Datamatrix { /** * Places the 8 bits of the first special corner case. * (Annex F - ECC 200 symbol character placement) - * @param $marr (array) Array of symbols. - * @param $nrow (int) Number of rows. - * @param $ncol (int) Number of columns. - * @param $chr (int) Char byte. + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $chr Char byte. * @return array * @protected */ @@ -1042,10 +1042,10 @@ class Datamatrix { /** * Places the 8 bits of the second special corner case. * (Annex F - ECC 200 symbol character placement) - * @param $marr (array) Array of symbols. - * @param $nrow (int) Number of rows. - * @param $ncol (int) Number of columns. - * @param $chr (int) Char byte. + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $chr Char byte. * @return array * @protected */ @@ -1064,10 +1064,10 @@ class Datamatrix { /** * Places the 8 bits of the third special corner case. * (Annex F - ECC 200 symbol character placement) - * @param $marr (array) Array of symbols. - * @param $nrow (int) Number of rows. - * @param $ncol (int) Number of columns. - * @param $chr (int) Char byte. + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $chr Char byte. * @return array * @protected */ @@ -1086,10 +1086,10 @@ class Datamatrix { /** * Places the 8 bits of the fourth special corner case. * (Annex F - ECC 200 symbol character placement) - * @param $marr (array) Array of symbols. - * @param $nrow (int) Number of rows. - * @param $ncol (int) Number of columns. - * @param $chr (int) Char byte. + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $chr Char byte. * @return array * @protected */ @@ -1108,8 +1108,8 @@ class Datamatrix { /** * Build a placement map. * (Annex F - ECC 200 symbol character placement) - * @param $nrow (int) Number of rows. - * @param $ncol (int) Number of columns. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. * @return array * @protected */ diff --git a/htdocs/includes/tecnickcom/tcpdf/include/barcodes/pdf417.php b/htdocs/includes/tecnickcom/tcpdf/include/barcodes/pdf417.php index 3b1774eaae4..bda24822ff6 100644 --- a/htdocs/includes/tecnickcom/tcpdf/include/barcodes/pdf417.php +++ b/htdocs/includes/tecnickcom/tcpdf/include/barcodes/pdf417.php @@ -523,10 +523,10 @@ class PDF417 { /** * This is the class constructor. * Creates a PDF417 object - * @param $code (string) code to represent using PDF417 - * @param $ecl (int) error correction level (0-8); default -1 = automatic correction level - * @param $aspectratio (float) the width to height of the symbol (excluding quiet zones) - * @param $macro (array) information for macro block + * @param string $code code to represent using PDF417 + * @param int $ecl error correction level (0-8); default -1 = automatic correction level + * @param float $aspectratio the width to height of the symbol (excluding quiet zones) + * @param array $macro information for macro block * @public */ public function __construct($code, $ecl=-1, $aspectratio=2, $macro=array()) { @@ -734,12 +734,13 @@ class PDF417 { /** * Returns the error correction level (0-8) to be used - * @param $ecl (int) error correction level - * @param $numcw (int) number of data codewords + * @param int $ecl error correction level + * @param int $numcw number of data codewords * @return int error correction level * @protected */ protected function getErrorCorrectionLevel($ecl, $numcw) { + $maxecl = 8; // starting error level // check for automatic levels if (($ecl < 0) OR ($ecl > 8)) { if ($numcw < 41) { @@ -755,7 +756,6 @@ class PDF417 { } } // get maximum correction level - $maxecl = 8; // starting error level $maxerrsize = (928 - $numcw); // available codewords for error while ($maxecl > 0) { $errsize = (2 << $ecl); @@ -772,8 +772,8 @@ class PDF417 { /** * Returns the error correction codewords - * @param $cw (array) array of codewords including Symbol Length Descriptor and pad - * @param $ecl (int) error correction level 0-8 + * @param array $cw array of codewords including Symbol Length Descriptor and pad + * @param int $ecl error correction level 0-8 * @return array of error correction codewords * @protected */ @@ -809,8 +809,8 @@ class PDF417 { /** * Create array of sequences from input - * @param $code (string) code - * @return bidimensional array containing characters and classification + * @param string $code code + * @return array bi-dimensional array containing characters and classification * @protected */ protected function getInputSequences($code) { @@ -864,9 +864,9 @@ class PDF417 { /** * Compact data by mode. - * @param $mode (int) compaction mode number - * @param $code (string) data to compact - * @param $addmode (boolean) if true add the mode codeword at first position + * @param int $mode compaction mode number + * @param string $code data to compact + * @param boolean $addmode if true add the mode codeword at first position * @return array of codewords * @protected */ @@ -878,7 +878,7 @@ class PDF417 { $txtarr = array(); // array of characters and sub-mode switching characters $codelen = strlen($code); for ($i = 0; $i < $codelen; ++$i) { - $chval = ord($code{$i}); + $chval = ord($code[$i]); if (($k = array_search($chval, $this->textsubmodes[$submode])) !== false) { // we are on the same sub-mode $txtarr[] = $k; @@ -888,7 +888,7 @@ class PDF417 { // search new sub-mode if (($s != $submode) AND (($k = array_search($chval, $this->textsubmodes[$s])) !== false)) { // $s is the new submode - if (((($i + 1) == $codelen) OR ((($i + 1) < $codelen) AND (array_search(ord($code{($i + 1)}), $this->textsubmodes[$submode]) !== false))) AND (($s == 3) OR (($s == 0) AND ($submode == 1)))) { + if (((($i + 1) == $codelen) OR ((($i + 1) < $codelen) AND (array_search(ord($code[($i + 1)]), $this->textsubmodes[$submode]) !== false))) AND (($s == 3) OR (($s == 0) AND ($submode == 1)))) { // shift (temporary change only for this char) if ($s == 3) { // shift to puntuaction @@ -943,8 +943,8 @@ class PDF417 { // tmp array for the 6 bytes block $cw6 = array(); do { - $d = bcmod($t, '900'); - $t = bcdiv($t, '900'); + $d = bcmod($t, '900', 0); + $t = bcdiv($t, '900', 0); // prepend the value to the beginning of the array array_unshift($cw6, $d); } while ($t != '0'); @@ -952,7 +952,7 @@ class PDF417 { $cw = array_merge($cw, $cw6); } else { for ($i = 0; $i < $sublen; ++$i) { - $cw[] = ord($code{$i}); + $cw[] = ord($code[$i]); } } $code = $rest; @@ -969,8 +969,8 @@ class PDF417 { } $t = '1'.$code; do { - $d = bcmod($t, '900'); - $t = bcdiv($t, '900'); + $d = bcmod($t, '900', 0); + $t = bcdiv($t, '900', 0); array_unshift($cw, $d); } while ($t != '0'); $code = $rest; diff --git a/htdocs/includes/tecnickcom/tcpdf/include/barcodes/qrcode.php b/htdocs/includes/tecnickcom/tcpdf/include/barcodes/qrcode.php index 59e73e25984..225bc023841 100644 --- a/htdocs/includes/tecnickcom/tcpdf/include/barcodes/qrcode.php +++ b/htdocs/includes/tecnickcom/tcpdf/include/barcodes/qrcode.php @@ -248,32 +248,6 @@ if (!defined('QRCODEDEFS')) { } // end of definitions -// #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*# - -// for compatibility with PHP4 -if (!function_exists('str_split')) { - /** - * Convert a string to an array (needed for PHP4 compatibility) - * @param $string (string) The input string. - * @param $split_length (int) Maximum length of the chunk. - * @return If the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string , the entire string is returned as the first (and only) array element. - */ - function str_split($string, $split_length=1) { - if ((strlen($string) > $split_length) OR (!$split_length)) { - do { - $c = strlen($string); - $parts[] = substr($string, 0, $split_length); - $string = substr($string, $split_length); - } while ($string !== false); - } else { - $parts = array($string); - } - return $parts; - } -} - -// ##################################################### - /** * @class QRcode * Class to create QR-code arrays for TCPDF class. @@ -632,8 +606,8 @@ class QRcode { /** * This is the class constructor. * Creates a QRcode object - * @param $code (string) code to represent using QRcode - * @param $eclevel (string) error level:
  • L : About 7% or less errors can be corrected.
  • M : About 15% or less errors can be corrected.
  • Q : About 25% or less errors can be corrected.
  • H : About 30% or less errors can be corrected.
+ * @param string $code code to represent using QRcode + * @param string $eclevel error level:
  • L : About 7% or less errors can be corrected.
  • M : About 15% or less errors can be corrected.
  • Q : About 25% or less errors can be corrected.
  • H : About 30% or less errors can be corrected.
* @public * @since 1.0.000 */ @@ -684,7 +658,7 @@ class QRcode { /** * Convert the frame in binary form - * @param $frame (array) array to binarize + * @param array $frame array to binarize * @return array frame in binary form */ protected function binarize($frame) { @@ -700,7 +674,7 @@ class QRcode { /** * Encode the input string to QR code - * @param $string (string) input string to encode + * @param string $string input string to encode */ protected function encodeString($string) { $this->dataStr = $string; @@ -716,7 +690,7 @@ class QRcode { /** * Encode mask - * @param $mask (int) masking mode + * @param int $mask masking mode */ protected function encodeMask($mask) { $spec = array(0, 0, 0, 0, 0); @@ -781,8 +755,8 @@ class QRcode { /** * Set frame value at specified position - * @param $at (array) x,y position - * @param $val (int) value of the character to set + * @param array $at x,y position + * @param int $val value of the character to set */ protected function setFrameAt($at, $val) { $this->frame[$at['y']][$at['x']] = chr($val); @@ -790,7 +764,7 @@ class QRcode { /** * Get frame value at specified position - * @param $at (array) x,y position + * @param array $at x,y position * @return value at specified position */ protected function getFrameAt($at) { @@ -854,8 +828,8 @@ class QRcode { /** * Initialize code. - * @param $spec (array) array of ECC specification - * @return 0 in case of success, -1 in case of error + * @param array $spec array of ECC specification + * @return int 0 in case of success, -1 in case of error */ protected function init($spec) { $dl = $this->rsDataCodes1($spec); @@ -911,14 +885,15 @@ class QRcode { protected function getCode() { if ($this->count < $this->dataLength) { $row = $this->count % $this->blocks; - $col = $this->count / $this->blocks; + $col = (int)($this->count / $this->blocks); if ($col >= $this->rsblocks[0]['dataLength']) { $row += $this->b1; } + $row = (int) $row; $ret = $this->rsblocks[$row]['data'][$col]; } elseif ($this->count < $this->dataLength + $this->eccLength) { $row = ($this->count - $this->dataLength) % $this->blocks; - $col = ($this->count - $this->dataLength) / $this->blocks; + $col = (int)(($this->count - $this->dataLength) / $this->blocks); $ret = $this->rsblocks[$row]['ecc'][$col]; } else { return 0; @@ -933,10 +908,10 @@ class QRcode { /** * Write Format Information on frame and returns the number of black bits - * @param $width (int) frame width - * @param $frame (array) frame - * @param $mask (array) masking mode - * @param $level (int) error correction level + * @param int $width frame width + * @param array $frame frame + * @param array $mask masking mode + * @param int $level error correction level * @return int blacks */ protected function writeFormatInformation($width, &$frame, $mask, $level) { @@ -977,8 +952,8 @@ class QRcode { /** * mask0 - * @param $x (int) X position - * @param $y (int) Y position + * @param int $x X position + * @param int $y Y position * @return int mask */ protected function mask0($x, $y) { @@ -987,8 +962,8 @@ class QRcode { /** * mask1 - * @param $x (int) X position - * @param $y (int) Y position + * @param int $x X position + * @param int $y Y position * @return int mask */ protected function mask1($x, $y) { @@ -997,8 +972,8 @@ class QRcode { /** * mask2 - * @param $x (int) X position - * @param $y (int) Y position + * @param int $x X position + * @param int $y Y position * @return int mask */ protected function mask2($x, $y) { @@ -1007,8 +982,8 @@ class QRcode { /** * mask3 - * @param $x (int) X position - * @param $y (int) Y position + * @param int $x X position + * @param int $y Y position * @return int mask */ protected function mask3($x, $y) { @@ -1017,8 +992,8 @@ class QRcode { /** * mask4 - * @param $x (int) X position - * @param $y (int) Y position + * @param int $x X position + * @param int $y Y position * @return int mask */ protected function mask4($x, $y) { @@ -1027,8 +1002,8 @@ class QRcode { /** * mask5 - * @param $x (int) X position - * @param $y (int) Y position + * @param int $x X position + * @param int $y Y position * @return int mask */ protected function mask5($x, $y) { @@ -1037,8 +1012,8 @@ class QRcode { /** * mask6 - * @param $x (int) X position - * @param $y (int) Y position + * @param int $x X position + * @param int $y Y position * @return int mask */ protected function mask6($x, $y) { @@ -1047,8 +1022,8 @@ class QRcode { /** * mask7 - * @param $x (int) X position - * @param $y (int) Y position + * @param int $x X position + * @param int $y Y position * @return int mask */ protected function mask7($x, $y) { @@ -1057,9 +1032,9 @@ class QRcode { /** * Return bitmask - * @param $maskNo (int) mask number - * @param $width (int) width - * @param $frame (array) frame + * @param int $maskNo mask number + * @param int $width width + * @param array $frame frame * @return array bitmask */ protected function generateMaskNo($maskNo, $width, $frame) { @@ -1079,17 +1054,17 @@ class QRcode { /** * makeMaskNo - * @param $maskNo (int) - * @param $width (int) - * @param $s (int) - * @param $d (int) - * @param $maskGenOnly (boolean) + * @param int $maskNo + * @param int $width + * @param int $s + * @param int $d + * @param boolean $maskGenOnly * @return int b */ protected function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly=false) { $b = 0; $bitMask = array(); - $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); + $bitMask = $this->generateMaskNo($maskNo, $width, $s); if ($maskGenOnly) { return; } @@ -1107,10 +1082,10 @@ class QRcode { /** * makeMask - * @param $width (int) - * @param $frame (array) - * @param $maskNo (int) - * @param $level (int) + * @param int $width + * @param array $frame + * @param int $maskNo + * @param int $level * @return array mask */ protected function makeMask($width, $frame, $maskNo, $level) { @@ -1122,7 +1097,7 @@ class QRcode { /** * calcN1N3 - * @param $length (int) + * @param int $length * @return int demerit */ protected function calcN1N3($length) { @@ -1152,8 +1127,8 @@ class QRcode { /** * evaluateSymbol - * @param $width (int) - * @param $frame (array) + * @param int $width + * @param array $frame * @return int demerit */ protected function evaluateSymbol($width, $frame) { @@ -1213,9 +1188,9 @@ class QRcode { /** * mask - * @param $width (int) - * @param $frame (array) - * @param $level (int) + * @param int $width + * @param array $frame + * @param int $level * @return array best mask */ protected function mask($width, $frame, $level) { @@ -1256,8 +1231,8 @@ class QRcode { /** * Return true if the character at specified position is a number - * @param $str (string) string - * @param $pos (int) characted position + * @param string $str string + * @param int $pos characted position * @return boolean true of false */ protected function isdigitat($str, $pos) { @@ -1269,8 +1244,8 @@ class QRcode { /** * Return true if the character at specified position is an alphanumeric character - * @param $str (string) string - * @param $pos (int) characted position + * @param string $str string + * @param int $pos characted position * @return boolean true of false */ protected function isalnumat($str, $pos) { @@ -1282,7 +1257,7 @@ class QRcode { /** * identifyMode - * @param $pos (int) + * @param int $pos * @return int mode */ protected function identifyMode($pos) { @@ -1387,6 +1362,7 @@ class QRcode { $p += 2; } $this->items = $this->appendNewInputItem($this->items, QR_MODE_KJ, $p, str_split($this->dataStr)); + $run = $p; return $run; } @@ -1441,7 +1417,7 @@ class QRcode { /** * splitString - * @return (int) + * @return int */ protected function splitString() { while (strlen($this->dataStr) > 0) { @@ -1456,7 +1432,7 @@ class QRcode { break; } case QR_MODE_KJ: { - if ($hint == QR_MODE_KJ) { + if ($this->hint == QR_MODE_KJ) { $length = $this->eatKanji(); } else { $length = $this->eat8(); @@ -1486,7 +1462,7 @@ class QRcode { $stringLen = strlen($this->dataStr); $p = 0; while ($p < $stringLen) { - $mode = $this->identifyMode(substr($this->dataStr, $p), $this->hint); + $mode = $this->identifyMode(substr($this->dataStr, $p)); if ($mode == QR_MODE_KJ) { $p += 2; } else { @@ -1505,10 +1481,10 @@ class QRcode { /** * newInputItem - * @param $mode (int) - * @param $size (int) - * @param $data (array) - * @param $bstream (array) + * @param int $mode + * @param int $size + * @param array $data + * @param array $bstream * @return array input item */ protected function newInputItem($mode, $size, $data, $bstream=null) { @@ -1529,8 +1505,8 @@ class QRcode { /** * encodeModeNum - * @param $inputitem (array) - * @param $version (int) + * @param array $inputitem + * @param int $version * @return array input item */ protected function encodeModeNum($inputitem, $version) { @@ -1558,8 +1534,8 @@ class QRcode { /** * encodeModeAn - * @param $inputitem (array) - * @param $version (int) + * @param array $inputitem + * @param int $version * @return array input item */ protected function encodeModeAn($inputitem, $version) { @@ -1581,8 +1557,8 @@ class QRcode { /** * encodeMode8 - * @param $inputitem (array) - * @param $version (int) + * @param array $inputitem + * @param int $version * @return array input item */ protected function encodeMode8($inputitem, $version) { @@ -1597,8 +1573,8 @@ class QRcode { /** * encodeModeKanji - * @param $inputitem (array) - * @param $version (int) + * @param array $inputitem + * @param int $version * @return array input item */ protected function encodeModeKanji($inputitem, $version) { @@ -1621,7 +1597,7 @@ class QRcode { /** * encodeModeStructure - * @param $inputitem (array) + * @param array $inputitem * @return array input item */ protected function encodeModeStructure($inputitem) { @@ -1635,8 +1611,8 @@ class QRcode { /** * encodeBitStream - * @param $inputitem (array) - * @param $version (int) + * @param array $inputitem + * @param int $version * @return array input item */ protected function encodeBitStream($inputitem, $version) { @@ -1687,11 +1663,11 @@ class QRcode { /** * Append data to an input object. * The data is copied and appended to the input object. - * @param $items (arrray) input items - * @param $mode (int) encoding mode. - * @param $size (int) size of data (byte). - * @param $data (array) array of input data. - * @return items + * @param array $items input items + * @param int $mode encoding mode. + * @param int $size size of data (byte). + * @param array $data array of input data. + * @return array items * */ protected function appendNewInputItem($items, $mode, $size, $data) { @@ -1704,10 +1680,10 @@ class QRcode { /** * insertStructuredAppendHeader - * @param $items (array) - * @param $size (int) - * @param $index (int) - * @param $parity (int) + * @param array $items + * @param int $size + * @param int $index + * @param int $parity * @return array items */ protected function insertStructuredAppendHeader($items, $size, $index, $parity) { @@ -1718,14 +1694,14 @@ class QRcode { return -1; } $buf = array($size, $index, $parity); - $entry = $this->newInputItem(QR_MODE_ST, 3, buf); + $entry = $this->newInputItem(QR_MODE_ST, 3, $buf); array_unshift($items, $entry); return $items; } /** * calcParity - * @param $items (array) + * @param array $items * @return int parity */ protected function calcParity($items) { @@ -1742,8 +1718,8 @@ class QRcode { /** * checkModeNum - * @param $size (int) - * @param $data (array) + * @param int $size + * @param array $data * @return boolean true or false */ protected function checkModeNum($size, $data) { @@ -1756,9 +1732,9 @@ class QRcode { } /** - * Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19). - * @param $c (int) character value - * @return value + * Look up the alphabet-numeric conversion table (see JIS X0510:2004, pp.19). + * @param int $c character value + * @return int value */ protected function lookAnTable($c) { return (($c > 127)?-1:$this->anTable[$c]); @@ -1766,8 +1742,8 @@ class QRcode { /** * checkModeAn - * @param $size (int) - * @param $data (array) + * @param int $size + * @param array $data * @return boolean true or false */ protected function checkModeAn($size, $data) { @@ -1781,7 +1757,7 @@ class QRcode { /** * estimateBitsModeNum - * @param $size (int) + * @param int $size * @return int number of bits */ protected function estimateBitsModeNum($size) { @@ -1802,7 +1778,7 @@ class QRcode { /** * estimateBitsModeAn - * @param $size (int) + * @param int $size * @return int number of bits */ protected function estimateBitsModeAn($size) { @@ -1815,7 +1791,7 @@ class QRcode { /** * estimateBitsMode8 - * @param $size (int) + * @param int $size * @return int number of bits */ protected function estimateBitsMode8($size) { @@ -1824,7 +1800,7 @@ class QRcode { /** * estimateBitsModeKanji - * @param $size (int) + * @param int $size * @return int number of bits */ protected function estimateBitsModeKanji($size) { @@ -1833,8 +1809,8 @@ class QRcode { /** * checkModeKanji - * @param $size (int) - * @param $data (array) + * @param int $size + * @param array $data * @return boolean true or false */ protected function checkModeKanji($size, $data) { @@ -1852,9 +1828,9 @@ class QRcode { /** * Validate the input data. - * @param $mode (int) encoding mode. - * @param $size (int) size of data (byte). - * @param $data (array) data to validate + * @param int $mode encoding mode. + * @param int $size size of data (byte). + * @param array $data data to validate * @return boolean true in case of valid data, false otherwise */ protected function check($mode, $size, $data) { @@ -1886,8 +1862,8 @@ class QRcode { /** * estimateBitStreamSize - * @param $items (array) - * @param $version (int) + * @param array $items + * @param int $version * @return int bits */ protected function estimateBitStreamSize($items, $version) { @@ -1930,7 +1906,7 @@ class QRcode { /** * estimateVersion - * @param $items (array) + * @param array $items * @return int version */ protected function estimateVersion($items) { @@ -1949,9 +1925,9 @@ class QRcode { /** * lengthOfCode - * @param $mode (int) - * @param $version (int) - * @param $bits (int) + * @param int $mode + * @param int $version + * @param int $bits * @return int size */ protected function lengthOfCode($mode, $version, $bits) { @@ -2006,7 +1982,7 @@ class QRcode { /** * createBitStream - * @param $items (array) + * @param array $items * @return array of items and total bits */ protected function createBitStream($items) { @@ -2021,7 +1997,7 @@ class QRcode { /** * convertData - * @param $items (array) + * @param array $items * @return array items */ protected function convertData($items) { @@ -2050,7 +2026,7 @@ class QRcode { /** * Append Padding Bit to bitstream - * @param $bstream (array) + * @param array $bstream * @return array bitstream */ protected function appendPaddingBit($bstream) { @@ -2083,7 +2059,7 @@ class QRcode { /** * mergeBitStream - * @param $items (array) items + * @param array $items items * @return array bitstream */ protected function mergeBitStream($items) { @@ -2100,7 +2076,7 @@ class QRcode { /** * Returns a stream of bits. - * @param $items (int) + * @param int $items * @return array padded merged byte stream */ protected function getBitStream($items) { @@ -2110,7 +2086,7 @@ class QRcode { /** * Pack all bit streams padding bits into a byte array. - * @param $items (int) + * @param int $items * @return array padded merged byte stream */ protected function getByteStream($items) { @@ -2124,7 +2100,7 @@ class QRcode { /** * Return an array with zeros - * @param $setLength (int) array size + * @param int $setLength array size * @return array */ protected function allocate($setLength) { @@ -2133,8 +2109,8 @@ class QRcode { /** * Return new bitstream from number - * @param $bits (int) number of bits - * @param $num (int) number + * @param int $bits number of bits + * @param int $num number * @return array bitstream */ protected function newFromNum($bits, $num) { @@ -2153,8 +2129,8 @@ class QRcode { /** * Return new bitstream from bytes - * @param $size (int) size - * @param $data (array) bytes + * @param int $size size + * @param array $data bytes * @return array bitstream */ protected function newFromBytes($size, $data) { @@ -2177,8 +2153,8 @@ class QRcode { /** * Append one bitstream to another - * @param $bitstream (array) original bitstream - * @param $append (array) bitstream to append + * @param array $bitstream original bitstream + * @param array $append bitstream to append * @return array bitstream */ protected function appendBitstream($bitstream, $append) { @@ -2193,9 +2169,9 @@ class QRcode { /** * Append one bitstream created from number to another - * @param $bitstream (array) original bitstream - * @param $bits (int) number of bits - * @param $num (int) number + * @param array $bitstream original bitstream + * @param int $bits number of bits + * @param int $num number * @return array bitstream */ protected function appendNum($bitstream, $bits, $num) { @@ -2208,9 +2184,9 @@ class QRcode { /** * Append one bitstream created from bytes to another - * @param $bitstream (array) original bitstream - * @param $size (int) size - * @param $data (array) bytes + * @param array $bitstream original bitstream + * @param int $size size + * @param array $data bytes * @return array bitstream */ protected function appendBytes($bitstream, $size, $data) { @@ -2223,7 +2199,7 @@ class QRcode { /** * Convert bitstream to bytes - * @param $bstream (array) original bitstream + * @param array $bstream original bitstream * @return array of bytes */ protected function bitstreamToByte($bstream) { @@ -2264,11 +2240,11 @@ class QRcode { /** * Replace a value on the array at the specified position - * @param $srctab (array) - * @param $x (int) X position - * @param $y (int) Y position - * @param $repl (string) value to replace - * @param $replLen (int) length of the repl string + * @param array $srctab + * @param int $x X position + * @param int $y Y position + * @param string $repl value to replace + * @param int $replLen length of the repl string * @return array srctab */ protected function qrstrset($srctab, $x, $y, $repl, $replLen=false) { @@ -2278,8 +2254,8 @@ class QRcode { /** * Return maximum data code length (bytes) for the version. - * @param $version (int) version - * @param $level (int) error correction level + * @param int $version version + * @param int $level error correction level * @return int maximum size (bytes) */ protected function getDataLength($version, $level) { @@ -2288,8 +2264,8 @@ class QRcode { /** * Return maximum error correction code length (bytes) for the version. - * @param $version (int) version - * @param $level (int) error correction level + * @param int $version version + * @param int $level error correction level * @return int ECC size (bytes) */ protected function getECCLength($version, $level){ @@ -2298,7 +2274,7 @@ class QRcode { /** * Return the width of the symbol for the version. - * @param $version (int) version + * @param int $version version * @return int width */ protected function getWidth($version) { @@ -2307,7 +2283,7 @@ class QRcode { /** * Return the numer of remainder bits. - * @param $version (int) version + * @param int $version version * @return int number of remainder bits */ protected function getRemainder($version) { @@ -2316,8 +2292,8 @@ class QRcode { /** * Return a version number that satisfies the input code length. - * @param $size (int) input code length (bytes) - * @param $level (int) error correction level + * @param int $size input code length (bytes) + * @param int $level error correction level * @return int version number */ protected function getMinimumVersion($size, $level) { @@ -2333,8 +2309,8 @@ class QRcode { /** * Return the size of length indicator for the mode and version. - * @param $mode (int) encoding mode - * @param $version (int) version + * @param int $mode encoding mode + * @param int $version version * @return int the size of the appropriate length indicator (bits). */ protected function lengthIndicator($mode, $version) { @@ -2353,8 +2329,8 @@ class QRcode { /** * Return the maximum length for the mode and version. - * @param $mode (int) encoding mode - * @param $version (int) version + * @param int $mode encoding mode + * @param int $version version * @return int the maximum length (bytes) */ protected function maximumWords($mode, $version) { @@ -2378,9 +2354,9 @@ class QRcode { /** * Return an array of ECC specification. - * @param $version (int) version - * @param $level (int) error correction level - * @param $spec (array) an array of ECC specification contains as following: {# of type1 blocks, # of data code, # of ecc code, # of type2 blocks, # of data code} + * @param int $version version + * @param int $level error correction level + * @param array $spec an array of ECC specification contains as following: {# of type1 blocks, # of data code, # of ecc code, # of type2 blocks, # of data code} * @return array spec */ protected function getEccSpec($version, $level, $spec) { @@ -2409,9 +2385,9 @@ class QRcode { /** * Put an alignment marker. - * @param $frame (array) frame - * @param $ox (int) X center coordinate of the pattern - * @param $oy (int) Y center coordinate of the pattern + * @param array $frame frame + * @param int $ox X center coordinate of the pattern + * @param int $oy Y center coordinate of the pattern * @return array frame */ protected function putAlignmentMarker($frame, $ox, $oy) { @@ -2432,9 +2408,9 @@ class QRcode { /** * Put an alignment pattern. - * @param $version (int) version - * @param $frame (array) frame - * @param $width (int) width + * @param int $version version + * @param array $frame frame + * @param int $width width * @return array frame */ protected function putAlignmentPattern($version, $frame, $width) { @@ -2474,8 +2450,8 @@ class QRcode { /** * Return BCH encoded version information pattern that is used for the symbol of version 7 or greater. Use lower 18 bits. - * @param $version (int) version - * @return BCH encoded version information pattern + * @param int $version version + * @return string BCH encoded version information pattern */ protected function getVersionPattern($version) { if (($version < 7) OR ($version > QRSPEC_VERSION_MAX)) { @@ -2486,9 +2462,9 @@ class QRcode { /** * Return BCH encoded format information pattern. - * @param $mask (array) - * @param $level (int) error correction level - * @return BCH encoded format information pattern + * @param array $mask + * @param int $level error correction level + * @return string BCH encoded format information pattern */ protected function getFormatInfo($mask, $level) { if (($mask < 0) OR ($mask > 7)) { @@ -2502,9 +2478,9 @@ class QRcode { /** * Put a finder pattern. - * @param $frame (array) frame - * @param $ox (int) X center coordinate of the pattern - * @param $oy (int) Y center coordinate of the pattern + * @param array $frame frame + * @param int $ox X center coordinate of the pattern + * @param int $oy Y center coordinate of the pattern * @return array frame */ protected function putFinderPattern($frame, $ox, $oy) { @@ -2525,8 +2501,8 @@ class QRcode { /** * Return a copy of initialized frame. - * @param $version (int) version - * @return Array of unsigned char. + * @param int $version version + * @return array array of unsigned char. */ protected function createFrame($version) { $width = $this->capacity[$version][QRCAP_WIDTH]; @@ -2590,8 +2566,8 @@ class QRcode { /** * Set new frame for the specified version. - * @param $version (int) version - * @return Array of unsigned char. + * @param int $version version + * @return array array of unsigned char. */ protected function newFrame($version) { if (($version < 1) OR ($version > QRSPEC_VERSION_MAX)) { @@ -2608,7 +2584,7 @@ class QRcode { /** * Return block number 0 - * @param $spec (array) + * @param array $spec * @return int value */ protected function rsBlockNum($spec) { @@ -2617,7 +2593,7 @@ class QRcode { /** * Return block number 1 - * @param $spec (array) + * @param array $spec * @return int value */ protected function rsBlockNum1($spec) { @@ -2626,7 +2602,7 @@ class QRcode { /** * Return data codes 1 - * @param $spec (array) + * @param array $spec * @return int value */ protected function rsDataCodes1($spec) { @@ -2635,7 +2611,7 @@ class QRcode { /** * Return ecc codes 1 - * @param $spec (array) + * @param array $spec * @return int value */ protected function rsEccCodes1($spec) { @@ -2644,7 +2620,7 @@ class QRcode { /** * Return block number 2 - * @param $spec (array) + * @param array $spec * @return int value */ protected function rsBlockNum2($spec) { @@ -2653,7 +2629,7 @@ class QRcode { /** * Return data codes 2 - * @param $spec (array) + * @param array $spec * @return int value */ protected function rsDataCodes2($spec) { @@ -2662,7 +2638,7 @@ class QRcode { /** * Return ecc codes 2 - * @param $spec (array) + * @param array $spec * @return int value */ protected function rsEccCodes2($spec) { @@ -2671,7 +2647,7 @@ class QRcode { /** * Return data length - * @param $spec (array) + * @param array $spec * @return int value */ protected function rsDataLength($spec) { @@ -2680,7 +2656,7 @@ class QRcode { /** * Return ecc length - * @param $spec (array) + * @param array $spec * @return int value */ protected function rsEccLength($spec) { @@ -2693,12 +2669,12 @@ class QRcode { /** * Initialize a Reed-Solomon codec and add it to existing rsitems - * @param $symsize (int) symbol size, bits - * @param $gfpoly (int) Field generator polynomial coefficients - * @param $fcr (int) first root of RS code generator polynomial, index form - * @param $prim (int) primitive element to generate polynomial roots - * @param $nroots (int) RS code generator polynomial degree (number of roots) - * @param $pad (int) padding bytes at front of shortened block + * @param int $symsize symbol size, bits + * @param int $gfpoly Field generator polynomial coefficients + * @param int $fcr first root of RS code generator polynomial, index form + * @param int $prim primitive element to generate polynomial roots + * @param int $nroots RS code generator polynomial degree (number of roots) + * @param int $pad padding bytes at front of shortened block * @return array Array of RS values:
  • mm = Bits per symbol;
  • nn = Symbols per block;
  • alpha_to = log lookup table array;
  • index_of = Antilog lookup table array;
  • genpoly = Generator polynomial array;
  • nroots = Number of generator;
  • roots = number of parity symbols;
  • fcr = First consecutive root, index form;
  • prim = Primitive element, index form;
  • iprim = prim-th root of 1, index form;
  • pad = Padding bytes in shortened block;
  • gfpoly
. */ protected function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) { @@ -2720,8 +2696,8 @@ class QRcode { /** * modnn - * @param $rs (array) RS values - * @param $x (int) X position + * @param array $rs RS values + * @param int $x X position * @return int X osition */ protected function modnn($rs, $x) { @@ -2734,12 +2710,12 @@ class QRcode { /** * Initialize a Reed-Solomon codec and returns an array of values. - * @param $symsize (int) symbol size, bits - * @param $gfpoly (int) Field generator polynomial coefficients - * @param $fcr (int) first root of RS code generator polynomial, index form - * @param $prim (int) primitive element to generate polynomial roots - * @param $nroots (int) RS code generator polynomial degree (number of roots) - * @param $pad (int) padding bytes at front of shortened block + * @param int $symsize symbol size, bits + * @param int $gfpoly Field generator polynomial coefficients + * @param int $fcr first root of RS code generator polynomial, index form + * @param int $prim primitive element to generate polynomial roots + * @param int $nroots RS code generator polynomial degree (number of roots) + * @param int $pad padding bytes at front of shortened block * @return array Array of RS values:
  • mm = Bits per symbol;
  • nn = Symbols per block;
  • alpha_to = log lookup table array;
  • index_of = Antilog lookup table array;
  • genpoly = Generator polynomial array;
  • nroots = Number of generator;
  • roots = number of parity symbols;
  • fcr = First consecutive root, index form;
  • prim = Primitive element, index form;
  • iprim = prim-th root of 1, index form;
  • pad = Padding bytes in shortened block;
  • gfpoly
. */ protected function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) { @@ -2821,9 +2797,9 @@ class QRcode { /** * Encode a Reed-Solomon codec and returns the parity array - * @param $rs (array) RS values - * @param $data (array) data - * @param $parity (array) parity + * @param array $rs RS values + * @param array $data data + * @param array $parity parity * @return parity array */ protected function encode_rs_char($rs, $data, $parity) { diff --git a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_colors.php b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_colors.php index 27fb7afd192..5a51594c317 100644 --- a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_colors.php +++ b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_colors.php @@ -240,9 +240,9 @@ class TCPDF_COLORS { /** * Return the Spot color array. - * @param $name (string) Name of the spot color. - * @param $spotc (array) Reference to an array of spot colors. - * @return (array) Spot color array or false if not defined. + * @param string $name Name of the spot color. + * @param array $spotc Reference to an array of spot colors. + * @return array|false Spot color array or false if not defined. * @since 5.9.125 (2011-10-03) * @public static */ @@ -264,10 +264,10 @@ class TCPDF_COLORS { /** * Returns an array (RGB or CMYK) from an html color name, or a six-digit (i.e. #3FE5AA), or three-digit (i.e. #7FF) hexadecimal color, or a javascript color array, or javascript color name. - * @param $hcolor (string) HTML color. - * @param $spotc (array) Reference to an array of spot colors. - * @param $defcol (array) Color to return in case of error. - * @return array RGB or CMYK color, or false in case of error. + * @param string $hcolor HTML color. + * @param array $spotc Reference to an array of spot colors. + * @param array $defcol Color to return in case of error. + * @return array|false RGB or CMYK color, or false in case of error. * @public static */ public static function convertHTMLColorToDec($hcolor, &$spotc, $defcol=array('R'=>128,'G'=>128,'B'=>128)) { @@ -275,7 +275,7 @@ class TCPDF_COLORS { $color = strtolower($color); // check for javascript color array syntax if (strpos($color, '[') !== false) { - if (preg_match('/[\[][\"\'](t|g|rgb|cmyk)[\"\'][\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\]]/', $color, $m) > 0) { + if (preg_match('/[\[][\"\'](t|g|rgb|cmyk)[\"\'][\,]?([0-9\.]*+)[\,]?([0-9\.]*+)[\,]?([0-9\.]*+)[\,]?([0-9\.]*+)[\]]/', $color, $m) > 0) { $returncolor = array(); switch ($m[1]) { case 'cmyk': { @@ -407,8 +407,8 @@ class TCPDF_COLORS { /** * Convert a color array into a string representation. - * @param $c (array) Array of colors. - * @return (string) The color array representation. + * @param array $c Array of colors. + * @return string The color array representation. * @since 5.9.137 (2011-12-01) * @public static */ @@ -438,7 +438,7 @@ class TCPDF_COLORS { /** * Convert color to javascript color. - * @param $color (string) color name or "#RRGGBB" + * @param string $color color name or "#RRGGBB" * @protected * @since 2.1.002 (2008-02-12) * @public static @@ -449,7 +449,7 @@ class TCPDF_COLORS { } if (!in_array($color, self::$jscolor)) { // default transparent color - $color = $jscolor[0]; + $color = self::$jscolor[0]; } return 'color.'.$color; } diff --git a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_filters.php b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_filters.php index 3bb89c092ad..3009cff7c7d 100644 --- a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_filters.php +++ b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_filters.php @@ -60,7 +60,7 @@ class TCPDF_FILTERS { /** * Get a list of available decoding filters. - * @return (array) Array of available filter decoders. + * @return array Array of available filter decoders. * @since 1.0.000 (2011-05-23) * @public static */ @@ -70,9 +70,9 @@ class TCPDF_FILTERS { /** * Decode data using the specified filter type. - * @param $filter (string) Filter name. - * @param $data (string) Data to decode. - * @return Decoded data string. + * @param string $filter Filter name. + * @param string $data Data to decode. + * @return string Decoded data string. * @since 1.0.000 (2011-05-23) * @public static */ @@ -130,8 +130,8 @@ class TCPDF_FILTERS { /** * Standard * Default decoding filter (leaves data unchanged). - * @param $data (string) Data to decode. - * @return Decoded data string. + * @param string $data Data to decode. + * @return string Decoded data string. * @since 1.0.000 (2011-05-23) * @public static */ @@ -142,8 +142,8 @@ class TCPDF_FILTERS { /** * ASCIIHexDecode * Decodes data encoded in an ASCII hexadecimal representation, reproducing the original binary data. - * @param $data (string) Data to decode. - * @return Decoded data string. + * @param string $data Data to decode. + * @return string Decoded data string. * @since 1.0.000 (2011-05-23) * @public static */ @@ -182,8 +182,8 @@ class TCPDF_FILTERS { /** * ASCII85Decode * Decodes data encoded in an ASCII base-85 representation, reproducing the original binary data. - * @param $data (string) Data to decode. - * @return Decoded data string. + * @param string $data Data to decode. + * @return string Decoded data string. * @since 1.0.000 (2011-05-23) * @public static */ @@ -266,8 +266,8 @@ class TCPDF_FILTERS { /** * LZWDecode * Decompresses data encoded using the LZW (Lempel-Ziv-Welch) adaptive compression method, reproducing the original text or binary data. - * @param $data (string) Data to decode. - * @return Decoded data string. + * @param string $data Data to decode. + * @return string Decoded data string. * @since 1.0.000 (2011-05-23) * @public static */ @@ -347,8 +347,8 @@ class TCPDF_FILTERS { /** * FlateDecode * Decompresses data encoded using the zlib/deflate compression method, reproducing the original text or binary data. - * @param $data (string) Data to decode. - * @return Decoded data string. + * @param string $data Data to decode. + * @return string Decoded data string. * @since 1.0.000 (2011-05-23) * @public static */ @@ -364,7 +364,7 @@ class TCPDF_FILTERS { /** * RunLengthDecode * Decompresses data encoded using a byte-oriented run-length encoding algorithm. - * @param $data (string) Data to decode. + * @param string $data Data to decode. * @since 1.0.000 (2011-05-23) * @public static */ @@ -400,8 +400,8 @@ class TCPDF_FILTERS { /** * CCITTFaxDecode (NOT IMPLEMETED - RETURN AN EXCEPTION) * Decompresses data encoded using the CCITT facsimile standard, reproducing the original data (typically monochrome image data at 1 bit per pixel). - * @param $data (string) Data to decode. - * @return Decoded data string. + * @param string $data Data to decode. + * @return string Decoded data string. * @since 1.0.000 (2011-05-23) * @public static */ @@ -413,8 +413,8 @@ class TCPDF_FILTERS { /** * JBIG2Decode (NOT IMPLEMETED - RETURN AN EXCEPTION) * Decompresses data encoded using the JBIG2 standard, reproducing the original monochrome (1 bit per pixel) image data (or an approximation of that data). - * @param $data (string) Data to decode. - * @return Decoded data string. + * @param string $data Data to decode. + * @return string Decoded data string. * @since 1.0.000 (2011-05-23) * @public static */ @@ -426,8 +426,8 @@ class TCPDF_FILTERS { /** * DCTDecode (NOT IMPLEMETED - RETURN AN EXCEPTION) * Decompresses data encoded using a DCT (discrete cosine transform) technique based on the JPEG standard, reproducing image sample data that approximates the original data. - * @param $data (string) Data to decode. - * @return Decoded data string. + * @param string $data Data to decode. + * @return string Decoded data string. * @since 1.0.000 (2011-05-23) * @public static */ @@ -439,8 +439,8 @@ class TCPDF_FILTERS { /** * JPXDecode (NOT IMPLEMETED - RETURN AN EXCEPTION) * Decompresses data encoded using the wavelet-based JPEG2000 standard, reproducing the original image data. - * @param $data (string) Data to decode. - * @return Decoded data string. + * @param string $data Data to decode. + * @return string Decoded data string. * @since 1.0.000 (2011-05-23) * @public static */ @@ -452,8 +452,8 @@ class TCPDF_FILTERS { /** * Crypt (NOT IMPLEMETED - RETURN AN EXCEPTION) * Decrypts data encrypted by a security handler, reproducing the data as it was before encryption. - * @param $data (string) Data to decode. - * @return Decoded data string. + * @param string $data Data to decode. + * @return string Decoded data string. * @since 1.0.000 (2011-05-23) * @public static */ @@ -466,7 +466,7 @@ class TCPDF_FILTERS { /** * Throw an exception. - * @param $msg (string) The error message + * @param string $msg The error message * @since 1.0.000 (2011-05-23) * @public static */ diff --git a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_fonts.php b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_fonts.php index 8681dfbdbfa..a71c84b7e0a 100644 --- a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_fonts.php +++ b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_fonts.php @@ -55,16 +55,16 @@ class TCPDF_FONTS { /** * Convert and add the selected TrueType or Type1 font to the fonts folder (that must be writeable). - * @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. - * @param $addcbbox (boolean) If true includes the character bounding box information on the php font file. - * @param $link (boolean) If true link to system font instead of copying the font data (not transportable) - Note: do not work with Type1 fonts. - * @return (string) TCPDF font name or boolean false in case of error. + * @param string $fontfile Font file (full path). + * @param string $fonttype 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 string $enc 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 int $flags 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 string $outpath Output path for generated font files (must be writeable by the web server). Leave empty for default font folder. + * @param int $platid 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 int $encid 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. + * @param boolean $addcbbox If true includes the character bounding box information on the php font file. + * @param boolean $link If true link to system font instead of copying the font data (not transportable) - Note: do not work with Type1 fonts. + * @return string|false TCPDF font name or boolean false in case of error. * @author Nicola Asuni * @since 5.9.123 (2010-09-30) * @public static @@ -557,6 +557,7 @@ class TCPDF_FONTS { $numGlyphs = TCPDF_STATIC::_getUSHORT($font, $offset); // ---------- get CIDToGIDMap ---------- $ctg = array(); + $c = 0; foreach ($encodingTables as $enctable) { // get only specified Platform ID and Encoding ID if (($enctable['platformID'] == $platid) AND ($enctable['encodingID'] == $encid)) { @@ -920,8 +921,8 @@ class TCPDF_FONTS { /** * Returs the checksum of a TTF table. - * @param $table (string) table to check - * @param $length (int) length of table in bytes + * @param string $table table to check + * @param int $length length of table in bytes * @return int checksum * @author Nicola Asuni * @since 5.2.000 (2010-06-02) @@ -942,9 +943,9 @@ class TCPDF_FONTS { /** * Returns a subset of the TrueType font data without the unused glyphs. - * @param $font (string) TrueType font data. - * @param $subsetchars (array) Array of used characters (the glyphs to keep). - * @return (string) A subset of TrueType font data without the unused glyphs. + * @param string $font TrueType font data. + * @param array $subsetchars Array of used characters (the glyphs to keep). + * @return string A subset of TrueType font data without the unused glyphs. * @author Nicola Asuni * @since 5.2.000 (2010-06-02) * @public static @@ -956,6 +957,7 @@ class TCPDF_FONTS { // sfnt version must be 0x00010000 for TrueType version 1.0. return $font; } + $c = 0; $offset += 4; // get number of tables $numTables = TCPDF_STATIC::_getUSHORT($font, $offset); @@ -1321,43 +1323,43 @@ class TCPDF_FONTS { // set the checkSumAdjustment to 0 $table[$tag]['data'] = substr($table[$tag]['data'], 0, 8)."\x0\x0\x0\x0".substr($table[$tag]['data'], 12); } - $pad = 4 - ($table[$tag]['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table[$tag]['length'] += $pad; - $table[$tag]['data'] .= str_repeat("\x0", $pad); - } $table[$tag]['offset'] = $offset; $offset += $table[$tag]['length']; + $numPad = ($offset + 3 & ~3) - $offset; + if($numPad > 0) { + $table[$tag]['data'] .= str_repeat("\x0", $numPad); + $offset += $numPad; + } // check sum is not changed (so keep the following line commented) - //$table[$tag]['checkSum'] = self::_getTTFtableChecksum($table[$tag]['data'], $table[$tag]['length']); + //$table[$tag]['checkSum'] = self::_getTTFtableChecksum($table[$tag]['data'], $table[$tag]['length'] + $numPad); } else { unset($table[$tag]); } } // add loca + $table['loca'] = array(); $table['loca']['data'] = $loca; $table['loca']['length'] = strlen($loca); - $pad = 4 - ($table['loca']['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table['loca']['length'] += $pad; - $table['loca']['data'] .= str_repeat("\x0", $pad); - } $table['loca']['offset'] = $offset; - $table['loca']['checkSum'] = self::_getTTFtableChecksum($table['loca']['data'], $table['loca']['length']); $offset += $table['loca']['length']; + $numPad = ($offset + 3 & ~3) - $offset; + if($numPad > 0) { + $table['loca']['data'] .= str_repeat("\x0", $numPad); + $offset += $numPad; + } + $table['loca']['checkSum'] = self::_getTTFtableChecksum($table['loca']['data'], $table['loca']['length'] + $numPad); // add glyf + $table['glyf'] = array(); $table['glyf']['data'] = $glyf; $table['glyf']['length'] = strlen($glyf); - $pad = 4 - ($table['glyf']['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table['glyf']['length'] += $pad; - $table['glyf']['data'] .= str_repeat("\x0", $pad); - } $table['glyf']['offset'] = $offset; - $table['glyf']['checkSum'] = self::_getTTFtableChecksum($table['glyf']['data'], $table['glyf']['length']); + $offset += $table['glyf']['length']; + $numPad = ($offset + 3 & ~3) - $offset; + if($numPad > 0) { + $table['glyf']['data'] .= str_repeat("\x0", $numPad); + $offset += $numPad; + } + $table['glyf']['checkSum'] = self::_getTTFtableChecksum($table['glyf']['data'], $table['glyf']['length'] + $numPad); // rebuild font $font = ''; $font .= pack('N', 0x10000); // sfnt version @@ -1381,15 +1383,15 @@ class TCPDF_FONTS { } // set checkSumAdjustment on head table $checkSumAdjustment = 0xB1B0AFBA - self::_getTTFtableChecksum($font, strlen($font)); - $font = substr($font, 0, $table['head']['offset'] + 8).pack('N', $checkSumAdjustment).substr($font, $table['head']['offset'] + 12); + $font = substr($font, 0, $table['head']['offset'] + $offset + 8).pack('N', $checkSumAdjustment).substr($font, $table['head']['offset'] + $offset + 12); return $font; } /** * Outputs font widths - * @param $font (array) font data - * @param $cidoffset (int) offset for CID values - * @return PDF command string for font widths + * @param array $font font data + * @param int $cidoffset offset for CID values + * @return string PDF command string for font widths * @author Nicola Asuni * @since 4.4.000 (2008-12-07) * @public static @@ -1495,10 +1497,10 @@ class TCPDF_FONTS { /** * Update the CIDToGIDMap string with a new value. - * @param $map (string) CIDToGIDMap. - * @param $cid (int) CID value. - * @param $gid (int) GID value. - * @return (string) CIDToGIDMap. + * @param string $map CIDToGIDMap. + * @param int $cid CID value. + * @param int $gid GID value. + * @return string CIDToGIDMap. * @author Nicola Asuni * @since 5.9.123 (2011-09-29) * @public static @@ -1533,8 +1535,8 @@ class TCPDF_FONTS { /** * Return font full path - * @param $file (string) Font file name. - * @param $fontdir (string) Font directory (set to false fto search on default directories) + * @param string $file Font file name. + * @param string $fontdir Font directory (set to false fto search on default directories) * @return string Font full path or empty string * @author Nicola Asuni * @since 6.0.025 @@ -1558,8 +1560,8 @@ class TCPDF_FONTS { /** * Get a reference font size. - * @param $size (string) String containing font size value. - * @param $refsize (float) Reference font size in points. + * @param string $size String containing font size value. + * @param float $refsize Reference font size in points. * @return float value in points * @public static */ @@ -1657,9 +1659,9 @@ class TCPDF_FONTS { /** * Returns the unicode caracter specified by the value - * @param $c (int) UTF-8 value - * @param $unicode (boolean) True if we are in unicode mode, false otherwise. - * @return Returns the specified character. + * @param int $c UTF-8 value + * @param boolean $unicode True if we are in unicode mode, false otherwise. + * @return string Returns the specified character. * @since 2.3.000 (2008-03-05) * @public static */ @@ -1686,8 +1688,8 @@ class TCPDF_FONTS { /** * Returns the unicode caracter specified by UTF-8 value - * @param $c (int) UTF-8 value - * @return Returns the specified character. + * @param int $c UTF-8 value + * @return string Returns the specified character. * @public static */ public static function unichrUnicode($c) { @@ -1696,8 +1698,8 @@ class TCPDF_FONTS { /** * Returns the unicode caracter specified by ASCII value - * @param $c (int) UTF-8 value - * @return Returns the specified character. + * @param int $c UTF-8 value + * @return string Returns the specified character. * @public static */ public static function unichrASCII($c) { @@ -1734,8 +1736,8 @@ class TCPDF_FONTS { * W1 = 110110yyyyyyyyyy * W2 = 110111xxxxxxxxxx * - * @param $unicode (array) array containing UTF-8 unicode values - * @param $setbom (boolean) if true set the Byte Order Mark (BOM = 0xFEFF) + * @param array $unicode array containing UTF-8 unicode values + * @param boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF) * @return string * @protected * @author Nicola Asuni @@ -1770,26 +1772,26 @@ class TCPDF_FONTS { /** * Convert an array of UTF8 values to array of unicode characters - * @param $ta (array) The input array of UTF8 values. - * @param $isunicode (boolean) True for Unicode mode, false otherwise. - * @return Return array of unicode characters + * @param array $ta The input array of UTF8 values. + * @param boolean $isunicode True for Unicode mode, false otherwise. + * @return array Return array of unicode characters * @since 4.5.037 (2009-04-07) * @public static */ public static function UTF8ArrayToUniArray($ta, $isunicode=true) { if ($isunicode) { - return array_map(array('TCPDF_FONTS', 'unichrUnicode'), $ta); + return array_map(get_called_class().'::unichrUnicode', $ta); } - return array_map(array('TCPDF_FONTS', 'unichrASCII'), $ta); + return array_map(get_called_class().'::unichrASCII', $ta); } /** * Extract a slice of the $strarr array and return it as string. - * @param $strarr (string) The input array of characters. - * @param $start (int) the starting element of $strarr. - * @param $end (int) first element that will not be returned. - * @param $unicode (boolean) True if we are in unicode mode, false otherwise. - * @return Return part of a string + * @param string[] $strarr The input array of characters. + * @param int $start the starting element of $strarr. + * @param int $end first element that will not be returned. + * @param boolean $unicode True if we are in unicode mode, false otherwise. + * @return string Return part of a string * @public static */ public static function UTF8ArrSubString($strarr, $start='', $end='', $unicode=true) { @@ -1808,10 +1810,10 @@ class TCPDF_FONTS { /** * Extract a slice of the $uniarr array and return it as string. - * @param $uniarr (string) The input array of characters. - * @param $start (int) the starting element of $strarr. - * @param $end (int) first element that will not be returned. - * @return Return part of a string + * @param string[] $uniarr The input array of characters. + * @param int $start the starting element of $strarr. + * @param int $end first element that will not be returned. + * @return string Return part of a string * @since 4.5.037 (2009-04-07) * @public static */ @@ -1831,7 +1833,7 @@ class TCPDF_FONTS { /** * Converts UTF-8 characters array to array of Latin1 characters array
- * @param $unicode (array) array containing UTF-8 unicode values + * @param array $unicode array containing UTF-8 unicode values * @return array * @author Nicola Asuni * @since 4.8.023 (2010-01-15) @@ -1855,9 +1857,9 @@ class TCPDF_FONTS { } /** - * Converts UTF-8 characters array to array of Latin1 string
- * @param $unicode (array) array containing UTF-8 unicode values - * @return array + * Converts UTF-8 characters array to Latin1 string
+ * @param array $unicode array containing UTF-8 unicode values + * @return string * @author Nicola Asuni * @since 4.8.023 (2010-01-15) * @public static @@ -1882,8 +1884,8 @@ class TCPDF_FONTS { /** * Converts UTF-8 character to integer value.
* Uses the getUniord() method if the value is not cached. - * @param $uch (string) character string to process. - * @return integer Unicode value + * @param string $uch character string to process. + * @return int Unicode value * @public static */ public static function uniord($uch) { @@ -1921,8 +1923,8 @@ class TCPDF_FONTS { * UTF8-tail = %x80-BF * --------------------------------------------------------------------- * - * @param $uch (string) character string to process. - * @return integer Unicode value + * @param string $uch character string to process. + * @return int Unicode value * @author Nicola Asuni * @public static */ @@ -1988,18 +1990,19 @@ class TCPDF_FONTS { /** * Converts UTF-8 strings to codepoints array.
* Invalid byte sequences will be replaced with 0xFFFD (replacement character)
- * @param $str (string) string to process. - * @param $isunicode (boolean) True when the documetn is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. + * @param string $str string to process. + * @param boolean $isunicode True when the documetn is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. * @return array containing codepoints (UTF-8 characters values) * @author Nicola Asuni * @public static */ - public static function UTF8StringToArray($str, $isunicode=true, &$currentfont) { + public static function UTF8StringToArray($str, $isunicode, &$currentfont) { + $str = is_null($str) ? '' : $str; if ($isunicode) { // requires PCRE unicode support turned on $chars = TCPDF_STATIC::pregSplit('//','u', $str, -1, PREG_SPLIT_NO_EMPTY); - $carr = array_map(array('TCPDF_FONTS', 'uniord'), $chars); + $carr = array_map(get_called_class().'::uniord', $chars); } else { $chars = str_split($str); $carr = array_map('ord', $chars); @@ -2014,30 +2017,30 @@ class TCPDF_FONTS { /** * Converts UTF-8 strings to Latin1 when using the standard 14 core fonts.
- * @param $str (string) string to process. - * @param $isunicode (boolean) True when the documetn is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. + * @param string $str string to process. + * @param boolean $isunicode True when the documetn is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. * @return string * @since 3.2.000 (2008-06-23) * @public static */ - public static function UTF8ToLatin1($str, $isunicode=true, &$currentfont) { + public static function UTF8ToLatin1($str, $isunicode, &$currentfont) { $unicode = self::UTF8StringToArray($str, $isunicode, $currentfont); // array containing UTF-8 unicode values return self::UTF8ArrToLatin1($unicode); } /** * Converts UTF-8 strings to UTF16-BE.
- * @param $str (string) string to process. - * @param $setbom (boolean) if true set the Byte Order Mark (BOM = 0xFEFF) - * @param $isunicode (boolean) True when the documetn is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. + * @param string $str string to process. + * @param boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF) + * @param boolean $isunicode True when the documetn is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. * @return string * @author Nicola Asuni * @since 1.53.0.TC005 (2005-01-05) * @public static */ - public static function UTF8ToUTF16BE($str, $setbom=false, $isunicode=true, &$currentfont) { + public static function UTF8ToUTF16BE($str, $setbom, $isunicode, &$currentfont) { if (!$isunicode) { return $str; // string is not in unicode } @@ -2047,50 +2050,50 @@ class TCPDF_FONTS { /** * Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). - * @param $str (string) string to manipulate. - * @param $setbom (bool) if true set the Byte Order Mark (BOM = 0xFEFF) - * @param $forcertl (bool) if true forces RTL text direction - * @param $isunicode (boolean) True if the document is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. + * @param string $str string to manipulate. + * @param bool $setbom if true set the Byte Order Mark (BOM = 0xFEFF) + * @param bool $forcertl if true forces RTL text direction + * @param boolean $isunicode True if the document is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. * @return string * @author Nicola Asuni * @since 2.1.000 (2008-01-08) * @public static */ - public static function utf8StrRev($str, $setbom=false, $forcertl=false, $isunicode=true, &$currentfont) { + public static function utf8StrRev($str, $setbom, $forcertl, $isunicode, &$currentfont) { return self::utf8StrArrRev(self::UTF8StringToArray($str, $isunicode, $currentfont), $str, $setbom, $forcertl, $isunicode, $currentfont); } /** * Reverse the RLT substrings array using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). - * @param $arr (array) array of unicode values. - * @param $str (string) string to manipulate (or empty value). - * @param $setbom (bool) if true set the Byte Order Mark (BOM = 0xFEFF) - * @param $forcertl (bool) if true forces RTL text direction - * @param $isunicode (boolean) True if the document is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. + * @param array $arr array of unicode values. + * @param string $str string to manipulate (or empty value). + * @param bool $setbom if true set the Byte Order Mark (BOM = 0xFEFF) + * @param bool $forcertl if true forces RTL text direction + * @param boolean $isunicode True if the document is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. * @return string * @author Nicola Asuni * @since 4.9.000 (2010-03-27) * @public static */ - public static function utf8StrArrRev($arr, $str='', $setbom=false, $forcertl=false, $isunicode=true, &$currentfont) { + public static function utf8StrArrRev($arr, $str, $setbom, $forcertl, $isunicode, &$currentfont) { return self::arrUTF8ToUTF16BE(self::utf8Bidi($arr, $str, $forcertl, $isunicode, $currentfont), $setbom); } /** * Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). - * @param $ta (array) array of characters composing the string. - * @param $str (string) string to process - * @param $forcertl (bool) if 'R' forces RTL, if 'L' forces LTR - * @param $isunicode (boolean) True if the document is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. + * @param array $ta array of characters composing the string. + * @param string $str string to process + * @param bool $forcertl if 'R' forces RTL, if 'L' forces LTR + * @param boolean $isunicode True if the document is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. * @return array of unicode chars * @author Nicola Asuni * @since 2.4.000 (2008-03-06) * @public static */ - public static function utf8Bidi($ta, $str='', $forcertl=false, $isunicode=true, &$currentfont) { + public static function utf8Bidi($ta, $str, $forcertl, $isunicode, &$currentfont) { // paragraph embedding level $pel = 0; // max level diff --git a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_images.php b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_images.php index 5e504f2101c..6f2860c60b7 100644 --- a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_images.php +++ b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_images.php @@ -55,6 +55,8 @@ class TCPDF_IMAGES { * Array of hinheritable SVG properties. * @since 5.0.000 (2010-05-02) * @public static + * + * @var string[] */ public static $svginheritprop = array('clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cursor', 'direction', 'display', 'fill', 'fill-opacity', 'fill-rule', 'font', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'image-rendering', 'kerning', 'letter-spacing', 'marker', 'marker-end', 'marker-mid', 'marker-start', 'pointer-events', 'shape-rendering', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-rendering', 'visibility', 'word-spacing', 'writing-mode'); @@ -62,8 +64,8 @@ class TCPDF_IMAGES { /** * Return the image type given the file name or array returned by getimagesize() function. - * @param $imgfile (string) image file name - * @param $iminfo (array) array of image information returned by getimagesize() function. + * @param string $imgfile image file name + * @param array $iminfo array of image information returned by getimagesize() function. * @return string image type * @since 4.8.017 (2009-11-27) * @public static @@ -77,10 +79,7 @@ class TCPDF_IMAGES { } } if (empty($type)) { - $fileinfo = pathinfo($imgfile); - if (isset($fileinfo['extension']) AND (!TCPDF_STATIC::empty_string($fileinfo['extension']))) { - $type = strtolower(trim($fileinfo['extension'])); - } + $type = strtolower(trim(pathinfo(parse_url($imgfile, PHP_URL_PATH), PATHINFO_EXTENSION))); } if ($type == 'jpg') { $type = 'jpeg'; @@ -90,9 +89,9 @@ class TCPDF_IMAGES { /** * Set the transparency for the given GD image. - * @param $new_image (image) GD image object - * @param $image (image) GD image object. - * return GD image object. + * @param resource $new_image GD image object + * @param resource $image GD image object. + * @return resource GD image object $new_image * @since 4.9.016 (2010-04-20) * @public static */ @@ -115,8 +114,8 @@ class TCPDF_IMAGES { /** * Convert the loaded image to a PNG and then return a structure for the PDF creator. * This function requires GD library and write access to the directory defined on K_PATH_CACHE constant. - * @param $image (image) Image object. - * @param $tempfile (string) Temporary file name. + * @param resource $image Image object. + * @param string $tempfile Temporary file name. * return image PNG image object. * @since 4.9.016 (2010-04-20) * @public static @@ -138,10 +137,10 @@ class TCPDF_IMAGES { /** * Convert the loaded image to a JPEG and then return a structure for the PDF creator. * This function requires GD library and write access to the directory defined on K_PATH_CACHE constant. - * @param $image (image) Image object. - * @param $quality (int) JPEG quality. - * @param $tempfile (string) Temporary file name. - * return image JPEG image object. + * @param resource $image Image object. + * @param int $quality JPEG quality. + * @param string $tempfile Temporary file name. + * return array|false image JPEG image object. * @public static */ public static function _toJPEG($image, $quality, $tempfile) { @@ -155,8 +154,8 @@ class TCPDF_IMAGES { /** * Extract info from a JPEG file without using the GD library. - * @param $file (string) image file to parse - * @return array structure containing the image data + * @param string $file image file to parse + * @return array|false structure containing the image data * @public static */ public static function _parsejpeg($file) { @@ -234,8 +233,8 @@ class TCPDF_IMAGES { /** * Extract info from a PNG file without using the GD library. - * @param $file (string) image file to parse - * @return array structure containing the image data + * @param string $file image file to parse + * @return array|false structure containing the image data * @public static */ public static function _parsepng($file) { diff --git a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_static.php b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_static.php index d66ec482549..c75fa580fb8 100644 --- a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_static.php +++ b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_static.php @@ -1,13 +1,13 @@ UTF-8 (hex): 0xC2 0xAD (c2ad) *
  • UTF-8 character: chr(194).chr(173)
  • * - * @param $txt (string) input string - * @param $unicode (boolean) True if we are in unicode mode, false otherwise. + * @param string $txt input string + * @param boolean $unicode True if we are in unicode mode, false otherwise. * @return string without SHY characters. * @since (4.5.019) 2009-02-28 * @public static */ - public static function removeSHY($txt = '', $unicode = true) - { + public static function removeSHY($txt='', $unicode=true) { $txt = preg_replace('/([\\xc2]{1}[\\xad]{1})/', '', $txt); if (!$unicode) { $txt = preg_replace('/([\\xad]{1})/', '', $txt); @@ -208,15 +171,14 @@ class TCPDF_STATIC /** * Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages) - * @param $brd (mixed) Indicates if borders must be drawn around the cell block. The value can be a number:
    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param $position (string) multicell position: 'start', 'middle', 'end' - * @param $opencell (boolean) True when the cell is left open at the page bottom, false otherwise. - * @return border mode array + * @param string|array|int $brd Indicates if borders must be drawn around the cell block. The value can be a number:
    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param string $position multicell position: 'start', 'middle', 'end' + * @param boolean $opencell True when the cell is left open at the page bottom, false otherwise. + * @return array border mode array * @since 4.4.002 (2008-12-09) * @public static */ - public static function getBorderMode($brd, $position = 'start', $opencell = true) - { + public static function getBorderMode($brd, $position='start', $opencell=true) { if ((!$opencell) OR empty($brd)) { return $brd; } @@ -283,64 +245,59 @@ class TCPDF_STATIC /** * Determine whether a string is empty. - * @param $str (string) string to be checked - * @return boolean true if string is empty + * @param string $str string to be checked + * @return bool true if string is empty * @since 4.5.044 (2009-04-16) * @public static */ - public static function empty_string($str) - { + public static function empty_string($str) { return (is_null($str) OR (is_string($str) AND (strlen($str) == 0))); } /** * Returns a temporary filename for caching object on filesystem. - * @param $type (string) Type of file (name of the subdir on the tcpdf cache folder). - * @param $file_id (string) TCPDF file_id. + * @param string $type Type of file (name of the subdir on the tcpdf cache folder). + * @param string $file_id TCPDF file_id. * @return string filename. * @since 4.5.000 (2008-12-31) * @public static */ - public static function getObjFilename($type = 'tmp', $file_id = '') - { + public static function getObjFilename($type='tmp', $file_id='') { return tempnam(K_PATH_CACHE, '__tcpdf_'.$file_id.'_'.$type.'_'.md5(TCPDF_STATIC::getRandomSeed()).'_'); } /** * Add "\" before "\", "(" and ")" - * @param $s (string) string to escape. + * @param string $s string to escape. * @return string escaped string. * @public static */ - public static function _escape($s) - { + public static function _escape($s) { // the chr(13) substitution fixes the Bugs item #1421290. return strtr($s, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\', chr(13) => '\r')); } /** * Escape some special characters (< > &) for XML output. - * @param $str (string) Input string to convert. - * @return converted string + * @param string $str Input string to convert. + * @return string converted string * @since 5.9.121 (2011-09-28) * @public static */ - public static function _escapeXML($str) - { + public static function _escapeXML($str) { $replaceTable = array("\0" => '', '&' => '&', '<' => '<', '>' => '>'); - $str = strtr($str, $replaceTable); + $str = strtr($str === null ? '' : $str, $replaceTable); return $str; } /** * Creates a copy of a class object - * @param $object (object) class object to be cloned - * @return cloned object + * @param object $object class object to be cloned + * @return object cloned object * @since 4.5.029 (2009-03-19) * @public static */ - public static function objclone($object) - { + public static function objclone($object) { if (($object instanceof Imagick) AND (version_compare(phpversion('imagick'), '3.0.1') !== 1)) { // on the versions after 3.0.1 the clone() method was deprecated in favour of clone keyword return @$object->clone(); @@ -350,13 +307,12 @@ class TCPDF_STATIC /** * Output input data and compress it if possible. - * @param $data (string) Data to output. - * @param $length (int) Data length in bytes. + * @param string $data Data to output. + * @param int $length Data length in bytes. * @since 5.9.086 * @public static */ - public static function sendOutputData($data, $length) - { + public static function sendOutputData($data, $length) { if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']) OR empty($_SERVER['HTTP_ACCEPT_ENCODING'])) { // the content length may vary if the server is using compression header('Content-Length: '.$length); @@ -366,14 +322,13 @@ class TCPDF_STATIC /** * Replace page number aliases with number. - * @param $page (string) Page content. - * @param $replace (array) Array of replacements (array keys are replacement strings, values are alias arrays). - * @param $diff (int) If passed, this will be set to the total char number difference between alias and replacements. - * @return replaced page content and updated $diff parameter as array. + * @param string $page Page content. + * @param array $replace Array of replacements (array keys are replacement strings, values are alias arrays). + * @param int $diff If passed, this will be set to the total char number difference between alias and replacements. + * @return array replaced page content and updated $diff parameter as array. * @public static */ - public static function replacePageNumAliases($page, $replace, $diff = 0) - { + public static function replacePageNumAliases($page, $replace, $diff=0) { foreach ($replace as $rep) { foreach ($rep[3] as $a) { if (strpos($page, $a) !== false) { @@ -387,13 +342,12 @@ class TCPDF_STATIC /** * Returns timestamp in seconds from formatted date-time. - * @param $date (string) Formatted date-time. + * @param string $date Formatted date-time. * @return int seconds. * @since 5.9.152 (2012-03-23) * @public static */ - public static function getTimestamp($date) - { + public static function getTimestamp($date) { if (($date[0] == 'D') AND ($date[1] == ':')) { // remove date prefix if present $date = substr($date, 2); @@ -403,26 +357,24 @@ class TCPDF_STATIC /** * Returns a formatted date-time. - * @param $time (int) Time in seconds. + * @param int $time Time in seconds. * @return string escaped date string. * @since 5.9.152 (2012-03-23) * @public static */ - public static function getFormattedDate($time) - { + public static function getFormattedDate($time) { return substr_replace(date('YmdHisO', intval($time)), '\'', (0 - 2), 0).'\''; } /** * Returns a string containing random data to be used as a seed for encryption methods. - * @param $seed (string) starting seed value + * @param string $seed starting seed value * @return string containing random data * @author Nicola Asuni * @since 5.9.006 (2010-10-19) * @public static */ - public static function getRandomSeed($seed = '') - { + public static function getRandomSeed($seed='') { $rnd = uniqid(rand().microtime(true), true); if (function_exists('posix_getpid')) { $rnd .= posix_getpid(); @@ -440,34 +392,36 @@ class TCPDF_STATIC /** * Encrypts a string using MD5 and returns it's value as a binary string. - * @param $str (string) input string - * @return String MD5 encrypted binary string + * @param string $str input string + * @return string MD5 encrypted binary string * @since 2.0.000 (2008-01-02) * @public static */ - public static function _md5_16($str) - { + public static function _md5_16($str) { return pack('H*', md5($str)); } /** - * Returns the input text exrypted using AES algorithm and the specified key. + * Returns the input text encrypted using AES algorithm and the specified key. * This method requires openssl or mcrypt. Text is padded to 16bytes blocks - * @param $key (string) encryption key - * @param $text (String) input text to be encrypted - * @return String encrypted text + * @param string $key encryption key + * @param string $text input text to be encrypted + * @return string encrypted text * @author Nicola Asuni * @since 5.0.005 (2010-05-11) * @public static */ - public static function _AES($key, $text) - { + public static function _AES($key, $text) { // padding (RFC 2898, PKCS #5: Password-Based Cryptography Specification Version 2.0) $padding = 16 - (strlen($text) % 16); $text .= str_repeat(chr($padding), $padding); if (extension_loaded('openssl')) { - $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc')); - $text = openssl_encrypt($text, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv); + $algo = 'aes-256-cbc'; + if (strlen($key) == 16) { + $algo = 'aes-128-cbc'; + } + $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($algo)); + $text = openssl_encrypt($text, $algo, $key, OPENSSL_RAW_DATA, $iv); return $iv.substr($text, 0, -16); } $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND); @@ -477,20 +431,23 @@ class TCPDF_STATIC } /** - * Returns the input text exrypted using AES algorithm and the specified key. + * Returns the input text encrypted using AES algorithm and the specified key. * This method requires openssl or mcrypt. Text is not padded - * @param $key (string) encryption key - * @param $text (String) input text to be encrypted - * @return String encrypted text + * @param string $key encryption key + * @param string $text input text to be encrypted + * @return string encrypted text * @author Nicola Asuni * @since TODO * @public static */ - public static function _AESnopad($key, $text) - { + public static function _AESnopad($key, $text) { if (extension_loaded('openssl')) { - $iv = str_repeat("\x00", openssl_cipher_iv_length('aes-256-cbc')); - $text = openssl_encrypt($text, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv); + $algo = 'aes-256-cbc'; + if (strlen($key) == 16) { + $algo = 'aes-128-cbc'; + } + $iv = str_repeat("\x00", openssl_cipher_iv_length($algo)); + $text = openssl_encrypt($text, $algo, $key, OPENSSL_RAW_DATA, $iv); return substr($text, 0, -16); } $iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)); @@ -501,23 +458,22 @@ class TCPDF_STATIC /** * Returns the input text encrypted using RC4 algorithm and the specified key. * RC4 is the standard encryption algorithm used in PDF format - * @param $key (string) Encryption key. - * @param $text (String) Input text to be encrypted. - * @param $last_enc_key (String) Reference to last RC4 key encrypted. - * @param $last_enc_key_c (String) Reference to last RC4 computed key. - * @return String encrypted text + * @param string $key Encryption key. + * @param string $text Input text to be encrypted. + * @param string $last_enc_key Reference to last RC4 key encrypted. + * @param string $last_enc_key_c Reference to last RC4 computed key. + * @return string encrypted text * @since 2.0.000 (2008-01-02) * @author Klemen Vodopivec, Nicola Asuni * @public static */ - public static function _RC4($key, $text, &$last_enc_key, &$last_enc_key_c) - { + public static function _RC4($key, $text, &$last_enc_key, &$last_enc_key_c) { if (function_exists('mcrypt_encrypt') AND ($out = @mcrypt_encrypt(MCRYPT_ARCFOUR, $key, $text, MCRYPT_MODE_STREAM, ''))) { // try to use mcrypt function if exist return $out; } if ($last_enc_key != $key) { - $k = str_repeat($key, ((256 / strlen($key)) + 1)); + $k = str_repeat($key, (int) ((256 / strlen($key)) + 1)); $rc4 = range(0, 255); $j = 0; for ($i = 0; $i < 256; ++$i) { @@ -549,14 +505,13 @@ class TCPDF_STATIC /** * Return the permission code used on encryption (P value). - * @param $permissions (Array) the set of permissions (specify the ones you want to block). - * @param $mode (int) encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit. + * @param array $permissions the set of permissions (specify the ones you want to block). + * @param int $mode encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit. * @since 5.0.005 (2010-05-12) * @author Nicola Asuni * @public static */ - public static function getUserPermissionCode($permissions, $mode = 0) - { + public static function getUserPermissionCode($permissions, $mode=0) { $options = array( 'owner' => 2, // bit 2 -- inverted logic: cleared by default 'print' => 4, // bit 3 @@ -587,14 +542,13 @@ class TCPDF_STATIC /** * Convert hexadecimal string to string - * @param $bs (string) byte-string to convert - * @return String + * @param string $bs byte-string to convert + * @return string * @since 5.0.005 (2010-05-12) * @author Nicola Asuni * @public static */ - public static function convertHexStringToString($bs) - { + public static function convertHexStringToString($bs) { $string = ''; // string to be returned $bslength = strlen($bs); if (($bslength % 2) != 0) { @@ -610,14 +564,13 @@ class TCPDF_STATIC /** * Convert string to hexadecimal string (byte string) - * @param $s (string) string to convert - * @return byte string + * @param string $s string to convert + * @return string byte string * @since 5.0.010 (2010-05-17) * @author Nicola Asuni * @public static */ - public static function convertStringToHexString($s) - { + public static function convertStringToHexString($s) { $bs = ''; $chars = preg_split('//', $s, -1, PREG_SPLIT_NO_EMPTY); foreach ($chars as $c) { @@ -628,14 +581,13 @@ class TCPDF_STATIC /** * Convert encryption P value to a string of bytes, low-order byte first. - * @param $protection (string) 32bit encryption permission value (P value) - * @return String + * @param string $protection 32bit encryption permission value (P value) + * @return string * @since 5.0.005 (2010-05-12) * @author Nicola Asuni * @public static */ - public static function getEncPermissionsString($protection) - { + public static function getEncPermissionsString($protection) { $binprot = sprintf('%032b', $protection); $str = chr(bindec(substr($binprot, 24, 8))); $str .= chr(bindec(substr($binprot, 16, 8))); @@ -646,14 +598,13 @@ class TCPDF_STATIC /** * Encode a name object. - * @param $name (string) Name object to encode. - * @return (string) Encoded name object. + * @param string $name Name object to encode. + * @return string Encoded name object. * @author Nicola Asuni * @since 5.9.097 (2011-06-23) * @public static */ - public static function encodeNameObject($name) - { + public static function encodeNameObject($name) { $escname = ''; $length = strlen($name); for ($i = 0; $i < $length; ++$i) { @@ -669,18 +620,17 @@ class TCPDF_STATIC /** * Convert JavaScript form fields properties array to Annotation Properties array. - * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param $spot_colors (array) Reference to spot colors array. - * @param $rtl (boolean) True if in Right-To-Left text direction mode, false otherwise. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $spot_colors Reference to spot colors array. + * @param boolean $rtl True if in Right-To-Left text direction mode, false otherwise. * @return array of annotation properties * @author Nicola Asuni * @since 4.8.000 (2009-09-06) * @public static */ - public static function getAnnotOptFromJSProp($prop, &$spot_colors, $rtl = false) - { + public static function getAnnotOptFromJSProp($prop, &$spot_colors, $rtl=false) { if (isset($prop['aopt']) AND is_array($prop['aopt'])) { - // the annotation options area lready defined + // the annotation options are already defined return $prop['aopt']; } $opt = array(); // value to be returned @@ -869,9 +819,7 @@ class TCPDF_STATIC if (isset($prop['charLimit'])) { $opt['maxlen'] = intval($prop['charLimit']); } - if (!isset($ff)) { - $ff = 0; // default value - } + $ff = 0; // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it. if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) { $ff += 1 << 0; @@ -1039,39 +987,38 @@ class TCPDF_STATIC /** * Format the page numbers. - * This method can be overriden for custom formats. - * @param $num (int) page number + * This method can be overridden for custom formats. + * @param int $num page number + * @return string * @since 4.2.005 (2008-11-06) * @public static */ - public static function formatPageNumber($num) - { - return number_format((float) $num, 0, '', '.'); + public static function formatPageNumber($num) { + return number_format((float)$num, 0, '', '.'); } /** * Format the page numbers on the Table Of Content. - * This method can be overriden for custom formats. - * @param $num (int) page number + * This method can be overridden for custom formats. + * @param int $num page number + * @return string * @since 4.5.001 (2009-01-04) * @see addTOC(), addHTMLTOC() * @public static */ - public static function formatTOCPageNumber($num) - { - return number_format((float) $num, 0, '', '.'); + public static function formatTOCPageNumber($num) { + return number_format((float)$num, 0, '', '.'); } /** * Extracts the CSS properties from a CSS string. - * @param $cssdata (string) string containing CSS definitions. - * @return An array where the keys are the CSS selectors and the values are the CSS properties. + * @param string $cssdata string containing CSS definitions. + * @return array An array where the keys are the CSS selectors and the values are the CSS properties. * @author Nicola Asuni * @since 5.1.000 (2010-05-25) * @public static */ - public static function extractCSSproperties($cssdata) - { + public static function extractCSSproperties($cssdata) { if (empty($cssdata)) { return array(); } @@ -1156,21 +1103,20 @@ class TCPDF_STATIC /** * Cleanup HTML code (requires HTML Tidy library). - * @param $html (string) htmlcode to fix - * @param $default_css (string) CSS commands to add - * @param $tagvs (array) parameters for setHtmlVSpace method - * @param $tidy_options (array) options for tidy_parse_string function - * @param $tagvspaces (array) Array of vertical spaces for tags. + * @param string $html htmlcode to fix + * @param string $default_css CSS commands to add + * @param array|null $tagvs parameters for setHtmlVSpace method + * @param array|null $tidy_options options for tidy_parse_string function + * @param array $tagvspaces Array of vertical spaces for tags. * @return string XHTML code cleaned up * @author Nicola Asuni * @since 5.9.017 (2010-11-16) * @see setHtmlVSpace() * @public static */ - public static function fixHTMLCode($html, $default_css = '', $tagvs = '', $tidy_options = '', &$tagvspaces) - { + public static function fixHTMLCode($html, $default_css, $tagvs, $tidy_options, &$tagvspaces) { // configure parameters for HTML Tidy - if ($tidy_options === '') { + if (TCPDF_STATIC::empty_string($tidy_options)) { $tidy_options = array ( 'clean' => 1, 'drop-empty-paras' => 0, @@ -1217,7 +1163,7 @@ class TCPDF_STATIC // remove some empty tag blocks $html = preg_replace('/]*)><\/div>/', '', $html); $html = preg_replace('/]*)><\/p>/', '', $html); - if ($tagvs !== '') { + if (!TCPDF_STATIC::empty_string($tagvs)) { // set vertical space for some XHTML tags $tagvspaces = $tagvs; } @@ -1227,15 +1173,14 @@ class TCPDF_STATIC /** * Returns true if the CSS selector is valid for the selected HTML tag - * @param $dom (array) array of HTML tags and properties - * @param $key (int) key of the current HTML tag - * @param $selector (string) CSS selector string + * @param array $dom array of HTML tags and properties + * @param int $key key of the current HTML tag + * @param string $selector CSS selector string * @return true if the selector is valid, false otherwise * @since 5.1.000 (2010-05-25) * @public static */ - public static function isValidCSSSelectorForTag($dom, $key, $selector) - { + public static function isValidCSSSelectorForTag($dom, $key, $selector) { $valid = false; // value to be returned $tag = $dom[$key]['value']; $class = array(); @@ -1388,15 +1333,14 @@ class TCPDF_STATIC /** * Returns the styles array that apply for the selected HTML tag. - * @param $dom (array) array of HTML tags and properties - * @param $key (int) key of the current HTML tag - * @param $css (array) array of CSS properties + * @param array $dom array of HTML tags and properties + * @param int $key key of the current HTML tag + * @param array $css array of CSS properties * @return array containing CSS properties * @since 5.1.000 (2010-05-25) * @public static */ - public static function getCSSdataArray($dom, $key, $css) - { + public static function getCSSdataArray($dom, $key, $css) { $cssarray = array(); // style to be returned // get parent CSS selectors $selectors = array(); @@ -1404,7 +1348,7 @@ class TCPDF_STATIC $selectors = $dom[($dom[$key]['parent'])]['csssel']; } // get all styles that apply - foreach ($css as $selector => $style) { + foreach($css as $selector => $style) { $pos = strpos($selector, ' '); // get specificity $specificity = substr($selector, 0, $pos); @@ -1436,13 +1380,12 @@ class TCPDF_STATIC /** * Compact CSS data array into single string. - * @param $css (array) array of CSS properties + * @param array $css array of CSS properties * @return string containing merged CSS properties * @since 5.9.070 (2011-04-19) * @public static */ - public static function getTagStyleFromCSSarray($css) - { + public static function getTagStyleFromCSSarray($css) { $tagstyle = ''; // value to be returned foreach ($css as $style) { // split single css commands @@ -1468,13 +1411,12 @@ class TCPDF_STATIC /** * Returns the Roman representation of an integer number - * @param $number (int) number to convert + * @param int $number number to convert * @return string roman representation of the specified number * @since 4.4.004 (2008-12-10) * @public static */ - public static function intToRoman($number) - { + public static function intToRoman($number) { $roman = ''; if ($number >= 4000) { // do not represent numbers above 4000 in Roman numerals @@ -1537,15 +1479,14 @@ class TCPDF_STATIC /** * Find position of last occurrence of a substring in a string - * @param $haystack (string) The string to search in. - * @param $needle (string) substring to search. - * @param $offset (int) May be specified to begin searching an arbitrary number of characters into the string. - * @return Returns the position where the needle exists. Returns FALSE if the needle was not found. + * @param string $haystack The string to search in. + * @param string $needle substring to search. + * @param int $offset May be specified to begin searching an arbitrary number of characters into the string. + * @return int|false Returns the position where the needle exists. Returns FALSE if the needle was not found. * @since 4.8.038 (2010-03-13) * @public static */ - public static function revstrpos($haystack, $needle, $offset = 0) - { + public static function revstrpos($haystack, $needle, $offset = 0) { $length = strlen($haystack); $offset = ($offset > 0)?($length - $offset):abs($offset); $pos = strpos(strrev($haystack), strrev($needle), $offset); @@ -1554,14 +1495,13 @@ class TCPDF_STATIC /** * Returns an array of hyphenation patterns. - * @param $file (string) TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ + * @param string $file 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/ * @return array of hyphenation patterns * @author Nicola Asuni * @since 4.9.012 (2010-04-12) * @public static */ - public static function getHyphenPatternsFromTEX($file) - { + public static function getHyphenPatternsFromTEX($file) { // TEX patterns are available at: // http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ $data = file_get_contents($file); @@ -1575,7 +1515,7 @@ class TCPDF_STATIC $patterns_array = preg_split('/[\s]+/', $data); // create new language array of patterns $patterns = array(); - foreach ($patterns_array as $val) { + foreach($patterns_array as $val) { if (!TCPDF_STATIC::empty_string($val)) { $val = trim($val); $val = str_replace('\'', '\\\'', $val); @@ -1588,29 +1528,29 @@ class TCPDF_STATIC /** * Get the Path-Painting Operators. - * @param $style (string) Style of rendering. Possible values are: - *
      - *
    • S or D: Stroke the path.
    • - *
    • s or d: Close and stroke the path.
    • - *
    • f or F: Fill the path, using the nonzero winding number rule to determine the region to fill.
    • - *
    • f* or F*: Fill the path, using the even-odd rule to determine the region to fill.
    • - *
    • B or FD or DF: Fill and then stroke the path, using the nonzero winding number rule to determine the region to fill.
    • - *
    • B* or F*D or DF*: Fill and then stroke the path, using the even-odd rule to determine the region to fill.
    • - *
    • b or fd or df: Close, fill, and then stroke the path, using the nonzero winding number rule to determine the region to fill.
    • - *
    • b or f*d or df*: Close, fill, and then stroke the path, using the even-odd rule to determine the region to fill.
    • - *
    • CNZ: Clipping mode using the even-odd rule to determine which regions lie inside the clipping path.
    • - *
    • CEO: Clipping mode using the nonzero winding number rule to determine which regions lie inside the clipping path
    • - *
    • n: End the path object without filling or stroking it.
    • - *
    - * @param $default (string) default style + * @param string $style Style of rendering. Possible values are: + *
      + *
    • S or D: Stroke the path.
    • + *
    • s or d: Close and stroke the path.
    • + *
    • f or F: Fill the path, using the nonzero winding number rule to determine the region to fill.
    • + *
    • f* or F*: Fill the path, using the even-odd rule to determine the region to fill.
    • + *
    • B or FD or DF: Fill and then stroke the path, using the nonzero winding number rule to determine the region to fill.
    • + *
    • B* or F*D or DF*: Fill and then stroke the path, using the even-odd rule to determine the region to fill.
    • + *
    • b or fd or df: Close, fill, and then stroke the path, using the nonzero winding number rule to determine the region to fill.
    • + *
    • b or f*d or df*: Close, fill, and then stroke the path, using the even-odd rule to determine the region to fill.
    • + *
    • CNZ: Clipping mode using the even-odd rule to determine which regions lie inside the clipping path.
    • + *
    • CEO: Clipping mode using the nonzero winding number rule to determine which regions lie inside the clipping path
    • + *
    • n: End the path object without filling or stroking it.
    • + *
    + * @param string $default default style + * @return string * @author Nicola Asuni * @since 5.0.000 (2010-04-30) * @public static */ - public static function getPathPaintOperator($style, $default = 'S') - { + public static function getPathPaintOperator($style, $default='S') { $op = ''; - switch ($style) { + switch($style) { case 'S': case 'D': { $op = 'S'; @@ -1680,15 +1620,14 @@ class TCPDF_STATIC /** * Get the product of two SVG tranformation matrices - * @param $ta (array) first SVG tranformation matrix - * @param $tb (array) second SVG tranformation matrix - * @return transformation array + * @param array $ta first SVG tranformation matrix + * @param array $tb second SVG tranformation matrix + * @return array transformation array * @author Nicola Asuni * @since 5.0.000 (2010-05-02) * @public static */ - public static function getTransformationMatrixProduct($ta, $tb) - { + public static function getTransformationMatrixProduct($ta, $tb) { $tm = array(); $tm[0] = ($ta[0] * $tb[0]) + ($ta[2] * $tb[1]); $tm[1] = ($ta[1] * $tb[0]) + ($ta[3] * $tb[1]); @@ -1701,14 +1640,13 @@ class TCPDF_STATIC /** * Get the tranformation matrix from SVG transform attribute - * @param $attribute (string) transformation + * @param string $attribute transformation * @return array of transformations * @author Nicola Asuni * @since 5.0.000 (2010-05-02) * @public static */ - public static function getSVGTransformMatrix($attribute) - { + public static function getSVGTransformMatrix($attribute) { // identity matrix $tm = array(1, 0, 0, 1, 0, 0); $transform = array(); @@ -1797,16 +1735,15 @@ class TCPDF_STATIC /** * Returns the angle in radiants between two vectors - * @param $x1 (int) X coordinate of first vector point - * @param $y1 (int) Y coordinate of first vector point - * @param $x2 (int) X coordinate of second vector point - * @param $y2 (int) Y coordinate of second vector point + * @param int $x1 X coordinate of first vector point + * @param int $y1 Y coordinate of first vector point + * @param int $x2 X coordinate of second vector point + * @param int $y2 Y coordinate of second vector point * @author Nicola Asuni * @since 5.0.000 (2010-05-04) * @public static */ - public static function getVectorsAngle($x1, $y1, $x2, $y2) - { + public static function getVectorsAngle($x1, $y1, $x2, $y2) { $dprod = ($x1 * $x2) + ($y1 * $y2); $dist1 = sqrt(($x1 * $x1) + ($y1 * $y1)); $dist2 = sqrt(($x2 * $x2) + ($y2 * $y2)); @@ -1823,25 +1760,31 @@ class TCPDF_STATIC /** * Split string by a regular expression. * This is a wrapper for the preg_split function to avoid the bug: https://bugs.php.net/bug.php?id=45850 - * @param $pattern (string) The regular expression pattern to search for without the modifiers, as a string. - * @param $modifiers (string) The modifiers part of the pattern, - * @param $subject (string) The input string. - * @param $limit (int) If specified, then only substrings up to limit are returned with the rest of the string being placed in the last substring. A limit of -1, 0 or NULL means "no limit" and, as is standard across PHP, you can use NULL to skip to the flags parameter. - * @param $flags (int) The flags as specified on the preg_split PHP function. - * @return Returns an array containing substrings of subject split along boundaries matched by pattern.modifier + * @param string $pattern The regular expression pattern to search for without the modifiers, as a string. + * @param string $modifiers The modifiers part of the pattern, + * @param string $subject The input string. + * @param int $limit If specified, then only substrings up to limit are returned with the rest of the string being placed in the last substring. A limit of -1, 0 or NULL means "no limit" and, as is standard across PHP, you can use NULL to skip to the flags parameter. + * @param int $flags The flags as specified on the preg_split PHP function. + * @return array Returns an array containing substrings of subject split along boundaries matched by pattern.modifier * @author Nicola Asuni * @since 6.0.023 * @public static */ - public static function pregSplit($pattern, $modifiers, $subject, $limit = null, $flags = null) - { + public static function pregSplit($pattern, $modifiers, $subject, $limit=NULL, $flags=NULL) { + // PHP 8.1 deprecates nulls for $limit and $flags + $limit = $limit === null ? -1 : $limit; + $flags = $flags === null ? 0 : $flags; // the bug only happens on PHP 5.2 when using the u modifier - if ((strpos($modifiers, 'u') === false) OR (count(preg_split('//u', "\n\t", -1, PREG_SPLIT_NO_EMPTY)) == 2)) { - return preg_split($pattern.$modifiers, $subject, $limit, $flags); + if ((strpos($modifiers, 'u') === FALSE) OR (count(preg_split('//u', "\n\t", -1, PREG_SPLIT_NO_EMPTY)) == 2)) { + $ret = preg_split($pattern.$modifiers, $subject, $limit, $flags); + if ($ret === false) { + return array(); + } + return is_array($ret) ? $ret : array(); } // preg_split is bugged - try alternative solution $ret = array(); - while (($nl = strpos($subject, "\n")) !== false) { + while (($nl = strpos($subject, "\n")) !== FALSE) { $ret = array_merge($ret, preg_split($pattern.$modifiers, substr($subject, 0, $nl), $limit, $flags)); $ret[] = "\n"; $subject = substr($subject, ($nl + 1)); @@ -1854,13 +1797,13 @@ class TCPDF_STATIC /** * Wrapper to use fopen only with local files - * @param string $filename The full path to the file to open - * @param string $mode Acceses type for the file ('r', 'r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+' or 'e') - * @return resource Returns a file pointer resource on success, or FALSE on error. + * @param string $filename Name of the file to open + * @param string $mode + * @return resource|false Returns a file pointer resource on success, or FALSE on error. * @public static */ - public static function fopenLocal($filename, $mode) - { + public static function fopenLocal($filename, $mode) { + // @CHANGE DOL if (strpos($filename, '//') === 0) { // Share folder on a (windows) server // e.g.: "//[MyServerName]/[MySharedFolder]/" @@ -1871,19 +1814,20 @@ class TCPDF_STATIC } elseif (stream_is_local($filename) !== true) { return false; } - return fopen($filename, $mode); } /** * Check if the URL exist. - * @param url (string) URL to check. - * @return Returns TRUE if the URL exists; FALSE otherwise. + * @param string $url URL to check. + * @return bool Returns TRUE if the URL exists; FALSE otherwise. * @public static + * @since 6.2.25 */ - public static function url_exists($url) - { + public static function url_exists($url) { $crs = curl_init(); + // encode query params in URL to get right response form the server + $url = self::encodeUrlQuery($url); curl_setopt($crs, CURLOPT_URL, $url); curl_setopt($crs, CURLOPT_NOBODY, true); curl_setopt($crs, CURLOPT_FAILONERROR, true); @@ -1895,22 +1839,46 @@ class TCPDF_STATIC curl_setopt($crs, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($crs, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($crs, CURLOPT_USERAGENT, 'tc-lib-file'); + curl_setopt($crs, CURLOPT_MAXREDIRS, 5); + if (defined('CURLOPT_PROTOCOLS')) { + curl_setopt($crs, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP | CURLPROTO_FTP | CURLPROTO_FTPS); + } curl_exec($crs); $code = curl_getinfo($crs, CURLINFO_HTTP_CODE); curl_close($crs); return ($code == 200); } + /** + * Encode query params in URL + * + * @param string $url + * @return string + * @since 6.3.3 (2019-11-01) + * @public static + */ + public static function encodeUrlQuery($url) { + $urlData = parse_url($url); + if (isset($urlData['query']) && $urlData['query']) { + $urlQueryData = array(); + parse_str(urldecode($urlData['query']), $urlQueryData); + $port = isset($urlData['port']) ? ':'.$urlData['port'] : ''; + $updatedUrl = $urlData['scheme'].'://'.$urlData['host'].$port.$urlData['path'].'?'.http_build_query($urlQueryData); + } else { + $updatedUrl = $url; + } + return $updatedUrl; + } + /** * Wrapper for file_exists. * Checks whether a file or directory exists. * Only allows some protocols and local files. - * @param filename (string) Path to the file or directory. - * @return Returns TRUE if the file or directory specified by filename exists; FALSE otherwise. + * @param string $filename Path to the file or directory. + * @return bool Returns TRUE if the file or directory specified by filename exists; FALSE otherwise. * @public static */ - public static function file_exists($filename) - { + public static function file_exists($filename) { if (preg_match('|^https?://|', $filename) == 1) { return self::url_exists($filename); } @@ -1923,31 +1891,30 @@ class TCPDF_STATIC /** * Reads entire file into a string. * The file can be also an URL. - * @param $file (string) Name of the file or URL to read. - * @return The function returns the read data or FALSE on failure. + * @param string $file Name of the file or URL to read. + * @return string|false The function returns the read data or FALSE on failure. * @author Nicola Asuni * @since 6.0.025 * @public static */ - public static function fileGetContents($file) - { + public static function fileGetContents($file) { $alt = array($file); // if ((strlen($file) > 1) - && ($file[0] === '/') - && ($file[1] !== '/') - && !empty($_SERVER['DOCUMENT_ROOT']) - && ($_SERVER['DOCUMENT_ROOT'] !== '/') + && ($file[0] === '/') + && ($file[1] !== '/') + && !empty($_SERVER['DOCUMENT_ROOT']) + && ($_SERVER['DOCUMENT_ROOT'] !== '/') ) { - $findroot = strpos($file, $_SERVER['DOCUMENT_ROOT']); - if (($findroot === false) || ($findroot > 1)) { - $alt[] = htmlspecialchars_decode(urldecode($_SERVER['DOCUMENT_ROOT'].$file)); - } + $findroot = strpos($file, $_SERVER['DOCUMENT_ROOT']); + if (($findroot === false) || ($findroot > 1)) { + $alt[] = htmlspecialchars_decode(urldecode($_SERVER['DOCUMENT_ROOT'].$file)); + } } // $protocol = 'http'; if (!empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) { - $protocol .= 's'; + $protocol .= 's'; } // $url = $file; @@ -1958,26 +1925,26 @@ class TCPDF_STATIC $alt[] = $url; // if (preg_match('%^(https?)://%', $url) - && empty($_SERVER['HTTP_HOST']) - && empty($_SERVER['DOCUMENT_ROOT']) + && empty($_SERVER['HTTP_HOST']) + && empty($_SERVER['DOCUMENT_ROOT']) ) { $urldata = parse_url($url); if (empty($urldata['query'])) { $host = $protocol.'://'.$_SERVER['HTTP_HOST']; if (strpos($url, $host) === 0) { - // convert URL to full server path - $tmp = str_replace($host, $_SERVER['DOCUMENT_ROOT'], $url); - $alt[] = htmlspecialchars_decode(urldecode($tmp)); + // convert URL to full server path + $tmp = str_replace($host, $_SERVER['DOCUMENT_ROOT'], $url); + $alt[] = htmlspecialchars_decode(urldecode($tmp)); } } } // if (isset($_SERVER['SCRIPT_URI']) - && !preg_match('%^(https?|ftp)://%', $file) - && !preg_match('%^//%', $file) + && !preg_match('%^(https?|ftp)://%', $file) + && !preg_match('%^//%', $file) ) { - $urldata = @parse_url($_SERVER['SCRIPT_URI']); - $alt[] = $urldata['scheme'].'://'.$urldata['host'].(($file[0] == '/') ? '' : '/').$file; + $urldata = @parse_url($_SERVER['SCRIPT_URI']); + $alt[] = $urldata['scheme'].'://'.$urldata['host'].(($file[0] == '/') ? '' : '/').$file; } // $alt = array_unique($alt); @@ -1987,7 +1954,7 @@ class TCPDF_STATIC } $ret = @file_get_contents($path); if ( $ret != false ) { - return $ret; + return $ret; } // try to use CURL for URLs if (!ini_get('allow_url_fopen') @@ -2001,13 +1968,17 @@ class TCPDF_STATIC curl_setopt($crs, CURLOPT_FAILONERROR, true); curl_setopt($crs, CURLOPT_RETURNTRANSFER, true); if ((ini_get('open_basedir') == '') && (!ini_get('safe_mode'))) { - curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true); } curl_setopt($crs, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($crs, CURLOPT_TIMEOUT, 30); curl_setopt($crs, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($crs, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($crs, CURLOPT_USERAGENT, 'tc-lib-file'); + curl_setopt($crs, CURLOPT_MAXREDIRS, 5); + if (defined('CURLOPT_PROTOCOLS')) { + curl_setopt($crs, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP | CURLPROTO_FTP | CURLPROTO_FTPS); + } $ret = curl_exec($crs); curl_close($crs); if ($ret !== false) { @@ -2020,60 +1991,56 @@ class TCPDF_STATIC /** * Get ULONG from string (Big Endian 32-bit unsigned integer). - * @param $str (string) string from where to extract value - * @param $offset (int) point from where to read the data + * @param string $str string from where to extract value + * @param int $offset point from where to read the data * @return int 32 bit value * @author Nicola Asuni * @since 5.2.000 (2010-06-02) * @public static */ - public static function _getULONG($str, $offset) - { + public static function _getULONG($str, $offset) { $v = unpack('Ni', substr($str, $offset, 4)); return $v['i']; } /** * Get USHORT from string (Big Endian 16-bit unsigned integer). - * @param $str (string) string from where to extract value - * @param $offset (int) point from where to read the data + * @param string $str string from where to extract value + * @param int $offset point from where to read the data * @return int 16 bit value * @author Nicola Asuni * @since 5.2.000 (2010-06-02) * @public static */ - public static function _getUSHORT($str, $offset) - { + public static function _getUSHORT($str, $offset) { $v = unpack('ni', substr($str, $offset, 2)); return $v['i']; } /** * Get SHORT from string (Big Endian 16-bit signed integer). - * @param $str (string) String from where to extract value. - * @param $offset (int) Point from where to read the data. + * @param string $str String from where to extract value. + * @param int $offset Point from where to read the data. * @return int 16 bit value * @author Nicola Asuni * @since 5.2.000 (2010-06-02) * @public static */ - public static function _getSHORT($str, $offset) - { + public static function _getSHORT($str, $offset) { $v = unpack('si', substr($str, $offset, 2)); return $v['i']; } /** * Get FWORD from string (Big Endian 16-bit signed integer). - * @param $str (string) String from where to extract value. - * @param $offset (int) Point from where to read the data. + * @param string $str String from where to extract value. + * @param int $offset Point from where to read the data. * @return int 16 bit value * @author Nicola Asuni * @since 5.9.123 (2011-09-30) * @public static */ - public static function _getFWORD($str, $offset) - { + public static function _getFWORD($str, $offset) { $v = self::_getUSHORT($str, $offset); if ($v > 0x7fff) { $v -= 0x10000; @@ -2083,30 +2050,28 @@ class TCPDF_STATIC /** * Get UFWORD from string (Big Endian 16-bit unsigned integer). - * @param $str (string) string from where to extract value - * @param $offset (int) point from where to read the data + * @param string $str string from where to extract value + * @param int $offset point from where to read the data * @return int 16 bit value * @author Nicola Asuni * @since 5.9.123 (2011-09-30) * @public static */ - public static function _getUFWORD($str, $offset) - { + public static function _getUFWORD($str, $offset) { $v = self::_getUSHORT($str, $offset); return $v; } /** * Get FIXED from string (32-bit signed fixed-point number (16.16). - * @param $str (string) string from where to extract value - * @param $offset (int) point from where to read the data + * @param string $str string from where to extract value + * @param int $offset point from where to read the data * @return int 16 bit value * @author Nicola Asuni * @since 5.9.123 (2011-09-30) * @public static */ - public static function _getFIXED($str, $offset) - { + public static function _getFIXED($str, $offset) { // mantissa $m = self::_getFWORD($str, $offset); // fraction @@ -2117,30 +2082,28 @@ class TCPDF_STATIC /** * Get BYTE from string (8-bit unsigned integer). - * @param $str (string) String from where to extract value. - * @param $offset (int) Point from where to read the data. + * @param string $str String from where to extract value. + * @param int $offset Point from where to read the data. * @return int 8 bit value * @author Nicola Asuni * @since 5.2.000 (2010-06-02) * @public static */ - public static function _getBYTE($str, $offset) - { + public static function _getBYTE($str, $offset) { $v = unpack('Ci', substr($str, $offset, 1)); return $v['i']; } /** * Binary-safe and URL-safe file read. * Reads up to length bytes from the file pointer referenced by handle. Reading stops as soon as one of the following conditions is met: length bytes have been read; EOF (end of file) is reached. - * @param $handle (resource) - * @param $length (int) - * @return Returns the read string or FALSE in case of error. + * @param resource $handle + * @param int $length + * @return string|false Returns the read string or FALSE in case of error. * @author Nicola Asuni * @since 4.5.027 (2009-03-16) * @public static */ - public static function rfread($handle, $length) - { + public static function rfread($handle, $length) { $data = fread($handle, $length); if ($data === false) { return false; @@ -2154,21 +2117,21 @@ class TCPDF_STATIC /** * Read a 4-byte (32 bit) integer from file. - * @param $f (string) file name. - * @return 4-byte integer + * @param resource $f file resource. + * @return int 4-byte integer * @public static */ - public static function _freadint($f) - { + public static function _freadint($f) { $a = unpack('Ni', fread($f, 4)); return $a['i']; } - /** * Array of page formats * measures are calculated in this way: (inches * 72) or (millimeters * 72 / 25.4) * @public static + * + * @var array */ public static $page_formats = array( // ISO 216 A Series + 2 SIS 014711 extensions @@ -2524,13 +2487,12 @@ class TCPDF_STATIC /** * Get page dimensions from format name. - * @param $format (mixed) The format name @see self::$page_format
      + * @param mixed $format The format name @see self::$page_format
        * @return array containing page width and height in points * @since 5.0.010 (2010-05-17) * @public static */ - public static function getPageSizeFromFormat($format) - { + public static function getPageSizeFromFormat($format) { if (isset(self::$page_formats[$format])) { return self::$page_formats[$format]; } @@ -2539,21 +2501,20 @@ class TCPDF_STATIC /** * Set page boundaries. - * @param $page (int) page number - * @param $type (string) valid values are:
        • 'MediaBox' : the boundaries of the physical medium on which the page shall be displayed or printed;
        • 'CropBox' : the visible region of default user space;
        • 'BleedBox' : the region to which the contents of the page shall be clipped when output in a production environment;
        • 'TrimBox' : the intended dimensions of the finished page after trimming;
        • 'ArtBox' : the page's meaningful content (including potential white space).
        - * @param $llx (float) lower-left x coordinate in user units. - * @param $lly (float) lower-left y coordinate in user units. - * @param $urx (float) upper-right x coordinate in user units. - * @param $ury (float) upper-right y coordinate in user units. - * @param $points (boolean) If true uses user units as unit of measure, otherwise uses PDF points. - * @param $k (float) Scale factor (number of points in user unit). - * @param $pagedim (array) Array of page dimensions. - * @return pagedim array of page dimensions. + * @param int $page page number + * @param string $type valid values are:
        • 'MediaBox' : the boundaries of the physical medium on which the page shall be displayed or printed;
        • 'CropBox' : the visible region of default user space;
        • 'BleedBox' : the region to which the contents of the page shall be clipped when output in a production environment;
        • 'TrimBox' : the intended dimensions of the finished page after trimming;
        • 'ArtBox' : the page's meaningful content (including potential white space).
        + * @param float $llx lower-left x coordinate in user units. + * @param float $lly lower-left y coordinate in user units. + * @param float $urx upper-right x coordinate in user units. + * @param float $ury upper-right y coordinate in user units. + * @param boolean $points If true uses user units as unit of measure, otherwise uses PDF points. + * @param float $k Scale factor (number of points in user unit). + * @param array $pagedim Array of page dimensions. + * @return array pagedim array of page dimensions. * @since 5.0.010 (2010-05-17) * @public static */ - public static function setPageBoxes($page, $type, $llx, $lly, $urx, $ury, $points = false, $k, $pagedim = array()) - { + public static function setPageBoxes($page, $type, $llx, $lly, $urx, $ury, $points, $k, $pagedim=array()) { if (!isset($pagedim[$page])) { // initialize array $pagedim[$page] = array(); @@ -2573,14 +2534,13 @@ class TCPDF_STATIC /** * Swap X and Y coordinates of page boxes (change page boxes orientation). - * @param $page (int) page number - * @param $pagedim (array) Array of page dimensions. - * @return pagedim array of page dimensions. + * @param int $page page number + * @param array $pagedim Array of page dimensions. + * @return array pagedim array of page dimensions. * @since 5.0.010 (2010-05-17) * @public static */ - public static function swapPageBoxCoordinates($page, $pagedim) - { + public static function swapPageBoxCoordinates($page, $pagedim) { foreach (self::$pageboxes as $type) { // swap X and Y coordinates if (isset($pagedim[$page][$type])) { @@ -2597,12 +2557,11 @@ class TCPDF_STATIC /** * Get the canonical page layout mode. - * @param $layout (string) The page layout. Possible values are:
        • SinglePage Display one page at a time
        • OneColumn Display the pages in one column
        • TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left
        • TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right
        • TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
        • TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right
        - * @return (string) Canonical page layout name. + * @param string $layout The page layout. Possible values are:
        • SinglePage Display one page at a time
        • OneColumn Display the pages in one column
        • TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left
        • TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right
        • TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
        • TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right
        + * @return string Canonical page layout name. * @public static */ - public static function getPageLayoutMode($layout = 'SinglePage') - { + public static function getPageLayoutMode($layout='SinglePage') { switch ($layout) { case 'default': case 'single': @@ -2641,12 +2600,11 @@ class TCPDF_STATIC /** * Get the canonical page layout mode. - * @param $mode (string) A name object specifying how the document should be displayed when opened:
        • UseNone Neither document outline nor thumbnail images visible
        • UseOutlines Document outline visible
        • UseThumbs Thumbnail images visible
        • FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible
        • UseOC (PDF 1.5) Optional content group panel visible
        • UseAttachments (PDF 1.6) Attachments panel visible
        - * @return (string) Canonical page mode name. + * @param string $mode A name object specifying how the document should be displayed when opened:
        • UseNone Neither document outline nor thumbnail images visible
        • UseOutlines Document outline visible
        • UseThumbs Thumbnail images visible
        • FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible
        • UseOC (PDF 1.5) Optional content group panel visible
        • UseAttachments (PDF 1.6) Attachments panel visible
        + * @return string Canonical page mode name. * @public static */ - public static function getPageMode($mode = 'UseNone') - { + public static function getPageMode($mode='UseNone') { switch ($mode) { case 'UseNone': { $page_mode = 'UseNone'; @@ -2678,6 +2636,8 @@ class TCPDF_STATIC } return $page_mode; } + + } // END OF TCPDF_STATIC CLASS //============================================================+ diff --git a/htdocs/includes/tecnickcom/tcpdf/scripts/doctum.php b/htdocs/includes/tecnickcom/tcpdf/scripts/doctum.php new file mode 100644 index 00000000000..4a9c98b71c4 --- /dev/null +++ b/htdocs/includes/tecnickcom/tcpdf/scripts/doctum.php @@ -0,0 +1,34 @@ +files() + ->name('*.php') + ->notPath('cache') + ->notPath('build') + ->notPath('fonts') + ->notPath('vendor') + ->notPath('tests') + ->notPath('examples') + ->in($rootDir); + +return new Doctum($iterator, [ + 'title' => 'TCPDF', + 'build_dir' => $rootDir . '/build', + 'cache_dir' => $rootDir . '/cache', + 'source_dir' => $rootDir, + 'remote_repository' => new GitHubRemoteRepository('tecnickcom/TCPDF', $rootDir), + 'footer_link' => [ + 'href' => 'https://github.com/tecnickcom/TCPDF#readme', + 'rel' => 'noreferrer noopener', + 'target' => '_blank', + 'before_text' => 'This documentation is for', + 'link_text' => 'TCPDF', + 'after_text' => 'the PHP library to build PDFs.', + ], +]); diff --git a/htdocs/includes/tecnickcom/tcpdf/tcpdf.php b/htdocs/includes/tecnickcom/tcpdf/tcpdf.php index ba507b12f4c..306f81f5c03 100644 --- a/htdocs/includes/tecnickcom/tcpdf/tcpdf.php +++ b/htdocs/includes/tecnickcom/tcpdf/tcpdf.php @@ -1,13 +1,13 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 6.3.2 + * @version 6.6.5 */ // TCPDF configuration -require_once dirname(__FILE__).'/tcpdf_autoconfig.php'; +require_once(dirname(__FILE__).'/tcpdf_autoconfig.php'); // TCPDF static font methods and data -require_once dirname(__FILE__).'/include/tcpdf_font_data.php'; +require_once(dirname(__FILE__).'/include/tcpdf_font_data.php'); // TCPDF static font methods and data -require_once dirname(__FILE__).'/include/tcpdf_fonts.php'; +require_once(dirname(__FILE__).'/include/tcpdf_fonts.php'); // TCPDF static color methods and data -require_once dirname(__FILE__).'/include/tcpdf_colors.php'; +require_once(dirname(__FILE__).'/include/tcpdf_colors.php'); // TCPDF static image methods and data -require_once dirname(__FILE__).'/include/tcpdf_images.php'; +require_once(dirname(__FILE__).'/include/tcpdf_images.php'); // TCPDF static methods and data -require_once dirname(__FILE__).'/include/tcpdf_static.php'; +require_once(dirname(__FILE__).'/include/tcpdf_static.php'); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -128,14 +128,13 @@ 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.
        * @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 6.3.2 + * @version 6.7.5 * @author Nicola Asuni - info@tecnick.com * @IgnoreAnnotation("protected") * @IgnoreAnnotation("public") * @IgnoreAnnotation("pre") */ -class TCPDF -{ +class TCPDF { // Protected properties @@ -575,12 +574,14 @@ class TCPDF /** * Minimum distance between header and top page margin. * @protected + * @var float */ protected $header_margin; /** * Minimum distance between footer and bottom page margin. * @protected + * @var float */ protected $footer_margin; @@ -601,12 +602,16 @@ class TCPDF /** * Default font used on page header. * @protected + * @var array + * @phpstan-var array{0: string, 1: string, 2: float|null} */ protected $header_font; /** * Default font used on page footer. * @protected + * @var array + * @phpstan-var array{0: string, 1: string, 2: float|null} */ protected $footer_font; @@ -653,7 +658,7 @@ class TCPDF protected $header_title = ''; /** - * String to pring on page header after title. + * String to print on page header after title. * @protected */ protected $header_string = ''; @@ -662,6 +667,8 @@ class TCPDF * Color for header text (RGB array). * @since 5.9.174 (2012-07-25) * @protected + * @var int[] + * @phpstan-var array{0: int, 1: int, 2: int} */ protected $header_text_color = array(0,0,0); @@ -669,6 +676,8 @@ class TCPDF * Color for header line (RGB array). * @since 5.9.174 (2012-07-25) * @protected + * @var int[] + * @phpstan-var array{0: int, 1: int, 2: int} */ protected $header_line_color = array(0,0,0); @@ -676,6 +685,8 @@ class TCPDF * Color for footer text (RGB array). * @since 5.9.174 (2012-07-25) * @protected + * @var int[] + * @phpstan-var array{0: int, 1: int, 2: int} */ protected $footer_text_color = array(0,0,0); @@ -683,6 +694,8 @@ class TCPDF * Color for footer line (RGB array). * @since 5.9.174 (2012-07-25) * @protected + * @var int[] + * @phpstan-var array{0: int, 1: int, 2: int} */ protected $footer_line_color = array(0,0,0); @@ -774,13 +787,6 @@ class TCPDF */ protected $encoding = 'UTF-8'; - /** - * PHP internal encoding. - * @protected - * @since 1.53.0.TC016 - */ - protected $internal_encoding; - /** * Boolean flag to indicate if the document language is Right-To-Left. * @protected @@ -832,6 +838,13 @@ class TCPDF */ protected $file_id; + /** + * Internal secret used to encrypt data. + * @protected + * @since 6.7.5 (2024-03-21) + */ + protected $hash_key; + // --- bookmark --- /** @@ -924,6 +937,7 @@ class TCPDF * Default cell height ratio. * @protected * @since 3.0.014 (2008-05-23) + * @var float */ protected $cell_height_ratio = K_CELL_HEIGHT_RATIO; @@ -1220,7 +1234,7 @@ class TCPDF * @protected * @since 4.5.025 (2009-03-10) */ - protected $default_monospaced_font = 'freemono'; + protected $default_monospaced_font = 'freemono'; // @CHANGE DOL /** * Cloned copy of the current class object. @@ -1801,6 +1815,7 @@ class TCPDF * (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008). * @protected * @since 5.9.152 (2012-03-23) + * @var array */ protected $overprint = array('OP' => false, 'op' => false, 'OPM' => 0); @@ -1833,6 +1848,23 @@ class TCPDF */ protected $gdgammacache = array(); + /** + * Cache array for file content + * @protected + * @var array + * @since 6.3.5 (2020-09-28) + */ + protected $fileContentCache = array(); + + /** + * Whether to allow local file path in image html tags, when prefixed with file:// + * + * @var bool + * @protected + * @since 6.4 (2020-07-23) + */ + protected $allowLocalFiles = false; + //------------------------------------------------------------ // METHODS //------------------------------------------------------------ @@ -1841,37 +1873,30 @@ class TCPDF * This is the class constructor. * It allows to set up the page format, the orientation and the measure unit used in all the methods (except for the font sizes). * - * IMPORTANT: Please note that this method sets the mb_internal_encoding to ASCII, so if you are using the mbstring module functions with TCPDF you need to correctly set/unset the mb_internal_encoding when needed. - * - * @param $orientation (string) page orientation. Possible values are (case insensitive):
        • P or Portrait (default)
        • L or Landscape
        • '' (empty string) for automatic orientation
        - * @param $unit (string) User measure unit. Possible values are:
        • pt: point
        • mm: millimeter (default)
        • cm: centimeter
        • in: inch

        A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit. - * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). - * @param $unicode (boolean) TRUE means that the input text is unicode (default = true) - * @param $encoding (string) Charset encoding (used only when converting back html entities); default is UTF-8. - * @param $diskcache (boolean) DEPRECATED FEATURE - * @param $pdfa (integer) If not false, set the document to PDF/A mode and the good version (1 or 3). + * @param string $orientation page orientation. Possible values are (case insensitive):
        • P or Portrait (default)
        • L or Landscape
        • '' (empty string) for automatic orientation
        + * @param string $unit User measure unit. Possible values are:
        • pt: point
        • mm: millimeter (default)
        • cm: centimeter
        • in: inch

        A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit. + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). + * @param boolean $unicode TRUE means that the input text is unicode (default = true) + * @param string $encoding Charset encoding (used only when converting back html entities); default is UTF-8. + * @param boolean $diskcache DEPRECATED FEATURE + * @param false|integer $pdfa If not false, set the document to PDF/A mode and the good version (1 or 3). * @public * @see getPageSizeFromFormat(), setPageFormat() */ - public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $pdfa = false) - { - /* Set internal character encoding to ASCII */ - if (function_exists('mb_internal_encoding') AND mb_internal_encoding()) { - $this->internal_encoding = mb_internal_encoding(); - mb_internal_encoding('ASCII'); - } + public function __construct($orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8', $diskcache=false, $pdfa=false) { // set file ID for trailer $serformat = (is_array($format) ? json_encode($format) : $format); $this->file_id = md5(TCPDF_STATIC::getRandomSeed('TCPDF'.$orientation.$unit.$serformat.$encoding)); + $this->hash_key = hash_hmac('sha256', TCPDF_STATIC::getRandomSeed($this->file_id), TCPDF_STATIC::getRandomSeed('TCPDF'), false); $this->font_obj_ids = array(); $this->page_obj_id = array(); $this->form_obj_id = array(); - // set pdf/a mode if ($pdfa != false) { $this->pdfa_mode = true; $this->pdfa_version = $pdfa; // 1 or 3 - } else $this->pdfa_mode = false; + } else + $this->pdfa_mode = false; $this->force_srgb = false; // set language direction @@ -1933,7 +1958,7 @@ class TCPDF $this->setPageFormat($format, $orientation); // page margins (1 cm) $margin = 28.35 / $this->k; - $this->SetMargins($margin, $margin); + $this->setMargins($margin, $margin); $this->clMargin = $this->lMargin; $this->crMargin = $this->rMargin; // internal cell padding @@ -1948,11 +1973,11 @@ class TCPDF $this->linestyleJoin = '0 j'; $this->linestyleDash = '[] 0 d'; // automatic page break - $this->SetAutoPageBreak(true, (2 * $margin)); + $this->setAutoPageBreak(true, (2 * $margin)); // full width display mode - $this->SetDisplayMode('fullwidth'); + $this->setDisplayMode('fullwidth'); // compression - $this->SetCompression(); + $this->setCompression(); // set default PDF version number $this->setPDFVersion(); $this->tcpdflink = true; @@ -1983,7 +2008,7 @@ class TCPDF // initialize some settings TCPDF_FONTS::utf8Bidi(array(), '', false, $this->isunicode, $this->CurrentFont); // set default font - $this->SetFont($this->FontFamily, $this->FontStyle, $this->FontSizePt); + $this->setFont($this->FontFamily, $this->FontStyle, $this->FontSizePt); $this->setHeaderFont(array($this->FontFamily, $this->FontStyle, $this->FontSizePt)); $this->setFooterFont(array($this->FontFamily, $this->FontStyle, $this->FontSizePt)); // check if PCRE Unicode support is enabled @@ -2008,9 +2033,6 @@ class TCPDF $this->header_xobj_autoreset = false; $this->custom_xmp = ''; $this->custom_xmp_rdf = ''; - // Call cleanup method after script execution finishes or exit() is called. - // NOTE: This will not be executed if the process is killed with a SIGTERM or SIGKILL signal. - register_shutdown_function(array($this, '_destroy'), true); } /** @@ -2018,20 +2040,18 @@ class TCPDF * @public * @since 1.53.0.TC016 */ - public function __destruct() - { + public function __destruct() { // cleanup $this->_destroy(true); } /** * Set the units of measure for the document. - * @param $unit (string) User measure unit. Possible values are:
        • pt: point
        • mm: millimeter (default)
        • cm: centimeter
        • in: inch

        A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit. + * @param string $unit User measure unit. Possible values are:
        • pt: point
        • mm: millimeter (default)
        • cm: centimeter
        • in: inch

        A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit. * @public * @since 3.0.015 (2008-06-06) */ - public function setPageUnit($unit) - { + public function setPageUnit($unit) { $unit = strtolower($unit); //Set scale factor switch ($unit) { @@ -2070,61 +2090,60 @@ class TCPDF /** * Change the format of the current page - * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() documentation or an array of two numbers (width, height) or an array containing the following measures and options:
          - *
        • ['format'] = page format name (one of the above);
        • - *
        • ['Rotate'] : The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.
        • - *
        • ['PZ'] : The page's preferred zoom (magnification) factor.
        • - *
        • ['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed:
        • - *
        • ['MediaBox']['llx'] : lower-left x coordinate
        • - *
        • ['MediaBox']['lly'] : lower-left y coordinate
        • - *
        • ['MediaBox']['urx'] : upper-right x coordinate
        • - *
        • ['MediaBox']['ury'] : upper-right y coordinate
        • - *
        • ['CropBox'] : the visible region of default user space:
        • - *
        • ['CropBox']['llx'] : lower-left x coordinate
        • - *
        • ['CropBox']['lly'] : lower-left y coordinate
        • - *
        • ['CropBox']['urx'] : upper-right x coordinate
        • - *
        • ['CropBox']['ury'] : upper-right y coordinate
        • - *
        • ['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment:
        • - *
        • ['BleedBox']['llx'] : lower-left x coordinate
        • - *
        • ['BleedBox']['lly'] : lower-left y coordinate
        • - *
        • ['BleedBox']['urx'] : upper-right x coordinate
        • - *
        • ['BleedBox']['ury'] : upper-right y coordinate
        • - *
        • ['TrimBox'] : the intended dimensions of the finished page after trimming:
        • - *
        • ['TrimBox']['llx'] : lower-left x coordinate
        • - *
        • ['TrimBox']['lly'] : lower-left y coordinate
        • - *
        • ['TrimBox']['urx'] : upper-right x coordinate
        • - *
        • ['TrimBox']['ury'] : upper-right y coordinate
        • - *
        • ['ArtBox'] : the extent of the page's meaningful content:
        • - *
        • ['ArtBox']['llx'] : lower-left x coordinate
        • - *
        • ['ArtBox']['lly'] : lower-left y coordinate
        • - *
        • ['ArtBox']['urx'] : upper-right x coordinate
        • - *
        • ['ArtBox']['ury'] : upper-right y coordinate
        • - *
        • ['BoxColorInfo'] :specify the colours and other visual characteristics that should be used in displaying guidelines on the screen for each of the possible page boundaries other than the MediaBox:
        • - *
        • ['BoxColorInfo'][BOXTYPE]['C'] : an array of three numbers in the range 0-255, representing the components in the DeviceRGB colour space.
        • - *
        • ['BoxColorInfo'][BOXTYPE]['W'] : the guideline width in default user units
        • - *
        • ['BoxColorInfo'][BOXTYPE]['S'] : the guideline style: S = Solid; D = Dashed
        • - *
        • ['BoxColorInfo'][BOXTYPE]['D'] : dash array defining a pattern of dashes and gaps to be used in drawing dashed guidelines
        • - *
        • ['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation
        • - *
        • ['trans']['Dur'] : The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.
        • - *
        • ['trans']['S'] : transition style : Split, Blinds, Box, Wipe, Dissolve, Glitter, R, Fly, Push, Cover, Uncover, Fade
        • - *
        • ['trans']['D'] : The duration of the transition effect, in seconds.
        • - *
        • ['trans']['Dm'] : (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.
        • - *
        • ['trans']['M'] : (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.
        • - *
        • ['trans']['Di'] : (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.
        • - *
        • ['trans']['SS'] : (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.
        • - *
        • ['trans']['B'] : (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.
        • - *
        - * @param $orientation (string) page orientation. Possible values are (case insensitive):
          - *
        • P or Portrait (default)
        • - *
        • L or Landscape
        • - *
        • '' (empty string) for automatic orientation
        • - *
        + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() documentation or an array of two numbers (width, height) or an array containing the following measures and options:
          + *
        • ['format'] = page format name (one of the above);
        • + *
        • ['Rotate'] : The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.
        • + *
        • ['PZ'] : The page's preferred zoom (magnification) factor.
        • + *
        • ['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed:
        • + *
        • ['MediaBox']['llx'] : lower-left x coordinate
        • + *
        • ['MediaBox']['lly'] : lower-left y coordinate
        • + *
        • ['MediaBox']['urx'] : upper-right x coordinate
        • + *
        • ['MediaBox']['ury'] : upper-right y coordinate
        • + *
        • ['CropBox'] : the visible region of default user space:
        • + *
        • ['CropBox']['llx'] : lower-left x coordinate
        • + *
        • ['CropBox']['lly'] : lower-left y coordinate
        • + *
        • ['CropBox']['urx'] : upper-right x coordinate
        • + *
        • ['CropBox']['ury'] : upper-right y coordinate
        • + *
        • ['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment:
        • + *
        • ['BleedBox']['llx'] : lower-left x coordinate
        • + *
        • ['BleedBox']['lly'] : lower-left y coordinate
        • + *
        • ['BleedBox']['urx'] : upper-right x coordinate
        • + *
        • ['BleedBox']['ury'] : upper-right y coordinate
        • + *
        • ['TrimBox'] : the intended dimensions of the finished page after trimming:
        • + *
        • ['TrimBox']['llx'] : lower-left x coordinate
        • + *
        • ['TrimBox']['lly'] : lower-left y coordinate
        • + *
        • ['TrimBox']['urx'] : upper-right x coordinate
        • + *
        • ['TrimBox']['ury'] : upper-right y coordinate
        • + *
        • ['ArtBox'] : the extent of the page's meaningful content:
        • + *
        • ['ArtBox']['llx'] : lower-left x coordinate
        • + *
        • ['ArtBox']['lly'] : lower-left y coordinate
        • + *
        • ['ArtBox']['urx'] : upper-right x coordinate
        • + *
        • ['ArtBox']['ury'] : upper-right y coordinate
        • + *
        • ['BoxColorInfo'] :specify the colours and other visual characteristics that should be used in displaying guidelines on the screen for each of the possible page boundaries other than the MediaBox:
        • + *
        • ['BoxColorInfo'][BOXTYPE]['C'] : an array of three numbers in the range 0-255, representing the components in the DeviceRGB colour space.
        • + *
        • ['BoxColorInfo'][BOXTYPE]['W'] : the guideline width in default user units
        • + *
        • ['BoxColorInfo'][BOXTYPE]['S'] : the guideline style: S = Solid; D = Dashed
        • + *
        • ['BoxColorInfo'][BOXTYPE]['D'] : dash array defining a pattern of dashes and gaps to be used in drawing dashed guidelines
        • + *
        • ['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation
        • + *
        • ['trans']['Dur'] : The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.
        • + *
        • ['trans']['S'] : transition style : Split, Blinds, Box, Wipe, Dissolve, Glitter, R, Fly, Push, Cover, Uncover, Fade
        • + *
        • ['trans']['D'] : The duration of the transition effect, in seconds.
        • + *
        • ['trans']['Dm'] : (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.
        • + *
        • ['trans']['M'] : (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.
        • + *
        • ['trans']['Di'] : (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.
        • + *
        • ['trans']['SS'] : (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.
        • + *
        • ['trans']['B'] : (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.
        • + *
        + * @param string $orientation page orientation. Possible values are (case insensitive):
          + *
        • P or Portrait (default)
        • + *
        • L or Landscape
        • + *
        • '' (empty string) for automatic orientation
        • + *
        * @protected * @since 3.0.015 (2008-06-06) * @see getPageSizeFromFormat() */ - protected function setPageFormat($format, $orientation = 'P') - { + protected function setPageFormat($format, $orientation='P') { if (!empty($format) AND isset($this->pagedim[$this->page])) { // remove inherited values unset($this->pagedim[$this->page]); @@ -2232,14 +2251,13 @@ class TCPDF /** * Set page orientation. - * @param $orientation (string) page orientation. Possible values are (case insensitive):
        • P or Portrait (default)
        • L or Landscape
        • '' (empty string) for automatic orientation
        - * @param $autopagebreak (boolean) Boolean indicating if auto-page-break mode should be on or off. - * @param $bottommargin (float) bottom margin of the page. + * @param string $orientation page orientation. Possible values are (case insensitive):
        • P or Portrait (default)
        • L or Landscape
        • '' (empty string) for automatic orientation
        + * @param boolean|null $autopagebreak Boolean indicating if auto-page-break mode should be on or off. + * @param float|null $bottommargin bottom margin of the page. * @public * @since 3.0.015 (2008-06-06) */ - public function setPageOrientation($orientation, $autopagebreak = '', $bottommargin = '') - { + public function setPageOrientation($orientation, $autopagebreak=null, $bottommargin=null) { if (!isset($this->pagedim[$this->page]['MediaBox'])) { // the boundaries of the physical medium on which the page shall be displayed or printed $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'MediaBox', 0, 0, $this->fwPt, $this->fhPt, true, $this->k, $this->pagedim); @@ -2290,7 +2308,7 @@ class TCPDF $this->wPt = $this->fwPt; $this->hPt = $this->fhPt; } - if ((abs($this->pagedim[$this->page]['MediaBox']['urx'] - $this->hPt) < $this->feps) AND (abs($this->pagedim[$this->page]['MediaBox']['ury'] - $this->wPt) < $this->feps)) { + if ((abs($this->pagedim[$this->page]['MediaBox']['urx'] - $this->hPt) < $this->feps) AND (abs($this->pagedim[$this->page]['MediaBox']['ury'] - $this->wPt) < $this->feps)){ // swap X and Y coordinates (change page orientation) $this->pagedim = TCPDF_STATIC::swapPageBoxCoordinates($this->page, $this->pagedim); } @@ -2311,7 +2329,7 @@ class TCPDF $bottommargin = 2 * 28.35 / $this->k; } } - $this->SetAutoPageBreak($autopagebreak, $bottommargin); + $this->setAutoPageBreak($autopagebreak, $bottommargin); // store page dimensions $this->pagedim[$this->page]['w'] = $this->wPt; $this->pagedim[$this->page]['h'] = $this->hPt; @@ -2341,12 +2359,11 @@ class TCPDF * \p{Lo} : Unicode letter or ideograph that does not have lowercase and uppercase variants. Is used to chunk chinese words. * \xa0 : Unicode Character 'NO-BREAK SPACE' (U+00A0) * - * @param $re (string) regular expression (leave empty for default). + * @param string $re regular expression (leave empty for default). * @public * @since 4.6.016 (2009-06-15) */ - public function setSpacesRE($re = '/[^\S\xa0]/') - { + public function setSpacesRE($re='/[^\S\xa0]/') { $this->re_spaces = $re; $re_parts = explode('/', $re); // get pattern parts @@ -2366,13 +2383,12 @@ class TCPDF /** * Enable or disable Right-To-Left language mode - * @param $enable (Boolean) if true enable Right-To-Left language mode. - * @param $resetx (Boolean) if true reset the X position on direction change. + * @param boolean $enable if true enable Right-To-Left language mode. + * @param boolean $resetx if true reset the X position on direction change. * @public * @since 2.0.000 (2008-01-03) */ - public function setRTL($enable, $resetx = true) - { + public function setRTL($enable, $resetx=true) { $enable = $enable ? true : false; $resetx = ($resetx AND ($enable != $this->rtl)); $this->rtl = $enable; @@ -2384,23 +2400,21 @@ class TCPDF /** * Return the RTL status - * @return boolean + * @return bool * @public * @since 4.0.012 (2008-07-24) */ - public function getRTL() - { + public function getRTL() { return $this->rtl; } /** * Force temporary RTL language direction - * @param $mode (mixed) can be false, 'L' for LTR or 'R' for RTL + * @param false|string $mode can be false, 'L' for LTR or 'R' for RTL * @public * @since 2.1.000 (2008-01-09) */ - public function setTempRTL($mode) - { + public function setTempRTL($mode) { $newmode = false; switch (strtoupper($mode)) { case 'LTR': @@ -2428,37 +2442,35 @@ class TCPDF /** * Return the current temporary RTL status - * @return boolean + * @return bool * @public * @since 4.8.014 (2009-11-04) */ - public function isRTLTextDir() - { + public function isRTLTextDir() { return ($this->rtl OR ($this->tmprtl == 'R')); } /** * Set the last cell height. - * @param $h (float) cell height. + * @param float $h cell height. * @author Nicola Asuni * @public * @since 1.53.0.TC034 */ - public function setLastH($h) - { + public function setLastH($h) { $this->lasth = $h; } /** * Return the cell height - * @param $fontsize (int) Font size in internal units - * @param $padding (boolean) If true add cell padding + * @param int $fontsize Font size in internal units + * @param boolean $padding If true add cell padding * @public + * @return float */ - public function getCellHeight($fontsize, $padding = true) - { + public function getCellHeight($fontsize, $padding=TRUE) { $height = ($fontsize * $this->cell_height_ratio); - if ($padding) { + if ($padding && !empty($this->cell_padding)) { $height += ($this->cell_padding['T'] + $this->cell_padding['B']); } return round($height, 6); @@ -2469,31 +2481,28 @@ class TCPDF * @public * @since 5.9.000 (2010-10-03) */ - public function resetLastH() - { + public function resetLastH() { $this->lasth = $this->getCellHeight($this->FontSize); } /** * Get the last cell height. - * @return last cell height + * @return float last cell height * @public * @since 4.0.017 (2008-08-05) */ - public function getLastH() - { + public function getLastH() { return $this->lasth; } /** * Set the adjusting factor to convert pixels to user units. - * @param $scale (float) adjusting factor to convert pixels to user units. + * @param float $scale adjusting factor to convert pixels to user units. * @author Nicola Asuni * @public * @since 1.5.2 */ - public function setImageScale($scale) - { + public function setImageScale($scale) { $this->imgscale = $scale; } @@ -2504,22 +2513,20 @@ class TCPDF * @public * @since 1.5.2 */ - public function getImageScale() - { + public function getImageScale() { return $this->imgscale; } /** * Returns an array of page dimensions: *
        • $this->pagedim[$this->page]['w'] = page width in points
        • $this->pagedim[$this->page]['h'] = height in points
        • $this->pagedim[$this->page]['wk'] = page width in user units
        • $this->pagedim[$this->page]['hk'] = page height in user units
        • $this->pagedim[$this->page]['tm'] = top margin
        • $this->pagedim[$this->page]['bm'] = bottom margin
        • $this->pagedim[$this->page]['lm'] = left margin
        • $this->pagedim[$this->page]['rm'] = right margin
        • $this->pagedim[$this->page]['pb'] = auto page break
        • $this->pagedim[$this->page]['or'] = page orientation
        • $this->pagedim[$this->page]['olm'] = original left margin
        • $this->pagedim[$this->page]['orm'] = original right margin
        • $this->pagedim[$this->page]['Rotate'] = The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.
        • $this->pagedim[$this->page]['PZ'] = The page's preferred zoom (magnification) factor.
        • $this->pagedim[$this->page]['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation
          • $this->pagedim[$this->page]['trans']['Dur'] = The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.
          • $this->pagedim[$this->page]['trans']['S'] = transition style : Split, Blinds, Box, Wipe, Dissolve, Glitter, R, Fly, Push, Cover, Uncover, Fade
          • $this->pagedim[$this->page]['trans']['D'] = The duration of the transition effect, in seconds.
          • $this->pagedim[$this->page]['trans']['Dm'] = (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.
          • $this->pagedim[$this->page]['trans']['M'] = (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.
          • $this->pagedim[$this->page]['trans']['Di'] = (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.
          • $this->pagedim[$this->page]['trans']['SS'] = (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.
          • $this->pagedim[$this->page]['trans']['B'] = (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.
        • $this->pagedim[$this->page]['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed
          • $this->pagedim[$this->page]['MediaBox']['llx'] = lower-left x coordinate in points
          • $this->pagedim[$this->page]['MediaBox']['lly'] = lower-left y coordinate in points
          • $this->pagedim[$this->page]['MediaBox']['urx'] = upper-right x coordinate in points
          • $this->pagedim[$this->page]['MediaBox']['ury'] = upper-right y coordinate in points
        • $this->pagedim[$this->page]['CropBox'] : the visible region of default user space
          • $this->pagedim[$this->page]['CropBox']['llx'] = lower-left x coordinate in points
          • $this->pagedim[$this->page]['CropBox']['lly'] = lower-left y coordinate in points
          • $this->pagedim[$this->page]['CropBox']['urx'] = upper-right x coordinate in points
          • $this->pagedim[$this->page]['CropBox']['ury'] = upper-right y coordinate in points
        • $this->pagedim[$this->page]['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment
          • $this->pagedim[$this->page]['BleedBox']['llx'] = lower-left x coordinate in points
          • $this->pagedim[$this->page]['BleedBox']['lly'] = lower-left y coordinate in points
          • $this->pagedim[$this->page]['BleedBox']['urx'] = upper-right x coordinate in points
          • $this->pagedim[$this->page]['BleedBox']['ury'] = upper-right y coordinate in points
        • $this->pagedim[$this->page]['TrimBox'] : the intended dimensions of the finished page after trimming
          • $this->pagedim[$this->page]['TrimBox']['llx'] = lower-left x coordinate in points
          • $this->pagedim[$this->page]['TrimBox']['lly'] = lower-left y coordinate in points
          • $this->pagedim[$this->page]['TrimBox']['urx'] = upper-right x coordinate in points
          • $this->pagedim[$this->page]['TrimBox']['ury'] = upper-right y coordinate in points
        • $this->pagedim[$this->page]['ArtBox'] : the extent of the page's meaningful content
          • $this->pagedim[$this->page]['ArtBox']['llx'] = lower-left x coordinate in points
          • $this->pagedim[$this->page]['ArtBox']['lly'] = lower-left y coordinate in points
          • $this->pagedim[$this->page]['ArtBox']['urx'] = upper-right x coordinate in points
          • $this->pagedim[$this->page]['ArtBox']['ury'] = upper-right y coordinate in points
        - * @param $pagenum (int) page number (empty = current page) + * @param int|null $pagenum page number (empty = current page) * @return array of page dimensions. * @author Nicola Asuni * @public * @since 4.5.027 (2009-03-16) */ - public function getPageDimensions($pagenum = '') - { + public function getPageDimensions($pagenum=null) { if (empty($pagenum)) { $pagenum = $this->page; } @@ -2528,15 +2535,14 @@ class TCPDF /** * Returns the page width in units. - * @param $pagenum (int) page number (empty = current page) - * @return int page width. + * @param int|null $pagenum page number (empty = current page) + * @return int|float page width. * @author Nicola Asuni * @public * @since 1.5.2 * @see getPageDimensions() */ - public function getPageWidth($pagenum = '') - { + public function getPageWidth($pagenum=null) { if (empty($pagenum)) { return $this->w; } @@ -2545,15 +2551,14 @@ class TCPDF /** * Returns the page height in units. - * @param $pagenum (int) page number (empty = current page) - * @return int page height. + * @param int|null $pagenum page number (empty = current page) + * @return int|float page height. * @author Nicola Asuni * @public * @since 1.5.2 * @see getPageDimensions() */ - public function getPageHeight($pagenum = '') - { + public function getPageHeight($pagenum=null) { if (empty($pagenum)) { return $this->h; } @@ -2562,15 +2567,14 @@ class TCPDF /** * Returns the page break margin. - * @param $pagenum (int) page number (empty = current page) - * @return int page break margin. + * @param int|null $pagenum page number (empty = current page) + * @return int|float page break margin. * @author Nicola Asuni * @public * @since 1.5.2 * @see getPageDimensions() */ - public function getBreakMargin($pagenum = '') - { + public function getBreakMargin($pagenum=null) { if (empty($pagenum)) { return $this->bMargin; } @@ -2584,27 +2588,25 @@ class TCPDF * @public * @since 1.5.2 */ - public function getScaleFactor() - { + public function getScaleFactor() { return $this->k; } /** * Defines the left, top and right margins. - * @param $left (float) Left margin. - * @param $top (float) Top margin. - * @param $right (float) Right margin. Default value is the left one. - * @param $keepmargins (boolean) if true overwrites the default page margins + * @param int|float $left Left margin. + * @param int|float $top Top margin. + * @param int|float|null $right Right margin. Default value is the left one. + * @param boolean $keepmargins if true overwrites the default page margins * @public * @since 1.0 * @see SetLeftMargin(), SetTopMargin(), SetRightMargin(), SetAutoPageBreak() */ - public function SetMargins($left, $top, $right = -1, $keepmargins = false) - { + public function setMargins($left, $top, $right=null, $keepmargins=false) { //Set left, top and right margins $this->lMargin = $left; $this->tMargin = $top; - if ($right == -1) { + if ($right == -1 OR $right === null) { $right = $left; } $this->rMargin = $right; @@ -2617,13 +2619,12 @@ class TCPDF /** * Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin. - * @param $margin (float) The margin. + * @param int|float $margin The margin. * @public * @since 1.4 * @see SetTopMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() */ - public function SetLeftMargin($margin) - { + public function setLeftMargin($margin) { //Set left margin $this->lMargin = $margin; if (($this->page > 0) AND ($this->x < $margin)) { @@ -2633,13 +2634,12 @@ class TCPDF /** * Defines the top margin. The method can be called before creating the first page. - * @param $margin (float) The margin. + * @param int|float $margin The margin. * @public * @since 1.5 * @see SetLeftMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() */ - public function SetTopMargin($margin) - { + public function setTopMargin($margin) { //Set top margin $this->tMargin = $margin; if (($this->page > 0) AND ($this->y < $margin)) { @@ -2649,13 +2649,12 @@ class TCPDF /** * Defines the right margin. The method can be called before creating the first page. - * @param $margin (float) The margin. + * @param int|float $margin The margin. * @public * @since 1.5 * @see SetLeftMargin(), SetTopMargin(), SetAutoPageBreak(), SetMargins() */ - public function SetRightMargin($margin) - { + public function setRightMargin($margin) { $this->rMargin = $margin; if (($this->page > 0) AND ($this->x > ($this->w - $margin))) { $this->x = $this->w - $margin; @@ -2664,13 +2663,12 @@ class TCPDF /** * Set the same internal Cell padding for top, right, bottom, left- - * @param $pad (float) internal padding. + * @param int|float $pad internal padding. * @public * @since 2.1.000 (2008-01-09) * @see getCellPaddings(), setCellPaddings() */ - public function SetCellPadding($pad) - { + public function setCellPadding($pad) { if ($pad >= 0) { $this->cell_padding['L'] = $pad; $this->cell_padding['T'] = $pad; @@ -2681,26 +2679,25 @@ class TCPDF /** * Set the internal Cell paddings. - * @param $left (float) left padding - * @param $top (float) top padding - * @param $right (float) right padding - * @param $bottom (float) bottom padding + * @param int|float|null $left left padding + * @param int|float|null $top top padding + * @param int|float|null $right right padding + * @param int|float|null $bottom bottom padding * @public * @since 5.9.000 (2010-10-03) * @see getCellPaddings(), SetCellPadding() */ - public function setCellPaddings($left = '', $top = '', $right = '', $bottom = '') - { - if (($left !== '') AND ($left >= 0)) { + public function setCellPaddings($left=null, $top=null, $right=null, $bottom=null) { + if (!TCPDF_STATIC::empty_string($left) AND ($left >= 0)) { $this->cell_padding['L'] = $left; } - if (($top !== '') AND ($top >= 0)) { + if (!TCPDF_STATIC::empty_string($top) AND ($top >= 0)) { $this->cell_padding['T'] = $top; } - if (($right !== '') AND ($right >= 0)) { + if (!TCPDF_STATIC::empty_string($right) AND ($right >= 0)) { $this->cell_padding['R'] = $right; } - if (($bottom !== '') AND ($bottom >= 0)) { + if (!TCPDF_STATIC::empty_string($bottom) AND ($bottom >= 0)) { $this->cell_padding['B'] = $bottom; } } @@ -2712,33 +2709,31 @@ class TCPDF * @since 5.9.000 (2010-10-03) * @see setCellPaddings(), SetCellPadding() */ - public function getCellPaddings() - { + public function getCellPaddings() { return $this->cell_padding; } /** * Set the internal Cell margins. - * @param $left (float) left margin - * @param $top (float) top margin - * @param $right (float) right margin - * @param $bottom (float) bottom margin + * @param int|float|null $left left margin + * @param int|float|null $top top margin + * @param int|float|null $right right margin + * @param int|float|null $bottom bottom margin * @public * @since 5.9.000 (2010-10-03) * @see getCellMargins() */ - public function setCellMargins($left = '', $top = '', $right = '', $bottom = '') - { - if (($left !== '') AND ($left >= 0)) { + public function setCellMargins($left=null, $top=null, $right=null, $bottom=null) { + if (!TCPDF_STATIC::empty_string($left) AND ($left >= 0)) { $this->cell_margin['L'] = $left; } - if (($top !== '') AND ($top >= 0)) { + if (!TCPDF_STATIC::empty_string($top) AND ($top >= 0)) { $this->cell_margin['T'] = $top; } - if (($right !== '') AND ($right >= 0)) { + if (!TCPDF_STATIC::empty_string($right) AND ($right >= 0)) { $this->cell_margin['R'] = $right; } - if (($bottom !== '') AND ($bottom >= 0)) { + if (!TCPDF_STATIC::empty_string($bottom) AND ($bottom >= 0)) { $this->cell_margin['B'] = $bottom; } } @@ -2750,20 +2745,18 @@ class TCPDF * @since 5.9.000 (2010-10-03) * @see setCellMargins() */ - public function getCellMargins() - { + public function getCellMargins() { return $this->cell_margin; } /** * Adjust the internal Cell padding array to take account of the line width. - * @param $brd (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @return array of adjustments + * @param string|array|int|bool $brd Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @return void|array array of adjustments * @public * @since 5.9.000 (2010-10-03) */ - protected function adjustCellPadding($brd = 0) - { + protected function adjustCellPadding($brd=0) { if (empty($brd)) { return; } @@ -2775,7 +2768,11 @@ class TCPDF $newbrd[$brd[$i]] = true; } $brd = $newbrd; - } elseif (($brd === 1) OR ($brd === true) OR (is_numeric($brd) AND (intval($brd) > 0))) { + } elseif ( + ($brd === 1) + || ($brd === true) + || (is_numeric($brd) && ((int)$brd > 0)) + ) { $brd = array('LRTB' => true); } if (!is_array($brd)) { @@ -2793,7 +2790,7 @@ class TCPDF // process borders foreach ($brd as $border => $style) { $line_width = $this->LineWidth; - if (is_array($style) AND isset($style['width'])) { + if (is_array($style) && isset($style['width'])) { // get border width $line_width = $style['width']; } @@ -2814,32 +2811,54 @@ class TCPDF } } // correct internal cell padding if required to avoid overlap between text and lines - if ((strpos($border, 'T') !== false) AND ($this->cell_padding['T'] < $adj)) { + if ( + is_numeric($this->cell_padding['T']) + && ($this->cell_padding['T'] < $adj) + && (strpos($border, 'T') !== false) + ) { $this->cell_padding['T'] = $adj; } - if ((strpos($border, 'R') !== false) AND ($this->cell_padding['R'] < $adj)) { + if ( + is_numeric($this->cell_padding['R']) + && ($this->cell_padding['R'] < $adj) + && (strpos($border, 'R') !== false) + ) { $this->cell_padding['R'] = $adj; } - if ((strpos($border, 'B') !== false) AND ($this->cell_padding['B'] < $adj)) { + if ( + is_numeric($this->cell_padding['B']) + && ($this->cell_padding['B'] < $adj) + && (strpos($border, 'B') !== false) + ) { $this->cell_padding['B'] = $adj; } - if ((strpos($border, 'L') !== false) AND ($this->cell_padding['L'] < $adj)) { + if ( + is_numeric($this->cell_padding['L']) + && ($this->cell_padding['L'] < $adj) + && (strpos($border, 'L') !== false) + ) { $this->cell_padding['L'] = $adj; } + } - return array('T' => ($this->cell_padding['T'] - $cp['T']), 'R' => ($this->cell_padding['R'] - $cp['R']), 'B' => ($this->cell_padding['B'] - $cp['B']), 'L' => ($this->cell_padding['L'] - $cp['L'])); + + return array( + 'T' => ($this->cell_padding['T'] - $cp['T']), + 'R' => ($this->cell_padding['R'] - $cp['R']), + 'B' => ($this->cell_padding['B'] - $cp['B']), + 'L' => ($this->cell_padding['L'] - $cp['L']), + ); } /** * Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm. - * @param $auto (boolean) Boolean indicating if mode should be on or off. - * @param $margin (float) Distance from the bottom of the page. + * @param boolean $auto Boolean indicating if mode should be on or off. + * @param float $margin Distance from the bottom of the page. * @public * @since 1.0 * @see Cell(), MultiCell(), AcceptPageBreak() */ - public function SetAutoPageBreak($auto, $margin = 0) - { + public function setAutoPageBreak($auto, $margin=0) { $this->AutoPageBreak = $auto ? true : false; $this->bMargin = $margin; $this->PageBreakTrigger = $this->h - $margin; @@ -2847,25 +2866,23 @@ class TCPDF /** * Return the auto-page-break mode (true or false). - * @return boolean auto-page-break mode + * @return bool auto-page-break mode * @public * @since 5.9.088 */ - public function getAutoPageBreak() - { + public function getAutoPageBreak() { return $this->AutoPageBreak; } /** * Defines the way the document is to be displayed by the viewer. - * @param $zoom (mixed) The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use.
        • fullpage: displays the entire page on screen
        • fullwidth: uses maximum width of window
        • real: uses real size (equivalent to 100% zoom)
        • default: uses viewer default mode
        - * @param $layout (string) The page layout. Possible values are:
        • SinglePage Display one page at a time
        • OneColumn Display the pages in one column
        • TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left
        • TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right
        • TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
        • TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right
        - * @param $mode (string) A name object specifying how the document should be displayed when opened:
        • UseNone Neither document outline nor thumbnail images visible
        • UseOutlines Document outline visible
        • UseThumbs Thumbnail images visible
        • FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible
        • UseOC (PDF 1.5) Optional content group panel visible
        • UseAttachments (PDF 1.6) Attachments panel visible
        + * @param mixed $zoom The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use.
        • fullpage: displays the entire page on screen
        • fullwidth: uses maximum width of window
        • real: uses real size (equivalent to 100% zoom)
        • default: uses viewer default mode
        + * @param string $layout The page layout. Possible values are:
        • SinglePage Display one page at a time
        • OneColumn Display the pages in one column
        • TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left
        • TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right
        • TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
        • TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right
        + * @param string $mode A name object specifying how the document should be displayed when opened:
        • UseNone Neither document outline nor thumbnail images visible
        • UseOutlines Document outline visible
        • UseThumbs Thumbnail images visible
        • FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible
        • UseOC (PDF 1.5) Optional content group panel visible
        • UseAttachments (PDF 1.6) Attachments panel visible
        * @public * @since 1.2 */ - public function SetDisplayMode($zoom, $layout = 'SinglePage', $mode = 'UseNone') - { + public function setDisplayMode($zoom, $layout='SinglePage', $mode='UseNone') { if (($zoom == 'fullpage') OR ($zoom == 'fullwidth') OR ($zoom == 'real') OR ($zoom == 'default') OR (!is_string($zoom))) { $this->ZoomMode = $zoom; } else { @@ -2878,12 +2895,11 @@ class TCPDF /** * Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default. * Note: the Zlib extension is required for this feature. If not present, compression will be turned off. - * @param $compress (boolean) Boolean indicating if compression must be enabled. + * @param boolean $compress Boolean indicating if compression must be enabled. * @public * @since 1.4 */ - public function SetCompression($compress = true) - { + public function setCompression($compress=true) { $this->compress = false; if (function_exists('gzcompress')) { if ($compress) { @@ -2896,95 +2912,99 @@ class TCPDF /** * Set flag to force sRGB_IEC61966-2.1 black scaled ICC color profile for the whole document. - * @param $mode (boolean) If true force sRGB output intent. + * @param boolean $mode If true force sRGB output intent. * @public * @since 5.9.121 (2011-09-28) */ - public function setSRGBmode($mode = false) - { + public function setSRGBmode($mode=false) { $this->force_srgb = $mode ? true : false; } /** * Turn on/off Unicode mode for document information dictionary (meta tags). * This has effect only when unicode mode is set to false. - * @param $unicode (boolean) if true set the meta information in Unicode + * @param boolean $unicode if true set the meta information in Unicode * @since 5.9.027 (2010-12-01) * @public */ - public function SetDocInfoUnicode($unicode = true) - { + public function setDocInfoUnicode($unicode=true) { $this->docinfounicode = $unicode ? true : false; } /** * Defines the title of the document. - * @param $title (string) The title. + * @param string $title The title. * @public * @since 1.2 * @see SetAuthor(), SetCreator(), SetKeywords(), SetSubject() */ - public function SetTitle($title) - { + public function setTitle($title) { $this->title = $title; } /** * Defines the subject of the document. - * @param $subject (string) The subject. + * @param string $subject The subject. * @public * @since 1.2 * @see SetAuthor(), SetCreator(), SetKeywords(), SetTitle() */ - public function SetSubject($subject) - { + public function setSubject($subject) { $this->subject = $subject; } /** * Defines the author of the document. - * @param $author (string) The name of the author. + * @param string $author The name of the author. * @public * @since 1.2 * @see SetCreator(), SetKeywords(), SetSubject(), SetTitle() */ - public function SetAuthor($author) - { + public function setAuthor($author) { $this->author = $author; } /** * Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'. - * @param $keywords (string) The list of keywords. + * @param string $keywords The list of keywords. * @public * @since 1.2 * @see SetAuthor(), SetCreator(), SetSubject(), SetTitle() */ - public function SetKeywords($keywords) - { + public function setKeywords($keywords) { $this->keywords = $keywords; } /** * Defines the creator of the document. This is typically the name of the application that generates the PDF. - * @param $creator (string) The name of the creator. + * @param string $creator The name of the creator. * @public * @since 1.2 * @see SetAuthor(), SetKeywords(), SetSubject(), SetTitle() */ - public function SetCreator($creator) - { + public function setCreator($creator) { $this->creator = $creator; } + /** + * Whether to allow local file path in image html tags, when prefixed with file:// + * + * @param bool $allowLocalFiles true, when local files should be allowed. Otherwise false. + * @public + * @since 6.4 + */ + public function setAllowLocalFiles($allowLocalFiles) { + $this->allowLocalFiles = (bool) $allowLocalFiles; + } + + /** * Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true. - * @param $msg (string) The error message + * @param string $msg The error message * @public * @since 1.0 */ - public function Error($msg) - { + public function Error($msg) { // unset all class variables $this->_destroy(true); if (defined('K_TCPDF_THROW_EXCEPTION_ERROR') AND !K_TCPDF_THROW_EXCEPTION_ERROR) { @@ -3002,8 +3022,7 @@ class TCPDF * @since 1.0 * @see AddPage(), Close() */ - public function Open() - { + public function Open() { $this->state = 1; } @@ -3015,8 +3034,7 @@ class TCPDF * @since 1.0 * @see Open(), Output() */ - public function Close() - { + public function Close() { if ($this->state == 3) { return; } @@ -3029,13 +3047,13 @@ class TCPDF $gvars = $this->getGraphicVars(); $this->setEqualColumns(); $this->lastpage(true); - $this->SetAutoPageBreak(false); + $this->setAutoPageBreak(false); $this->x = 0; $this->y = $this->h - (1 / $this->k); $this->lMargin = 0; $this->_outSaveGraphicsState(); $font = defined('PDF_FONT_NAME_MAIN')?PDF_FONT_NAME_MAIN:'helvetica'; - $this->SetFont($font, '', 1); + $this->setFont($font, '', 1); $this->setTextRenderingMode(0, false, false); $msg = "\x50\x6f\x77\x65\x72\x65\x64\x20\x62\x79\x20\x54\x43\x50\x44\x46\x20\x28\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67\x29"; $lnk = "\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67"; @@ -3054,14 +3072,13 @@ class TCPDF /** * Move pointer at the specified document page and update page dimensions. - * @param $pnum (int) page number (1 ... numpages) - * @param $resetmargins (boolean) if true reset left, right, top margins and Y position. + * @param int $pnum page number (1 ... numpages) + * @param boolean $resetmargins if true reset left, right, top margins and Y position. * @public * @since 2.1.000 (2008-01-07) * @see getPage(), lastpage(), getNumPages() */ - public function setPage($pnum, $resetmargins = false) - { + public function setPage($pnum, $resetmargins=false) { if (($pnum == $this->page) AND ($this->state == 2)) { return; } @@ -3081,13 +3098,13 @@ class TCPDF $this->original_rMargin = $this->pagedim[$this->page]['orm']; $this->AutoPageBreak = $this->pagedim[$this->page]['pb']; $this->CurOrientation = $this->pagedim[$this->page]['or']; - $this->SetAutoPageBreak($this->AutoPageBreak, $this->bMargin); + $this->setAutoPageBreak($this->AutoPageBreak, $this->bMargin); // restore graphic settings //$this->setGraphicVars($gvars); if ($resetmargins) { $this->lMargin = $this->pagedim[$this->page]['olm']; $this->rMargin = $this->pagedim[$this->page]['orm']; - $this->SetY($this->tMargin); + $this->setY($this->tMargin); } else { // account for booklet mode if ($this->pagedim[$this->page]['olm'] != $this->pagedim[$oldpage]['olm']) { @@ -3103,13 +3120,12 @@ class TCPDF /** * Reset pointer to the last document page. - * @param $resetmargins (boolean) if true reset left, right, top margins and Y position. + * @param boolean $resetmargins if true reset left, right, top margins and Y position. * @public * @since 2.0.000 (2008-01-04) * @see setPage(), getPage(), getNumPages() */ - public function lastPage($resetmargins = false) - { + public function lastPage($resetmargins=false) { $this->setPage($this->getNumPages(), $resetmargins); } @@ -3120,8 +3136,7 @@ class TCPDF * @since 2.1.000 (2008-01-07) * @see setPage(), lastpage(), getNumPages() */ - public function getPage() - { + public function getPage() { return $this->page; } @@ -3132,22 +3147,20 @@ class TCPDF * @since 2.1.000 (2008-01-07) * @see setPage(), getPage(), lastpage() */ - public function getNumPages() - { + public function getNumPages() { return $this->numpages; } /** * Adds a new TOC (Table Of Content) page to the document. - * @param $orientation (string) page orientation. - * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). - * @param $keepmargins (boolean) if true overwrites the default page margins with the current margins + * @param string $orientation page orientation. + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). + * @param boolean $keepmargins if true overwrites the default page margins with the current margins * @public * @since 5.0.001 (2010-05-06) * @see AddPage(), startPage(), endPage(), endTOCPage() */ - public function addTOCPage($orientation = '', $format = '', $keepmargins = false) - { + public function addTOCPage($orientation='', $format='', $keepmargins=false) { $this->AddPage($orientation, $format, $keepmargins, true); } @@ -3157,24 +3170,22 @@ class TCPDF * @since 5.0.001 (2010-05-06) * @see AddPage(), startPage(), endPage(), addTOCPage() */ - public function endTOCPage() - { + public function endTOCPage() { $this->endPage(true); } /** * Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled). * The origin of the coordinate system is at the top-left corner (or top-right for RTL) and increasing ordinates go downwards. - * @param $orientation (string) page orientation. Possible values are (case insensitive):
        • P or PORTRAIT (default)
        • L or LANDSCAPE
        - * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). - * @param $keepmargins (boolean) if true overwrites the default page margins with the current margins - * @param $tocpage (boolean) if true set the tocpage state to true (the added page will be used to display Table Of Content). + * @param string $orientation page orientation. Possible values are (case insensitive):
        • P or PORTRAIT (default)
        • L or LANDSCAPE
        + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). + * @param boolean $keepmargins if true overwrites the default page margins with the current margins + * @param boolean $tocpage if true set the tocpage state to true (the added page will be used to display Table Of Content). * @public * @since 1.0 * @see startPage(), endPage(), addTOCPage(), endTOCPage(), getPageSizeFromFormat(), setPageFormat() */ - public function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false) - { + public function AddPage($orientation='', $format='', $keepmargins=false, $tocpage=false) { if ($this->inxobj) { // we are inside an XObject template return; @@ -3193,13 +3204,12 @@ class TCPDF /** * Terminate the current page - * @param $tocpage (boolean) if true set the tocpage state to false (end the page used to display Table Of Content). + * @param boolean $tocpage if true set the tocpage state to false (end the page used to display Table Of Content). * @public * @since 4.2.010 (2008-11-14) * @see AddPage(), startPage(), addTOCPage(), endTOCPage() */ - public function endPage($tocpage = false) - { + public function endPage($tocpage=false) { // check if page is already closed if (($this->page == 0) OR ($this->numpages > $this->page) OR (!$this->pageopen[$this->page])) { return; @@ -3218,15 +3228,14 @@ class TCPDF /** * Starts a new page to the document. The page must be closed using the endPage() function. * The origin of the coordinate system is at the top-left corner and increasing ordinates go downwards. - * @param $orientation (string) page orientation. Possible values are (case insensitive):
        • P or PORTRAIT (default)
        • L or LANDSCAPE
        - * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). - * @param $tocpage (boolean) if true the page is designated to contain the Table-Of-Content. + * @param string $orientation page orientation. Possible values are (case insensitive):
        • P or PORTRAIT (default)
        • L or LANDSCAPE
        + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). + * @param boolean $tocpage if true the page is designated to contain the Table-Of-Content. * @since 4.2.010 (2008-11-14) * @see AddPage(), endPage(), addTOCPage(), endTOCPage(), getPageSizeFromFormat(), setPageFormat() * @public */ - public function startPage($orientation = '', $format = '', $tocpage = false) - { + public function startPage($orientation='', $format='', $tocpage=false) { if ($tocpage) { $this->tocpage = true; } @@ -3258,7 +3267,7 @@ class TCPDF if ($this->numpages > $this->page) { // this page has been already added $this->setPage($this->page + 1); - $this->SetY($this->tMargin); + $this->setY($this->tMargin); return; } // start a new page @@ -3297,8 +3306,7 @@ class TCPDF * @public * @since 4.0.016 (2008-07-30) */ - public function setPageMark() - { + public function setPageMark() { $this->intmrk[$this->page] = $this->pagelen[$this->page]; $this->bordermrk[$this->page] = $this->intmrk[$this->page]; $this->setContentMark(); @@ -3307,12 +3315,11 @@ class TCPDF /** * Set start-writing mark on selected page. * Borders and fills are always created after content and inserted on the position marked by this method. - * @param $page (int) page number (default is the current page) + * @param int $page page number (default is the current page) * @protected * @since 4.6.021 (2009-07-20) */ - protected function setContentMark($page = 0) - { + protected function setContentMark($page=0) { if ($page <= 0) { $page = $this->page; } @@ -3325,16 +3332,15 @@ class TCPDF /** * Set header data. - * @param $ln (string) header image logo - * @param $lw (string) header image logo width in mm - * @param $ht (string) string to print as title on document header - * @param $hs (string) string to print on document header - * @param $tc (array) RGB array color for text. - * @param $lc (array) RGB array color for line. + * @param string $ln header image logo + * @param int $lw header image logo width in mm + * @param string $ht string to print as title on document header + * @param string $hs string to print on document header + * @param int[] $tc RGB array color for text. + * @param int[] $lc RGB array color for line. * @public */ - public function setHeaderData($ln = '', $lw = 0, $ht = '', $hs = '', $tc = array(0,0,0), $lc = array(0,0,0)) - { + public function setHeaderData($ln='', $lw=0, $ht='', $hs='', $tc=array(0,0,0), $lc=array(0,0,0)) { $this->header_logo = $ln; $this->header_logo_width = $lw; $this->header_title = $ht; @@ -3345,12 +3351,11 @@ class TCPDF /** * Set footer data. - * @param $tc (array) RGB array color for text. - * @param $lc (array) RGB array color for line. + * @param int[] $tc RGB array color for text. + * @param int[] $lc RGB array color for line. * @public */ - public function setFooterData($tc = array(0,0,0), $lc = array(0,0,0)) - { + public function setFooterData($tc=array(0,0,0), $lc=array(0,0,0)) { $this->footer_text_color = $tc; $this->footer_line_color = $lc; } @@ -3358,12 +3363,11 @@ class TCPDF /** * Returns header data: *
        • $ret['logo'] = logo image
        • $ret['logo_width'] = width of the image logo in user units
        • $ret['title'] = header title
        • $ret['string'] = header description string
        - * @return array() + * @return array * @public * @since 4.0.012 (2008-07-24) */ - public function getHeaderData() - { + public function getHeaderData() { $ret = array(); $ret['logo'] = $this->header_logo; $ret['logo_width'] = $this->header_logo_width; @@ -3377,11 +3381,10 @@ class TCPDF /** * Set header margin. * (minimum distance between header and top page margin) - * @param $hm (int) distance in user units + * @param float $hm distance in user units * @public */ - public function setHeaderMargin($hm = 10) - { + public function setHeaderMargin($hm=10) { $this->header_margin = $hm; } @@ -3391,19 +3394,17 @@ class TCPDF * @since 4.0.012 (2008-07-24) * @public */ - public function getHeaderMargin() - { + public function getHeaderMargin() { return $this->header_margin; } /** * Set footer margin. * (minimum distance between footer and bottom page margin) - * @param $fm (int) distance in user units + * @param float $fm distance in user units * @public */ - public function setFooterMargin($fm = 10) - { + public function setFooterMargin($fm=10) { $this->footer_margin = $fm; } @@ -3413,27 +3414,24 @@ class TCPDF * @since 4.0.012 (2008-07-24) * @public */ - public function getFooterMargin() - { + public function getFooterMargin() { return $this->footer_margin; } /** * Set a flag to print page header. - * @param $val (boolean) set to true to print the page header (default), false otherwise. + * @param boolean $val set to true to print the page header (default), false otherwise. * @public */ - public function setPrintHeader($val = true) - { + public function setPrintHeader($val=true) { $this->print_header = $val ? true : false; } /** * Set a flag to print page footer. - * @param $val (boolean) set to true to print the page footer (default), false otherwise. + * @param boolean $val set to true to print the page footer (default), false otherwise. * @public */ - public function setPrintFooter($val = true) - { + public function setPrintFooter($val=true) { $this->print_footer = $val ? true : false; } @@ -3442,8 +3440,7 @@ class TCPDF * @return float * @public */ - public function getImageRBX() - { + public function getImageRBX() { return $this->img_rb_x; } @@ -3452,8 +3449,7 @@ class TCPDF * @return float * @public */ - public function getImageRBY() - { + public function getImageRBY() { return $this->img_rb_y; } @@ -3461,18 +3457,16 @@ class TCPDF * Reset the xobject template used by Header() method. * @public */ - public function resetHeaderTemplate() - { + public function resetHeaderTemplate() { $this->header_xobjid = false; } /** * Set a flag to automatically reset the xobject template used by Header() method at each page. - * @param $val (boolean) set to true to reset Header xobject template at each page, false otherwise. + * @param boolean $val set to true to reset Header xobject template at each page, false otherwise. * @public */ - public function setHeaderTemplateAutoreset($val = true) - { + public function setHeaderTemplateAutoreset($val=true) { $this->header_xobj_autoreset = $val ? true : false; } @@ -3481,8 +3475,7 @@ class TCPDF * It is automatically called by AddPage() and could be overwritten in your own inherited class. * @public */ - public function Header() - { + public function Header() { if ($this->header_xobjid === false) { // start a new XObject Template $this->header_xobjid = $this->startTemplate($this->w, $this->tMargin); @@ -3515,22 +3508,22 @@ class TCPDF $header_x = $this->original_lMargin + ($headerdata['logo_width'] * 1.1); } $cw = $this->w - $this->original_lMargin - $this->original_rMargin - ($headerdata['logo_width'] * 1.1); - $this->SetTextColorArray($this->header_text_color); + $this->setTextColorArray($this->header_text_color); // header title - $this->SetFont($headerfont[0], 'B', $headerfont[2] + 1); - $this->SetX($header_x); + $this->setFont($headerfont[0], 'B', $headerfont[2] + 1); + $this->setX($header_x); $this->Cell($cw, $cell_height, $headerdata['title'], 0, 1, '', 0, '', 0); // header string - $this->SetFont($headerfont[0], $headerfont[1], $headerfont[2]); - $this->SetX($header_x); + $this->setFont($headerfont[0], $headerfont[1], $headerfont[2]); + $this->setX($header_x); $this->MultiCell($cw, $cell_height, $headerdata['string'], 0, '', 0, 1, '', '', true, 0, false, true, 0, 'T', false); // print an ending header line - $this->SetLineStyle(array('width' => 0.85 / $this->k, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $headerdata['line_color'])); - $this->SetY((2.835 / $this->k) + max($imgy, $this->y)); + $this->setLineStyle(array('width' => 0.85 / $this->k, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $headerdata['line_color'])); + $this->setY((2.835 / $this->k) + max($imgy, $this->y)); if ($this->rtl) { - $this->SetX($this->original_rMargin); + $this->setX($this->original_rMargin); } else { - $this->SetX($this->original_lMargin); + $this->setX($this->original_lMargin); } $this->Cell(($this->w - $this->original_lMargin - $this->original_rMargin), 0, '', 'T', 0, 'C'); $this->endTemplate(); @@ -3559,13 +3552,12 @@ class TCPDF * It is automatically called by AddPage() and could be overwritten in your own inherited class. * @public */ - public function Footer() - { + public function Footer() { $cur_y = $this->y; - $this->SetTextColorArray($this->footer_text_color); + $this->setTextColorArray($this->footer_text_color); //set style for cell border $line_width = (0.85 / $this->k); - $this->SetLineStyle(array('width' => $line_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $this->footer_line_color)); + $this->setLineStyle(array('width' => $line_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $this->footer_line_color)); //print document barcode $barcode = $this->getBarcode(); if (!empty($barcode)) { @@ -3591,13 +3583,13 @@ class TCPDF } else { $pagenumtxt = $w_page.$this->getPageNumGroupAlias().' / '.$this->getPageGroupAlias(); } - $this->SetY($cur_y); + $this->setY($cur_y); //Print page number if ($this->getRTL()) { - $this->SetX($this->original_rMargin); + $this->setX($this->original_rMargin); $this->Cell(0, 0, $pagenumtxt, 'T', 0, 'L'); } else { - $this->SetX($this->original_lMargin); + $this->setX($this->original_lMargin); $this->Cell(0, 0, $this->getAliasRightShift().$pagenumtxt, 'T', 0, 'R'); } } @@ -3607,8 +3599,7 @@ class TCPDF * @protected * @since 4.0.012 (2008-07-24) */ - protected function setHeader() - { + protected function setHeader() { if (!$this->print_header OR ($this->state != 2)) { return; } @@ -3621,20 +3612,20 @@ class TCPDF $this->_outSaveGraphicsState(); $this->rMargin = $this->original_rMargin; $this->lMargin = $this->original_lMargin; - $this->SetCellPadding(0); + $this->setCellPadding(0); //set current position if ($this->rtl) { - $this->SetXY($this->original_rMargin, $this->header_margin); + $this->setXY($this->original_rMargin, $this->header_margin); } else { - $this->SetXY($this->original_lMargin, $this->header_margin); + $this->setXY($this->original_lMargin, $this->header_margin); } - $this->SetFont($this->header_font[0], $this->header_font[1], $this->header_font[2]); + $this->setFont($this->header_font[0], $this->header_font[1], $this->header_font[2]); $this->Header(); //restore position if ($this->rtl) { - $this->SetXY($this->original_rMargin, $this->tMargin); + $this->setXY($this->original_rMargin, $this->tMargin); } else { - $this->SetXY($this->original_lMargin, $this->tMargin); + $this->setXY($this->original_lMargin, $this->tMargin); } $this->_outRestoreGraphicsState(); $this->lasth = $lasth; @@ -3649,8 +3640,7 @@ class TCPDF * @protected * @since 4.0.012 (2008-07-24) */ - protected function setFooter() - { + protected function setFooter() { if ($this->state != 2) { return; } @@ -3670,21 +3660,21 @@ class TCPDF $this->_outSaveGraphicsState(); $this->rMargin = $this->original_rMargin; $this->lMargin = $this->original_lMargin; - $this->SetCellPadding(0); + $this->setCellPadding(0); //set current position $footer_y = $this->h - $this->footer_margin; if ($this->rtl) { - $this->SetXY($this->original_rMargin, $footer_y); + $this->setXY($this->original_rMargin, $footer_y); } else { - $this->SetXY($this->original_lMargin, $footer_y); + $this->setXY($this->original_lMargin, $footer_y); } - $this->SetFont($this->footer_font[0], $this->footer_font[1], $this->footer_font[2]); + $this->setFont($this->footer_font[0], $this->footer_font[1], $this->footer_font[2]); $this->Footer(); //restore position if ($this->rtl) { - $this->SetXY($this->original_rMargin, $this->tMargin); + $this->setXY($this->original_rMargin, $this->tMargin); } else { - $this->SetXY($this->original_lMargin, $this->tMargin); + $this->setXY($this->original_lMargin, $this->tMargin); } $this->_outRestoreGraphicsState(); $this->lasth = $lasth; @@ -3702,12 +3692,11 @@ class TCPDF /** * Check if we are on the page body (excluding page header and footer). - * @return true if we are not in page header nor in page footer, false otherwise. + * @return bool true if we are not in page header nor in page footer, false otherwise. * @protected * @since 5.9.091 (2011-06-15) */ - protected function inPageBody() - { + protected function inPageBody() { return (($this->InHeader === false) AND ($this->InFooter === false)); } @@ -3716,8 +3705,7 @@ class TCPDF * @protected * @since 4.5.030 (2009-03-25) */ - protected function setTableHeader() - { + protected function setTableHeader() { if ($this->num_columns > 1) { // multi column mode return; @@ -3784,19 +3772,17 @@ class TCPDF * @since 1.0 * @see getAliasNbPages() */ - public function PageNo() - { + public function PageNo() { return $this->page; } /** * Returns the array of spot colors. - * @return (array) Spot colors array. + * @return array Spot colors array. * @public * @since 6.0.038 (2013-09-30) */ - public function getAllSpotColors() - { + public function getAllSpotColors() { return $this->spot_colors; } @@ -3804,17 +3790,16 @@ class TCPDF * Defines a new spot color. * It can be expressed in RGB components or gray scale. * The method can be called before the first page is created and the value is retained from page to page. - * @param $name (string) Full name of the spot color. - * @param $c (float) Cyan color for CMYK. Value between 0 and 100. - * @param $m (float) Magenta color for CMYK. Value between 0 and 100. - * @param $y (float) Yellow color for CMYK. Value between 0 and 100. - * @param $k (float) Key (Black) color for CMYK. Value between 0 and 100. + * @param string $name Full name of the spot color. + * @param float $c Cyan color for CMYK. Value between 0 and 100. + * @param float $m Magenta color for CMYK. Value between 0 and 100. + * @param float $y Yellow color for CMYK. Value between 0 and 100. + * @param float $k Key (Black) color for CMYK. Value between 0 and 100. * @public * @since 4.0.024 (2008-09-12) * @see SetDrawSpotColor(), SetFillSpotColor(), SetTextSpotColor() */ - public function AddSpotColor($name, $c, $m, $y, $k) - { + public function AddSpotColor($name, $c, $m, $y, $k) { if (!isset($this->spot_colors[$name])) { $i = (1 + count($this->spot_colors)); $this->spot_colors[$name] = array('C' => $c, 'M' => $m, 'Y' => $y, 'K' => $k, 'name' => $name, 'i' => $i); @@ -3823,15 +3808,14 @@ class TCPDF /** * Set the spot color for the specified type ('draw', 'fill', 'text'). - * @param $type (string) Type of object affected by this color: ('draw', 'fill', 'text'). - * @param $name (string) Name of the spot color. - * @param $tint (float) Intensity of the color (from 0 to 100 ; 100 = full intensity by default). - * @return (string) PDF color command. + * @param string $type Type of object affected by this color: ('draw', 'fill', 'text'). + * @param string $name Name of the spot color. + * @param float $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default). + * @return string PDF color command. * @public * @since 5.9.125 (2011-10-03) */ - public function setSpotColor($type, $name, $tint = 100) - { + public function setSpotColor($type, $name, $tint=100) { $spotcolor = TCPDF_COLORS::getSpotColor($name, $this->spot_colors); if ($spotcolor === false) { $this->Error('Undefined spot color: '.$name.', you must add it using the AddSpotColor() method.'); @@ -3871,40 +3855,37 @@ class TCPDF /** * Defines the spot color used for all drawing operations (lines, rectangles and cell borders). - * @param $name (string) Name of the spot color. - * @param $tint (float) Intensity of the color (from 0 to 100 ; 100 = full intensity by default). + * @param string $name Name of the spot color. + * @param float $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default). * @public * @since 4.0.024 (2008-09-12) * @see AddSpotColor(), SetFillSpotColor(), SetTextSpotColor() */ - public function SetDrawSpotColor($name, $tint = 100) - { + public function setDrawSpotColor($name, $tint=100) { $this->setSpotColor('draw', $name, $tint); } /** * Defines the spot color used for all filling operations (filled rectangles and cell backgrounds). - * @param $name (string) Name of the spot color. - * @param $tint (float) Intensity of the color (from 0 to 100 ; 100 = full intensity by default). + * @param string $name Name of the spot color. + * @param float $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default). * @public * @since 4.0.024 (2008-09-12) * @see AddSpotColor(), SetDrawSpotColor(), SetTextSpotColor() */ - public function SetFillSpotColor($name, $tint = 100) - { + public function setFillSpotColor($name, $tint=100) { $this->setSpotColor('fill', $name, $tint); } /** * Defines the spot color used for text. - * @param $name (string) Name of the spot color. - * @param $tint (int) Intensity of the color (from 0 to 100 ; 100 = full intensity by default). + * @param string $name Name of the spot color. + * @param int $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default). * @public * @since 4.0.024 (2008-09-12) * @see AddSpotColor(), SetDrawSpotColor(), SetFillSpotColor() */ - public function SetTextSpotColor($name, $tint = 100) - { + public function setTextSpotColor($name, $tint=100) { $this->setSpotColor('text', $name, $tint); } @@ -3912,15 +3893,14 @@ class TCPDF * Set the color array for the specified type ('draw', 'fill', 'text'). * It can be expressed in RGB, CMYK or GRAY SCALE components. * The method can be called before the first page is created and the value is retained from page to page. - * @param $type (string) Type of object affected by this color: ('draw', 'fill', 'text'). - * @param $color (array) Array of colors (1=gray, 3=RGB, 4=CMYK or 5=spotcolor=CMYK+name values). - * @param $ret (boolean) If true do not send the PDF command. - * @return (string) The PDF command or empty string. + * @param string $type Type of object affected by this color: ('draw', 'fill', 'text'). + * @param array $color Array of colors (1=gray, 3=RGB, 4=CMYK or 5=spotcolor=CMYK+name values). + * @param boolean $ret If true do not send the PDF command. + * @return string The PDF command or empty string. * @public * @since 3.1.000 (2008-06-11) */ - public function setColorArray($type, $color, $ret = false) - { + public function setColorArray($type, $color, $ret=false) { if (is_array($color)) { $color = array_values($color); // component: grey, RGB red or CMYK cyan @@ -3944,15 +3924,14 @@ class TCPDF * Defines the color used for all drawing operations (lines, rectangles and cell borders). * It can be expressed in RGB, CMYK or GRAY SCALE components. * The method can be called before the first page is created and the value is retained from page to page. - * @param $color (array) Array of colors (1, 3 or 4 values). - * @param $ret (boolean) If true do not send the PDF command. + * @param array $color Array of colors (1, 3 or 4 values). + * @param boolean $ret If true do not send the PDF command. * @return string the PDF command * @public * @since 3.1.000 (2008-06-11) * @see SetDrawColor() */ - public function SetDrawColorArray($color, $ret = false) - { + public function setDrawColorArray($color, $ret=false) { return $this->setColorArray('draw', $color, $ret); } @@ -3960,46 +3939,43 @@ class TCPDF * Defines the color used for all filling operations (filled rectangles and cell backgrounds). * It can be expressed in RGB, CMYK or GRAY SCALE components. * The method can be called before the first page is created and the value is retained from page to page. - * @param $color (array) Array of colors (1, 3 or 4 values). - * @param $ret (boolean) If true do not send the PDF command. + * @param array $color Array of colors (1, 3 or 4 values). + * @param boolean $ret If true do not send the PDF command. * @public * @since 3.1.000 (2008-6-11) * @see SetFillColor() */ - public function SetFillColorArray($color, $ret = false) - { + public function setFillColorArray($color, $ret=false) { return $this->setColorArray('fill', $color, $ret); } /** * Defines the color used for text. It can be expressed in RGB components or gray scale. * The method can be called before the first page is created and the value is retained from page to page. - * @param $color (array) Array of colors (1, 3 or 4 values). - * @param $ret (boolean) If true do not send the PDF command. + * @param array $color Array of colors (1, 3 or 4 values). + * @param boolean $ret If true do not send the PDF command. * @public * @since 3.1.000 (2008-6-11) * @see SetFillColor() */ - public function SetTextColorArray($color, $ret = false) - { + public function setTextColorArray($color, $ret=false) { return $this->setColorArray('text', $color, $ret); } /** * Defines the color used by the specified type ('draw', 'fill', 'text'). - * @param $type (string) Type of object affected by this color: ('draw', 'fill', 'text'). - * @param $col1 (float) GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). - * @param $col2 (float) GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). - * @param $col3 (float) BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). - * @param $col4 (float) KEY (BLACK) color for CMYK (0-100). - * @param $ret (boolean) If true do not send the command. - * @param $name (string) spot color name (if any) - * @return (string) The PDF command or empty string. + * @param string $type Type of object affected by this color: ('draw', 'fill', 'text'). + * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). + * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). + * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). + * @param float $col4 KEY (BLACK) color for CMYK (0-100). + * @param boolean $ret If true do not send the command. + * @param string $name spot color name (if any) + * @return string The PDF command or empty string. * @public * @since 5.9.125 (2011-10-03) */ - public function setColor($type, $col1 = 0, $col2 = -1, $col3 = -1, $col4 = -1, $ret = false, $name = '') - { + public function setColor($type, $col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') { // set default values if (!is_numeric($col1)) { $col1 = 0; @@ -4067,7 +4043,7 @@ class TCPDF } } $this->ColorFlag = ($this->FillColor != $this->TextColor); - if (($type != 'text') AND ($this->state == 2)) { + if (($type != 'text') AND ($this->state == 2) AND $type !== 0) { if (!$ret) { $this->_out($pdfcolor); } @@ -4078,95 +4054,92 @@ class TCPDF /** * Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. - * @param $col1 (float) GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). - * @param $col2 (float) GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). - * @param $col3 (float) BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). - * @param $col4 (float) KEY (BLACK) color for CMYK (0-100). - * @param $ret (boolean) If true do not send the command. - * @param $name (string) spot color name (if any) + * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). + * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). + * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). + * @param float $col4 KEY (BLACK) color for CMYK (0-100). + * @param boolean $ret If true do not send the command. + * @param string $name spot color name (if any) * @return string the PDF command * @public * @since 1.3 * @see SetDrawColorArray(), SetFillColor(), SetTextColor(), Line(), Rect(), Cell(), MultiCell() */ - public function SetDrawColor($col1 = 0, $col2 = -1, $col3 = -1, $col4 = -1, $ret = false, $name = '') - { + public function setDrawColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') { return $this->setColor('draw', $col1, $col2, $col3, $col4, $ret, $name); } /** * Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. - * @param $col1 (float) GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). - * @param $col2 (float) GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). - * @param $col3 (float) BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). - * @param $col4 (float) KEY (BLACK) color for CMYK (0-100). - * @param $ret (boolean) If true do not send the command. - * @param $name (string) Spot color name (if any). - * @return (string) The PDF command. + * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). + * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). + * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). + * @param float $col4 KEY (BLACK) color for CMYK (0-100). + * @param boolean $ret If true do not send the command. + * @param string $name Spot color name (if any). + * @return string The PDF command. * @public * @since 1.3 * @see SetFillColorArray(), SetDrawColor(), SetTextColor(), Rect(), Cell(), MultiCell() */ - public function SetFillColor($col1 = 0, $col2 = -1, $col3 = -1, $col4 = -1, $ret = false, $name = '') - { + public function setFillColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') { return $this->setColor('fill', $col1, $col2, $col3, $col4, $ret, $name); } /** * Defines the color used for text. It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. - * @param $col1 (float) GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). - * @param $col2 (float) GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). - * @param $col3 (float) BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). - * @param $col4 (float) KEY (BLACK) color for CMYK (0-100). - * @param $ret (boolean) If true do not send the command. - * @param $name (string) Spot color name (if any). - * @return (string) Empty string. + * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). + * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). + * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). + * @param float $col4 KEY (BLACK) color for CMYK (0-100). + * @param boolean $ret If true do not send the command. + * @param string $name Spot color name (if any). + * @return string Empty string. * @public * @since 1.3 * @see SetTextColorArray(), SetDrawColor(), SetFillColor(), Text(), Cell(), MultiCell() */ - public function SetTextColor($col1 = 0, $col2 = -1, $col3 = -1, $col4 = -1, $ret = false, $name = '') - { + public function setTextColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') { return $this->setColor('text', $col1, $col2, $col3, $col4, $ret, $name); } /** * Returns the length of a string in user unit. A font must be selected.
        - * @param $s (string) The string whose length is to be computed - * @param $fontname (string) Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. - * @param $fontstyle (string) Font style. Possible values are (case insensitive):
        • empty string: regular
        • B: bold
        • I: italic
        • U: underline
        • D: line-through
        • O: overline
        or any combination. The default value is regular. - * @param $fontsize (float) Font size in points. The default value is the current size. - * @param $getarray (boolean) if true returns an array of characters widths, if false returns the total length. - * @return mixed int total string length or array of characted widths + * @param string $s The string whose length is to be computed + * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. + * @param string $fontstyle Font style. Possible values are (case insensitive):
        • empty string: regular
        • B: bold
        • I: italic
        • U: underline
        • D: line-through
        • O: overline
        or any combination. The default value is regular. + * @param float $fontsize Font size in points. The default value is the current size. + * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. + * @return float[]|float total string length or array of characted widths + * @phpstan-return ($getarray is true ? float[] : float) total string length or array of characted widths * @author Nicola Asuni * @public * @since 1.2 */ - public function GetStringWidth($s, $fontname = '', $fontstyle = '', $fontsize = 0, $getarray = false) - { + public function GetStringWidth($s, $fontname='', $fontstyle='', $fontsize=0, $getarray=false) { return $this->GetArrStringWidth(TCPDF_FONTS::utf8Bidi(TCPDF_FONTS::UTF8StringToArray($s, $this->isunicode, $this->CurrentFont), $s, $this->tmprtl, $this->isunicode, $this->CurrentFont), $fontname, $fontstyle, $fontsize, $getarray); } /** * Returns the string length of an array of chars in user unit or an array of characters widths. A font must be selected.
        - * @param $sa (string) The array of chars whose total length is to be computed - * @param $fontname (string) Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. - * @param $fontstyle (string) Font style. Possible values are (case insensitive):
        • empty string: regular
        • B: bold
        • I: italic
        • U: underline
        • D: line through
        • O: overline
        or any combination. The default value is regular. - * @param $fontsize (float) Font size in points. The default value is the current size. - * @param $getarray (boolean) if true returns an array of characters widths, if false returns the total length. - * @return mixed int total string length or array of characted widths + * @param array $sa The array of chars whose total length is to be computed + * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. + * @param string $fontstyle Font style. Possible values are (case insensitive):
        • empty string: regular
        • B: bold
        • I: italic
        • U: underline
        • D: line through
        • O: overline
        or any combination. The default value is regular. + * @param float $fontsize Font size in points. The default value is the current size. + * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. + * @return float[]|float total string length or array of characted widths + * @phpstan-return ($getarray is true ? float[] : float) total string length or array of characted widths * @author Nicola Asuni * @public * @since 2.4.000 (2008-03-06) */ - public function GetArrStringWidth($sa, $fontname = '', $fontstyle = '', $fontsize = 0, $getarray = false) - { + public function GetArrStringWidth($sa, $fontname='', $fontstyle='', $fontsize=0, $getarray=false) { // store current values if (!TCPDF_STATIC::empty_string($fontname)) { $prev_FontFamily = $this->FontFamily; $prev_FontStyle = $this->FontStyle; $prev_FontSizePt = $this->FontSizePt; - $this->SetFont($fontname, $fontstyle, $fontsize, '', 'default', false); + $this->setFont($fontname, $fontstyle, $fontsize, '', 'default', false); } // convert UTF-8 array to Latin1 if required if ($this->isunicode AND (!$this->isUnicodeFont())) { @@ -4182,7 +4155,7 @@ class TCPDF } // restore previous values if (!TCPDF_STATIC::empty_string($fontname)) { - $this->SetFont($prev_FontFamily, $prev_FontStyle, $prev_FontSizePt, '', 'default', false); + $this->setFont($prev_FontFamily, $prev_FontStyle, $prev_FontSizePt, '', 'default', false); } if ($getarray) { return $wa; @@ -4192,15 +4165,14 @@ class TCPDF /** * Returns the length of the char in user unit for the current font considering current stretching and spacing (tracking). - * @param $char (int) The char code whose length is to be returned - * @param $notlast (boolean) If false ignore the font-spacing. + * @param int $char The char code whose length is to be returned + * @param boolean $notlast If false ignore the font-spacing. * @return float char width * @author Nicola Asuni * @public * @since 2.4.000 (2008-03-06) */ - public function GetCharWidth($char, $notlast = true) - { + public function GetCharWidth($char, $notlast=true) { // get raw width $chw = $this->getRawCharWidth($char); if (($this->font_spacing < 0) OR (($this->font_spacing > 0) AND $notlast)) { @@ -4216,20 +4188,19 @@ class TCPDF /** * Returns the length of the char in user unit for the current font. - * @param $char (int) The char code whose length is to be returned + * @param int $char The char code whose length is to be returned * @return float char width * @author Nicola Asuni * @public * @since 5.9.000 (2010-09-28) */ - public function getRawCharWidth($char) - { + public function getRawCharWidth($char) { if ($char == 173) { // SHY character will not be printed return (0); } - if (isset($this->CurrentFont['cw'][$char])) { - $w = $this->CurrentFont['cw'][$char]; + if (isset($this->CurrentFont['cw'][intval($char)])) { + $w = $this->CurrentFont['cw'][intval($char)]; } elseif (isset($this->CurrentFont['dw'])) { // default width $w = $this->CurrentFont['dw']; @@ -4244,13 +4215,12 @@ class TCPDF /** * Returns the numbero of characters in a string. - * @param $s (string) The input string. + * @param string $s The input string. * @return int number of characters * @public * @since 2.0.0001 (2008-01-07) */ - public function GetNumChars($s) - { + public function GetNumChars($s) { if ($this->isUnicodeFont()) { return count(TCPDF_FONTS::UTF8StringToArray($s, $this->isunicode, $this->CurrentFont)); } @@ -4262,8 +4232,7 @@ class TCPDF * @protected * @since 4.0.013 (2008-07-28) */ - protected function getFontsList() - { + protected function getFontsList() { if (($fontsdir = opendir(TCPDF_FONTS::_getfontpath())) !== false) { while (($file = readdir($fontsdir)) !== false) { if (substr($file, -4) == '.php') { @@ -4278,17 +4247,16 @@ class TCPDF * Imports a TrueType, Type1, core, or CID0 font and makes it available. * It is necessary to generate a font definition file first (read /fonts/utils/README.TXT). * The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated. - * @param $family (string) Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font. - * @param $style (string) Font style. Possible values are (case insensitive):
        • empty string: regular (default)
        • B: bold
        • I: italic
        • BI or IB: bold italic
        - * @param $fontfile (string) The font definition file. By default, the name is built from the family and style, in lower case with no spaces. - * @return array containing the font data, or false in case of error. - * @param $subset (mixed) if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font. + * @param string $family Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font. + * @param string $style Font style. Possible values are (case insensitive):
        • empty string: regular (default)
        • B: bold
        • I: italic
        • BI or IB: bold italic
        + * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces. + * @return array|false array containing the font data, or false in case of error. + * @param mixed $subset if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font. * @public * @since 1.5 * @see SetFont(), setFontSubsetting() */ - public function AddFont($family, $style = '', $fontfile = '', $subset = 'default') - { + public function AddFont($family, $style='', $fontfile='', $subset='default') { if ($subset === 'default') { $subset = $this->font_subsetting; } @@ -4323,7 +4291,7 @@ class TCPDF // all fonts must be embedded $family = 'pdfa'.$family; } - $tempstyle = strtoupper($style); + $tempstyle = strtoupper($style === null ? '' : $style); $style = ''; // underline if (strpos($tempstyle, 'U') !== false) { @@ -4390,7 +4358,23 @@ class TCPDF } // include font file if (!TCPDF_STATIC::empty_string($fontfile) AND (@TCPDF_STATIC::file_exists($fontfile))) { - include $fontfile; + $type=null; + $name=null; + $desc=null; + $up=-null; + $ut=null; + $cw=null; + $cbbox=null; + $dw=null; + $enc=null; + $cidinfo=null; + $file=null; + $ctg=null; + $diff=null; + $originalsize=null; + $size1=null; + $size2=null; + include($fontfile); } else { $this->Error('Could not include font definition file: '.$family.''); } @@ -4450,7 +4434,7 @@ class TCPDF $this->Error('Unknow font type: '.$type.''); } // set name if unset - if (!isset($name) OR empty($name)) { + if (empty($name)) { $name = $fontkey; } // create artificial font style variations if missing (only works with non-embedded fonts) @@ -4493,7 +4477,7 @@ class TCPDF // we are inside an XObject template $this->xobjects[$this->xobjid]['fonts'][$fontkey] = $this->numfonts; } - if (isset($diff) AND (!empty($diff))) { + if (!empty($diff)) { //Search existing encodings $d = 0; $nb = count($this->diffs); @@ -4511,7 +4495,7 @@ class TCPDF } if (!TCPDF_STATIC::empty_string($file)) { if (!isset($this->FontFiles[$file])) { - if ((strcasecmp($type, 'TrueType') == 0) OR (strcasecmp($type, 'TrueTypeUnicode') == 0)) { + if ((strcasecmp($type,'TrueType') == 0) OR (strcasecmp($type, 'TrueTypeUnicode') == 0)) { $this->FontFiles[$file] = array('length1' => $originalsize, 'fontdir' => $fontdir, 'subset' => $subset, 'fontkeys' => array($fontkey)); } elseif ($type != 'core') { $this->FontFiles[$file] = array('length1' => $size1, 'length2' => $size2, 'fontdir' => $fontdir, 'subset' => $subset, 'fontkeys' => array($fontkey)); @@ -4533,19 +4517,18 @@ class TCPDF * The method can be called before the first page is created and the font is retained from page to page. * If you just wish to change the current font size, it is simpler to call SetFontSize(). * Note: for the standard fonts, the font metric files must be accessible. There are three possibilities for this:
        • They are in the current directory (the one where the running script lies)
        • They are in one of the directories defined by the include_path parameter
        • They are in the directory defined by the K_PATH_FONTS constant

        - * @param $family (string) Family font. It can be either a name defined by AddFont() or one of the standard Type1 families (case insensitive):
        • times (Times-Roman)
        • timesb (Times-Bold)
        • timesi (Times-Italic)
        • timesbi (Times-BoldItalic)
        • helvetica (Helvetica)
        • helveticab (Helvetica-Bold)
        • helveticai (Helvetica-Oblique)
        • helveticabi (Helvetica-BoldOblique)
        • courier (Courier)
        • courierb (Courier-Bold)
        • courieri (Courier-Oblique)
        • courierbi (Courier-BoldOblique)
        • symbol (Symbol)
        • zapfdingbats (ZapfDingbats)
        It is also possible to pass an empty string. In that case, the current family is retained. - * @param $style (string) Font style. Possible values are (case insensitive):
        • empty string: regular
        • B: bold
        • I: italic
        • U: underline
        • D: line through
        • O: overline
        or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined. - * @param $size (float) Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12 - * @param $fontfile (string) The font definition file. By default, the name is built from the family and style, in lower case with no spaces. - * @param $subset (mixed) if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font. - * @param $out (boolean) if true output the font size command, otherwise only set the font properties. + * @param string $family Family font. It can be either a name defined by AddFont() or one of the standard Type1 families (case insensitive):
        • times (Times-Roman)
        • timesb (Times-Bold)
        • timesi (Times-Italic)
        • timesbi (Times-BoldItalic)
        • helvetica (Helvetica)
        • helveticab (Helvetica-Bold)
        • helveticai (Helvetica-Oblique)
        • helveticabi (Helvetica-BoldOblique)
        • courier (Courier)
        • courierb (Courier-Bold)
        • courieri (Courier-Oblique)
        • courierbi (Courier-BoldOblique)
        • symbol (Symbol)
        • zapfdingbats (ZapfDingbats)
        It is also possible to pass an empty string. In that case, the current family is retained. + * @param string $style Font style. Possible values are (case insensitive):
        • empty string: regular
        • B: bold
        • I: italic
        • U: underline
        • D: line through
        • O: overline
        or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined. + * @param float|null $size Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12 + * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces. + * @param mixed $subset if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font. + * @param boolean $out if true output the font size command, otherwise only set the font properties. * @author Nicola Asuni * @public * @since 1.0 * @see AddFont(), SetFontSize() */ - public function SetFont($family, $style = '', $size = null, $fontfile = '', $subset = 'default', $out = true) - { + public function setFont($family, $style='', $size=null, $fontfile='', $subset='default', $out=true) { //Select a font; size given in points if ($size === null) { $size = $this->FontSizePt; @@ -4562,20 +4545,19 @@ class TCPDF $this->setFontSubBuffer($this->CurrentFont['fontkey'], 'subsetchars', $this->CurrentFont['subsetchars']); } $this->CurrentFont = $this->getFontBuffer($fontdata['fontkey']); - $this->SetFontSize($size, $out); + $this->setFontSize($size, $out); } /** * Defines the size of the current font. - * @param $size (float) The font size in points. - * @param $out (boolean) if true output the font size command, otherwise only set the font properties. + * @param float $size The font size in points. + * @param boolean $out if true output the font size command, otherwise only set the font properties. * @public * @since 1.0 * @see SetFont() */ - public function SetFontSize($size, $out = true) - { - $size = (float) $size; + public function setFontSize($size, $out=true) { + $size = (float)$size; // font size in points $this->FontSizePt = $size; // font size in user units @@ -4615,8 +4597,7 @@ class TCPDF * @public * @since 5.9.152 (2012-03-23) */ - public function getFontBBox() - { + public function getFontBBox() { $fbbox = array(); if (isset($this->CurrentFont['desc']['FontBBox'])) { $tmpbbox = explode(' ', substr($this->CurrentFont['desc']['FontBBox'], 1, -1)); @@ -4651,23 +4632,21 @@ class TCPDF /** * Convert a relative font measure into absolute value. - * @param $s (int) Font measure. + * @param int $s Font measure. * @return float Absolute measure. * @since 5.9.186 (2012-09-13) */ - public function getAbsFontMeasure($s) - { + public function getAbsFontMeasure($s) { return ($s * $this->FontSize / 1000); } /** * Returns the glyph bounding box of the specified character in the current font in user units. - * @param $char (int) Input character code. - * @return mixed array(xMin, yMin, xMax, yMax) or FALSE if not defined. + * @param int $char Input character code. + * @return false|array array(xMin, yMin, xMax, yMax) or FALSE if not defined. * @since 5.9.186 (2012-09-13) */ - public function getCharBBox($char) - { + public function getCharBBox($char) { $c = intval($char); if (isset($this->CurrentFont['cw'][$c])) { // glyph is defined ... use zero width & height for glyphs without outlines @@ -4682,16 +4661,15 @@ class TCPDF /** * Return the font descent value - * @param $font (string) font name - * @param $style (string) font style - * @param $size (float) The size (in points) + * @param string $font font name + * @param string $style font style + * @param float $size The size (in points) * @return int font descent * @public * @author Nicola Asuni * @since 4.9.003 (2010-03-30) */ - public function getFontDescent($font, $style = '', $size = 0) - { + public function getFontDescent($font, $style='', $size=0) { $fontdata = $this->AddFont($font, $style); $fontinfo = $this->getFontBuffer($fontdata['fontkey']); if (isset($fontinfo['desc']['Descent']) AND ($fontinfo['desc']['Descent'] <= 0)) { @@ -4704,16 +4682,15 @@ class TCPDF /** * Return the font ascent value. - * @param $font (string) font name - * @param $style (string) font style - * @param $size (float) The size (in points) + * @param string $font font name + * @param string $style font style + * @param float $size The size (in points) * @return int font ascent * @public * @author Nicola Asuni * @since 4.9.003 (2010-03-30) */ - public function getFontAscent($font, $style = '', $size = 0) - { + public function getFontAscent($font, $style='', $size=0) { $fontdata = $this->AddFont($font, $style); $fontinfo = $this->getFontBuffer($fontdata['fontkey']); if (isset($fontinfo['desc']['Ascent']) AND ($fontinfo['desc']['Ascent'] > 0)) { @@ -4726,15 +4703,14 @@ class TCPDF /** * Return true in the character is present in the specified font. - * @param $char (mixed) Character to check (integer value or string) - * @param $font (string) Font name (family name). - * @param $style (string) Font style. - * @return (boolean) true if the char is defined, false otherwise. + * @param mixed $char Character to check (integer value or string) + * @param string $font Font name (family name). + * @param string $style Font style. + * @return bool true if the char is defined, false otherwise. * @public * @since 5.9.153 (2012-03-28) */ - public function isCharDefined($char, $font = '', $style = '') - { + public function isCharDefined($char, $font='', $style='') { if (is_string($char)) { // get character code $char = TCPDF_FONTS::UTF8StringToArray($char, $this->isunicode, $this->CurrentFont); @@ -4753,16 +4729,15 @@ class TCPDF /** * Replace missing font characters on selected font with specified substitutions. - * @param $text (string) Text to process. - * @param $font (string) Font name (family name). - * @param $style (string) Font style. - * @param $subs (array) Array of possible character substitutions. The key is the character to check (integer value) and the value is a single intege value or an array of possible substitutes. - * @return (string) Processed text. + * @param string $text Text to process. + * @param string $font Font name (family name). + * @param string $style Font style. + * @param array $subs Array of possible character substitutions. The key is the character to check (integer value) and the value is a single intege value or an array of possible substitutes. + * @return string Processed text. * @public * @since 5.9.153 (2012-03-28) */ - public function replaceMissingChars($text, $font = '', $style = '', $subs = array()) - { + public function replaceMissingChars($text, $font='', $style='', $subs=array()) { if (empty($subs)) { return $text; } @@ -4778,7 +4753,7 @@ class TCPDF if (isset($subs[$chr])) { // we have available substitutions if (is_array($subs[$chr])) { - foreach ($subs[$chr] as $s) { + foreach($subs[$chr] as $s) { if (isset($fontinfo['cw'][$s])) { $uniarr[$k] = $s; break; @@ -4795,12 +4770,11 @@ class TCPDF /** * Defines the default monospaced font. - * @param $font (string) Font name. + * @param string $font Font name. * @public * @since 4.5.025 */ - public function SetDefaultMonospacedFont($font) - { + public function setDefaultMonospacedFont($font) { $this->default_monospaced_font = $font; } @@ -4811,8 +4785,7 @@ class TCPDF * @since 1.5 * @see Cell(), Write(), Image(), Link(), SetLink() */ - public function AddLink() - { + public function AddLink() { // create a new internal link $n = count($this->links) + 1; $this->links[$n] = array('p' => 0, 'y' => 0, 'f' => false); @@ -4821,17 +4794,16 @@ class TCPDF /** * Defines the page and position a link points to. - * @param $link (int) The link identifier returned by AddLink() - * @param $y (float) Ordinate of target position; -1 indicates the current position. The default value is 0 (top of page) - * @param $page (int) Number of target page; -1 indicates the current page (default value). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. + * @param int $link The link identifier returned by AddLink() + * @param float $y Ordinate of target position; -1 indicates the current position. The default value is 0 (top of page) + * @param int|string $page Number of target page; -1 indicates the current page (default value). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. * @public * @since 1.5 * @see AddLink() */ - public function SetLink($link, $y = 0, $page = -1) - { + public function setLink($link, $y=0, $page=-1) { $fixed = false; - if (!empty($page) AND ($page[0] == '*')) { + if (!empty($page) AND (substr($page, 0, 1) == '*')) { $page = intval(substr($page, 1)); // this page number will not be changed when moving/add/deleting pages $fixed = true; @@ -4848,36 +4820,34 @@ class TCPDF /** * Puts a link on a rectangular area of the page. * Text or image links are generally put via Cell(), Write() or Image(), but this method can be useful for instance to define a clickable area inside an image. - * @param $x (float) Abscissa of the upper-left corner of the rectangle - * @param $y (float) Ordinate of the upper-left corner of the rectangle - * @param $w (float) Width of the rectangle - * @param $h (float) Height of the rectangle - * @param $link (mixed) URL or identifier returned by AddLink() - * @param $spaces (int) number of spaces on the text to link + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param mixed $link URL or identifier returned by AddLink() + * @param int $spaces number of spaces on the text to link * @public * @since 1.5 * @see AddLink(), Annotation(), Cell(), Write(), Image() */ - public function Link($x, $y, $w, $h, $link, $spaces = 0) - { + public function Link($x, $y, $w, $h, $link, $spaces=0) { $this->Annotation($x, $y, $w, $h, $link, array('Subtype'=>'Link'), $spaces); } /** * Puts a markup annotation on a rectangular area of the page. * !!!!THE ANNOTATION SUPPORT IS NOT YET FULLY IMPLEMENTED !!!! - * @param $x (float) Abscissa of the upper-left corner of the rectangle - * @param $y (float) Ordinate of the upper-left corner of the rectangle - * @param $w (float) Width of the rectangle - * @param $h (float) Height of the rectangle - * @param $text (string) annotation text or alternate content - * @param $opt (array) array of options (see section 8.4 of PDF reference 1.7). - * @param $spaces (int) number of spaces on the text to link + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param string $text annotation text or alternate content + * @param array $opt array of options (see section 8.4 of PDF reference 1.7). + * @param int $spaces number of spaces on the text to link * @public * @since 4.0.018 (2008-08-06) */ - public function Annotation($x, $y, $w, $h, $text, $opt = array('Subtype'=>'Text'), $spaces = 0) - { + public function Annotation($x, $y, $w, $h, $text, $opt=array('Subtype'=>'Text'), $spaces=0) { if ($this->inxobj) { // store parameters for later use on template $this->xobjects[$this->xobjid]['annotations'][] = array('x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'text' => $text, 'opt' => $opt, 'spaces' => $spaces); @@ -4967,16 +4937,15 @@ class TCPDF * @protected * @see Annotation() */ - protected function _putEmbeddedFiles() - { - if ($this->pdfa_mode && $this->pdfa_version != 3) { + protected function _putEmbeddedFiles() { + if ($this->pdfa_mode && $this->pdfa_version != 3) { // embedded files are not allowed in PDF/A mode version 1 and 2 return; } reset($this->embeddedfiles); foreach ($this->embeddedfiles as $filename => $filedata) { - $data = TCPDF_STATIC::fileGetContents($filedata['file']); - if ($data !== false) { + $data = $this->getCachedFileContents($filedata['file']); + if ($data !== FALSE) { $rawsize = strlen($data); if ($rawsize > 0) { // update name tree @@ -5014,32 +4983,31 @@ class TCPDF /** * Prints a text cell at the specified position. * This method allows to place a string precisely on the page. - * @param $x (float) Abscissa of the cell origin - * @param $y (float) Ordinate of the cell origin - * @param $txt (string) String to print - * @param $fstroke (int) outline size in user units (false = disable) - * @param $fclip (boolean) if true activate clipping mode (you must call StartTransform() before this function and StopTransform() to stop the clipping tranformation). - * @param $ffill (boolean) if true fills the text - * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param $ln (int) Indicates where the current position should go after the call. Possible values are:
        • 0: to the right (or left for RTL languages)
        • 1: to the beginning of the next line
        • 2: below
        Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. - * @param $align (string) Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        - * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false). - * @param $link (mixed) URL or identifier returned by AddLink(). - * @param $stretch (int) font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. - * @param $ignore_min_height (boolean) if true ignore automatic minimum height value. - * @param $calign (string) cell vertical alignment relative to the specified Y value. Possible values are:
        • T : cell top
        • A : font top
        • L : font baseline
        • D : font bottom
        • B : cell bottom
        - * @param $valign (string) text vertical alignment inside the cell. Possible values are:
        • T : top
        • C : center
        • B : bottom
        - * @param $rtloff (boolean) if true uses the page top-left corner as origin of axis for $x and $y initial position. + * @param float $x Abscissa of the cell origin + * @param float $y Ordinate of the cell origin + * @param string $txt String to print + * @param int $fstroke outline size in user units (0 = disable) + * @param boolean $fclip if true activate clipping mode (you must call StartTransform() before this function and StopTransform() to stop the clipping tranformation). + * @param boolean $ffill if true fills the text + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param int $ln Indicates where the current position should go after the call. Possible values are:
        • 0: to the right (or left for RTL languages)
        • 1: to the beginning of the next line
        • 2: below
        Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. + * @param string $align Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param mixed $link URL or identifier returned by AddLink(). + * @param int $stretch font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. + * @param boolean $ignore_min_height if true ignore automatic minimum height value. + * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:
        • T : cell top
        • A : font top
        • L : font baseline
        • D : font bottom
        • B : cell bottom
        + * @param string $valign text vertical alignment inside the cell. Possible values are:
        • T : top
        • C : center
        • B : bottom
        + * @param boolean $rtloff if true uses the page top-left corner as origin of axis for $x and $y initial position. * @public * @since 1.0 * @see Cell(), Write(), MultiCell(), WriteHTML(), WriteHTMLCell() */ - public function Text($x, $y, $txt, $fstroke = false, $fclip = false, $ffill = true, $border = 0, $ln = 0, $align = '', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M', $rtloff = false) - { + public function Text($x, $y, $txt, $fstroke=0, $fclip=false, $ffill=true, $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M', $rtloff=false) { $textrendermode = $this->textrendermode; $textstrokewidth = $this->textstrokewidth; $this->setTextRenderingMode($fstroke, $ffill, $fclip); - $this->SetXY($x, $y, $rtloff); + $this->setXY($x, $y, $rtloff); $this->Cell(0, 0, $txt, $border, $ln, $align, $fill, $link, $stretch, $ignore_min_height, $calign, $valign); // restore previous rendering mode $this->textrendermode = $textrendermode; @@ -5050,13 +5018,12 @@ class TCPDF * Whenever a page break condition is met, the method is called, and the break is issued or not depending on the returned value. * The default implementation returns a value according to the mode selected by SetAutoPageBreak().
        * This method is called automatically and should not be called directly by the application. - * @return boolean + * @return bool * @public * @since 1.4 * @see SetAutoPageBreak() */ - public function AcceptPageBreak() - { + public function AcceptPageBreak() { if ($this->num_columns > 1) { // multi column mode if ($this->current_column < ($this->num_columns - 1)) { @@ -5076,15 +5043,14 @@ class TCPDF /** * Add page if needed. - * @param $h (float) Cell height. Default value: 0. - * @param $y (mixed) starting y position, leave empty for current position. - * @param $addpage (boolean) if true add a page, otherwise only return the true/false state - * @return boolean true in case of page break, false otherwise. + * @param float $h Cell height. Default value: 0. + * @param float|null $y starting y position, leave empty for current position. + * @param bool $addpage if true add a page, otherwise only return the true/false state + * @return bool true in case of page break, false otherwise. * @since 3.2.000 (2008-07-01) * @protected */ - protected function checkPageBreak($h = 0, $y = '', $addpage = true) - { + protected function checkPageBreak($h=0, $y=null, $addpage=true) { if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } @@ -5122,24 +5088,23 @@ class TCPDF /** * Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
        * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. - * @param $w (float) Cell width. If 0, the cell extends up to the right margin. - * @param $h (float) Cell height. Default value: 0. - * @param $txt (string) String to print. Default value: empty string. - * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param $ln (int) Indicates where the current position should go after the call. Possible values are:
        • 0: to the right (or left for RTL languages)
        • 1: to the beginning of the next line
        • 2: below
        Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. - * @param $align (string) Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        - * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false). - * @param $link (mixed) URL or identifier returned by AddLink(). - * @param $stretch (int) font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. - * @param $ignore_min_height (boolean) if true ignore automatic minimum height value. - * @param $calign (string) cell vertical alignment relative to the specified Y value. Possible values are:
        • T : cell top
        • C : center
        • B : cell bottom
        • A : font top
        • L : font baseline
        • D : font bottom
        - * @param $valign (string) text vertical alignment inside the cell. Possible values are:
        • T : top
        • C : center
        • B : bottom
        + * @param float $w Cell width. If 0, the cell extends up to the right margin. + * @param float $h Cell height. Default value: 0. + * @param string $txt String to print. Default value: empty string. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param int $ln Indicates where the current position should go after the call. Possible values are:
        • 0: to the right (or left for RTL languages)
        • 1: to the beginning of the next line
        • 2: below
        Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. + * @param string $align Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param mixed $link URL or identifier returned by AddLink(). + * @param int $stretch font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. + * @param boolean $ignore_min_height if true ignore automatic minimum height value. + * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:
        • T : cell top
        • C : center
        • B : cell bottom
        • A : font top
        • L : font baseline
        • D : font bottom
        + * @param string $valign text vertical alignment inside the cell. Possible values are:
        • T : top
        • C : center
        • B : bottom
        * @public * @since 1.0 * @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), AddLink(), Ln(), MultiCell(), Write(), SetAutoPageBreak() */ - public function Cell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M') - { + public function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') { $prev_cell_margin = $this->cell_margin; $prev_cell_padding = $this->cell_padding; $this->adjustCellPadding($border); @@ -5162,9 +5127,9 @@ class TCPDF // print shadow $this->x += $this->txtshadow['depth_w']; $this->y += $this->txtshadow['depth_h']; - $this->SetFillColorArray($this->txtshadow['color']); - $this->SetTextColorArray($this->txtshadow['color']); - $this->SetDrawColorArray($this->txtshadow['color']); + $this->setFillColorArray($this->txtshadow['color']); + $this->setTextColorArray($this->txtshadow['color']); + $this->setDrawColorArray($this->txtshadow['color']); if ($this->txtshadow['opacity'] != $alpha['CA']) { $this->setAlpha($this->txtshadow['opacity'], $this->txtshadow['blend_mode']); } @@ -5174,9 +5139,9 @@ class TCPDF //restore data $this->x = $x; $this->y = $y; - $this->SetFillColorArray($bc); - $this->SetTextColorArray($fc); - $this->SetDrawColorArray($sc); + $this->setFillColorArray($bc); + $this->setTextColorArray($fc); + $this->setDrawColorArray($sc); if ($this->txtshadow['opacity'] != $alpha['CA']) { $this->setAlpha($alpha['CA'], $alpha['BM'], $alpha['ca'], $alpha['AIS']); } @@ -5191,26 +5156,26 @@ class TCPDF /** * Returns the PDF string code to print a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
        * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. - * @param $w (float) Cell width. If 0, the cell extends up to the right margin. - * @param $h (float) Cell height. Default value: 0. - * @param $txt (string) String to print. Default value: empty string. - * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param $ln (int) Indicates where the current position should go after the call. Possible values are:
        • 0: to the right (or left for RTL languages)
        • 1: to the beginning of the next line
        • 2: below
        Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. - * @param $align (string) Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        - * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false). - * @param $link (mixed) URL or identifier returned by AddLink(). - * @param $stretch (int) font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. - * @param $ignore_min_height (boolean) if true ignore automatic minimum height value. - * @param $calign (string) cell vertical alignment relative to the specified Y value. Possible values are:
        • T : cell top
        • C : center
        • B : cell bottom
        • A : font top
        • L : font baseline
        • D : font bottom
        - * @param $valign (string) text vertical alignment inside the cell. Possible values are:
        • T : top
        • M : middle
        • B : bottom
        + * @param float $w Cell width. If 0, the cell extends up to the right margin. + * @param float $h Cell height. Default value: 0. + * @param string $txt String to print. Default value: empty string. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param int $ln Indicates where the current position should go after the call. Possible values are:
        • 0: to the right (or left for RTL languages)
        • 1: to the beginning of the next line
        • 2: below
        Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. + * @param string $align Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param mixed $link URL or identifier returned by AddLink(). + * @param int $stretch font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. + * @param boolean $ignore_min_height if true ignore automatic minimum height value. + * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:
        • T : cell top
        • C : center
        • B : cell bottom
        • A : font top
        • L : font baseline
        • D : font bottom
        + * @param string $valign text vertical alignment inside the cell. Possible values are:
        • T : top
        • M : middle
        • B : bottom
        * @return string containing cell code * @protected * @since 1.0 * @see Cell() */ - protected function getCellCode($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M') - { + protected function getCellCode($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') { // replace 'NO-BREAK SPACE' (U+00A0) character with a simple space + $txt = is_null($txt) ? '' : $txt; $txt = str_replace(TCPDF_FONTS::unichr(160, $this->isunicode), ' ', $txt); $prev_cell_margin = $this->cell_margin; $prev_cell_padding = $this->cell_padding; @@ -5586,12 +5551,12 @@ class TCPDF $xdk = $xdx * $k; // print text $s .= sprintf('BT %F %F Td [(%s)] TJ ET', $xdk, (($this->h - $basefonty) * $k), $txt2); - if (isset($uniblock)) { + if (isset($uniblock)) { // @phpstan-ignore-line // print overlapping characters as separate string $xshift = 0; // horizontal shift $ty = (($this->h - $basefonty + (0.2 * $this->FontSize)) * $k); $spw = (($w - $txwidth - $this->cell_padding['L'] - $this->cell_padding['R']) / ($ns?$ns:1)); - foreach ($uniblock as $uk => $uniarr) { + foreach ($uniblock as $uk => $uniarr) { // @phpstan-ignore-line if (($uk % 2) == 0) { // x space to skip if ($spacewidth != 0) { @@ -5671,14 +5636,13 @@ class TCPDF /** * Replace a char if is defined on the current font. - * @param $oldchar (int) Integer code (unicode) of the character to replace. - * @param $newchar (int) Integer code (unicode) of the new character. + * @param int $oldchar Integer code (unicode) of the character to replace. + * @param int $newchar Integer code (unicode) of the new character. * @return int the replaced char or the old char in case the new char i not defined * @protected * @since 5.9.167 (2012-06-22) */ - protected function replaceChar($oldchar, $newchar) - { + protected function replaceChar($oldchar, $newchar) { if ($this->isCharDefined($newchar)) { // add the new char on the subset list $this->CurrentFont['subsetchars'][$newchar] = true; @@ -5691,18 +5655,17 @@ class TCPDF /** * Returns the code to draw the cell border - * @param $x (float) X coordinate. - * @param $y (float) Y coordinate. - * @param $w (float) Cell width. - * @param $h (float) Cell height. - * @param $brd (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param float $x X coordinate. + * @param float $y Y coordinate. + * @param float $w Cell width. + * @param float $h Cell height. + * @param string|array|int $brd Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) * @return string containing cell border code * @protected * @see SetLineStyle() * @since 5.7.000 (2010-08-02) */ - protected function getCellBorder($x, $y, $w, $h, $brd) - { + protected function getCellBorder($x, $y, $w, $h, $brd) { $s = ''; // string to be returned if (empty($brd)) { return $s; @@ -5744,7 +5707,7 @@ class TCPDF if (is_array($style) AND !empty($style)) { // apply border style $prev_style = $this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor.' '; - $s .= $this->SetLineStyle($style, true)."\n"; + $s .= $this->setLineStyle($style, true)."\n"; } switch ($mode) { case 'ext': { @@ -5792,25 +5755,25 @@ class TCPDF if (strlen($border) == 4) { $s .= sprintf('%F %F %F %F re S ', $xT, $yT, ($w * $k), (-$h * $k)); } elseif (strlen($border) == 3) { - if (strpos($border, 'B') === false) { // LTR + if (strpos($border,'B') === false) { // LTR $s .= sprintf('%F %F m ', $xL, $yL); $s .= sprintf('%F %F l ', $xT, $yT); $s .= sprintf('%F %F l ', $xR, $yR); $s .= sprintf('%F %F l ', $xB, $yB); $s .= 'S '; - } elseif (strpos($border, 'L') === false) { // TRB + } elseif (strpos($border,'L') === false) { // TRB $s .= sprintf('%F %F m ', $xT, $yT); $s .= sprintf('%F %F l ', $xR, $yR); $s .= sprintf('%F %F l ', $xB, $yB); $s .= sprintf('%F %F l ', $xL, $yL); $s .= 'S '; - } elseif (strpos($border, 'T') === false) { // RBL + } elseif (strpos($border,'T') === false) { // RBL $s .= sprintf('%F %F m ', $xR, $yR); $s .= sprintf('%F %F l ', $xB, $yB); $s .= sprintf('%F %F l ', $xL, $yL); $s .= sprintf('%F %F l ', $xT, $yT); $s .= 'S '; - } elseif (strpos($border, 'R') === false) { // BLT + } elseif (strpos($border,'R') === false) { // BLT $s .= sprintf('%F %F m ', $xB, $yB); $s .= sprintf('%F %F l ', $xL, $yL); $s .= sprintf('%F %F l ', $xT, $yT); @@ -5818,34 +5781,34 @@ class TCPDF $s .= 'S '; } } elseif (strlen($border) == 2) { - if ((strpos($border, 'L') !== false) AND (strpos($border, 'T') !== false)) { // LT + if ((strpos($border,'L') !== false) AND (strpos($border,'T') !== false)) { // LT $s .= sprintf('%F %F m ', $xL, $yL); $s .= sprintf('%F %F l ', $xT, $yT); $s .= sprintf('%F %F l ', $xR, $yR); $s .= 'S '; - } elseif ((strpos($border, 'T') !== false) AND (strpos($border, 'R') !== false)) { // TR + } elseif ((strpos($border,'T') !== false) AND (strpos($border,'R') !== false)) { // TR $s .= sprintf('%F %F m ', $xT, $yT); $s .= sprintf('%F %F l ', $xR, $yR); $s .= sprintf('%F %F l ', $xB, $yB); $s .= 'S '; - } elseif ((strpos($border, 'R') !== false) AND (strpos($border, 'B') !== false)) { // RB + } elseif ((strpos($border,'R') !== false) AND (strpos($border,'B') !== false)) { // RB $s .= sprintf('%F %F m ', $xR, $yR); $s .= sprintf('%F %F l ', $xB, $yB); $s .= sprintf('%F %F l ', $xL, $yL); $s .= 'S '; - } elseif ((strpos($border, 'B') !== false) AND (strpos($border, 'L') !== false)) { // BL + } elseif ((strpos($border,'B') !== false) AND (strpos($border,'L') !== false)) { // BL $s .= sprintf('%F %F m ', $xB, $yB); $s .= sprintf('%F %F l ', $xL, $yL); $s .= sprintf('%F %F l ', $xT, $yT); $s .= 'S '; - } elseif ((strpos($border, 'L') !== false) AND (strpos($border, 'R') !== false)) { // LR + } elseif ((strpos($border,'L') !== false) AND (strpos($border,'R') !== false)) { // LR $s .= sprintf('%F %F m ', $xL, $yL); $s .= sprintf('%F %F l ', $xT, $yT); $s .= 'S '; $s .= sprintf('%F %F m ', $xR, $yR); $s .= sprintf('%F %F l ', $xB, $yB); $s .= 'S '; - } elseif ((strpos($border, 'T') !== false) AND (strpos($border, 'B') !== false)) { // TB + } elseif ((strpos($border,'T') !== false) AND (strpos($border,'B') !== false)) { // TB $s .= sprintf('%F %F m ', $xT, $yT); $s .= sprintf('%F %F l ', $xR, $yR); $s .= 'S '; @@ -5854,19 +5817,19 @@ class TCPDF $s .= 'S '; } } else { // strlen($border) == 1 - if (strpos($border, 'L') !== false) { // L + if (strpos($border,'L') !== false) { // L $s .= sprintf('%F %F m ', $xL, $yL); $s .= sprintf('%F %F l ', $xT, $yT); $s .= 'S '; - } elseif (strpos($border, 'T') !== false) { // T + } elseif (strpos($border,'T') !== false) { // T $s .= sprintf('%F %F m ', $xT, $yT); $s .= sprintf('%F %F l ', $xR, $yR); $s .= 'S '; - } elseif (strpos($border, 'R') !== false) { // R + } elseif (strpos($border,'R') !== false) { // R $s .= sprintf('%F %F m ', $xR, $yR); $s .= sprintf('%F %F l ', $xB, $yB); $s .= 'S '; - } elseif (strpos($border, 'B') !== false) { // B + } elseif (strpos($border,'B') !== false) { // B $s .= sprintf('%F %F m ', $xB, $yB); $s .= sprintf('%F %F l ', $xL, $yL); $s .= 'S '; @@ -5884,29 +5847,28 @@ class TCPDF * This method allows printing text with line breaks. * They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.
        * Text can be aligned, centered or justified. The cell block can be framed and the background painted. - * @param $w (float) Width of cells. If 0, they extend up to the right margin of the page. - * @param $h (float) Cell minimum height. The cell extends automatically if needed. - * @param $txt (string) String to print - * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param $align (string) Allows to center or align the text. Possible values are:
        • L or empty string: left align
        • C: center
        • R: right align
        • J: justification (default value when $ishtml=false)
        - * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false). - * @param $ln (int) Indicates where the current position should go after the call. Possible values are:
        • 0: to the right
        • 1: to the beginning of the next line [DEFAULT]
        • 2: below
        - * @param $x (float) x position in user units - * @param $y (float) y position in user units - * @param $reseth (boolean) if true reset the last cell height (default true). - * @param $stretch (int) font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. - * @param $ishtml (boolean) INTERNAL USE ONLY -- set to true if $txt is HTML content (default = false). Never set this parameter to true, use instead writeHTMLCell() or writeHTML() methods. - * @param $autopadding (boolean) if true, uses internal padding and automatically adjust it to account for line width. - * @param $maxh (float) maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false. - * @param $valign (string) Vertical alignment of text (requires $maxh = $h > 0). Possible values are:
        • T: TOP
        • M: middle
        • B: bottom
        . This feature works only when $ishtml=false and the cell must fit in a single page. - * @param $fitcell (boolean) if true attempt to fit all the text within the cell by reducing the font size (do not work in HTML mode). $maxh must be greater than 0 and equal to $h. + * @param float $w Width of cells. If 0, they extend up to the right margin of the page. + * @param float $h Cell minimum height. The cell extends automatically if needed. + * @param string $txt String to print + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param string $align Allows to center or align the text. Possible values are:
        • L or empty string: left align
        • C: center
        • R: right align
        • J: justification (default value when $ishtml=false)
        + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param int $ln Indicates where the current position should go after the call. Possible values are:
        • 0: to the right
        • 1: to the beginning of the next line [DEFAULT]
        • 2: below
        + * @param float|null $x x position in user units + * @param float|null $y y position in user units + * @param boolean $reseth if true reset the last cell height (default true). + * @param int $stretch font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. + * @param boolean $ishtml INTERNAL USE ONLY -- set to true if $txt is HTML content (default = false). Never set this parameter to true, use instead writeHTMLCell() or writeHTML() methods. + * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width. + * @param float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false. + * @param string $valign Vertical alignment of text (requires $maxh = $h > 0). Possible values are:
        • T: TOP
        • M: middle
        • B: bottom
        . This feature works only when $ishtml=false and the cell must fit in a single page. + * @param boolean $fitcell if true attempt to fit all the text within the cell by reducing the font size (do not work in HTML mode). $maxh must be greater than 0 and equal to $h. * @return int Return the number of cells or 1 for html mode. * @public * @since 1.3 * @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak() */ - public function MultiCell($w, $h, $txt, $border = 0, $align = 'J', $fill = false, $ln = 1, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'T', $fitcell = false) - { + public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln=1, $x=null, $y=null, $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0, $valign='T', $fitcell=false) { $prev_cell_margin = $this->cell_margin; $prev_cell_padding = $this->cell_padding; // adjust internal padding @@ -5921,7 +5883,7 @@ class TCPDF $this->resetLastH(); } if (!TCPDF_STATIC::empty_string($y)) { - $this->SetY($y); // set y in order to convert negative y values to positive ones + $this->setY($y); // set y in order to convert negative y values to positive ones } $y = $this->GetY(); $resth = 0; @@ -5936,7 +5898,7 @@ class TCPDF // get current column $startcolumn = $this->current_column; if (!TCPDF_STATIC::empty_string($x)) { - $this->SetX($x); + $this->setX($x); } else { $x = $this->GetX(); } @@ -5997,7 +5959,7 @@ class TCPDF $maxit = (2 * min(100, max(10, intval($fmax)))); // max number of iterations while ($maxit >= 0) { $fmid = (($fmax + $fmin) / 2); - $this->SetFontSize($fmid, false); + $this->setFontSize($fmid, false); $this->resetLastH(); $text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border); $diff = ($maxh - $text_height); @@ -6013,11 +5975,11 @@ class TCPDF } if ($maxit < 0) { // premature exit, we get the minimum font value to fit the cell - $this->SetFontSize($fmin); + $this->setFontSize($fmin); $this->resetLastH(); $text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border); } else { - $this->SetFontSize($fmid); + $this->setFontSize($fmid); $this->resetLastH(); } } @@ -6034,7 +5996,7 @@ class TCPDF $nl = $this->Write($this->lasth, $txt, '', 0, $align, true, $stretch, false, true, $maxh, 0, $mc_margin); if ($fitcell) { // restore font size - $this->SetFontSize($prev_FontSizePt); + $this->setFontSize($prev_FontSizePt); } } if ($autopadding) { @@ -6081,7 +6043,7 @@ class TCPDF $this->setPage($page); if ($this->num_columns < 2) { // single-column mode - $this->SetX($x); + $this->setX($x); $this->y = $this->tMargin; } // account for margin changes @@ -6243,15 +6205,15 @@ class TCPDF } if ($ln > 0) { //Go to the beginning of the next line - $this->SetY($currentY + $mc_margin['B']); + $this->setY($currentY + $mc_margin['B']); if ($ln == 2) { - $this->SetX($x + $w + $mc_margin['L'] + $mc_margin['R']); + $this->setX($x + $w + $mc_margin['L'] + $mc_margin['R']); } } else { // go left or right by case $this->setPage($startpage); $this->y = $y; - $this->SetX($x + $w + $mc_margin['L'] + $mc_margin['R']); + $this->setX($x + $w + $mc_margin['L'] + $mc_margin['R']); } $this->setContentMark(); $this->cell_padding = $prev_cell_padding; @@ -6263,20 +6225,19 @@ class TCPDF /** * This method return the estimated number of lines for print a simple text string using Multicell() method. - * @param $txt (string) String for calculating his height - * @param $w (float) Width of cells. If 0, they extend up to the right margin of the page. - * @param $reseth (boolean) if true reset the last cell height (default false). - * @param $autopadding (boolean) if true, uses internal padding and automatically adjust it to account for line width (default true). - * @param $cellpadding (float) Internal cell padding, if empty uses default cell padding. - * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param string $txt String for calculating his height + * @param float $w Width of cells. If 0, they extend up to the right margin of the page. + * @param boolean $reseth if true reset the last cell height (default false). + * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width (default true). + * @param array|null $cellpadding Internal cell padding, if empty uses default cell padding. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) * @return float Return the minimal height needed for multicell method for printing the $txt param. * @author Alexander Escalona Fern\E1ndez, Nicola Asuni * @public * @since 4.5.011 */ - public function getNumLines($txt, $w = 0, $reseth = false, $autopadding = true, $cellpadding = '', $border = 0) - { - if ($txt === null) { + public function getNumLines($txt, $w=0, $reseth=false, $autopadding=true, $cellpadding=null, $border=0) { + if ($txt === NULL) { return 0; } if ($txt === '') { @@ -6358,7 +6319,7 @@ class TCPDF * $start_page = $pdf->getPage(); * // call your printing functions with your parameters * // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * $pdf->MultiCell($w=0, $h=0, $txt, $border=1, $align='L', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0); + * $pdf->MultiCell($w=0, $h=0, $txt, $border=1, $align='L', $fill=false, $ln=1, $x=null, $y=null, $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0); * // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * // get the new Y * $end_y = $pdf->GetY(); @@ -6384,18 +6345,17 @@ class TCPDF * // restore previous object * $pdf = $pdf->rollbackTransaction(); * - * @param $w (float) Width of cells. If 0, they extend up to the right margin of the page. - * @param $txt (string) String for calculating his height - * @param $reseth (boolean) if true reset the last cell height (default false). - * @param $autopadding (boolean) if true, uses internal padding and automatically adjust it to account for line width (default true). - * @param $cellpadding (float) Internal cell padding, if empty uses default cell padding. - * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param float $w Width of cells. If 0, they extend up to the right margin of the page. + * @param string $txt String for calculating his height + * @param boolean $reseth if true reset the last cell height (default false). + * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width (default true). + * @param array|null $cellpadding Internal cell padding, if empty uses default cell padding. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) * @return float Return the minimal height needed for multicell method for printing the $txt param. * @author Nicola Asuni, Alexander Escalona Fern\E1ndez * @public */ - public function getStringHeight($w, $txt, $reseth = false, $autopadding = true, $cellpadding = '', $border = 0) - { + public function getStringHeight($w, $txt, $reseth=false, $autopadding=true, $cellpadding=null, $border=0) { // adjust internal padding $prev_cell_padding = $this->cell_padding; $prev_lasth = $this->lasth; @@ -6412,31 +6372,30 @@ class TCPDF /** * This method prints text from the current position.
        - * @param $h (float) Line height - * @param $txt (string) String to print - * @param $link (mixed) URL or identifier returned by AddLink() - * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false). - * @param $align (string) Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        - * @param $ln (boolean) if true set cursor at the bottom of the line, otherwise set cursor at the top of the line. - * @param $stretch (int) font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. - * @param $firstline (boolean) if true prints only the first line and return the remaining string. - * @param $firstblock (boolean) if true the string is the starting of a line. - * @param $maxh (float) maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. - * @param $wadj (float) first line width will be reduced by this amount (used in HTML mode). - * @param $margin (array) margin array of the parent container + * @param float $h Line height + * @param string $txt String to print + * @param mixed $link URL or identifier returned by AddLink() + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param string $align Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        + * @param boolean $ln if true set cursor at the bottom of the line, otherwise set cursor at the top of the line. + * @param int $stretch font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. + * @param boolean $firstline if true prints only the first line and return the remaining string. + * @param boolean $firstblock if true the string is the starting of a line. + * @param float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. + * @param float $wadj first line width will be reduced by this amount (used in HTML mode). + * @param array|null $margin margin array of the parent container * @return mixed Return the number of cells or the remaining string if $firstline = true. * @public * @since 1.5 */ - public function Write($h, $txt, $link = '', $fill = false, $align = '', $ln = false, $stretch = 0, $firstline = false, $firstblock = false, $maxh = 0, $wadj = 0, $margin = '') - { + public function Write($h, $txt, $link='', $fill=false, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0, $wadj=0, $margin=null) { // check page for no-write regions and adapt page margins if necessary list($this->x, $this->y) = $this->checkPageRegions($h, $this->x, $this->y); if (strlen($txt) == 0) { // fix empty text $txt = ' '; } - if ($margin === '') { + if (!is_array($margin)) { // set default margins $margin = $this->cell_margin; } @@ -6461,7 +6420,7 @@ class TCPDF // calculate maximum width for a single character on string $chrw = $this->GetArrStringWidth($chars, '', '', 0, true); array_walk($chrw, array($this, 'getRawCharWidth')); - $maxchwidth = max($chrw); + $maxchwidth = ((is_array($chrw) || $chrw instanceof Countable) && count($chrw) > 0) ? max($chrw) : 0; // get array of chars $uchars = TCPDF_FONTS::UTF8ArrayToUniArray($chars, $this->isunicode); // get the number of characters @@ -6538,7 +6497,7 @@ class TCPDF $w = $linew; $tmpcellpadding = $this->cell_padding; if ($maxh == 0) { - $this->SetCellPadding(0); + $this->setCellPadding(0); } } if ($firstblock AND $this->isRTLTextDir()) { @@ -6561,14 +6520,16 @@ class TCPDF $shy = false; // account for margin changes if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND ($this->inPageBody())) { - $this->AcceptPageBreak(); - if ($this->rtl) { - $this->x -= $margin['R']; - } else { - $this->x += $margin['L']; + if ($this->AcceptPageBreak()) + { + if ($this->rtl) { + $this->x -= $margin['R']; + } else { + $this->x += $margin['L']; + } + $this->lMargin += $margin['L']; + $this->rMargin += $margin['R']; } - $this->lMargin += $margin['L']; - $this->rMargin += $margin['R']; } $w = $this->getRemainingWidth(); $wmax = ($w - $this->cell_padding['L'] - $this->cell_padding['R']); @@ -6612,7 +6573,7 @@ class TCPDF // *** very slow *** $l = $this->GetArrStringWidth(TCPDF_FONTS::utf8Bidi(array_slice($chars, $j, ($i - $j)), '', $this->tmprtl, $this->isunicode, $this->CurrentFont)); } else { - $l += $this->GetCharWidth($c); + $l += $this->GetCharWidth($c, ($i+1 < $nb)); } if (($l > $wmax) OR (($c == 173) AND (($l + $tmp_shy_replacement_width) >= $wmax))) { if (($c == 173) AND (($l + $tmp_shy_replacement_width) > $wmax)) { @@ -6649,7 +6610,7 @@ class TCPDF $w = $linew; $tmpcellpadding = $this->cell_padding; if ($maxh == 0) { - $this->SetCellPadding(0); + $this->setCellPadding(0); } } if ($firstblock AND $this->isRTLTextDir()) { @@ -6693,7 +6654,7 @@ class TCPDF $w = $linew; $tmpcellpadding = $this->cell_padding; if ($maxh == 0) { - $this->SetCellPadding(0); + $this->setCellPadding(0); } } if ($firstblock AND $this->isRTLTextDir()) { @@ -6741,7 +6702,7 @@ class TCPDF $w = $linew; $tmpcellpadding = $this->cell_padding; if ($maxh == 0) { - $this->SetCellPadding(0); + $this->setCellPadding(0); } } // print the line @@ -6766,14 +6727,16 @@ class TCPDF } // account for margin changes if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND ($this->inPageBody())) { - $this->AcceptPageBreak(); - if ($this->rtl) { - $this->x -= $margin['R']; - } else { - $this->x += $margin['L']; + if ($this->AcceptPageBreak()) + { + if ($this->rtl) { + $this->x -= $margin['R']; + } else { + $this->x += $margin['L']; + } + $this->lMargin += $margin['L']; + $this->rMargin += $margin['R']; } - $this->lMargin += $margin['L']; - $this->rMargin += $margin['R']; } $w = $this->getRemainingWidth(); $wmax = $w - $this->cell_padding['L'] - $this->cell_padding['R']; @@ -6794,13 +6757,10 @@ class TCPDF switch ($align) { case 'J': case 'C': { - $w = $w; break; } case 'L': { - if ($this->rtl) { - $w = $w; - } else { + if (!$this->rtl) { $w = $l; } break; @@ -6808,8 +6768,6 @@ class TCPDF case 'R': { if ($this->rtl) { $w = $l; - } else { - $w = $w; } break; } @@ -6835,7 +6793,7 @@ class TCPDF $w = $linew; $tmpcellpadding = $this->cell_padding; if ($maxh == 0) { - $this->SetCellPadding(0); + $this->setCellPadding(0); } } if ($firstblock AND $this->isRTLTextDir()) { @@ -6857,11 +6815,10 @@ class TCPDF /** * Returns the remaining width between the current position and margins. - * @return int Return the remaining width + * @return float Return the remaining width * @protected */ - protected function getRemainingWidth() - { + protected function getRemainingWidth() { list($this->x, $this->y) = $this->checkPageRegions(0, $this->x, $this->y); if ($this->rtl) { return ($this->x - $this->lMargin); @@ -6872,17 +6829,16 @@ class TCPDF /** * Set the block dimensions accounting for page breaks and page/column fitting - * @param $w (float) width - * @param $h (float) height - * @param $x (float) X coordinate - * @param $y (float) Y coodiante - * @param $fitonpage (boolean) if true the block is resized to not exceed page dimensions. - * @return array($w, $h, $x, $y) + * @param float $w width + * @param float $h height + * @param float $x X coordinate + * @param float $y Y coodiante + * @param boolean $fitonpage if true the block is resized to not exceed page dimensions. + * @return array array($w, $h, $x, $y) * @protected * @since 5.5.009 (2010-07-05) */ - protected function fitBlock($w, $h, $x, $y, $fitonpage = false) - { + protected function fitBlock($w, $h, $x, $y, $fitonpage=false) { if ($w <= 0) { // set maximum width $w = ($this->w - $this->lMargin - $this->rMargin); @@ -6927,6 +6883,8 @@ class TCPDF } // resize the block to be contained on the remaining available page or column space if ($fitonpage) { + // fallback to avoid division by zero + $h = $h == 0 ? 1 : $h; $ratio_wh = ($w / $h); if (($y + $h) > $this->PageBreakTrigger) { $h = $this->PageBreakTrigger - $y; @@ -6954,44 +6912,49 @@ class TCPDF * The format can be specified explicitly or inferred from the file extension.
        * It is possible to put a link on the image.
        * Remark: if an image is used several times, only one copy will be embedded in the file.
        - * @param $file (string) Name of the file containing the image or a '@' character followed by the image data string. To link an image without embedding it on the document, set an asterisk character before the URL (i.e.: '*http://www.example.com/image.jpg'). - * @param $x (float) Abscissa of the upper-left corner (LTR) or upper-right corner (RTL). - * @param $y (float) Ordinate of the upper-left corner (LTR) or upper-right corner (RTL). - * @param $w (float) Width of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param $h (float) Height of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param $type (string) Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. - * @param $link (mixed) URL or identifier returned by AddLink(). - * @param $align (string) Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        - * @param $resize (mixed) If true resize (reduce) the image to fit $w and $h (requires GD or ImageMagick library); if false do not resize; if 2 force resize in all cases (upscaling and downscaling). - * @param $dpi (int) dot-per-inch resolution used on resize - * @param $palign (string) Allows to center or align the image on the current line. Possible values are:
        • L : left align
        • C : center
        • R : right align
        • '' : empty string : left for LTR or right for RTL
        - * @param $ismask (boolean) true if this image is a mask, false otherwise - * @param $imgmask (mixed) image object returned by this function or false - * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param $fitbox (mixed) If not false scale image dimensions proportionally to fit within the ($w, $h) box. $fitbox can be true or a 2 characters string indicating the image alignment inside the box. The first character indicate the horizontal alignment (L = left, C = center, R = right) the second character indicate the vertical algnment (T = top, M = middle, B = bottom). - * @param $hidden (boolean) If true do not display the image. - * @param $fitonpage (boolean) If true the image is resized to not exceed page dimensions. - * @param $alt (boolean) If true the image will be added as alternative and not directly printed (the ID of the image will be returned). - * @param $altimgs (array) Array of alternate images IDs. Each alternative image must be an array with two values: an integer representing the image ID (the value returned by the Image method) and a boolean value to indicate if the image is the default for printing. - * @return image information + * @param string $file Name of the file containing the image or a '@' character followed by the image data string. To link an image without embedding it on the document, set an asterisk character before the URL (i.e.: '*http://www.example.com/image.jpg'). + * @param float|null $x Abscissa of the upper-left corner (LTR) or upper-right corner (RTL). + * @param float|null $y Ordinate of the upper-left corner (LTR) or upper-right corner (RTL). + * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. + * @param mixed $link URL or identifier returned by AddLink(). + * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        + * @param mixed $resize If true resize (reduce) the image to fit $w and $h (requires GD or ImageMagick library); if false do not resize; if 2 force resize in all cases (upscaling and downscaling). + * @param int $dpi dot-per-inch resolution used on resize + * @param string $palign Allows to center or align the image on the current line. Possible values are:
        • L : left align
        • C : center
        • R : right align
        • '' : empty string : left for LTR or right for RTL
        + * @param boolean $ismask true if this image is a mask, false otherwise + * @param mixed $imgmask image object returned by this function or false + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param mixed $fitbox If not false scale image dimensions proportionally to fit within the ($w, $h) box. $fitbox can be true or a 2 characters string indicating the image alignment inside the box. The first character indicate the horizontal alignment (L = left, C = center, R = right) the second character indicate the vertical algnment (T = top, M = middle, B = bottom). + * @param boolean $hidden If true do not display the image. + * @param boolean $fitonpage If true the image is resized to not exceed page dimensions. + * @param boolean $alt If true the image will be added as alternative and not directly printed (the ID of the image will be returned). + * @param array $altimgs Array of alternate images IDs. Each alternative image must be an array with two values: an integer representing the image ID (the value returned by the Image method) and a boolean value to indicate if the image is the default for printing. + * @return mixed|false image information * @public * @since 1.1 */ - public function Image($file, $x = '', $y = '', $w = 0, $h = 0, $type = '', $link = '', $align = '', $resize = false, $dpi = 300, $palign = '', $ismask = false, $imgmask = false, $border = 0, $fitbox = false, $hidden = false, $fitonpage = false, $alt = false, $altimgs = array()) - { + public function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false, $alt=false, $altimgs=array()) { if ($this->state != 2) { - return; + return false; } - if (strcmp($x, '') === 0) { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if (strcmp($y, '') === 0) { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary list($x, $y) = $this->checkPageRegions($h, $x, $y); $exurl = ''; // external streams - $imsize = false; + $imsize = FALSE; + + // Make sure the file variable is not empty or null because accessing $file[0] later + // results in error when running PHP 7.4 + if (empty($file)) { + return false; + } // check if we are passing an image as file or string if ($file[0] === '@') { // image from string @@ -7003,25 +6966,21 @@ class TCPDF $exurl = $file; } // check if file exist and it is valid - if (!@TCPDF_STATIC::file_exists($file)) { - // DOL CHANGE If we keep this, the image is not visible on pages after the first one. - //var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file))); + if (!@$this->fileExists($file)) { + // @CHANGE DOL If we keep this, the image is not visible on pages after the first one. + //var_dump($file.' '.(!@$this->fileExists($file))); //return false; // try to encode spaces on filename $tfile = str_replace(' ', '%20', $file); - if (@TCPDF_STATIC::file_exists($tfile)) { + if (@$this->fileExists($tfile)) { $file = $tfile; } } - if (($imsize = @getimagesize($file)) === false) { - if (in_array($file, $this->imagekeys)) { - // get existing image data - $info = $this->getImageBuffer($file); - $imsize = array($info['w'], $info['h']); - } elseif (strpos($file, '__tcpdf_'.$this->file_id.'_img') === false) { - $imgdata = TCPDF_STATIC::fileGetContents($file); - } - } + if (false !== $info = $this->getImageBuffer($file)) { + $imsize = array($info['w'], $info['h']); + } elseif (($imsize = @getimagesize($file)) === FALSE && strpos($file, '__tcpdf_'.$this->file_id.'_img') === FALSE){ + $imgdata = $this->getCachedFileContents($file); + } } if (!empty($imgdata)) { // copy image to cache @@ -7035,12 +6994,12 @@ class TCPDF fclose($fp); unset($imgdata); $imsize = @getimagesize($file); - if ($imsize === false) { + if ($imsize === FALSE) { unlink($file); $file = $original_file; } } - if ($imsize === false) { + if ($imsize === FALSE) { if (($w > 0) AND ($h > 0)) { // get measures from specified data $pw = $this->getHTMLUnitToUnits($w, 0, $this->pdfunit, true) * $this->imgscale * $this->k; @@ -7141,14 +7100,14 @@ class TCPDF $newimage = false; // get existing image data $info = $this->getImageBuffer($file); - if (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === false) { + if (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === FALSE) { // check if the newer image is larger $oldsize = ($info['w'] * $info['h']); if ((($oldsize < $newsize) AND ($resize)) OR (($oldsize < $pixsize) AND (!$resize))) { $newimage = true; } } - } elseif (($ismask === false) AND ($imgmask === false) AND (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === false)) { + } elseif (($ismask === false) AND ($imgmask === false) AND (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === FALSE)) { // create temp image file (without alpha channel) $tempfile_plain = K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_imgmask_plain_'.$filehash; // create temp alpha file @@ -7178,8 +7137,6 @@ class TCPDF } elseif ($type == 'jpg') { $type = 'jpeg'; } - $mqr = TCPDF_STATIC::get_mqr(); - TCPDF_STATIC::set_mqr(false); // Specific image handlers (defined on TCPDF_IMAGES CLASS) $mtd = '_parse'.$type; // GD image handler function @@ -7188,7 +7145,7 @@ class TCPDF if ((method_exists('TCPDF_IMAGES', $mtd)) AND (!($resize AND (function_exists($gdfunction) OR extension_loaded('imagick'))))) { // TCPDF image functions $info = TCPDF_IMAGES::$mtd($file); - if (($ismask === false) AND ($imgmask === false) AND (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === false) + if (($ismask === false) AND ($imgmask === false) AND (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === FALSE) AND (($info === 'pngalpha') OR (isset($info['trns']) AND !empty($info['trns'])))) { return $this->ImagePngAlpha($file, $x, $y, $pixw, $pixh, $w, $h, 'PNG', $link, $align, $resize, $dpi, $palign, $filehash); } @@ -7212,7 +7169,7 @@ class TCPDF $info = TCPDF_IMAGES::_toJPEG($img, $this->jpeg_quality, TCPDF_STATIC::getObjFilename('img', $this->file_id)); } } - } catch (Exception $e) { + } catch(Exception $e) { $info = false; } } @@ -7226,9 +7183,9 @@ class TCPDF $svgimg = substr($file, 1); } else { // get SVG file content - $svgimg = TCPDF_STATIC::fileGetContents($file); + $svgimg = $this->getCachedFileContents($file); } - if ($svgimg !== false) { + if ($svgimg !== FALSE) { // get width and height $regs = array(); if (preg_match('/]*)>/si', $svgimg, $regs)) { @@ -7273,15 +7230,14 @@ class TCPDF $info = TCPDF_IMAGES::_parsejpeg($tempname); unlink($tempname); $img->destroy(); - } catch (Exception $e) { + } catch(Exception $e) { $info = false; } } if ($info === false) { // unable to process image - return; + return false; } - TCPDF_STATIC::set_mqr($mqr); if ($ismask) { // force grayscale $info['cs'] = 'DeviceGray'; @@ -7298,31 +7254,20 @@ class TCPDF $info['i'] = $this->setImageBuffer($file, $info); } // set alignment + $this->img_rb_x = $x + $w; $this->img_rb_y = $y + $h; + // set alignment - if ($this->rtl) { - if ($palign == 'L') { - $ximg = $this->lMargin; - } elseif ($palign == 'C') { - $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($palign == 'R') { - $ximg = $this->w - $this->rMargin - $w; - } else { - $ximg = $x - $w; - } - $this->img_rb_x = $ximg; + if ($palign == 'L') { + $ximg = $this->lMargin; + } elseif ($palign == 'C') { + $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($palign == 'R') { + $ximg = $this->w - $this->rMargin - $w; } else { - if ($palign == 'L') { - $ximg = $this->lMargin; - } elseif ($palign == 'C') { - $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($palign == 'R') { - $ximg = $this->w - $this->rMargin - $w; - } else { - $ximg = $x; - } - $this->img_rb_x = $ximg + $w; + $ximg = $this->rtl ? $x - $w : $x; } + if ($ismask OR $hidden) { // image is not displayed return $info['i']; @@ -7348,7 +7293,7 @@ class TCPDF $this->Link($ximg, $y, $w, $h, $link, 0); } // set pointer to align the next text/objects - switch ($align) { + switch($align) { case 'T': { $this->y = $y; $this->x = $this->img_rb_x; @@ -7365,7 +7310,7 @@ class TCPDF break; } case 'N': { - $this->SetY($this->img_rb_y); + $this->setY($this->img_rb_y); break; } default:{ @@ -7382,27 +7327,26 @@ class TCPDF /** * Extract info from a PNG image with alpha channel using the Imagick or GD library. - * @param $file (string) Name of the file containing the image. - * @param $x (float) Abscissa of the upper-left corner. - * @param $y (float) Ordinate of the upper-left corner. - * @param $wpx (float) Original width of the image in pixels. - * @param $hpx (float) original height of the image in pixels. - * @param $w (float) Width of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param $h (float) Height of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param $type (string) Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. - * @param $link (mixed) URL or identifier returned by AddLink(). - * @param $align (string) Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        - * @param $resize (boolean) If true resize (reduce) the image to fit $w and $h (requires GD library). - * @param $dpi (int) dot-per-inch resolution used on resize - * @param $palign (string) Allows to center or align the image on the current line. Possible values are:
        • L : left align
        • C : center
        • R : right align
        • '' : empty string : left for LTR or right for RTL
        - * @param $filehash (string) File hash used to build unique file names. + * @param string $file Name of the file containing the image. + * @param float $x Abscissa of the upper-left corner. + * @param float $y Ordinate of the upper-left corner. + * @param float $wpx Original width of the image in pixels. + * @param float $hpx original height of the image in pixels. + * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. + * @param mixed $link URL or identifier returned by AddLink(). + * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        + * @param boolean $resize If true resize (reduce) the image to fit $w and $h (requires GD library). + * @param int $dpi dot-per-inch resolution used on resize + * @param string $palign Allows to center or align the image on the current line. Possible values are:
        • L : left align
        • C : center
        • R : right align
        • '' : empty string : left for LTR or right for RTL
        + * @param string $filehash File hash used to build unique file names. * @author Nicola Asuni * @protected * @since 4.3.007 (2008-12-04) * @see Image() */ - protected function ImagePngAlpha($file, $x, $y, $wpx, $hpx, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $filehash = '') - { + protected function ImagePngAlpha($file, $x, $y, $wpx, $hpx, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $filehash='') { // create temp images if (empty($filehash)) { $filehash = md5($file); @@ -7460,7 +7404,7 @@ class TCPDF $color = imagecolorat($img, $xpx, $ypx); // get and correct gamma color $alpha = $this->getGDgamma($img, $color); - imagesetpixel($imgalpha, $xpx, $ypx, (int) $alpha); + imagesetpixel($imgalpha, (int) $xpx, (int) $ypx, (int) $alpha); } } imagepng($imgalpha, $tempfile_alpha); @@ -7491,19 +7435,18 @@ class TCPDF /** * Get the GD-corrected PNG gamma value from alpha color - * @param $img (int) GD image Resource ID. - * @param $c (int) alpha color + * @param resource $img GD image Resource ID. + * @param int $c alpha color * @protected * @since 4.3.007 (2008-12-04) */ - protected function getGDgamma($img, $c) - { + protected function getGDgamma($img, $c) { if (!isset($this->gdgammacache['#'.$c])) { $colors = imagecolorsforindex($img, $c); // GD alpha is only 7 bit (0 -> 127) - $this->gdgammacache['#'.$c] = (((127 - $colors['alpha']) / 127) * 255); + $this->gdgammacache['#'.$c] = (int) (((127 - $colors['alpha']) / 127) * 255); // correct gamma - $this->gdgammacache['#'.$c] = (pow(($this->gdgammacache['#'.$c] / 255), 2.2) * 255); + $this->gdgammacache['#'.$c] = (int) (pow(($this->gdgammacache['#'.$c] / 255), 2.2) * 255); // store the latest values on cache to improve performances if (count($this->gdgammacache) > 8) { // remove one element from the cache array @@ -7516,14 +7459,13 @@ class TCPDF /** * Performs a line break. * The current abscissa goes back to the left margin and the ordinate increases by the amount passed in parameter. - * @param $h (float) The height of the break. By default, the value equals the height of the last printed cell. - * @param $cell (boolean) if true add the current left (or right o for RTL) padding to the X coordinate + * @param float|null $h The height of the break. By default, the value equals the height of the last printed cell. + * @param boolean $cell if true add the current left (or right o for RTL) padding to the X coordinate * @public * @since 1.0 * @see Cell() */ - public function Ln($h = '', $cell = false) - { + public function Ln($h=null, $cell=false) { if (($this->num_columns > 1) AND ($this->y == $this->columns[$this->current_column]['y']) AND isset($this->columns[$this->current_column]['x']) AND ($this->x == $this->columns[$this->current_column]['x'])) { // revove vertical space from the top of the column return; @@ -7542,7 +7484,7 @@ class TCPDF } else { $this->x = $this->lMargin + $cellpadding; } - if (is_string($h)) { + if (TCPDF_STATIC::empty_string($h)) { $h = $this->lasth; } $this->y += $h; @@ -7557,8 +7499,7 @@ class TCPDF * @since 1.2 * @see SetX(), GetY(), SetY() */ - public function GetX() - { + public function GetX() { //Get x position if ($this->rtl) { return ($this->w - $this->x); @@ -7574,8 +7515,7 @@ class TCPDF * @since 1.2 * @see SetX(), GetY(), SetY() */ - public function GetAbsX() - { + public function GetAbsX() { return $this->x; } @@ -7586,22 +7526,20 @@ class TCPDF * @since 1.0 * @see SetY(), GetX(), SetX() */ - public function GetY() - { + public function GetY() { return $this->y; } /** * Defines the abscissa of the current position. * If the passed value is negative, it is relative to the right of the page (or left if language is RTL). - * @param $x (float) The value of the abscissa in user units. - * @param $rtloff (boolean) if true always uses the page top-left corner as origin of axis. + * @param float $x The value of the abscissa in user units. + * @param boolean $rtloff if true always uses the page top-left corner as origin of axis. * @public * @since 1.2 * @see GetX(), GetY(), SetY(), SetXY() */ - public function SetX($x, $rtloff = false) - { + public function setX($x, $rtloff=false) { $x = floatval($x); if (!$rtloff AND $this->rtl) { if ($x >= 0) { @@ -7627,15 +7565,14 @@ class TCPDF /** * Moves the current abscissa back to the left margin and sets the ordinate. * If the passed value is negative, it is relative to the bottom of the page. - * @param $y (float) The value of the ordinate in user units. - * @param $resetx (bool) if true (default) reset the X position. - * @param $rtloff (boolean) if true always uses the page top-left corner as origin of axis. + * @param float $y The value of the ordinate in user units. + * @param bool $resetx if true (default) reset the X position. + * @param boolean $rtloff if true always uses the page top-left corner as origin of axis. * @public * @since 1.0 * @see GetX(), GetY(), SetY(), SetXY() */ - public function SetY($y, $resetx = true, $rtloff = false) - { + public function setY($y, $resetx=true, $rtloff=false) { $y = floatval($y); if ($resetx) { //reset x @@ -7661,70 +7598,65 @@ class TCPDF /** * Defines the abscissa and ordinate of the current position. * If the passed values are negative, they are relative respectively to the right and bottom of the page. - * @param $x (float) The value of the abscissa. - * @param $y (float) The value of the ordinate. - * @param $rtloff (boolean) if true always uses the page top-left corner as origin of axis. + * @param float $x The value of the abscissa. + * @param float $y The value of the ordinate. + * @param boolean $rtloff if true always uses the page top-left corner as origin of axis. * @public * @since 1.2 * @see SetX(), SetY() */ - public function SetXY($x, $y, $rtloff = false) - { - $this->SetY($y, false, $rtloff); - $this->SetX($x, $rtloff); + public function setXY($x, $y, $rtloff=false) { + $this->setY($y, false, $rtloff); + $this->setX($x, $rtloff); } /** * Set the absolute X coordinate of the current pointer. - * @param $x (float) The value of the abscissa in user units. + * @param float $x The value of the abscissa in user units. * @public * @since 5.9.186 (2012-09-13) * @see setAbsX(), setAbsY(), SetAbsXY() */ - public function SetAbsX($x) - { + public function setAbsX($x) { $this->x = floatval($x); } /** * Set the absolute Y coordinate of the current pointer. - * @param $y (float) (float) The value of the ordinate in user units. + * @param float $y (float) The value of the ordinate in user units. * @public * @since 5.9.186 (2012-09-13) * @see setAbsX(), setAbsY(), SetAbsXY() */ - public function SetAbsY($y) - { + public function setAbsY($y) { $this->y = floatval($y); } /** * Set the absolute X and Y coordinates of the current pointer. - * @param $x (float) The value of the abscissa in user units. - * @param $y (float) (float) The value of the ordinate in user units. + * @param float $x The value of the abscissa in user units. + * @param float $y (float) The value of the ordinate in user units. * @public * @since 5.9.186 (2012-09-13) * @see setAbsX(), setAbsY(), SetAbsXY() */ - public function SetAbsXY($x, $y) - { - $this->SetAbsX($x); - $this->SetAbsY($y); + public function setAbsXY($x, $y) { + $this->setAbsX($x); + $this->setAbsY($y); } /** * Send the document to a given destination: string, local file or browser. * In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
        * The method first calls Close() if necessary to terminate the document. - * @param $name (string) The name of the file when saved. Note that special characters are removed and blanks characters are replaced with the underscore character. - * @param $dest (string) Destination where to send the document. It can take one of the following values:
        • I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.
        • D: send to the browser and force a file download with the name given by name.
        • F: save to a local server file with the name given by name.
        • S: return the document as a string (name is ignored).
        • FI: equivalent to F + I option
        • FD: equivalent to F + D option
        • E: return the document as base64 mime multi-part email attachment (RFC 2045)
        + * @param string $name The name of the file when saved + * @param string $dest Destination where to send the document. It can take one of the following values:
        • I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.
        • D: send to the browser and force a file download with the name given by name.
        • F: save to a local server file with the name given by name.
        • S: return the document as a string (name is ignored).
        • FI: equivalent to F + I option
        • FD: equivalent to F + D option
        • E: return the document as base64 mime multi-part email attachment (RFC 2045)
        * @return string * @public * @since 1.0 * @see Close() */ - public function Output($name = 'doc.pdf', $dest = 'I') - { + public function Output($name='doc.pdf', $dest='I') { //Output PDF to some destination //Finish document if necessary if ($this->state < 3) { @@ -7735,10 +7667,7 @@ class TCPDF $dest = $dest ? 'D' : 'F'; } $dest = strtoupper($dest); - if ($dest[0] != 'F') { - $name = preg_replace('/[\s]+/', '_', $name); - $name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $name); - } + if ($this->sign) { // *** apply digital signature to the document *** // get the document content @@ -7792,7 +7721,7 @@ class TCPDF $this->buffer = substr($pdfdoc, 0, $byte_range[1]).'<'.$signature.'>'.substr($pdfdoc, $byte_range[1]); $this->bufferlen = strlen($this->buffer); } - switch ($dest) { + switch($dest) { case 'I': { // Send PDF to the standard output if (ob_get_contents()) { @@ -7809,7 +7738,8 @@ class TCPDF header('Pragma: public'); header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - header('Content-Disposition: inline; filename="'.basename($name).'"'); + header('Content-Disposition: inline; filename="' . rawurlencode(basename($name)) . '"; ' . + 'filename*=UTF-8\'\'' . rawurlencode(basename($name))); TCPDF_STATIC::sendOutputData($this->getBuffer(), $this->bufferlen); } else { echo $this->getBuffer(); @@ -7840,7 +7770,8 @@ class TCPDF header('Content-Type: application/pdf'); } // use the Content-Disposition header to supply a recommended filename - header('Content-Disposition: attachment; filename="'.basename($name).'"'); + header('Content-Disposition: attachment; filename="' . rawurlencode(basename($name)) . '"; ' . + 'filename*=UTF-8\'\'' . rawurlencode(basename($name))); header('Content-Transfer-Encoding: binary'); TCPDF_STATIC::sendOutputData($this->getBuffer(), $this->bufferlen); break; @@ -7918,25 +7849,20 @@ class TCPDF protected static $cleaned_ids = array(); /** * Unset all class variables except the following critical variables. - * @param $destroyall (boolean) if true destroys all class variables, otherwise preserves critical variables. - * @param $preserve_objcopy (boolean) if true preserves the objcopy variable + * @param boolean $destroyall if true destroys all class variables, otherwise preserves critical variables. + * @param boolean $preserve_objcopy if true preserves the objcopy variable * @public * @since 4.5.016 (2009-02-24) */ - public function _destroy($destroyall = false, $preserve_objcopy = false) - { - // restore internal encoding - if (isset($this->internal_encoding) AND !empty($this->internal_encoding)) { - mb_internal_encoding($this->internal_encoding); - } + public function _destroy($destroyall=false, $preserve_objcopy=false) { if (isset(self::$cleaned_ids[$this->file_id])) { $destroyall = false; } - if ($destroyall AND !$preserve_objcopy) { + if ($destroyall AND !$preserve_objcopy && isset($this->file_id)) { self::$cleaned_ids[$this->file_id] = true; // remove all temporary files - if ($handle = opendir(K_PATH_CACHE)) { - while ( false !== ( $file_name = readdir($handle) ) ) { + if ($handle = @opendir(K_PATH_CACHE)) { + while ( false !== ( $file_name = readdir( $handle ) ) ) { if (strpos($file_name, '__tcpdf_'.$this->file_id.'_') === 0) { unlink(K_PATH_CACHE.$file_name); } @@ -7944,15 +7870,15 @@ class TCPDF closedir($handle); } if (isset($this->imagekeys)) { - foreach ($this->imagekeys as $file) { - // @CHANGE DOL - // unlink($file); + foreach($this->imagekeys as $file) { + if (strpos($file, K_PATH_CACHE) === 0 && TCPDF_STATIC::file_exists($file)) { + @unlink($file); + } } } } $preserve = array( 'file_id', - 'internal_encoding', 'state', 'bufferlen', 'buffer', @@ -7979,8 +7905,7 @@ class TCPDF * Check for locale-related bug * @protected */ - protected function _dochecks() - { + protected function _dochecks() { //Check for locale-related bug if (1.1 == 1) { $this->Error('Don\'t alter the locale before including class file'); @@ -7993,12 +7918,11 @@ class TCPDF /** * Return an array containing variations for the basic page number alias. - * @param $a (string) Base alias. + * @param string $a Base alias. * @return array of page number aliases * @protected */ - protected function getInternalPageNumberAliases($a = '') - { + protected function getInternalPageNumberAliases($a= '') { $alias = array(); // build array of Unicode + ASCII variants (the order is important) $alias = array('u' => array(), 'a' => array()); @@ -8019,11 +7943,10 @@ class TCPDF * @return array of page number aliases * @protected */ - protected function getAllInternalPageNumberAliases() - { + protected function getAllInternalPageNumberAliases() { $basic_alias = array(TCPDF_STATIC::$alias_tot_pages, TCPDF_STATIC::$alias_num_page, TCPDF_STATIC::$alias_group_tot_pages, TCPDF_STATIC::$alias_group_num_page, TCPDF_STATIC::$alias_right_shift); $pnalias = array(); - foreach ($basic_alias as $k => $a) { + foreach($basic_alias as $k => $a) { $pnalias[$k] = $this->getInternalPageNumberAliases($a); } return $pnalias; @@ -8032,14 +7955,13 @@ class TCPDF /** * Replace right shift page number aliases with spaces to correct right alignment. * This works perfectly only when using monospaced fonts. - * @param $page (string) Page content. - * @param $aliases (array) Array of page aliases. - * @param $diff (int) initial difference to add. - * @return replaced page content. + * @param string $page Page content. + * @param array $aliases Array of page aliases. + * @param int $diff initial difference to add. + * @return string replaced page content. * @protected */ - protected function replaceRightShiftPageNumAliases($page, $aliases, $diff) - { + protected function replaceRightShiftPageNumAliases($page, $aliases, $diff) { foreach ($aliases as $type => $alias) { foreach ($alias as $a) { // find position of compensation factor @@ -8071,11 +7993,10 @@ class TCPDF /** * Set page boxes to be included on page descriptions. - * @param $boxes (array) Array of page boxes to set on document: ('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'). + * @param array $boxes Array of page boxes to set on document: ('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'). * @protected */ - protected function setPageBoxTypes($boxes) - { + protected function setPageBoxTypes($boxes) { $this->page_boxes = array(); foreach ($boxes as $box) { if (in_array($box, TCPDF_STATIC::$pageboxes)) { @@ -8088,8 +8009,7 @@ class TCPDF * Output pages (and replace page number aliases). * @protected */ - protected function _putpages() - { + protected function _putpages() { $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; // get internal aliases for page numbers $pnalias = $this->getAllInternalPageNumberAliases(); @@ -8188,7 +8108,7 @@ class TCPDF } $out .= ' /Contents '.($this->n + 1).' 0 R'; $out .= ' /Rotate '.$this->pagedim[$n]['Rotate']; - if (!$this->pdfa_mode) { + if (!$this->pdfa_mode || $this->pdfa_version >= 2) { $out .= ' /Group << /Type /Group /S /Transparency /CS /DeviceRGB >>'; } if (isset($this->pagedim[$n]['trans']) AND !empty($this->pagedim[$n]['trans'])) { @@ -8235,7 +8155,7 @@ class TCPDF //Pages root $out = $this->_getobj(1)."\n"; $out .= '<< /Type /Pages /Kids ['; - foreach ($this->page_obj_id as $page_obj) { + foreach($this->page_obj_id as $page_obj) { $out .= ' '.$page_obj.' 0 R'; } $out .= ' ] /Count '.$num_pages.' >>'; @@ -8245,14 +8165,13 @@ class TCPDF /** * Get references to page annotations. - * @param $n (int) page number + * @param int $n page number * @return string * @protected * @author Nicola Asuni * @since 5.0.010 (2010-05-17) */ - protected function _getannotsrefs($n) - { + protected function _getannotsrefs($n) { if (!(isset($this->PageAnnots[$n]) OR ($this->sign AND isset($this->signature_data['cert_type'])))) { return ''; } @@ -8296,8 +8215,7 @@ class TCPDF * @author Nicola Asuni * @since 4.0.018 (2008-08-06) */ - protected function _putannotsobjs() - { + protected function _putannotsobjs() { // reset object counter for ($n=1; $n <= $this->numpages; ++$n) { if (isset($this->PageAnnots[$n])) { @@ -8545,8 +8463,13 @@ class TCPDF } else { $annots .= ' /Name /Note'; } + $hasStateModel = isset($pl['opt']['statemodel']); + $hasState = isset($pl['opt']['state']); $statemodels = array('Marked', 'Review'); - if (isset($pl['opt']['statemodel']) AND in_array($pl['opt']['statemodel'], $statemodels)) { + if (!$hasStateModel && !$hasState) { + break; + } + if ($hasStateModel AND in_array($pl['opt']['statemodel'], $statemodels)) { $annots .= ' /StateModel /'.$pl['opt']['statemodel']; } else { $pl['opt']['statemodel'] = 'Marked'; @@ -8557,7 +8480,7 @@ class TCPDF } else { $states = array('Accepted', 'Rejected', 'Cancelled', 'Completed', 'None'); } - if (isset($pl['opt']['state']) AND in_array($pl['opt']['state'], $states)) { + if ($hasState AND in_array($pl['opt']['state'], $states)) { $annots .= ' /State /'.$pl['opt']['state']; } else { if ($pl['opt']['statemodel'] == 'Marked') { @@ -8572,7 +8495,7 @@ class TCPDF if (is_string($pl['txt']) && !empty($pl['txt'])) { if ($pl['txt'][0] == '#') { // internal destination - $annots .= ' /A <>'; + $annots .= ' /A <>'; } elseif ($pl['txt'][0] == '%') { // embedded PDF file $filename = basename(substr($pl['txt'], 1)); @@ -8817,7 +8740,7 @@ class TCPDF if (is_array($pl['opt']['ff'])) { // array of bit settings $flag = 0; - foreach ($pl['opt']['ff'] as $val) { + foreach($pl['opt']['ff'] as $val) { $flag += 1 << ($val - 1); } } else { @@ -8881,7 +8804,7 @@ class TCPDF } if (isset($pl['opt']['opt']) AND (is_array($pl['opt']['opt'])) AND !empty($pl['opt']['opt'])) { $annots .= ' /Opt ['; - foreach ($pl['opt']['opt'] AS $copt) { + foreach($pl['opt']['opt'] AS $copt) { if (is_array($copt)) { $annots .= ' ['.$this->_textstring($copt[0], $annot_obj_id).' '.$this->_textstring($copt[1], $annot_obj_id).']'; } else { @@ -8895,7 +8818,7 @@ class TCPDF } if (isset($pl['opt']['i']) AND (is_array($pl['opt']['i'])) AND !empty($pl['opt']['i'])) { $annots .= ' /I ['; - foreach ($pl['opt']['i'] AS $copt) { + foreach($pl['opt']['i'] AS $copt) { $annots .= intval($copt).' '; } $annots .= ']'; @@ -8935,15 +8858,14 @@ class TCPDF /** * Put appearance streams XObject used to define annotation's appearance states. - * @param $w (int) annotation width - * @param $h (int) annotation height - * @param $stream (string) appearance stream + * @param int $w annotation width + * @param int $h annotation height + * @param string $stream appearance stream * @return int object ID * @protected * @since 4.8.001 (2009-09-09) */ - protected function _putAPXObject($w = 0, $h = 0, $stream = '') - { + protected function _putAPXObject($w=0, $h=0, $stream='') { $stream = trim($stream); $out = $this->_getobj()."\n"; $this->xobjects['AX'.$this->n] = array('n' => $this->n); @@ -8973,16 +8895,13 @@ class TCPDF * @author Nicola Asuni * @protected */ - protected function _putfonts() - { + protected function _putfonts() { $nf = $this->n; foreach ($this->diffs as $diff) { //Encodings $this->_newobj(); $this->_out('<< /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.'] >>'."\n".'endobj'); } - $mqr = TCPDF_STATIC::get_mqr(); - TCPDF_STATIC::set_mqr(false); foreach ($this->FontFiles as $file => $info) { // search and get font file to embedd $fontfile = TCPDF_FONTS::getFontFullPath($file, $info['fontdir']); @@ -9036,7 +8955,6 @@ class TCPDF $this->_out($out); } } - TCPDF_STATIC::set_mqr($mqr); foreach ($this->fontkeys as $k) { //Font objects $font = $this->getFontBuffer($k); @@ -9121,13 +9039,12 @@ class TCPDF /** * Adds unicode fonts.
        * Based on PDF Reference 1.3 (section 5) - * @param $font (array) font data + * @param array $font font data * @protected * @author Nicola Asuni * @since 1.52.0.TC005 (2005-01-05) */ - protected function _puttruetypeunicode($font) - { + protected function _puttruetypeunicode($font) { $fontname = ''; if ($font['subset']) { // change name for font subsetting @@ -9226,13 +9143,12 @@ class TCPDF /** * Output CID-0 fonts. * A Type 0 CIDFont contains glyph descriptions based on the Adobe Type 1 font format - * @param $font (array) font data + * @param array $font font data * @protected * @author Andrew Whitehead, Nicola Asuni, Yukihiro Nakadaira * @since 3.2.000 (2008-06-23) */ - protected function _putcidfont0($font) - { + protected function _putcidfont0($font) { $cidoffset = 0; if (!isset($font['cw'][1])) { $cidoffset = 31; @@ -9302,12 +9218,12 @@ class TCPDF * Output images. * @protected */ - protected function _putimages() - { + protected function _putimages() { $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; foreach ($this->imagekeys as $file) { $info = $this->getImageBuffer($file); // set object for alternate images array + $altoid = null; if ((!$this->pdfa_mode) AND isset($info['altimgs']) AND !empty($info['altimgs'])) { $altoid = $this->_newobj(); $out = '['; @@ -9355,7 +9271,7 @@ class TCPDF $out .= ' /Decode [1 0 1 0 1 0 1 0]'; } $out .= ' /BitsPerComponent '.$info['bpc']; - if (isset($altoid) AND ($altoid > 0)) { + if ($altoid > 0) { // reference to alternate images dictionary $out .= ' /Alternates '.$altoid.' 0 R'; } @@ -9432,8 +9348,7 @@ class TCPDF * @protected * @see startTemplate(), endTemplate(), printTemplate() */ - protected function _putxobjects() - { + protected function _putxobjects() { foreach ($this->xobjects as $key => $data) { if (isset($data['outdata'])) { $stream = str_replace($this->epsmarker, '', trim($data['outdata'])); @@ -9450,7 +9365,7 @@ class TCPDF $out .= ' /Matrix [1 0 0 1 0 0]'; $out .= ' /Resources <<'; $out .= ' /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'; - if (!$this->pdfa_mode) { + if (!$this->pdfa_mode || $this->pdfa_version >= 2) { // transparency if (isset($data['extgstates']) AND !empty($data['extgstates'])) { $out .= ' /ExtGState <<'; @@ -9536,8 +9451,7 @@ class TCPDF * @protected * @since 4.0.024 (2008-09-12) */ - protected function _putspotcolors() - { + protected function _putspotcolors() { foreach ($this->spot_colors as $name => $color) { $this->_newobj(); $this->spot_colors[$name]['n'] = $this->n; @@ -9557,8 +9471,7 @@ class TCPDF * @protected * @since 5.8.014 (2010-08-23) */ - protected function _getxobjectdict() - { + protected function _getxobjectdict() { $out = ''; foreach ($this->xobjects as $id => $objid) { $out .= ' /'.$id.' '.$objid['n'].' 0 R'; @@ -9570,8 +9483,7 @@ class TCPDF * Output Resources Dictionary. * @protected */ - protected function _putresourcedict() - { + protected function _putresourcedict() { $out = $this->_getobj(2)."\n"; $out .= '<< /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'; $out .= ' /Font <<'; @@ -9591,7 +9503,7 @@ class TCPDF } $out .= ' >>'; } - if (!$this->pdfa_mode) { + if (!$this->pdfa_mode || $this->pdfa_version >= 2) { // transparency if (isset($this->extgstates) AND !empty($this->extgstates)) { $out .= ' /ExtGState <<'; @@ -9635,8 +9547,7 @@ class TCPDF * Output Resources. * @protected */ - protected function _putresources() - { + protected function _putresources() { $this->_putextgstates(); $this->_putocg(); $this->_putfonts(); @@ -9659,8 +9570,7 @@ class TCPDF * @return int object id * @protected */ - protected function _putinfo() - { + protected function _putinfo() { $oid = $this->_newobj(); $out = '<<'; // store current isunicode value @@ -9707,35 +9617,32 @@ class TCPDF /** * Set additional XMP data to be added on the default XMP data just before the end of "x:xmpmeta" tag. * IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method! - * @param $xmp (string) Custom XMP data. + * @param string $xmp Custom XMP data. * @since 5.9.128 (2011-10-06) * @public */ - public function setExtraXMP($xmp) - { + public function setExtraXMP($xmp) { $this->custom_xmp = $xmp; } /** * Set additional XMP data to be added on the default XMP data just before the end of "rdf:RDF" tag. * IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method! - * @param $xmp (string) Custom XMP RDF data. + * @param string $xmp Custom XMP RDF data. * @since 6.3.0 (2019-09-19) * @public */ - public function setExtraXMPRDF($xmp) - { + public function setExtraXMPRDF($xmp) { $this->custom_xmp_rdf = $xmp; } /** * Put XMP data object and return ID. - * @return (int) The object ID. + * @return int The object ID. * @since 5.9.121 (2011-09-28) * @protected */ - protected function _putXMP() - { + protected function _putXMP() { $oid = $this->_newobj(); // store current isunicode value $prev_isunicode = $this->isunicode; @@ -9810,6 +9717,16 @@ class TCPDF $xmp .= "\t\t\t\t\t\t".'http://ns.adobe.com/pdf/1.3/'."\n"; $xmp .= "\t\t\t\t\t\t".'pdf'."\n"; $xmp .= "\t\t\t\t\t\t".'Adobe PDF Schema'."\n"; + $xmp .= "\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'internal'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'Adobe PDF Schema'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'InstanceID'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'URI'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t".''."\n"; $xmp .= "\t\t\t\t\t".''."\n"; $xmp .= "\t\t\t\t\t".''."\n"; $xmp .= "\t\t\t\t\t\t".'http://ns.adobe.com/xap/1.0/mm/'."\n"; @@ -9874,8 +9791,7 @@ class TCPDF * @return int object id * @protected */ - protected function _putcatalog() - { + protected function _putcatalog() { // put XMP $xmpobj = $this->_putXMP(); // if required, add standard sRGB ICC colour profile @@ -10005,7 +9921,7 @@ class TCPDF } } if (!empty($this->form_obj_id)) { - foreach ($this->form_obj_id as $objid) { + foreach($this->form_obj_id as $objid) { $objrefs .= ' '.$objid.' 0 R'; } } @@ -10030,12 +9946,7 @@ class TCPDF } $out .= ' >> >>'; } - $font = $this->getFontBuffer('helvetica'); - // @DOLCHANGE LDR Fix PHP warning - if (empty($font['i'])) { - //var_dump($this->fonts['helvetica']['i']);exit; - $font['i'] = ''; - } + $font = $this->getFontBuffer((($this->pdfa_mode) ? 'pdfa' : '') .'helvetica'); $out .= ' /DA (/F'.$font['i'].' 0 Tf 0 g)'; $out .= ' /Q '.(($this->rtl)?'2':'0'); //$out .= ' /XFA '; @@ -10067,8 +9978,7 @@ class TCPDF * @since 3.1.000 (2008-06-09) * @protected */ - protected function _putviewerpreferences() - { + protected function _putviewerpreferences() { $vp = $this->viewer_preferences; $out = ' /ViewerPreferences <<'; if ($this->rtl) { @@ -10127,7 +10037,7 @@ class TCPDF foreach ($vp['PrintPageRange'] as $k => $v) { $PrintPageRangeNum .= ' '.($v - 1).''; } - $out .= ' /PrintPageRange ['.substr($PrintPageRangeNum, 1).']'; + $out .= ' /PrintPageRange ['.substr($PrintPageRangeNum,1).']'; } if (isset($vp['NumCopies'])) { $out .= ' /NumCopies '.intval($vp['NumCopies']); @@ -10140,8 +10050,7 @@ class TCPDF * Output PDF File Header (7.5.2). * @protected */ - protected function _putheader() - { + protected function _putheader() { $this->_out('%PDF-'.$this->PDFVersion); $this->_out('%'.chr(0xe2).chr(0xe3).chr(0xcf).chr(0xd3)); } @@ -10150,8 +10059,7 @@ class TCPDF * Output end of document (EOF). * @protected */ - protected function _enddoc() - { + protected function _enddoc() { if (isset($this->CurrentFont['fontkey']) AND isset($this->CurrentFont['subsetchars'])) { // save subset chars of the previous font $this->setFontSubBuffer($this->CurrentFont['fontkey'], 'subsetchars', $this->CurrentFont['subsetchars']); @@ -10237,13 +10145,12 @@ class TCPDF /** * Initialize a new page. - * @param $orientation (string) page orientation. Possible values are (case insensitive):
        • P or PORTRAIT (default)
        • L or LANDSCAPE
        - * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). + * @param string $orientation page orientation. Possible values are (case insensitive):
        • P or PORTRAIT (default)
        • L or LANDSCAPE
        + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). * @protected * @see getPageSizeFromFormat(), setPageFormat() */ - protected function _beginpage($orientation = '', $format = '') - { + protected function _beginpage($orientation='', $format='') { ++$this->page; $this->pageobjects[$this->page] = array(); $this->setPageBuffer($this->page, ''); @@ -10286,8 +10193,7 @@ class TCPDF * Mark end of page. * @protected */ - protected function _endpage() - { + protected function _endpage() { $this->setVisibility('all'); $this->state = 1; } @@ -10297,22 +10203,20 @@ class TCPDF * @return int object number * @protected */ - protected function _newobj() - { + protected function _newobj() { $this->_out($this->_getobj()); return $this->n; } /** * Return the starting object string for the selected object ID. - * @param $objid (int) Object ID (leave empty to get a new ID). + * @param int|null $objid Object ID (leave empty to get a new ID). * @return string the starting object string * @protected * @since 5.8.009 (2010-08-20) */ - protected function _getobj($objid = '') - { - if ($objid === '') { + protected function _getobj($objid=null) { + if (TCPDF_STATIC::empty_string($objid)) { ++$this->n; $objid = $this->n; } @@ -10323,95 +10227,89 @@ class TCPDF /** * Underline text. - * @param $x (int) X coordinate - * @param $y (int) Y coordinate - * @param $txt (string) text to underline + * @param int $x X coordinate + * @param int $y Y coordinate + * @param string $txt text to underline * @protected */ - protected function _dounderline($x, $y, $txt) - { + protected function _dounderline($x, $y, $txt) { $w = $this->GetStringWidth($txt); return $this->_dounderlinew($x, $y, $w); } /** * Underline for rectangular text area. - * @param $x (int) X coordinate - * @param $y (int) Y coordinate - * @param $w (int) width to underline + * @param int $x X coordinate + * @param int $y Y coordinate + * @param int $w width to underline * @protected * @since 4.8.008 (2009-09-29) */ - protected function _dounderlinew($x, $y, $w) - { + protected function _dounderlinew($x, $y, $w) { $linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt; return sprintf('%F %F %F %F re f', $x * $this->k, ((($this->h - $y) * $this->k) + $linew), $w * $this->k, $linew); } /** * Line through text. - * @param $x (int) X coordinate - * @param $y (int) Y coordinate - * @param $txt (string) text to linethrough + * @param int $x X coordinate + * @param int $y Y coordinate + * @param string $txt text to linethrough * @protected */ - protected function _dolinethrough($x, $y, $txt) - { + protected function _dolinethrough($x, $y, $txt) { $w = $this->GetStringWidth($txt); return $this->_dolinethroughw($x, $y, $w); } /** * Line through for rectangular text area. - * @param $x (int) X coordinate - * @param $y (int) Y coordinate - * @param $w (int) line length (width) + * @param int $x X coordinate + * @param int $y Y coordinate + * @param int $w line length (width) * @protected * @since 4.9.008 (2009-09-29) */ - protected function _dolinethroughw($x, $y, $w) - { + protected function _dolinethroughw($x, $y, $w) { $linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt; return sprintf('%F %F %F %F re f', $x * $this->k, ((($this->h - $y) * $this->k) + $linew + ($this->FontSizePt / 3)), $w * $this->k, $linew); } /** * Overline text. - * @param $x (int) X coordinate - * @param $y (int) Y coordinate - * @param $txt (string) text to overline + * @param int $x X coordinate + * @param int $y Y coordinate + * @param string $txt text to overline * @protected * @since 4.9.015 (2010-04-19) */ - protected function _dooverline($x, $y, $txt) - { + protected function _dooverline($x, $y, $txt) { $w = $this->GetStringWidth($txt); return $this->_dooverlinew($x, $y, $w); } /** * Overline for rectangular text area. - * @param $x (int) X coordinate - * @param $y (int) Y coordinate - * @param $w (int) width to overline + * @param int $x X coordinate + * @param int $y Y coordinate + * @param int $w width to overline * @protected * @since 4.9.015 (2010-04-19) */ - protected function _dooverlinew($x, $y, $w) - { + protected function _dooverlinew($x, $y, $w) { $linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt; return sprintf('%F %F %F %F re f', $x * $this->k, (($this->h - $y + $this->FontAscent) * $this->k) - $linew, $w * $this->k, $linew); + } /** * Format a data string for meta information - * @param $s (string) data string to escape. - * @param $n (int) object ID + * @param string $s data string to escape. + * @param int $n object ID * @return string escaped string. * @protected */ - protected function _datastring($s, $n = 0) - { + protected function _datastring($s, $n=0) { if ($n == 0) { $n = $this->n; } @@ -10421,12 +10319,11 @@ class TCPDF /** * Set the document creation timestamp - * @param $time (mixed) Document creation timestamp in seconds or date-time string. + * @param mixed $time Document creation timestamp in seconds or date-time string. * @public * @since 5.9.152 (2012-03-23) */ - public function setDocCreationTimestamp($time) - { + public function setDocCreationTimestamp($time) { if (is_string($time)) { $time = TCPDF_STATIC::getTimestamp($time); } @@ -10435,12 +10332,11 @@ class TCPDF /** * Set the document modification timestamp - * @param $time (mixed) Document modification timestamp in seconds or date-time string. + * @param mixed $time Document modification timestamp in seconds or date-time string. * @public * @since 5.9.152 (2012-03-23) */ - public function setDocModificationTimestamp($time) - { + public function setDocModificationTimestamp($time) { if (is_string($time)) { $time = TCPDF_STATIC::getTimestamp($time); } @@ -10449,36 +10345,33 @@ class TCPDF /** * Returns document creation timestamp in seconds. - * @return (int) Creation timestamp in seconds. + * @return int Creation timestamp in seconds. * @public * @since 5.9.152 (2012-03-23) */ - public function getDocCreationTimestamp() - { + public function getDocCreationTimestamp() { return $this->doc_creation_timestamp; } /** * Returns document modification timestamp in seconds. - * @return (int) Modfication timestamp in seconds. + * @return int Modfication timestamp in seconds. * @public * @since 5.9.152 (2012-03-23) */ - public function getDocModificationTimestamp() - { + public function getDocModificationTimestamp() { return $this->doc_modification_timestamp; } /** * Returns a formatted date for meta information - * @param $n (int) Object ID. - * @param $timestamp (int) Timestamp to convert. + * @param int $n Object ID. + * @param int $timestamp Timestamp to convert. * @return string escaped date string. * @protected * @since 4.6.028 (2009-08-25) */ - protected function _datestring($n = 0, $timestamp = 0) - { + protected function _datestring($n=0, $timestamp=0) { if ((empty($timestamp)) OR ($timestamp < 0)) { $timestamp = $this->doc_creation_timestamp; } @@ -10487,13 +10380,12 @@ class TCPDF /** * Format a text string for meta information - * @param $s (string) string to escape. - * @param $n (int) object ID + * @param string $s string to escape. + * @param int $n object ID * @return string escaped string. * @protected */ - protected function _textstring($s, $n = 0) - { + protected function _textstring($s, $n=0) { if ($this->isunicode) { //Convert string to UTF-16BE $s = TCPDF_FONTS::UTF8ToUTF16BE($s, true, $this->isunicode, $this->CurrentFont); @@ -10503,14 +10395,13 @@ class TCPDF /** * get raw output stream. - * @param $s (string) string to output. - * @param $n (int) object reference for encryption mode + * @param string $s string to output. + * @param int $n object reference for encryption mode * @protected * @author Nicola Asuni * @since 5.5.000 (2010-06-22) */ - protected function _getrawstream($s, $n = 0) - { + protected function _getrawstream($s, $n=0) { if ($n <= 0) { // default to current object $n = $this->n; @@ -10520,11 +10411,10 @@ class TCPDF /** * Output a string to the document. - * @param $s (string) string to output. + * @param string $s string to output. * @public */ - public function _out($s) - { + public function _out($s) { // @CHANGE DOL if ($this->state == 2) { if ($this->inxobj) { // we are inside an XObject template @@ -10549,56 +10439,55 @@ class TCPDF /** * Set header font. - * @param $font (array) Array describing the basic font parameters: (family, style, size). + * @param array $font Array describing the basic font parameters: (family, style, size). + * @phpstan-param array{0: string, 1: string, 2: float|null} $font * @public * @since 1.1 */ - public function setHeaderFont($font) - { + public function setHeaderFont($font) { $this->header_font = $font; } /** * Get header font. - * @return array() Array describing the basic font parameters: (family, style, size). + * @return array Array describing the basic font parameters: (family, style, size). + * @phpstan-return array{0: string, 1: string, 2: float|null} * @public * @since 4.0.012 (2008-07-24) */ - public function getHeaderFont() - { + public function getHeaderFont() { return $this->header_font; } /** * Set footer font. - * @param $font (array) Array describing the basic font parameters: (family, style, size). + * @param array $font Array describing the basic font parameters: (family, style, size). + * @phpstan-param array{0: string, 1: string, 2: float|null} $font * @public * @since 1.1 */ - public function setFooterFont($font) - { + public function setFooterFont($font) { $this->footer_font = $font; } /** * Get Footer font. - * @return array() Array describing the basic font parameters: (family, style, size). + * @return array Array describing the basic font parameters: (family, style, size). + * @phpstan-return array{0: string, 1: string, 2: float|null} $font * @public * @since 4.0.012 (2008-07-24) */ - public function getFooterFont() - { + public function getFooterFont() { return $this->footer_font; } /** * Set language array. - * @param $language (array) + * @param array $language * @public * @since 1.1 */ - public function setLanguageArray($language) - { + public function setLanguageArray($language) { $this->l = $language; if (isset($this->l['a_meta_dir'])) { $this->rtl = $this->l['a_meta_dir']=='rtl' ? true : false; @@ -10611,8 +10500,7 @@ class TCPDF * Returns the PDF data. * @public */ - public function getPDFData() - { + public function getPDFData() { if ($this->state < 3) { $this->Close(); } @@ -10621,18 +10509,17 @@ class TCPDF /** * Output anchor link. - * @param $url (string) link URL or internal link (i.e.: <a href="#23,4.5">link to page 23 at 4.5 Y position</a>) - * @param $name (string) link name - * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false). - * @param $firstline (boolean) if true prints only the first line and return the remaining string. - * @param $color (array) array of RGB text color - * @param $style (string) font style (U, D, B, I) - * @param $firstblock (boolean) if true the string is the starting of a line. - * @return the number of cells used or the remaining text if $firstline = true; + * @param string $url link URL or internal link (i.e.: <a href="#23,4.5">link to page 23 at 4.5 Y position</a>) + * @param string $name link name + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param boolean $firstline if true prints only the first line and return the remaining string. + * @param array|null $color array of RGB text color + * @param string $style font style (U, D, B, I) + * @param boolean $firstblock if true the string is the starting of a line. + * @return int the number of cells used or the remaining text if $firstline = true; * @public */ - public function addHtmlLink($url, $name, $fill = false, $firstline = false, $color = '', $style = -1, $firstblock = false) - { + public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color=null, $style=-1, $firstblock=false) { if (isset($url[1]) AND ($url[0] == '#') AND is_numeric($url[1])) { // convert url to internal link $lnkdata = explode(',', $url); @@ -10644,50 +10531,48 @@ class TCPDF $lnky = 0; } $url = $this->AddLink(); - $this->SetLink($url, $lnky, $page); + $this->setLink($url, $lnky, $page); } } // store current settings $prevcolor = $this->fgcolor; $prevstyle = $this->FontStyle; if (empty($color)) { - $this->SetTextColorArray($this->htmlLinkColorArray); + $this->setTextColorArray($this->htmlLinkColorArray); } else { - $this->SetTextColorArray($color); + $this->setTextColorArray($color); } if ($style == -1) { - $this->SetFont('', $this->FontStyle.$this->htmlLinkFontStyle); + $this->setFont('', $this->FontStyle.$this->htmlLinkFontStyle); } else { - $this->SetFont('', $this->FontStyle.$style); + $this->setFont('', $this->FontStyle.$style); } $ret = $this->Write($this->lasth, $name, $url, $fill, '', false, 0, $firstline, $firstblock, 0); // restore settings - $this->SetFont('', $prevstyle); - $this->SetTextColorArray($prevcolor); + $this->setFont('', $prevstyle); + $this->setTextColorArray($prevcolor); return $ret; } /** * Converts pixels to User's Units. - * @param $px (int) pixels + * @param int $px pixels * @return float value in user's unit * @public * @see setImageScale(), getImageScale() */ - public function pixelsToUnits($px) - { + public function pixelsToUnits($px) { return ($px / ($this->imgscale * $this->k)); } /** * Reverse function for htmlentities. * Convert entities in UTF-8. - * @param $text_to_convert (string) Text to convert. + * @param string $text_to_convert Text to convert. * @return string converted text string * @public */ - public function unhtmlentities($text_to_convert) - { + public function unhtmlentities($text_to_convert) { return @html_entity_decode($text_to_convert, ENT_QUOTES, $this->encoding); } @@ -10696,14 +10581,13 @@ class TCPDF /** * Compute encryption key depending on object number where the encrypted data is stored. * This is used for all strings and streams without crypt filter specifier. - * @param $n (int) object number + * @param int $n object number * @return int object key * @protected * @author Nicola Asuni * @since 2.0.000 (2008-01-02) */ - protected function _objectkey($n) - { + protected function _objectkey($n) { $objkey = $this->encryptdata['key'].pack('VXxx', $n); if ($this->encryptdata['mode'] == 2) { // AES-128 // AES padding @@ -10716,15 +10600,14 @@ class TCPDF /** * Encrypt the input string. - * @param $n (int) object number - * @param $s (string) data string to encrypt - * @return encrypted string + * @param int $n object number + * @param string $s data string to encrypt + * @return string encrypted string * @protected * @author Nicola Asuni * @since 5.0.005 (2010-05-11) */ - protected function _encrypt_data($n, $s) - { + protected function _encrypt_data($n, $s) { if (!$this->encrypted) { return $s; } @@ -10752,8 +10635,7 @@ class TCPDF * @author Nicola Asuni * @since 2.0.000 (2008-01-02) */ - protected function _putencryption() - { + protected function _putencryption() { if (!$this->encrypted) { return; } @@ -10873,8 +10755,7 @@ class TCPDF * @since 2.0.000 (2008-01-02) * @author Nicola Asuni */ - protected function _Uvalue() - { + protected function _Uvalue() { if ($this->encryptdata['mode'] == 0) { // RC4-40 return TCPDF_STATIC::_RC4($this->encryptdata['key'], TCPDF_STATIC::$enc_padding, $this->last_enc_key, $this->last_enc_key_c); } elseif ($this->encryptdata['mode'] < 3) { // RC4-128, AES-128 @@ -10907,8 +10788,7 @@ class TCPDF * @since 5.9.006 (2010-10-19) * @author Nicola Asuni */ - protected function _UEvalue() - { + protected function _UEvalue() { $hashkey = hash('sha256', $this->encryptdata['user_password'].$this->encryptdata['UKS'], true); return TCPDF_STATIC::_AESnopad($hashkey, $this->encryptdata['key']); } @@ -10920,8 +10800,7 @@ class TCPDF * @since 2.0.000 (2008-01-02) * @author Nicola Asuni */ - protected function _Ovalue() - { + protected function _Ovalue() { if ($this->encryptdata['mode'] < 3) { // RC4-40, RC4-128, AES-128 $tmp = TCPDF_STATIC::_md5_16($this->encryptdata['owner_password']); if ($this->encryptdata['mode'] > 0) { @@ -10959,22 +10838,20 @@ class TCPDF * @since 5.9.006 (2010-10-19) * @author Nicola Asuni */ - protected function _OEvalue() - { + protected function _OEvalue() { $hashkey = hash('sha256', $this->encryptdata['owner_password'].$this->encryptdata['OKS'].$this->encryptdata['U'], true); return TCPDF_STATIC::_AESnopad($hashkey, $this->encryptdata['key']); } /** * Convert password for AES-256 encryption mode - * @param $password (string) password + * @param string $password password * @return string password * @protected * @since 5.9.006 (2010-10-19) * @author Nicola Asuni */ - protected function _fixAES256Password($password) - { + protected function _fixAES256Password($password) { $psw = ''; // password to be returned $psw_array = TCPDF_FONTS::utf8Bidi(TCPDF_FONTS::UTF8StringToArray($password, $this->isunicode, $this->CurrentFont), $password, $this->rtl, $this->isunicode, $this->CurrentFont); foreach ($psw_array as $c) { @@ -10989,8 +10866,7 @@ class TCPDF * @since 2.0.000 (2008-01-02) * @author Nicola Asuni */ - protected function _generateencryptionkey() - { + protected function _generateencryptionkey() { $keybytelen = ($this->encryptdata['Length'] / 8); if (!$this->encryptdata['pubkey']) { // standard mode if ($this->encryptdata['mode'] == 3) { // AES-256 @@ -11099,17 +10975,16 @@ class TCPDF * Remark: the protection against modification is for people who have the full Acrobat product. * If you don't set any password, the document will open as usual. If you set a user password, the PDF viewer will ask for it before displaying the document. The master password, if different from the user one, can be used to get full access. * Note: protecting a document requires to encrypt it, which increases the processing time a lot. This can cause a PHP time-out in some cases, especially if the document contains images or fonts. - * @param $permissions (Array) the set of permissions (specify the ones you want to block):
        • print : Print the document;
        • modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';
        • copy : Copy or otherwise extract text and graphics from the document;
        • annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);
        • fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;
        • extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);
        • assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;
        • print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.
        • owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.
        - * @param $user_pass (String) user password. Empty by default. - * @param $owner_pass (String) owner password. If not specified, a random value is used. - * @param $mode (int) encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit. - * @param $pubkeys (String) array of recipients containing public-key certificates ('c') and permissions ('p'). For example: array(array('c' => 'file://../examples/data/cert/tcpdf.crt', 'p' => array('print'))) + * @param array $permissions the set of permissions (specify the ones you want to block):
        • print : Print the document;
        • modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';
        • copy : Copy or otherwise extract text and graphics from the document;
        • annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);
        • fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;
        • extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);
        • assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;
        • print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.
        • owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.
        + * @param string $user_pass user password. Empty by default. + * @param string|null $owner_pass owner password. If not specified, a random value is used. + * @param int $mode encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit. + * @param array|null $pubkeys array of recipients containing public-key certificates ('c') and permissions ('p'). For example: array(array('c' => 'file://../examples/data/cert/tcpdf.crt', 'p' => array('print'))) * @public * @since 2.0.000 (2008-01-02) * @author Nicola Asuni */ - public function SetProtection($permissions = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'), $user_pass = '', $owner_pass = null, $mode = 0, $pubkeys = null) - { + public function setProtection($permissions=array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'), $user_pass='', $owner_pass=null, $mode=0, $pubkeys=null) { if ($this->pdfa_mode) { // encryption is not allowed in PDF/A mode return; @@ -11215,8 +11090,7 @@ class TCPDF * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function StartTransform() - { + public function StartTransform() { if ($this->state != 2) { return; } @@ -11239,8 +11113,7 @@ class TCPDF * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function StopTransform() - { + public function StopTransform() { if ($this->state != 2) { return; } @@ -11258,62 +11131,58 @@ class TCPDF } /** * Horizontal Scaling. - * @param $s_x (float) scaling factor for width as percent. 0 is not allowed. - * @param $x (int) abscissa of the scaling center. Default is current x position - * @param $y (int) ordinate of the scaling center. Default is current y position + * @param float $s_x scaling factor for width as percent. 0 is not allowed. + * @param int $x abscissa of the scaling center. Default is current x position + * @param int $y ordinate of the scaling center. Default is current y position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function ScaleX($s_x, $x = '', $y = '') - { + public function ScaleX($s_x, $x='', $y='') { $this->Scale($s_x, 100, $x, $y); } /** * Vertical Scaling. - * @param $s_y (float) scaling factor for height as percent. 0 is not allowed. - * @param $x (int) abscissa of the scaling center. Default is current x position - * @param $y (int) ordinate of the scaling center. Default is current y position + * @param float $s_y scaling factor for height as percent. 0 is not allowed. + * @param int $x abscissa of the scaling center. Default is current x position + * @param int $y ordinate of the scaling center. Default is current y position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function ScaleY($s_y, $x = '', $y = '') - { + public function ScaleY($s_y, $x='', $y='') { $this->Scale(100, $s_y, $x, $y); } /** * Vertical and horizontal proportional Scaling. - * @param $s (float) scaling factor for width and height as percent. 0 is not allowed. - * @param $x (int) abscissa of the scaling center. Default is current x position - * @param $y (int) ordinate of the scaling center. Default is current y position + * @param float $s scaling factor for width and height as percent. 0 is not allowed. + * @param int $x abscissa of the scaling center. Default is current x position + * @param int $y ordinate of the scaling center. Default is current y position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function ScaleXY($s, $x = '', $y = '') - { + public function ScaleXY($s, $x='', $y='') { $this->Scale($s, $s, $x, $y); } /** * Vertical and horizontal non-proportional Scaling. - * @param $s_x (float) scaling factor for width as percent. 0 is not allowed. - * @param $s_y (float) scaling factor for height as percent. 0 is not allowed. - * @param $x (int) abscissa of the scaling center. Default is current x position - * @param $y (int) ordinate of the scaling center. Default is current y position + * @param float $s_x scaling factor for width as percent. 0 is not allowed. + * @param float $s_y scaling factor for height as percent. 0 is not allowed. + * @param float|null $x abscissa of the scaling center. Default is current x position + * @param float|null $y ordinate of the scaling center. Default is current y position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function Scale($s_x, $s_y, $x = '', $y = '') - { - if ($x === '') { + public function Scale($s_x, $s_y, $x=null, $y=null) { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } if (($s_x == 0) OR ($s_y == 0)) { @@ -11337,90 +11206,83 @@ class TCPDF /** * Horizontal Mirroring. - * @param $x (int) abscissa of the point. Default is current x position + * @param float|null $x abscissa of the point. Default is current x position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function MirrorH($x = '') - { + public function MirrorH($x=null) { $this->Scale(-100, 100, $x); } /** * Verical Mirroring. - * @param $y (int) ordinate of the point. Default is current y position + * @param float|null $y ordinate of the point. Default is current y position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function MirrorV($y = '') - { - $this->Scale(100, -100, '', $y); + public function MirrorV($y=null) { + $this->Scale(100, -100, null, $y); } /** * Point reflection mirroring. - * @param $x (int) abscissa of the point. Default is current x position - * @param $y (int) ordinate of the point. Default is current y position + * @param float|null $x abscissa of the point. Default is current x position + * @param float|null $y ordinate of the point. Default is current y position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function MirrorP($x = '', $y = '') - { + public function MirrorP($x=null,$y=null) { $this->Scale(-100, -100, $x, $y); } /** * Reflection against a straight line through point (x, y) with the gradient angle (angle). - * @param $angle (float) gradient angle of the straight line. Default is 0 (horizontal line). - * @param $x (int) abscissa of the point. Default is current x position - * @param $y (int) ordinate of the point. Default is current y position + * @param float $angle gradient angle of the straight line. Default is 0 (horizontal line). + * @param float|null $x abscissa of the point. Default is current x position + * @param float|null $y ordinate of the point. Default is current y position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function MirrorL($angle = 0, $x = '', $y = '') - { + public function MirrorL($angle=0, $x=null,$y=null) { $this->Scale(-100, 100, $x, $y); $this->Rotate(-2*($angle-90), $x, $y); } /** * Translate graphic object horizontally. - * @param $t_x (int) movement to the right (or left for RTL) + * @param int $t_x movement to the right (or left for RTL) * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function TranslateX($t_x) - { + public function TranslateX($t_x) { $this->Translate($t_x, 0); } /** * Translate graphic object vertically. - * @param $t_y (int) movement to the bottom + * @param int $t_y movement to the bottom * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function TranslateY($t_y) - { + public function TranslateY($t_y) { $this->Translate(0, $t_y); } /** * Translate graphic object horizontally and vertically. - * @param $t_x (int) movement to the right - * @param $t_y (int) movement to the bottom + * @param int $t_x movement to the right + * @param int $t_y movement to the bottom * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function Translate($t_x, $t_y) - { + public function Translate($t_x, $t_y) { //calculate elements of transformation matrix $tm = array(); $tm[0] = 1; @@ -11435,19 +11297,18 @@ class TCPDF /** * Rotate object. - * @param $angle (float) angle in degrees for counter-clockwise rotation - * @param $x (int) abscissa of the rotation center. Default is current x position - * @param $y (int) ordinate of the rotation center. Default is current y position + * @param float $angle angle in degrees for counter-clockwise rotation + * @param float|null $x abscissa of the rotation center. Default is current x position + * @param float|null $y ordinate of the rotation center. Default is current y position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function Rotate($angle, $x = '', $y = '') - { - if ($x === '') { + public function Rotate($angle, $x=null, $y=null) { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } $y = ($this->h - $y) * $this->k; @@ -11466,48 +11327,45 @@ class TCPDF /** * Skew horizontally. - * @param $angle_x (float) angle in degrees between -90 (skew to the left) and 90 (skew to the right) - * @param $x (int) abscissa of the skewing center. default is current x position - * @param $y (int) ordinate of the skewing center. default is current y position + * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right) + * @param float|null $x abscissa of the skewing center. default is current x position + * @param float|null $y ordinate of the skewing center. default is current y position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function SkewX($angle_x, $x = '', $y = '') - { + public function SkewX($angle_x, $x=null, $y=null) { $this->Skew($angle_x, 0, $x, $y); } /** * Skew vertically. - * @param $angle_y (float) angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) - * @param $x (int) abscissa of the skewing center. default is current x position - * @param $y (int) ordinate of the skewing center. default is current y position + * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) + * @param float|null $x abscissa of the skewing center. default is current x position + * @param float|null $y ordinate of the skewing center. default is current y position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function SkewY($angle_y, $x = '', $y = '') - { + public function SkewY($angle_y, $x=null, $y=null) { $this->Skew(0, $angle_y, $x, $y); } /** * Skew. - * @param $angle_x (float) angle in degrees between -90 (skew to the left) and 90 (skew to the right) - * @param $angle_y (float) angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) - * @param $x (int) abscissa of the skewing center. default is current x position - * @param $y (int) ordinate of the skewing center. default is current y position + * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right) + * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) + * @param float|null $x abscissa of the skewing center. default is current x position + * @param float|null $y ordinate of the skewing center. default is current y position * @public * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - public function Skew($angle_x, $angle_y, $x = '', $y = '') - { - if ($x === '') { + public function Skew($angle_x, $angle_y, $x=null, $y=null) { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } if (($angle_x <= -90) OR ($angle_x >= 90) OR ($angle_y <= -90) OR ($angle_y >= 90)) { @@ -11529,13 +11387,12 @@ class TCPDF /** * Apply graphic transformations. - * @param $tm (array) transformation matrix + * @param array $tm transformation matrix * @protected * @since 2.1.000 (2008-01-07) * @see StartTransform(), StopTransform() */ - protected function Transform($tm) - { + protected function Transform($tm) { if ($this->state != 2) { return; } @@ -11562,13 +11419,12 @@ class TCPDF /** * Defines the line width. By default, the value equals 0.2 mm. The method can be called before the first page is created and the value is retained from page to page. - * @param $width (float) The width. + * @param float $width The width. * @public * @since 1.0 * @see Line(), Rect(), Cell(), MultiCell() */ - public function SetLineWidth($width) - { + public function setLineWidth($width) { //Set line width $this->LineWidth = $width; $this->linestyleWidth = sprintf('%F w', ($width * $this->k)); @@ -11584,39 +11440,37 @@ class TCPDF * @since 2.1.000 (2008-01-07) * @see Line(), SetLineWidth() */ - public function GetLineWidth() - { + public function GetLineWidth() { return $this->LineWidth; } /** * Set line style. - * @param $style (array) Line style. Array with keys among the following: - *
          - *
        • width (float): Width of the line in user units.
        • - *
        • cap (string): Type of cap to put on the line. Possible values are: - * butt, round, square. The difference between "square" and "butt" is that - * "square" projects a flat end past the end of the line.
        • - *
        • join (string): Type of join. Possible values are: miter, round, - * bevel.
        • - *
        • dash (mixed): Dash pattern. Is 0 (without dash) or string with - * series of length values, which are the lengths of the on and off dashes. - * For example: "2" represents 2 on, 2 off, 2 on, 2 off, ...; "2,1" is 2 on, - * 1 off, 2 on, 1 off, ...
        • - *
        • phase (integer): Modifier on the dash pattern which is used to shift - * the point at which the pattern starts.
        • - *
        • color (array): Draw color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName).
        • - *
        - * @param $ret (boolean) if true do not send the command. + * @param array $style Line style. Array with keys among the following: + *
          + *
        • width (float): Width of the line in user units.
        • + *
        • cap (string): Type of cap to put on the line. Possible values are: + * butt, round, square. The difference between "square" and "butt" is that + * "square" projects a flat end past the end of the line.
        • + *
        • join (string): Type of join. Possible values are: miter, round, + * bevel.
        • + *
        • dash (mixed): Dash pattern. Is 0 (without dash) or string with + * series of length values, which are the lengths of the on and off dashes. + * For example: "2" represents 2 on, 2 off, 2 on, 2 off, ...; "2,1" is 2 on, + * 1 off, 2 on, 1 off, ...
        • + *
        • phase (integer): Modifier on the dash pattern which is used to shift + * the point at which the pattern starts.
        • + *
        • color (array): Draw color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName).
        • + *
        + * @param boolean $ret if true do not send the command. * @return string the PDF command * @public * @since 2.1.000 (2008-01-08) */ - public function SetLineStyle($style, $ret = false) - { + public function setLineStyle($style, $ret=false) { $s = ''; // string to be returned if (!is_array($style)) { - return; + return $s; } if (isset($style['width'])) { $this->LineWidth = $style['width']; @@ -11660,7 +11514,7 @@ class TCPDF $s .= $this->linestyleDash.' '; } if (isset($style['color'])) { - $s .= $this->SetDrawColorArray($style['color'], true).' '; + $s .= $this->setDrawColorArray($style['color'], true).' '; } if (!$ret AND ($this->state == 2)) { $this->_out($s); @@ -11670,13 +11524,12 @@ class TCPDF /** * Begin a new subpath by moving the current point to coordinates (x, y), omitting any connecting line segment. - * @param $x (float) Abscissa of point. - * @param $y (float) Ordinate of point. + * @param float $x Abscissa of point. + * @param float $y Ordinate of point. * @protected * @since 2.1.000 (2008-01-08) */ - protected function _outPoint($x, $y) - { + protected function _outPoint($x, $y) { if ($this->state == 2) { $this->_out(sprintf('%F %F m', ($x * $this->k), (($this->h - $y) * $this->k))); } @@ -11685,13 +11538,12 @@ class TCPDF /** * Append a straight line segment from the current point to the point (x, y). * The new current point shall be (x, y). - * @param $x (float) Abscissa of end point. - * @param $y (float) Ordinate of end point. + * @param float $x Abscissa of end point. + * @param float $y Ordinate of end point. * @protected * @since 2.1.000 (2008-01-08) */ - protected function _outLine($x, $y) - { + protected function _outLine($x, $y) { if ($this->state == 2) { $this->_out(sprintf('%F %F l', ($x * $this->k), (($this->h - $y) * $this->k))); } @@ -11699,16 +11551,15 @@ class TCPDF /** * Append a rectangle to the current path as a complete subpath, with lower-left corner (x, y) and dimensions widthand height in user space. - * @param $x (float) Abscissa of upper-left corner. - * @param $y (float) Ordinate of upper-left corner. - * @param $w (float) Width. - * @param $h (float) Height. - * @param $op (string) options + * @param float $x Abscissa of upper-left corner. + * @param float $y Ordinate of upper-left corner. + * @param float $w Width. + * @param float $h Height. + * @param string $op options * @protected * @since 2.1.000 (2008-01-08) */ - protected function _outRect($x, $y, $w, $h, $op) - { + protected function _outRect($x, $y, $w, $h, $op) { if ($this->state == 2) { $this->_out(sprintf('%F %F %F %F re %s', ($x * $this->k), (($this->h - $y) * $this->k), ($w * $this->k), (-$h * $this->k), $op)); } @@ -11717,17 +11568,16 @@ class TCPDF /** * Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the Bezier control points. * The new current point shall be (x3, y3). - * @param $x1 (float) Abscissa of control point 1. - * @param $y1 (float) Ordinate of control point 1. - * @param $x2 (float) Abscissa of control point 2. - * @param $y2 (float) Ordinate of control point 2. - * @param $x3 (float) Abscissa of end point. - * @param $y3 (float) Ordinate of end point. + * @param float $x1 Abscissa of control point 1. + * @param float $y1 Ordinate of control point 1. + * @param float $x2 Abscissa of control point 2. + * @param float $y2 Ordinate of control point 2. + * @param float $x3 Abscissa of end point. + * @param float $y3 Ordinate of end point. * @protected * @since 2.1.000 (2008-01-08) */ - protected function _outCurve($x1, $y1, $x2, $y2, $x3, $y3) - { + protected function _outCurve($x1, $y1, $x2, $y2, $x3, $y3) { if ($this->state == 2) { $this->_out(sprintf('%F %F %F %F %F %F c', ($x1 * $this->k), (($this->h - $y1) * $this->k), ($x2 * $this->k), (($this->h - $y2) * $this->k), ($x3 * $this->k), (($this->h - $y3) * $this->k))); } @@ -11736,15 +11586,14 @@ class TCPDF /** * Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using the current point and (x2, y2) as the Bezier control points. * The new current point shall be (x3, y3). - * @param $x2 (float) Abscissa of control point 2. - * @param $y2 (float) Ordinate of control point 2. - * @param $x3 (float) Abscissa of end point. - * @param $y3 (float) Ordinate of end point. + * @param float $x2 Abscissa of control point 2. + * @param float $y2 Ordinate of control point 2. + * @param float $x3 Abscissa of end point. + * @param float $y3 Ordinate of end point. * @protected * @since 4.9.019 (2010-04-26) */ - protected function _outCurveV($x2, $y2, $x3, $y3) - { + protected function _outCurveV($x2, $y2, $x3, $y3) { if ($this->state == 2) { $this->_out(sprintf('%F %F %F %F v', ($x2 * $this->k), (($this->h - $y2) * $this->k), ($x3 * $this->k), (($this->h - $y3) * $this->k))); } @@ -11753,15 +11602,14 @@ class TCPDF /** * Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the Bezier control points. * The new current point shall be (x3, y3). - * @param $x1 (float) Abscissa of control point 1. - * @param $y1 (float) Ordinate of control point 1. - * @param $x3 (float) Abscissa of end point. - * @param $y3 (float) Ordinate of end point. + * @param float $x1 Abscissa of control point 1. + * @param float $y1 Ordinate of control point 1. + * @param float $x3 Abscissa of end point. + * @param float $y3 Ordinate of end point. * @protected * @since 2.1.000 (2008-01-08) */ - protected function _outCurveY($x1, $y1, $x3, $y3) - { + protected function _outCurveY($x1, $y1, $x3, $y3) { if ($this->state == 2) { $this->_out(sprintf('%F %F %F %F y', ($x1 * $this->k), (($this->h - $y1) * $this->k), ($x3 * $this->k), (($this->h - $y3) * $this->k))); } @@ -11769,22 +11617,21 @@ class TCPDF /** * Draws a line between two points. - * @param $x1 (float) Abscissa of first point. - * @param $y1 (float) Ordinate of first point. - * @param $x2 (float) Abscissa of second point. - * @param $y2 (float) Ordinate of second point. - * @param $style (array) Line style. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param float $x1 Abscissa of first point. + * @param float $y1 Ordinate of first point. + * @param float $x2 Abscissa of second point. + * @param float $y2 Ordinate of second point. + * @param array $style Line style. Array like for SetLineStyle(). Default value: default line style (empty array). * @public * @since 1.0 * @see SetLineWidth(), SetDrawColor(), SetLineStyle() */ - public function Line($x1, $y1, $x2, $y2, $style = array()) - { + public function Line($x1, $y1, $x2, $y2, $style=array()) { if ($this->state != 2) { return; } if (is_array($style)) { - $this->SetLineStyle($style); + $this->setLineStyle($style); } $this->_outPoint($x1, $y1); $this->_outLine($x2, $y2); @@ -11793,24 +11640,23 @@ class TCPDF /** * Draws a rectangle. - * @param $x (float) Abscissa of upper-left corner. - * @param $y (float) Ordinate of upper-left corner. - * @param $w (float) Width. - * @param $h (float) Height. - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $border_style (array) Border style of rectangle. Array with keys among the following: - *
          - *
        • all: Line style of all borders. Array like for SetLineStyle().
        • - *
        • L, T, R, B or combinations: Line style of left, top, right or bottom border. Array like for SetLineStyle().
        • - *
        - * If a key is not present or is null, the correspondent border is not drawn. Default value: default line style (empty array). - * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @param float $x Abscissa of upper-left corner. + * @param float $y Ordinate of upper-left corner. + * @param float $w Width. + * @param float $h Height. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $border_style Border style of rectangle. Array with keys among the following: + *
          + *
        • all: Line style of all borders. Array like for SetLineStyle().
        • + *
        • L, T, R, B or combinations: Line style of left, top, right or bottom border. Array like for SetLineStyle().
        • + *
        + * If a key is not present or is null, the correspondent border is not drawn. Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). * @public * @since 1.0 * @see SetLineStyle() */ - public function Rect($x, $y, $w, $h, $style = '', $border_style = array(), $fill_color = array()) - { + public function Rect($x, $y, $w, $h, $style='', $border_style=array(), $fill_color=array()) { if ($this->state != 2) { return; } @@ -11819,12 +11665,12 @@ class TCPDF } if (!(strpos($style, 'F') === false) AND !empty($fill_color)) { // set background color - $this->SetFillColorArray($fill_color); + $this->setFillColorArray($fill_color); } if (!empty($border_style)) { if (isset($border_style['all']) AND !empty($border_style['all'])) { //set global style for border - $this->SetLineStyle($border_style['all']); + $this->setLineStyle($border_style['all']); $border_style = array(); } else { // remove stroke operator from style @@ -11866,32 +11712,31 @@ class TCPDF * Draws a Bezier curve. * The Bezier curve is a tangent to the line between the control points at * either end of the curve. - * @param $x0 (float) Abscissa of start point. - * @param $y0 (float) Ordinate of start point. - * @param $x1 (float) Abscissa of control point 1. - * @param $y1 (float) Ordinate of control point 1. - * @param $x2 (float) Abscissa of control point 2. - * @param $y2 (float) Ordinate of control point 2. - * @param $x3 (float) Abscissa of end point. - * @param $y3 (float) Ordinate of end point. - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $line_style (array) Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array). - * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @param float $x0 Abscissa of start point. + * @param float $y0 Ordinate of start point. + * @param float $x1 Abscissa of control point 1. + * @param float $y1 Ordinate of control point 1. + * @param float $x2 Abscissa of control point 2. + * @param float $y2 Ordinate of control point 2. + * @param float $x3 Abscissa of end point. + * @param float $y3 Ordinate of end point. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). * @public * @see SetLineStyle() * @since 2.1.000 (2008-01-08) */ - public function Curve($x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3, $style = '', $line_style = array(), $fill_color = array()) - { + public function Curve($x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3, $style='', $line_style=array(), $fill_color=array()) { if ($this->state != 2) { return; } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { - $this->SetFillColorArray($fill_color); + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { + $this->setFillColorArray($fill_color); } $op = TCPDF_STATIC::getPathPaintOperator($style); if ($line_style) { - $this->SetLineStyle($line_style); + $this->setLineStyle($line_style); } $this->_outPoint($x0, $y0); $this->_outCurve($x1, $y1, $x2, $y2, $x3, $y3); @@ -11902,30 +11747,29 @@ class TCPDF * Draws a poly-Bezier curve. * Each Bezier curve segment is a tangent to the line between the control points at * either end of the curve. - * @param $x0 (float) Abscissa of start point. - * @param $y0 (float) Ordinate of start point. - * @param $segments (float) An array of bezier descriptions. Format: array(x1, y1, x2, y2, x3, y3). - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $line_style (array) Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array). - * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @param float $x0 Abscissa of start point. + * @param float $y0 Ordinate of start point. + * @param float[] $segments An array of bezier descriptions. Format: array(x1, y1, x2, y2, x3, y3). + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). * @public * @see SetLineStyle() * @since 3.0008 (2008-05-12) */ - public function Polycurve($x0, $y0, $segments, $style = '', $line_style = array(), $fill_color = array()) - { + public function Polycurve($x0, $y0, $segments, $style='', $line_style=array(), $fill_color=array()) { if ($this->state != 2) { return; } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { - $this->SetFillColorArray($fill_color); + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { + $this->setFillColorArray($fill_color); } $op = TCPDF_STATIC::getPathPaintOperator($style); if ($op == 'f') { $line_style = array(); } if ($line_style) { - $this->SetLineStyle($line_style); + $this->setLineStyle($line_style); } $this->_outPoint($x0, $y0); foreach ($segments as $segment) { @@ -11938,38 +11782,37 @@ class TCPDF /** * Draws an ellipse. * An ellipse is formed from n Bezier curves. - * @param $x0 (float) Abscissa of center point. - * @param $y0 (float) Ordinate of center point. - * @param $rx (float) Horizontal radius. - * @param $ry (float) Vertical radius (if ry = 0 then is a circle, see Circle()). Default value: 0. - * @param $angle: (float) Angle oriented (anti-clockwise). Default value: 0. - * @param $astart: (float) Angle start of draw line. Default value: 0. - * @param $afinish: (float) Angle finish of draw line. Default value: 360. - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $line_style (array) Line style of ellipse. Array like for SetLineStyle(). Default value: default line style (empty array). - * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). - * @param $nc (integer) Number of curves used to draw a 90 degrees portion of ellipse. + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $rx Horizontal radius. + * @param float $ry Vertical radius (if ry = 0 then is a circle, see Circle()). Default value: 0. + * @param float $angle Angle oriented (anti-clockwise). Default value: 0. + * @param float $astart Angle start of draw line. Default value: 0. + * @param float $afinish Angle finish of draw line. Default value: 360. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of ellipse. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @param integer $nc Number of curves used to draw a 90 degrees portion of ellipse. * @author Nicola Asuni * @public * @since 2.1.000 (2008-01-08) */ - public function Ellipse($x0, $y0, $rx, $ry = '', $angle = 0, $astart = 0, $afinish = 360, $style = '', $line_style = array(), $fill_color = array(), $nc = 2) - { + public function Ellipse($x0, $y0, $rx, $ry=0, $angle=0, $astart=0, $afinish=360, $style='', $line_style=array(), $fill_color=array(), $nc=2) { if ($this->state != 2) { return; } if (TCPDF_STATIC::empty_string($ry) OR ($ry == 0)) { $ry = $rx; } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { - $this->SetFillColorArray($fill_color); + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { + $this->setFillColorArray($fill_color); } $op = TCPDF_STATIC::getPathPaintOperator($style); if ($op == 'f') { $line_style = array(); } if ($line_style) { - $this->SetLineStyle($line_style); + $this->setLineStyle($line_style); } $this->_outellipticalarc($x0, $y0, $rx, $ry, $angle, $astart, $afinish, false, $nc, true, true, false); $this->_out($op); @@ -11978,25 +11821,24 @@ class TCPDF /** * Append an elliptical arc to the current path. * An ellipse is formed from n Bezier curves. - * @param $xc (float) Abscissa of center point. - * @param $yc (float) Ordinate of center point. - * @param $rx (float) Horizontal radius. - * @param $ry (float) Vertical radius (if ry = 0 then is a circle, see Circle()). Default value: 0. - * @param $xang: (float) Angle between the X-axis and the major axis of the ellipse. Default value: 0. - * @param $angs: (float) Angle start of draw line. Default value: 0. - * @param $angf: (float) Angle finish of draw line. Default value: 360. - * @param $pie (boolean) if true do not mark the border point (used to draw pie sectors). - * @param $nc (integer) Number of curves used to draw a 90 degrees portion of ellipse. - * @param $startpoint (boolean) if true output a starting point. - * @param $ccw (boolean) if true draws in counter-clockwise. - * @param $svg (boolean) if true the angles are in svg mode (already calculated). + * @param float $xc Abscissa of center point. + * @param float $yc Ordinate of center point. + * @param float $rx Horizontal radius. + * @param float $ry Vertical radius (if ry = 0 then is a circle, see Circle()). Default value: 0. + * @param float $xang Angle between the X-axis and the major axis of the ellipse. Default value: 0. + * @param float $angs Angle start of draw line. Default value: 0. + * @param float $angf Angle finish of draw line. Default value: 360. + * @param boolean $pie if true do not mark the border point (used to draw pie sectors). + * @param integer $nc Number of curves used to draw a 90 degrees portion of ellipse. + * @param boolean $startpoint if true output a starting point. + * @param boolean $ccw if true draws in counter-clockwise. + * @param boolean $svg if true the angles are in svg mode (already calculated). * @return array bounding box coordinates (x min, y min, x max, y max) * @author Nicola Asuni * @protected * @since 4.9.019 (2010-04-26) */ - protected function _outellipticalarc($xc, $yc, $rx, $ry, $xang = 0, $angs = 0, $angf = 360, $pie = false, $nc = 2, $startpoint = true, $ccw = true, $svg = false) - { + protected function _outellipticalarc($xc, $yc, $rx, $ry, $xang=0, $angs=0, $angf=360, $pie=false, $nc=2, $startpoint=true, $ccw=true, $svg=false) { if (($rx <= 0) OR ($ry < 0)) { return; } @@ -12115,59 +11957,56 @@ class TCPDF /** * Draws a circle. * A circle is formed from n Bezier curves. - * @param $x0 (float) Abscissa of center point. - * @param $y0 (float) Ordinate of center point. - * @param $r (float) Radius. - * @param $angstr: (float) Angle start of draw line. Default value: 0. - * @param $angend: (float) Angle finish of draw line. Default value: 360. - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $line_style (array) Line style of circle. Array like for SetLineStyle(). Default value: default line style (empty array). - * @param $fill_color (array) Fill color. Format: array(red, green, blue). Default value: default color (empty array). - * @param $nc (integer) Number of curves used to draw a 90 degrees portion of circle. + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $r Radius. + * @param float $angstr Angle start of draw line. Default value: 0. + * @param float $angend Angle finish of draw line. Default value: 360. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of circle. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). + * @param integer $nc Number of curves used to draw a 90 degrees portion of circle. * @public * @since 2.1.000 (2008-01-08) */ - public function Circle($x0, $y0, $r, $angstr = 0, $angend = 360, $style = '', $line_style = array(), $fill_color = array(), $nc = 2) - { + public function Circle($x0, $y0, $r, $angstr=0, $angend=360, $style='', $line_style=array(), $fill_color=array(), $nc=2) { $this->Ellipse($x0, $y0, $r, $r, 0, $angstr, $angend, $style, $line_style, $fill_color, $nc); } /** * Draws a polygonal line - * @param $p (array) Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $line_style (array) Line style of polygon. Array with keys among the following: - *
          - *
        • all: Line style of all lines. Array like for SetLineStyle().
        • - *
        • 0 to ($np - 1): Line style of each line. Array like for SetLineStyle().
        • - *
        - * If a key is not present or is null, not draws the line. Default value is default line style (empty array). - * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of polygon. Array with keys among the following: + *
          + *
        • all: Line style of all lines. Array like for SetLineStyle().
        • + *
        • 0 to ($np - 1): Line style of each line. Array like for SetLineStyle().
        • + *
        + * If a key is not present or is null, not draws the line. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). * @since 4.8.003 (2009-09-15) * @public */ - public function PolyLine($p, $style = '', $line_style = array(), $fill_color = array()) - { + public function PolyLine($p, $style='', $line_style=array(), $fill_color=array()) { $this->Polygon($p, $style, $line_style, $fill_color, false); } /** * Draws a polygon. - * @param $p (array) Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $line_style (array) Line style of polygon. Array with keys among the following: - *
          - *
        • all: Line style of all lines. Array like for SetLineStyle().
        • - *
        • 0 to ($np - 1): Line style of each line. Array like for SetLineStyle().
        • - *
        - * If a key is not present or is null, not draws the line. Default value is default line style (empty array). - * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). - * @param $closed (boolean) if true the polygon is closes, otherwise will remain open + * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of polygon. Array with keys among the following: + *
          + *
        • all: Line style of all lines. Array like for SetLineStyle().
        • + *
        • 0 to ($np - 1): Line style of each line. Array like for SetLineStyle().
        • + *
        + * If a key is not present or is null, not draws the line. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @param boolean $closed if true the polygon is closes, otherwise will remain open * @public * @since 2.1.000 (2008-01-08) */ - public function Polygon($p, $style = '', $line_style = array(), $fill_color = array(), $closed = true) - { + public function Polygon($p, $style='', $line_style=array(), $fill_color=array(), $closed=true) { if ($this->state != 2) { return; } @@ -12184,8 +12023,8 @@ class TCPDF } $nc += 4; } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { - $this->SetFillColorArray($fill_color); + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { + $this->setFillColorArray($fill_color); } $op = TCPDF_STATIC::getPathPaintOperator($style); if ($op == 'f') { @@ -12194,7 +12033,7 @@ class TCPDF $draw = true; if ($line_style) { if (isset($line_style['all'])) { - $this->SetLineStyle($line_style['all']); + $this->setLineStyle($line_style['all']); } else { $draw = false; if ($op == 'B') { @@ -12214,7 +12053,7 @@ class TCPDF if ($line_style[$line_num] != 0) { if (is_array($line_style[$line_num])) { $this->_out('S'); - $this->SetLineStyle($line_style[$line_num]); + $this->setLineStyle($line_style[$line_num]); $this->_outPoint($p[$i - 2], $p[$i - 1]); $this->_outLine($p[$i], $p[$i + 1]); $this->_out('S'); @@ -12241,35 +12080,34 @@ class TCPDF /** * Draws a regular polygon. - * @param $x0 (float) Abscissa of center point. - * @param $y0 (float) Ordinate of center point. - * @param $r: (float) Radius of inscribed circle. - * @param $ns (integer) Number of sides. - * @param $angle (float) Angle oriented (anti-clockwise). Default value: 0. - * @param $draw_circle (boolean) Draw inscribed circle or not. Default value: false. - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $line_style (array) Line style of polygon sides. Array with keys among the following: - *
          - *
        • all: Line style of all sides. Array like for SetLineStyle().
        • - *
        • 0 to ($ns - 1): Line style of each side. Array like for SetLineStyle().
        • - *
        - * If a key is not present or is null, not draws the side. Default value is default line style (empty array). - * @param $fill_color (array) Fill color. Format: array(red, green, blue). Default value: default color (empty array). - * @param $circle_style (string) Style of rendering of inscribed circle (if draws). Possible values are: - *
          - *
        • D or empty string: Draw (default).
        • - *
        • F: Fill.
        • - *
        • DF or FD: Draw and fill.
        • - *
        • CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
        • - *
        • CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
        • - *
        - * @param $circle_outLine_style (array) Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array). - * @param $circle_fill_color (array) Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $r Radius of inscribed circle. + * @param integer $ns Number of sides. + * @param float $angle Angle oriented (anti-clockwise). Default value: 0. + * @param boolean $draw_circle Draw inscribed circle or not. Default value: false. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of polygon sides. Array with keys among the following: + *
          + *
        • all: Line style of all sides. Array like for SetLineStyle().
        • + *
        • 0 to ($ns - 1): Line style of each side. Array like for SetLineStyle().
        • + *
        + * If a key is not present or is null, not draws the side. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). + * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are: + *
          + *
        • D or empty string: Draw (default).
        • + *
        • F: Fill.
        • + *
        • DF or FD: Draw and fill.
        • + *
        • CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
        • + *
        • CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
        • + *
        + * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). * @public * @since 2.1.000 (2008-01-08) */ - public function RegularPolygon($x0, $y0, $r, $ns, $angle = 0, $draw_circle = false, $style = '', $line_style = array(), $fill_color = array(), $circle_style = '', $circle_outLine_style = array(), $circle_fill_color = array()) - { + public function RegularPolygon($x0, $y0, $r, $ns, $angle=0, $draw_circle=false, $style='', $line_style=array(), $fill_color=array(), $circle_style='', $circle_outLine_style=array(), $circle_fill_color=array()) { if (3 > $ns) { $ns = 3; } @@ -12288,37 +12126,36 @@ class TCPDF /** * Draws a star polygon - * @param $x0 (float) Abscissa of center point. - * @param $y0 (float) Ordinate of center point. - * @param $r (float) Radius of inscribed circle. - * @param $nv (integer) Number of vertices. - * @param $ng (integer) Number of gap (if ($ng % $nv = 1) then is a regular polygon). - * @param $angle: (float) Angle oriented (anti-clockwise). Default value: 0. - * @param $draw_circle: (boolean) Draw inscribed circle or not. Default value is false. - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $line_style (array) Line style of polygon sides. Array with keys among the following: - *
          - *
        • all: Line style of all sides. Array like for - * SetLineStyle().
        • - *
        • 0 to (n - 1): Line style of each side. Array like for SetLineStyle().
        • - *
        - * If a key is not present or is null, not draws the side. Default value is default line style (empty array). - * @param $fill_color (array) Fill color. Format: array(red, green, blue). Default value: default color (empty array). - * @param $circle_style (string) Style of rendering of inscribed circle (if draws). Possible values are: - *
          - *
        • D or empty string: Draw (default).
        • - *
        • F: Fill.
        • - *
        • DF or FD: Draw and fill.
        • - *
        • CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
        • - *
        • CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
        • - *
        - * @param $circle_outLine_style (array) Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array). - * @param $circle_fill_color (array) Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $r Radius of inscribed circle. + * @param integer $nv Number of vertices. + * @param integer $ng Number of gap (if ($ng % $nv = 1) then is a regular polygon). + * @param float $angle Angle oriented (anti-clockwise). Default value: 0. + * @param boolean $draw_circle Draw inscribed circle or not. Default value is false. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of polygon sides. Array with keys among the following: + *
          + *
        • all: Line style of all sides. Array like for + * SetLineStyle().
        • + *
        • 0 to (n - 1): Line style of each side. Array like for SetLineStyle().
        • + *
        + * If a key is not present or is null, not draws the side. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). + * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are: + *
          + *
        • D or empty string: Draw (default).
        • + *
        • F: Fill.
        • + *
        • DF or FD: Draw and fill.
        • + *
        • CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
        • + *
        • CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
        • + *
        + * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). * @public * @since 2.1.000 (2008-01-08) */ - public function StarPolygon($x0, $y0, $r, $nv, $ng, $angle = 0, $draw_circle = false, $style = '', $line_style = array(), $fill_color = array(), $circle_style = '', $circle_outLine_style = array(), $circle_fill_color = array()) - { + public function StarPolygon($x0, $y0, $r, $nv, $ng, $angle=0, $draw_circle=false, $style='', $line_style=array(), $fill_color=array(), $circle_style='', $circle_outLine_style=array(), $circle_fill_color=array()) { if ($nv < 2) { $nv = 2; } @@ -12348,40 +12185,38 @@ class TCPDF /** * Draws a rounded rectangle. - * @param $x (float) Abscissa of upper-left corner. - * @param $y (float) Ordinate of upper-left corner. - * @param $w (float) Width. - * @param $h (float) Height. - * @param $r (float) the radius of the circle used to round off the corners of the rectangle. - * @param $round_corner (string) Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111"). - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $border_style (array) Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array). - * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @param float $x Abscissa of upper-left corner. + * @param float $y Ordinate of upper-left corner. + * @param float $w Width. + * @param float $h Height. + * @param float $r the radius of the circle used to round off the corners of the rectangle. + * @param string $round_corner Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111"). + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $border_style Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). * @public * @since 2.1.000 (2008-01-08) */ - public function RoundedRect($x, $y, $w, $h, $r, $round_corner = '1111', $style = '', $border_style = array(), $fill_color = array()) - { + public function RoundedRect($x, $y, $w, $h, $r, $round_corner='1111', $style='', $border_style=array(), $fill_color=array()) { $this->RoundedRectXY($x, $y, $w, $h, $r, $r, $round_corner, $style, $border_style, $fill_color); } /** * Draws a rounded rectangle. - * @param $x (float) Abscissa of upper-left corner. - * @param $y (float) Ordinate of upper-left corner. - * @param $w (float) Width. - * @param $h (float) Height. - * @param $rx (float) the x-axis radius of the ellipse used to round off the corners of the rectangle. - * @param $ry (float) the y-axis radius of the ellipse used to round off the corners of the rectangle. - * @param $round_corner (string) Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111"). - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $border_style (array) Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array). - * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @param float $x Abscissa of upper-left corner. + * @param float $y Ordinate of upper-left corner. + * @param float $w Width. + * @param float $h Height. + * @param float $rx the x-axis radius of the ellipse used to round off the corners of the rectangle. + * @param float $ry the y-axis radius of the ellipse used to round off the corners of the rectangle. + * @param string $round_corner Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111"). + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $border_style Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). * @public * @since 4.9.019 (2010-04-22) */ - public function RoundedRectXY($x, $y, $w, $h, $rx, $ry, $round_corner = '1111', $style = '', $border_style = array(), $fill_color = array()) - { + public function RoundedRectXY($x, $y, $w, $h, $rx, $ry, $round_corner='1111', $style='', $border_style=array(), $fill_color=array()) { if ($this->state != 2) { return; } @@ -12391,15 +12226,15 @@ class TCPDF return; } // Rounded - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { - $this->SetFillColorArray($fill_color); + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { + $this->setFillColorArray($fill_color); } $op = TCPDF_STATIC::getPathPaintOperator($style); if ($op == 'f') { $border_style = array(); } if ($border_style) { - $this->SetLineStyle($border_style); + $this->setLineStyle($border_style); } $MyArc = 4 / 3 * (sqrt(2) - 1); $this->_outPoint($x + $rx, $y); @@ -12441,18 +12276,17 @@ class TCPDF /** * Draws a grahic arrow. - * @param $x0 (float) Abscissa of first point. - * @param $y0 (float) Ordinate of first point. - * @param $x1 (float) Abscissa of second point. - * @param $y1 (float) Ordinate of second point. - * @param $head_style (int) (0 = draw only arrowhead arms, 1 = draw closed arrowhead, but no fill, 2 = closed and filled arrowhead, 3 = filled arrowhead) - * @param $arm_size (float) length of arrowhead arms - * @param $arm_angle (int) angle between an arm and the shaft + * @param float $x0 Abscissa of first point. + * @param float $y0 Ordinate of first point. + * @param float $x1 Abscissa of second point. + * @param float $y1 Ordinate of second point. + * @param int $head_style (0 = draw only arrowhead arms, 1 = draw closed arrowhead, but no fill, 2 = closed and filled arrowhead, 3 = filled arrowhead) + * @param float $arm_size length of arrowhead arms + * @param int $arm_angle angle between an arm and the shaft * @author Piotr Galecki, Nicola Asuni, Andy Meier * @since 4.6.018 (2009-07-10) */ - public function Arrow($x0, $y0, $x1, $y1, $head_style = 0, $arm_size = 5, $arm_angle = 15) - { + public function Arrow($x0, $y0, $x1, $y1, $head_style=0, $arm_size=5, $arm_angle=15) { // getting arrow direction angle // 0 deg angle is when both arms go along X axis. angle grows clockwise. $dir_angle = atan2(($y0 - $y1), ($x0 - $x1)); @@ -12508,17 +12342,16 @@ class TCPDF /** * Add a Named Destination. * NOTE: destination names are unique, so only last entry will be saved. - * @param $name (string) Destination name. - * @param $y (float) Y position in user units of the destiantion on the selected page (default = -1 = current position; 0 = page start;). - * @param $page (int|string) Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. - * @param $x (float) X position in user units of the destiantion on the selected page (default = -1 = current position;). - * @return (string) Stripped named destination identifier or false in case of error. + * @param string $name Destination name. + * @param float $y Y position in user units of the destiantion on the selected page (default = -1 = current position; 0 = page start;). + * @param int|string $page Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. + * @param float $x X position in user units of the destiantion on the selected page (default = -1 = current position;). + * @return string|false Stripped named destination identifier or false in case of error. * @public * @author Christian Deligant, Nicola Asuni * @since 5.9.097 (2011-06-23) */ - public function setDestination($name, $y = -1, $page = '', $x = -1) - { + public function setDestination($name, $y=-1, $page='', $x=-1) { // remove unsupported characters $name = TCPDF_STATIC::encodeNameObject($name); if (TCPDF_STATIC::empty_string($name)) { @@ -12539,7 +12372,7 @@ class TCPDF $x = $this->w; } $fixed = false; - if (!empty($page) AND ($page[0] == '*')) { + if (!empty($page) AND (substr($page, 0, 1) == '*')) { $page = intval(substr($page, 1)); // this page number will not be changed when moving/add/deleting pages $fixed = true; @@ -12556,13 +12389,12 @@ class TCPDF /** * Return the Named Destination array. - * @return (array) Named Destination array. + * @return array Named Destination array. * @public * @author Nicola Asuni * @since 5.9.097 (2011-06-23) */ - public function getDestination() - { + public function getDestination() { return $this->dests; } @@ -12572,14 +12404,13 @@ class TCPDF * @author Johannes G\FCntert, Nicola Asuni * @since 5.9.098 (2011-06-23) */ - protected function _putdests() - { + protected function _putdests() { if (empty($this->dests)) { return; } $this->n_dests = $this->_newobj(); $out = ' <<'; - foreach ($this->dests as $name => $o) { + foreach($this->dests as $name => $o) { $out .= ' /'.$name.' '.sprintf('[%u 0 R /XYZ %F %F null]', $this->page_obj_id[($o['p'])], ($o['x'] * $this->k), ($this->pagedim[$o['p']]['h'] - ($o['y'] * $this->k))); } $out .= ' >>'; @@ -12589,36 +12420,34 @@ class TCPDF /** * Adds a bookmark - alias for Bookmark(). - * @param $txt (string) Bookmark description. - * @param $level (int) Bookmark level (minimum value is 0). - * @param $y (float) Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;). - * @param $page (int|string) Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. - * @param $style (string) Font style: B = Bold, I = Italic, BI = Bold + Italic. - * @param $color (array) RGB color array (values from 0 to 255). - * @param $x (float) X position in user units of the bookmark on the selected page (default = -1 = current position;). - * @param $link (mixed) URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name). + * @param string $txt Bookmark description. + * @param int $level Bookmark level (minimum value is 0). + * @param float $y Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;). + * @param int|string $page Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. + * @param string $style Font style: B = Bold, I = Italic, BI = Bold + Italic. + * @param array $color RGB color array (values from 0 to 255). + * @param float $x X position in user units of the bookmark on the selected page (default = -1 = current position;). + * @param mixed $link URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name). * @public */ - public function setBookmark($txt, $level = 0, $y = -1, $page = '', $style = '', $color = array(0,0,0), $x = -1, $link = '') - { + public function setBookmark($txt, $level=0, $y=-1, $page='', $style='', $color=array(0,0,0), $x=-1, $link='') { $this->Bookmark($txt, $level, $y, $page, $style, $color, $x, $link); } /** * Adds a bookmark. - * @param $txt (string) Bookmark description. - * @param $level (int) Bookmark level (minimum value is 0). - * @param $y (float) Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;). - * @param $page (int|string) Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. - * @param $style (string) Font style: B = Bold, I = Italic, BI = Bold + Italic. - * @param $color (array) RGB color array (values from 0 to 255). - * @param $x (float) X position in user units of the bookmark on the selected page (default = -1 = current position;). - * @param $link (mixed) URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name). + * @param string $txt Bookmark description. + * @param int $level Bookmark level (minimum value is 0). + * @param float $y Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;). + * @param int|string $page Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. + * @param string $style Font style: B = Bold, I = Italic, BI = Bold + Italic. + * @param array $color RGB color array (values from 0 to 255). + * @param float $x X position in user units of the bookmark on the selected page (default = -1 = current position;). + * @param mixed $link URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name). * @public * @since 2.1.002 (2008-02-12) */ - public function Bookmark($txt, $level = 0, $y = -1, $page = '', $style = '', $color = array(0,0,0), $x = -1, $link = '') - { + public function Bookmark($txt, $level=0, $y=-1, $page='', $style='', $color=array(0,0,0), $x=-1, $link='') { if ($level < 0) { $level = 0; } @@ -12646,7 +12475,8 @@ class TCPDF $x = $this->w; } $fixed = false; - if (!empty($page) AND ($page[0] == '*')) { + $pageAsString = (string) $page; + if ($pageAsString && $pageAsString[0] == '*') { $page = intval(substr($page, 1)); // this page number will not be changed when moving/add/deleting pages $fixed = true; @@ -12665,8 +12495,7 @@ class TCPDF * @protected * @since 5.9.119 (2011-09-19) */ - protected function sortBookmarks() - { + protected function sortBookmarks() { // get sorting columns $outline_p = array(); $outline_y = array(); @@ -12684,8 +12513,7 @@ class TCPDF * @author Olivier Plathey, Nicola Asuni * @since 2.1.002 (2008-02-12) */ - protected function _putbookmarks() - { + protected function _putbookmarks() { $nb = count($this->outlines); if ($nb == 0) { return; @@ -12806,27 +12634,25 @@ class TCPDF /** * Adds a javascript - * @param $script (string) Javascript code + * @param string $script Javascript code * @public * @author Johannes G\FCntert, Nicola Asuni * @since 2.1.002 (2008-02-12) */ - public function IncludeJS($script) - { + public function IncludeJS($script) { $this->javascript .= $script; } /** * Adds a javascript object and return object ID - * @param $script (string) Javascript code - * @param $onload (boolean) if true executes this object when opening the document + * @param string $script Javascript code + * @param boolean $onload if true executes this object when opening the document * @return int internal object ID * @public * @author Nicola Asuni * @since 4.8.000 (2009-09-07) */ - public function addJavascriptObject($script, $onload = false) - { + public function addJavascriptObject($script, $onload=false) { if ($this->pdfa_mode) { // javascript is not allowed in PDF/A mode return false; @@ -12842,8 +12668,7 @@ class TCPDF * @author Johannes G\FCntert, Nicola Asuni * @since 2.1.002 (2008-02-12) */ - protected function _putjavascript() - { + protected function _putjavascript() { if ($this->pdfa_mode OR (empty($this->javascript) AND empty($this->js_objects))) { return; } @@ -12890,19 +12715,18 @@ class TCPDF /** * Adds a javascript form field. - * @param $type (string) field type - * @param $name (string) field name - * @param $x (int) horizontal position - * @param $y (int) vertical position - * @param $w (int) width - * @param $h (int) height - * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param string $type field type + * @param string $name field name + * @param int $x horizontal position + * @param int $y vertical position + * @param int $w width + * @param int $h height + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. * @protected * @author Denis Van Nuffelen, Nicola Asuni * @since 2.1.002 (2008-02-12) */ - protected function _addfield($type, $name, $x, $y, $w, $h, $prop) - { + protected function _addfield($type, $name, $x, $y, $w, $h, $prop) { if ($this->rtl) { $x = $x - $w; } @@ -12911,7 +12735,7 @@ class TCPDF $k = $this->k; $this->javascript .= sprintf("f".$name."=this.addField('%s','%s',%u,[%F,%F,%F,%F]);", $name, $type, $this->PageNo()-1, $x*$k, ($this->h-$y)*$k+1, ($x+$w)*$k, ($this->h-$y-$h)*$k+1)."\n"; $this->javascript .= 'f'.$name.'.textSize='.$this->FontSizePt.";\n"; - foreach ($prop as $key => $val) { + foreach($prop as $key => $val) { if (strcmp(substr($key, -5), 'Color') == 0) { $val = TCPDF_COLORS::_JScolor($val); } else { @@ -12933,13 +12757,12 @@ class TCPDF /** * Set default properties for form fields. - * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. * @public * @author Nicola Asuni * @since 4.8.000 (2009-09-06) */ - public function setFormDefaultProp($prop = array()) - { + public function setFormDefaultProp($prop=array()) { $this->default_form_prop = $prop; } @@ -12950,31 +12773,29 @@ class TCPDF * @author Nicola Asuni * @since 4.8.000 (2009-09-06) */ - public function getFormDefaultProp() - { + public function getFormDefaultProp() { return $this->default_form_prop; } /** * Creates a text field - * @param $name (string) field name - * @param $w (float) Width of the rectangle - * @param $h (float) Height of the rectangle - * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param $opt (array) annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param $x (float) Abscissa of the upper-left corner of the rectangle - * @param $y (float) Ordinate of the upper-left corner of the rectangle - * @param $js (boolean) if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @param string $name field name + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). * @public * @author Nicola Asuni * @since 4.8.000 (2009-09-07) */ - public function TextField($name, $w, $h, $prop = array(), $opt = array(), $x = '', $y = '', $js = false) - { - if ($x === '') { + public function TextField($name, $w, $h, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary @@ -13078,25 +12899,24 @@ class TCPDF /** * Creates a RadioButton field. - * @param $name (string) Field name. - * @param $w (int) Width of the radio button. - * @param $prop (array) Javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param $opt (array) Annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param $onvalue (string) Value to be returned if selected. - * @param $checked (boolean) Define the initial state. - * @param $x (float) Abscissa of the upper-left corner of the rectangle - * @param $y (float) Ordinate of the upper-left corner of the rectangle - * @param $js (boolean) If true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @param string $name Field name. + * @param int $w Width of the radio button. + * @param array $prop Javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt Annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param string $onvalue Value to be returned if selected. + * @param boolean $checked Define the initial state. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js If true put the field using JavaScript (requires Acrobat Writer to be rendered). * @public * @author Nicola Asuni * @since 4.8.000 (2009-09-07) */ - public function RadioButton($name, $w, $prop = array(), $opt = array(), $onvalue = 'On', $checked = false, $x = '', $y = '', $js = false) - { - if ($x === '') { + public function RadioButton($name, $w, $prop=array(), $opt=array(), $onvalue='On', $checked=false, $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary @@ -13182,25 +13002,24 @@ class TCPDF /** * Creates a List-box field - * @param $name (string) field name - * @param $w (int) width - * @param $h (int) height - * @param $values (array) array containing the list of values. - * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param $opt (array) annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param $x (float) Abscissa of the upper-left corner of the rectangle - * @param $y (float) Ordinate of the upper-left corner of the rectangle - * @param $js (boolean) if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @param string $name field name + * @param int $w width + * @param int $h height + * @param array $values array containing the list of values. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). * @public * @author Nicola Asuni * @since 4.8.000 (2009-09-07) */ - public function ListBox($name, $w, $h, $values, $prop = array(), $opt = array(), $x = '', $y = '', $js = false) - { - if ($x === '') { + public function ListBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary @@ -13230,7 +13049,7 @@ class TCPDF $popt['ap'] = array(); $popt['ap']['n'] = '/Tx BMC q '.$fontstyle.' '; $text = ''; - foreach ($values as $item) { + foreach($values as $item) { if (is_array($item)) { $text .= $item[1]."\n"; } else { @@ -13269,25 +13088,24 @@ class TCPDF /** * Creates a Combo-box field - * @param $name (string) field name - * @param $w (int) width - * @param $h (int) height - * @param $values (array) array containing the list of values. - * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param $opt (array) annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param $x (float) Abscissa of the upper-left corner of the rectangle - * @param $y (float) Ordinate of the upper-left corner of the rectangle - * @param $js (boolean) if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @param string $name field name + * @param int $w width + * @param int $h height + * @param array $values array containing the list of values. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). * @public * @author Nicola Asuni * @since 4.8.000 (2009-09-07) */ - public function ComboBox($name, $w, $h, $values, $prop = array(), $opt = array(), $x = '', $y = '', $js = false) - { - if ($x === '') { + public function ComboBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary @@ -13318,7 +13136,7 @@ class TCPDF $popt['ap'] = array(); $popt['ap']['n'] = '/Tx BMC q '.$fontstyle.' '; $text = ''; - foreach ($values as $item) { + foreach($values as $item) { if (is_array($item)) { $text .= $item[1]."\n"; } else { @@ -13357,25 +13175,24 @@ class TCPDF /** * Creates a CheckBox field - * @param $name (string) field name - * @param $w (int) width - * @param $checked (boolean) define the initial state. - * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param $opt (array) annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param $onvalue (string) value to be returned if selected. - * @param $x (float) Abscissa of the upper-left corner of the rectangle - * @param $y (float) Ordinate of the upper-left corner of the rectangle - * @param $js (boolean) if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @param string $name field name + * @param int $w width + * @param boolean $checked define the initial state. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param string $onvalue value to be returned if selected. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). * @public * @author Nicola Asuni * @since 4.8.000 (2009-09-07) */ - public function CheckBox($name, $w, $checked = false, $prop = array(), $opt = array(), $onvalue = 'Yes', $x = '', $y = '', $js = false) - { - if ($x === '') { + public function CheckBox($name, $w, $checked=false, $prop=array(), $opt=array(), $onvalue='Yes', $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary @@ -13437,26 +13254,25 @@ class TCPDF /** * Creates a button field - * @param $name (string) field name - * @param $w (int) width - * @param $h (int) height - * @param $caption (string) caption. - * @param $action (mixed) action triggered by pressing the button. Use a string to specify a javascript action. Use an array to specify a form action options as on section 12.7.5 of PDF32000_2008. - * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param $opt (array) annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param $x (float) Abscissa of the upper-left corner of the rectangle - * @param $y (float) Ordinate of the upper-left corner of the rectangle - * @param $js (boolean) if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @param string $name field name + * @param int $w width + * @param int $h height + * @param string $caption caption. + * @param mixed $action action triggered by pressing the button. Use a string to specify a javascript action. Use an array to specify a form action options as on section 12.7.5 of PDF32000_2008. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). * @public * @author Nicola Asuni * @since 4.8.000 (2009-09-07) */ - public function Button($name, $w, $h, $caption, $action, $prop = array(), $opt = array(), $x = '', $y = '', $js = false) - { - if ($x === '') { + public function Button($name, $w, $h, $caption, $action, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary @@ -13489,7 +13305,7 @@ class TCPDF 'R' => array('width' => $bw, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(51)), 'T' => array('width' => $bw, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(231)), 'B' => array('width' => $bw, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(51))); - $this->SetFillColor(204); + $this->setFillColor(204); $this->Cell($w, $h, $caption, $border, 0, 'C', true, '', 1, false, 'T', 'M'); $this->endTemplate(); --$this->n; @@ -13619,8 +13435,7 @@ class TCPDF * @author Nicola Asuni * @since 4.6.008 (2009-05-07) */ - protected function _putsignature() - { + protected function _putsignature() { if ((!$this->sign) OR (!isset($this->signature_data['cert_type']))) { return; } @@ -13696,27 +13511,26 @@ class TCPDF * WARNING: This is experimental and currently do not work. * Check the PDF Reference 8.7.1 Transform Methods, * Table 8.105 Entries in the UR transform parameters dictionary - * @param $enable (boolean) if true enable user's rights on PDF reader - * @param $document (string) Names specifying additional document-wide usage rights for the document. The only defined value is "/FullSave", which permits a user to save the document along with modified form and/or annotation data. - * @param $annots (string) Names specifying additional annotation-related usage rights for the document. Valid names in PDF 1.5 and later are /Create/Delete/Modify/Copy/Import/Export, which permit the user to perform the named operation on annotations. - * @param $form (string) Names specifying additional form-field-related usage rights for the document. Valid names are: /Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate - * @param $signature (string) Names specifying additional signature-related usage rights for the document. The only defined value is /Modify, which permits a user to apply a digital signature to an existing signature form field or clear a signed signature form field. - * @param $ef (string) Names specifying additional usage rights for named embedded files in the document. Valid names are /Create/Delete/Modify/Import, which permit the user to perform the named operation on named embedded files - Names specifying additional embedded-files-related usage rights for the document. - * @param $formex (string) Names specifying additional form-field-related usage rights. The only valid name is BarcodePlaintext, which permits text form field data to be encoded as a plaintext two-dimensional barcode. + * @param boolean $enable if true enable user's rights on PDF reader + * @param string $document Names specifying additional document-wide usage rights for the document. The only defined value is "/FullSave", which permits a user to save the document along with modified form and/or annotation data. + * @param string $annots Names specifying additional annotation-related usage rights for the document. Valid names in PDF 1.5 and later are /Create/Delete/Modify/Copy/Import/Export, which permit the user to perform the named operation on annotations. + * @param string $form Names specifying additional form-field-related usage rights for the document. Valid names are: /Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate + * @param string $signature Names specifying additional signature-related usage rights for the document. The only defined value is /Modify, which permits a user to apply a digital signature to an existing signature form field or clear a signed signature form field. + * @param string $ef Names specifying additional usage rights for named embedded files in the document. Valid names are /Create/Delete/Modify/Import, which permit the user to perform the named operation on named embedded files + Names specifying additional embedded-files-related usage rights for the document. + * @param string $formex Names specifying additional form-field-related usage rights. The only valid name is BarcodePlaintext, which permits text form field data to be encoded as a plaintext two-dimensional barcode. * @public * @author Nicola Asuni * @since 2.9.000 (2008-03-26) */ public function setUserRights( - $enable = true, - $document = '/FullSave', - $annots = '/Create/Delete/Modify/Copy/Import/Export', - $form = '/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate', - $signature = '/Modify', - $ef = '/Create/Delete/Modify/Import', - $formex = '' - ) { + $enable=true, + $document='/FullSave', + $annots='/Create/Delete/Modify/Copy/Import/Export', + $form='/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate', + $signature='/Modify', + $ef='/Create/Delete/Modify/Import', + $formex='') { $this->ur['enabled'] = $enable; $this->ur['document'] = $document; $this->ur['annots'] = $annots; @@ -13735,19 +13549,18 @@ class TCPDF * To create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt * To export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12 * To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes - * @param $signing_cert (mixed) signing certificate (string or filename prefixed with 'file://') - * @param $private_key (mixed) private key (string or filename prefixed with 'file://') - * @param $private_key_password (string) password - * @param $extracerts (string) specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used. - * @param $cert_type (int) The access permissions granted for this document. Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature. - * @param $info (array) array of option information: Name, Location, Reason, ContactInfo. - * @param $approval (string) Enable approval signature eg. for PDF incremental update + * @param mixed $signing_cert signing certificate (string or filename prefixed with 'file://') + * @param mixed $private_key private key (string or filename prefixed with 'file://') + * @param string $private_key_password password + * @param string $extracerts specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used. + * @param int $cert_type The access permissions granted for this document. Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature. + * @param array $info array of option information: Name, Location, Reason, ContactInfo. + * @param string $approval Enable approval signature eg. for PDF incremental update * @public * @author Nicola Asuni * @since 4.6.005 (2009-04-24) */ - public function setSignature($signing_cert = '', $private_key = '', $private_key_password = '', $extracerts = '', $cert_type = 2, $info = array(), $approval = '') - { + public function setSignature($signing_cert='', $private_key='', $private_key_password='', $extracerts='', $cert_type=2, $info=array(), $approval='') { // to create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt // to export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12 // to convert pfx certificate to pem: openssl @@ -13774,54 +13587,51 @@ class TCPDF /** * Set the digital signature appearance (a cliccable rectangle area to get signature properties) - * @param $x (float) Abscissa of the upper-left corner. - * @param $y (float) Ordinate of the upper-left corner. - * @param $w (float) Width of the signature area. - * @param $h (float) Height of the signature area. - * @param $page (int) option page number (if < 0 the current page is used). - * @param $name (string) Name of the signature. + * @param float $x Abscissa of the upper-left corner. + * @param float $y Ordinate of the upper-left corner. + * @param float $w Width of the signature area. + * @param float $h Height of the signature area. + * @param int $page option page number (if < 0 the current page is used). + * @param string $name Name of the signature. * @public * @author Nicola Asuni * @since 5.3.011 (2010-06-17) */ - public function setSignatureAppearance($x = 0, $y = 0, $w = 0, $h = 0, $page = -1, $name = '') - { + public function setSignatureAppearance($x=0, $y=0, $w=0, $h=0, $page=-1, $name='') { $this->signature_appearance = $this->getSignatureAppearanceArray($x, $y, $w, $h, $page, $name); } /** * Add an empty digital signature appearance (a cliccable rectangle area to get signature properties) - * @param $x (float) Abscissa of the upper-left corner. - * @param $y (float) Ordinate of the upper-left corner. - * @param $w (float) Width of the signature area. - * @param $h (float) Height of the signature area. - * @param $page (int) option page number (if < 0 the current page is used). - * @param $name (string) Name of the signature. + * @param float $x Abscissa of the upper-left corner. + * @param float $y Ordinate of the upper-left corner. + * @param float $w Width of the signature area. + * @param float $h Height of the signature area. + * @param int $page option page number (if < 0 the current page is used). + * @param string $name Name of the signature. * @public * @author Nicola Asuni * @since 5.9.101 (2011-07-06) */ - public function addEmptySignatureAppearance($x = 0, $y = 0, $w = 0, $h = 0, $page = -1, $name = '') - { + public function addEmptySignatureAppearance($x=0, $y=0, $w=0, $h=0, $page=-1, $name='') { ++$this->n; $this->empty_signature_appearance[] = array('objid' => $this->n) + $this->getSignatureAppearanceArray($x, $y, $w, $h, $page, $name); } /** * Get the array that defines the signature appearance (page and rectangle coordinates). - * @param $x (float) Abscissa of the upper-left corner. - * @param $y (float) Ordinate of the upper-left corner. - * @param $w (float) Width of the signature area. - * @param $h (float) Height of the signature area. - * @param $page (int) option page number (if < 0 the current page is used). - * @param $name (string) Name of the signature. - * @return (array) Array defining page and rectangle coordinates of signature appearance. + * @param float $x Abscissa of the upper-left corner. + * @param float $y Ordinate of the upper-left corner. + * @param float $w Width of the signature area. + * @param float $h Height of the signature area. + * @param int $page option page number (if < 0 the current page is used). + * @param string $name Name of the signature. + * @return array Array defining page and rectangle coordinates of signature appearance. * @protected * @author Nicola Asuni * @since 5.9.101 (2011-07-06) */ - protected function getSignatureAppearanceArray($x = 0, $y = 0, $w = 0, $h = 0, $page = -1, $name = '') - { + protected function getSignatureAppearanceArray($x=0, $y=0, $w=0, $h=0, $page=-1, $name='') { $sigapp = array(); if (($page < 1) OR ($page > $this->numpages)) { $sigapp['page'] = $this->page; @@ -13845,16 +13655,15 @@ class TCPDF * Enable document timestamping (requires the OpenSSL Library). * The trusted timestamping improve document security that means that no one should be able to change the document once it has been recorded. * Use with digital signature only! - * @param $tsa_host (string) Time Stamping Authority (TSA) server (prefixed with 'https://') - * @param $tsa_username (string) Specifies the username for TSA authorization (optional) OR specifies the TSA authorization PEM file (see: example_66.php, optional) - * @param $tsa_password (string) Specifies the password for TSA authorization (optional) - * @param $tsa_cert (string) Specifies the location of TSA certificate for authorization (optional for cURL) + * @param string $tsa_host Time Stamping Authority (TSA) server (prefixed with 'https://') + * @param string $tsa_username Specifies the username for TSA authorization (optional) OR specifies the TSA authorization PEM file (see: example_66.php, optional) + * @param string $tsa_password Specifies the password for TSA authorization (optional) + * @param string $tsa_cert Specifies the location of TSA certificate for authorization (optional for cURL) * @public * @author Richard Stockinger * @since 6.0.090 (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(); if (!function_exists('curl_init')) { $this->Error('Please enable cURL PHP extension!'); @@ -13876,14 +13685,13 @@ class TCPDF /** * NOT YET IMPLEMENTED * Request TSA for a timestamp - * @param $signature (string) Digital signature as binary string - * @return (string) Timestamped digital signature + * @param string $signature Digital signature as binary string + * @return string Timestamped digital signature * @protected * @author Richard Stockinger * @since 6.0.090 (2014-06-16) */ - protected function applyTSA($signature) - { + protected function applyTSA($signature) { if (!$this->tsa_timestamp) { return $signature; } @@ -13894,12 +13702,11 @@ class TCPDF /** * Create a new page group. * NOTE: call this function before calling AddPage() - * @param $page (int) starting group page (leave empty for next page). + * @param int|null $page starting group page (leave empty for next page). * @public * @since 3.0.000 (2008-03-27) */ - public function startPageGroup($page = '') - { + public function startPageGroup($page=null) { if (empty($page)) { $page = $this->page + 1; } @@ -13908,12 +13715,11 @@ class TCPDF /** * Set the starting page number. - * @param $num (int) Starting page number. + * @param int $num Starting page number. * @since 5.9.093 (2011-06-16) * @public */ - public function setStartingPageNumber($num = 1) - { + public function setStartingPageNumber($num=1) { $this->starting_page_number = max(0, intval($num)); } @@ -13924,8 +13730,7 @@ class TCPDF * @since 5.9.099 (2011-06-27) * @public */ - public function getAliasRightShift() - { + public function getAliasRightShift() { // calculate aproximatively the ratio between widths of aliases and replacements. $ref = '{'.TCPDF_STATIC::$alias_right_shift.'}{'.TCPDF_STATIC::$alias_tot_pages.'}{'.TCPDF_STATIC::$alias_num_page.'}'; $rep = str_repeat(' ', $this->GetNumChars($ref)); @@ -13951,8 +13756,7 @@ class TCPDF * @since 4.0.018 (2008-08-08) * @public */ - public function getAliasNbPages() - { + public function getAliasNbPages() { if ($this->isUnicodeFont()) { return '{'.TCPDF_STATIC::$alias_tot_pages.'}'; } @@ -13967,8 +13771,7 @@ class TCPDF * @since 4.5.000 (2009-01-02) * @public */ - public function getAliasNumPage() - { + public function getAliasNumPage() { if ($this->isUnicodeFont()) { return '{'.TCPDF_STATIC::$alias_num_page.'}'; } @@ -13979,12 +13782,11 @@ class TCPDF * Return the alias for the total number of pages in the current page group. * If the current font is unicode type, the returned string is surrounded by additional curly braces. * This alias will be replaced by the total number of pages in this group. - * @return alias of the current page group + * @return string alias of the current page group * @public * @since 3.0.000 (2008-03-27) */ - public function getPageGroupAlias() - { + public function getPageGroupAlias() { if ($this->isUnicodeFont()) { return '{'.TCPDF_STATIC::$alias_group_tot_pages.'}'; } @@ -13995,12 +13797,11 @@ class TCPDF * Return the alias for the page number on the current page group. * If the current font is unicode type, the returned string is surrounded by additional curly braces. * This alias will be replaced by the page number (relative to the belonging group). - * @return alias of the current page group + * @return string alias of the current page group * @public * @since 4.5.000 (2009-01-02) */ - public function getPageNumGroupAlias() - { + public function getPageNumGroupAlias() { if ($this->isUnicodeFont()) { return '{'.TCPDF_STATIC::$alias_group_num_page.'}'; } @@ -14009,12 +13810,11 @@ class TCPDF /** * Return the current page in the group. - * @return current page in the group + * @return int current page in the group * @public * @since 3.0.000 (2008-03-27) */ - public function getGroupPageNo() - { + public function getGroupPageNo() { return $this->pagegroups[$this->currpagegroup]; } @@ -14024,8 +13824,7 @@ class TCPDF * @since 4.3.003 (2008-11-18) * @see PaneNo(), formatPageNumber() */ - public function getGroupPageNoFormatted() - { + public function getGroupPageNoFormatted() { return TCPDF_STATIC::formatPageNumber($this->getGroupPageNo()); } @@ -14035,8 +13834,7 @@ class TCPDF * @since 4.2.005 (2008-11-06) * @see PaneNo(), formatPageNumber() */ - public function PageNoFormatted() - { + public function PageNoFormatted() { return TCPDF_STATIC::formatPageNumber($this->PageNo()); } @@ -14045,8 +13843,7 @@ class TCPDF * @protected * @since 3.0.000 (2008-03-27) */ - protected function _putocg() - { + protected function _putocg() { if (empty($this->pdflayers)) { return; } @@ -14055,9 +13852,9 @@ class TCPDF $out = '<< /Type /OCG'; $out .= ' /Name '.$this->_textstring($layer['name'], $this->pdflayers[$key]['objid']); $out .= ' /Usage <<'; - if (isset($layer['print']) AND ($layer['print'] !== null)) { + if (isset($layer['print']) AND ($layer['print'] !== NULL)) { $out .= ' /Print <>'; - } + } $out .= ' /View <>'; $out .= ' >> >>'; $out .= "\n".'endobj'; @@ -14067,15 +13864,14 @@ class TCPDF /** * Start a new pdf layer. - * @param $name (string) Layer name (only a-z letters and numbers). Leave empty for automatic name. - * @param $print (boolean|null) Set to TRUE to print this layer, FALSE to not print and NULL to not set this option - * @param $view (boolean) Set to true to view this layer. - * @param $lock (boolean) If true lock the layer + * @param string $name Layer name (only a-z letters and numbers). Leave empty for automatic name. + * @param boolean|null $print Set to TRUE to print this layer, FALSE to not print and NULL to not set this option + * @param boolean $view Set to true to view this layer. + * @param boolean $lock If true lock the layer * @public * @since 5.9.102 (2011-07-13) */ - public function startLayer($name = '', $print = true, $view = true, $lock = true) - { + public function startLayer($name='', $print=true, $view=true, $lock=true) { if ($this->state != 2) { return; } @@ -14095,8 +13891,7 @@ class TCPDF * @public * @since 5.9.102 (2011-07-13) */ - public function endLayer() - { + public function endLayer() { if ($this->state != 2) { return; } @@ -14111,17 +13906,16 @@ class TCPDF * Set the visibility of the successive elements. * This can be useful, for instance, to put a background * image or color that will show on screen but won't print. - * @param $v (string) visibility mode. Legal values are: all, print, screen or view. + * @param string $v visibility mode. Legal values are: all, print, screen or view. * @public * @since 3.0.000 (2008-03-27) */ - public function setVisibility($v) - { + public function setVisibility($v) { if ($this->state != 2) { return; } $this->endLayer(); - switch ($v) { + switch($v) { case 'print': { $this->startLayer('Print', true, false); break; @@ -14144,14 +13938,13 @@ class TCPDF /** * Add transparency parameters to the current extgstate - * @param $parms (array) parameters - * @return the number of extgstates + * @param array $parms parameters + * @return int|void the number of extgstates * @protected * @since 3.0.000 (2008-03-27) */ - protected function addExtGState($parms) - { - if ($this->pdfa_mode) { + protected function addExtGState($parms) { + if ($this->pdfa_mode || $this->pdfa_version >= 2) { // transparencies are not allowed in PDF/A mode return; } @@ -14177,14 +13970,13 @@ class TCPDF /** * Add an extgstate - * @param $gs (array) extgstate + * @param int $gs extgstate * @protected * @since 3.0.000 (2008-03-27) */ - protected function setExtGState($gs) - { - if ($this->pdfa_mode OR ($this->state != 2)) { - // transparency is not allowed in PDF/A mode + protected function setExtGState($gs) { + if (($this->pdfa_mode && $this->pdfa_version < 2) OR ($this->state != 2)) { + // transparency is not allowed in PDF/A-1 mode return; } $this->_out(sprintf('/GS%d gs', $gs)); @@ -14195,8 +13987,7 @@ class TCPDF * @protected * @since 3.0.000 (2008-03-27) */ - protected function _putextgstates() - { + protected function _putextgstates() { foreach ($this->extgstates as $i => $ext) { $this->extgstates[$i]['n'] = $this->_newobj(); $out = '<< /Type /ExtGState'; @@ -14219,14 +14010,13 @@ class TCPDF /** * Set overprint mode for stroking (OP) and non-stroking (op) painting operations. * (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008). - * @param $stroking (boolean) If true apply overprint for stroking operations. - * @param $nonstroking (boolean) If true apply overprint for painting operations other than stroking. - * @param $mode (integer) Overprint mode: (0 = each source colour component value replaces the value previously painted for the corresponding device colorant; 1 = a tint value of 0.0 for a source colour component shall leave the corresponding component of the previously painted colour unchanged). + * @param boolean $stroking If true apply overprint for stroking operations. + * @param boolean|null $nonstroking If true apply overprint for painting operations other than stroking. + * @param integer $mode Overprint mode: (0 = each source colour component value replaces the value previously painted for the corresponding device colorant; 1 = a tint value of 0.0 for a source colour component shall leave the corresponding component of the previously painted colour unchanged). * @public * @since 5.9.152 (2012-03-23) */ - public function setOverprint($stroking = true, $nonstroking = '', $mode = 0) - { + public function setOverprint($stroking=true, $nonstroking=null, $mode=0) { if ($this->state != 2) { return; } @@ -14248,28 +14038,26 @@ class TCPDF /** * Get the overprint mode array (OP, op, OPM). * (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008). - * @return array. + * @return array * @public * @since 5.9.152 (2012-03-23) */ - public function getOverprint() - { + public function getOverprint() { return $this->overprint; } /** * Set alpha for stroking (CA) and non-stroking (ca) operations. - * @param $stroking (float) Alpha value for stroking operations: real value from 0 (transparent) to 1 (opaque). - * @param $bm (string) blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity - * @param $nonstroking (float) Alpha value for non-stroking operations: real value from 0 (transparent) to 1 (opaque). - * @param $ais (boolean) + * @param float $stroking Alpha value for stroking operations: real value from 0 (transparent) to 1 (opaque). + * @param string $bm blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity + * @param float|null $nonstroking Alpha value for non-stroking operations: real value from 0 (transparent) to 1 (opaque). + * @param boolean $ais * @public * @since 3.0.000 (2008-03-27) */ - public function setAlpha($stroking = 1, $bm = 'Normal', $nonstroking = '', $ais = false) - { - if ($this->pdfa_mode) { - // transparency is not allowed in PDF/A mode + public function setAlpha($stroking=1, $bm='Normal', $nonstroking=null, $ais=false) { + if ($this->pdfa_mode && $this->pdfa_version < 2) { + // transparency is not allowed in PDF/A-1 mode return; } $stroking = floatval($stroking); @@ -14295,23 +14083,21 @@ class TCPDF /** * Get the alpha mode array (CA, ca, BM, AIS). * (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008). - * @return array. + * @return array * @public * @since 5.9.152 (2012-03-23) */ - public function getAlpha() - { + public function getAlpha() { return $this->alpha; } /** * Set the default JPEG compression quality (1-100) - * @param $quality (int) JPEG quality, integer between 1 and 100 + * @param int $quality JPEG quality, integer between 1 and 100 * @public * @since 3.0.000 (2008-03-27) */ - public function setJPEGQuality($quality) - { + public function setJPEGQuality($quality) { if (($quality < 1) OR ($quality > 100)) { $quality = 75; } @@ -14320,48 +14106,48 @@ class TCPDF /** * Set the default number of columns in a row for HTML tables. - * @param $cols (int) number of columns + * @param int $cols number of columns * @public * @since 3.0.014 (2008-06-04) */ - public function setDefaultTableColumns($cols = 4) - { + public function setDefaultTableColumns($cols=4) { $this->default_table_columns = intval($cols); } /** * Set the height of the cell (line height) respect the font height. - * @param $h (int) cell proportion respect font height (typical value = 1.25). + * @param float $h cell proportion respect font height (typical value = 1.25). * @public * @since 3.0.014 (2008-06-04) */ - public function setCellHeightRatio($h) - { + public function setCellHeightRatio($h) { $this->cell_height_ratio = $h; } /** * return the height of cell repect font height. * @public + * @return float * @since 4.0.012 (2008-07-24) */ - public function getCellHeightRatio() - { + public function getCellHeightRatio() { return $this->cell_height_ratio; } /** * Set the PDF version (check PDF reference for valid values). - * @param $version (string) PDF document version. + * @param string $version PDF document version. * @public * @since 3.1.000 (2008-06-09) */ - public function setPDFVersion($version = '1.7') - { + public function setPDFVersion($version='1.7') { if ($this->pdfa_mode && $this->pdfa_version == 1 ) { - // PDF/A mode + // PDF/A-1 mode $this->PDFVersion = '1.4'; - } else { + } elseif ($this->pdfa_mode && $this->pdfa_version >= 2 ) { + // PDF/A-2 mode + $this->PDFVersion = '1.7'; + } else { $this->PDFVersion = $version; } } @@ -14370,31 +14156,29 @@ class TCPDF * Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print. * (see Section 8.1 of PDF reference, "Viewer Preferences"). *
        • HideToolbar boolean (Optional) A flag specifying whether to hide the viewer application's tool bars when the document is active. Default value: false.
        • HideMenubar boolean (Optional) A flag specifying whether to hide the viewer application's menu bar when the document is active. Default value: false.
        • HideWindowUI boolean (Optional) A flag specifying whether to hide user interface elements in the document's window (such as scroll bars and navigation controls), leaving only the document's contents displayed. Default value: false.
        • FitWindow boolean (Optional) A flag specifying whether to resize the document's window to fit the size of the first displayed page. Default value: false.
        • CenterWindow boolean (Optional) A flag specifying whether to position the document's window in the center of the screen. Default value: false.
        • DisplayDocTitle boolean (Optional; PDF 1.4) A flag specifying whether the window's title bar should display the document title taken from the Title entry of the document information dictionary (see Section 10.2.1, "Document Information Dictionary"). If false, the title bar should instead display the name of the PDF file containing the document. Default value: false.
        • NonFullScreenPageMode name (Optional) The document's page mode, specifying how to display the document on exiting full-screen mode:
          • UseNone Neither document outline nor thumbnail images visible
          • UseOutlines Document outline visible
          • UseThumbs Thumbnail images visible
          • UseOC Optional content group panel visible
          This entry is meaningful only if the value of the PageMode entry in the catalog dictionary (see Section 3.6.1, "Document Catalog") is FullScreen; it is ignored otherwise. Default value: UseNone.
        • ViewArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be displayed when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:
          • MediaBox
          • CropBox (default)
          • BleedBox
          • TrimBox
          • ArtBox
        • ViewClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:
          • MediaBox
          • CropBox (default)
          • BleedBox
          • TrimBox
          • ArtBox
        • PrintArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be rendered when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:
          • MediaBox
          • CropBox (default)
          • BleedBox
          • TrimBox
          • ArtBox
        • PrintClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:
          • MediaBox
          • CropBox (default)
          • BleedBox
          • TrimBox
          • ArtBox
        • PrintScaling name (Optional; PDF 1.6) The page scaling option to be selected when a print dialog is displayed for this document. Valid values are:
          • None, which indicates that the print dialog should reflect no page scaling
          • AppDefault (default), which indicates that applications should use the current print scaling
        • Duplex name (Optional; PDF 1.7) The paper handling option to use when printing the file from the print dialog. The following values are valid:
          • Simplex - Print single-sided
          • DuplexFlipShortEdge - Duplex and flip on the short edge of the sheet
          • DuplexFlipLongEdge - Duplex and flip on the long edge of the sheet
          Default value: none
        • PickTrayByPDFSize boolean (Optional; PDF 1.7) A flag specifying whether the PDF page size is used to select the input paper tray. This setting influences only the preset values used to populate the print dialog presented by a PDF viewer application. If PickTrayByPDFSize is true, the check box in the print dialog associated with input paper tray is checked. Note: This setting has no effect on Mac OS systems, which do not provide the ability to pick the input tray by size.
        • PrintPageRange array (Optional; PDF 1.7) The page numbers used to initialize the print dialog box when the file is printed. The first page of the PDF file is denoted by 1. Each pair consists of the first and last pages in the sub-range. An odd number of integers causes this entry to be ignored. Negative numbers cause the entire array to be ignored. Default value: as defined by PDF viewer application
        • NumCopies integer (Optional; PDF 1.7) The number of copies to be printed when the print dialog is opened for this file. Supported values are the integers 2 through 5. Values outside this range are ignored. Default value: as defined by PDF viewer application, but typically 1
        - * @param $preferences (array) array of options. + * @param array $preferences array of options. * @author Nicola Asuni * @public * @since 3.1.000 (2008-06-09) */ - public function setViewerPreferences($preferences) - { + public function setViewerPreferences($preferences) { $this->viewer_preferences = $preferences; } /** * Paints color transition registration bars - * @param $x (float) abscissa of the top left corner of the rectangle. - * @param $y (float) ordinate of the top left corner of the rectangle. - * @param $w (float) width of the rectangle. - * @param $h (float) height of the rectangle. - * @param $transition (boolean) if true prints tcolor transitions to white. - * @param $vertical (boolean) if true prints bar vertically. - * @param $colors (string) colors to print separated by comma. Valid values are: A,W,R,G,B,C,M,Y,K,RGB,CMYK,ALL,ALLSPOT,. Where: A = grayscale black, W = grayscale white, R = RGB red, G RGB green, B RGB blue, C = CMYK cyan, M = CMYK magenta, Y = CMYK yellow, K = CMYK key/black, RGB = RGB registration color, CMYK = CMYK registration color, ALL = Spot registration color, ALLSPOT = print all defined spot colors, = name of the spot color to print. + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param boolean $transition if true prints tcolor transitions to white. + * @param boolean $vertical if true prints bar vertically. + * @param string $colors colors to print separated by comma. Valid values are: A,W,R,G,B,C,M,Y,K,RGB,CMYK,ALL,ALLSPOT,. Where: A = grayscale black, W = grayscale white, R = RGB red, G RGB green, B RGB blue, C = CMYK cyan, M = CMYK magenta, Y = CMYK yellow, K = CMYK key/black, RGB = RGB registration color, CMYK = CMYK registration color, ALL = Spot registration color, ALLSPOT = print all defined spot colors, = name of the spot color to print. * @author Nicola Asuni * @since 4.9.000 (2010-03-26) * @public */ - public function colorRegistrationBar($x, $y, $w, $h, $transition = true, $vertical = false, $colors = 'A,R,G,B,C,M,Y,K') - { + public function colorRegistrationBar($x, $y, $w, $h, $transition=true, $vertical=false, $colors='A,R,G,B,C,M,Y,K') { if (strpos($colors, 'ALLSPOT') !== false) { // expand spot colors $spot_colors = ''; @@ -14512,7 +14296,7 @@ class TCPDF // color gradient $this->LinearGradient($xb, $yb, $wb, $hb, $col_a, $col_b, $coords); } else { - $this->SetFillColorArray($col_b); + $this->setFillColorArray($col_b); // colored rectangle $this->Rect($xb, $yb, $wb, $hb, 'F', array()); } @@ -14524,19 +14308,18 @@ class TCPDF /** * Paints crop marks. - * @param $x (float) abscissa of the crop mark center. - * @param $y (float) ordinate of the crop mark center. - * @param $w (float) width of the crop mark. - * @param $h (float) height of the crop mark. - * @param $type (string) type of crop mark, one symbol per type separated by comma: T = TOP, F = BOTTOM, L = LEFT, R = RIGHT, TL = A = TOP-LEFT, TR = B = TOP-RIGHT, BL = C = BOTTOM-LEFT, BR = D = BOTTOM-RIGHT. - * @param $color (array) crop mark color (default spot registration color). + * @param float $x abscissa of the crop mark center. + * @param float $y ordinate of the crop mark center. + * @param float $w width of the crop mark. + * @param float $h height of the crop mark. + * @param string $type type of crop mark, one symbol per type separated by comma: T = TOP, F = BOTTOM, L = LEFT, R = RIGHT, TL = A = TOP-LEFT, TR = B = TOP-RIGHT, BL = C = BOTTOM-LEFT, BR = D = BOTTOM-RIGHT. + * @param array $color crop mark color (default spot registration color). * @author Nicola Asuni * @since 4.9.000 (2010-03-26) * @public */ - public function cropMark($x, $y, $w, $h, $type = 'T,R,B,L', $color = array(100,100,100,100,'All')) - { - $this->SetLineStyle(array('width' => (0.5 / $this->k), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $color)); + public function cropMark($x, $y, $w, $h, $type='T,R,B,L', $color=array(100,100,100,100,'All')) { + $this->setLineStyle(array('width' => (0.5 / $this->k), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $color)); $type = strtoupper($type); $type = preg_replace('/[^A-Z\-\,]*/', '', $type); // split type in single components @@ -14596,29 +14379,28 @@ class TCPDF /** * Paints a registration mark - * @param $x (float) abscissa of the registration mark center. - * @param $y (float) ordinate of the registration mark center. - * @param $r (float) radius of the crop mark. - * @param $double (boolean) if true print two concentric crop marks. - * @param $cola (array) crop mark color (default spot registration color 'All'). - * @param $colb (array) second crop mark color (default spot registration color 'None'). + * @param float $x abscissa of the registration mark center. + * @param float $y ordinate of the registration mark center. + * @param float $r radius of the crop mark. + * @param boolean $double if true print two concentric crop marks. + * @param array $cola crop mark color (default spot registration color 'All'). + * @param array $colb second crop mark color (default spot registration color 'None'). * @author Nicola Asuni * @since 4.9.000 (2010-03-26) * @public */ - public function registrationMark($x, $y, $r, $double = false, $cola = array(100,100,100,100,'All'), $colb = array(0,0,0,0,'None')) - { - $line_style = array('width' => max((0.5 / $this->k), ($r / 30)), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $cola); - $this->SetFillColorArray($cola); + public function registrationMark($x, $y, $r, $double=false, $cola=array(100,100,100,100,'All'), $colb=array(0,0,0,0,'None')) { + $line_style = array('width' => max((0.5 / $this->k),($r / 30)), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $cola); + $this->setFillColorArray($cola); $this->PieSector($x, $y, $r, 90, 180, 'F'); $this->PieSector($x, $y, $r, 270, 360, 'F'); $this->Circle($x, $y, $r, 0, 360, 'C', $line_style, array(), 8); if ($double) { $ri = $r * 0.5; - $this->SetFillColorArray($colb); + $this->setFillColorArray($colb); $this->PieSector($x, $y, $ri, 90, 180, 'F'); $this->PieSector($x, $y, $ri, 270, 360, 'F'); - $this->SetFillColorArray($cola); + $this->setFillColorArray($cola); $this->PieSector($x, $y, $ri, 0, 90, 'F'); $this->PieSector($x, $y, $ri, 180, 270, 'F'); $this->Circle($x, $y, $ri, 0, 360, 'C', $line_style, array(), 8); @@ -14627,36 +14409,35 @@ class TCPDF /** * Paints a CMYK registration mark - * @param $x (float) abscissa of the registration mark center. - * @param $y (float) ordinate of the registration mark center. - * @param $r (float) radius of the crop mark. + * @param float $x abscissa of the registration mark center. + * @param float $y ordinate of the registration mark center. + * @param float $r radius of the crop mark. * @author Nicola Asuni * @since 6.0.038 (2013-09-30) * @public */ - public function registrationMarkCMYK($x, $y, $r) - { + public function registrationMarkCMYK($x, $y, $r) { // line width - $lw = max((0.5 / $this->k), ($r / 8)); + $lw = max((0.5 / $this->k),($r / 8)); // internal radius $ri = ($r * 0.6); // external radius $re = ($r * 1.3); // Cyan - $this->SetFillColorArray(array(100,0,0,0)); + $this->setFillColorArray(array(100,0,0,0)); $this->PieSector($x, $y, $ri, 270, 360, 'F'); // Magenta - $this->SetFillColorArray(array(0,100,0,0)); + $this->setFillColorArray(array(0,100,0,0)); $this->PieSector($x, $y, $ri, 0, 90, 'F'); // Yellow - $this->SetFillColorArray(array(0,0,100,0)); + $this->setFillColorArray(array(0,0,100,0)); $this->PieSector($x, $y, $ri, 90, 180, 'F'); // Key - black - $this->SetFillColorArray(array(0,0,0,100)); + $this->setFillColorArray(array(0,0,0,100)); $this->PieSector($x, $y, $ri, 180, 270, 'F'); // registration color $line_style = array('width' => $lw, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(100,100,100,100,'All')); - $this->SetFillColorArray(array(100,100,100,100,'All')); + $this->setFillColorArray(array(100,100,100,100,'All')); // external circle $this->Circle($x, $y, $r, 0, 360, 'C', $line_style, array(), 8); // cross lines @@ -14668,63 +14449,60 @@ class TCPDF /** * Paints a linear colour gradient. - * @param $x (float) abscissa of the top left corner of the rectangle. - * @param $y (float) ordinate of the top left corner of the rectangle. - * @param $w (float) width of the rectangle. - * @param $h (float) height of the rectangle. - * @param $col1 (array) first color (Grayscale, RGB or CMYK components). - * @param $col2 (array) second color (Grayscale, RGB or CMYK components). - * @param $coords (array) array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0). + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param array $col1 first color (Grayscale, RGB or CMYK components). + * @param array $col2 second color (Grayscale, RGB or CMYK components). + * @param array $coords array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0). * @author Andreas W\FCrmser, Nicola Asuni * @since 3.1.000 (2008-06-09) * @public */ - public function LinearGradient($x, $y, $w, $h, $col1 = array(), $col2 = array(), $coords = array(0,0,1,0)) - { + public function LinearGradient($x, $y, $w, $h, $col1=array(), $col2=array(), $coords=array(0,0,1,0)) { $this->Clip($x, $y, $w, $h); $this->Gradient(2, $coords, array(array('color' => $col1, 'offset' => 0, 'exponent' => 1), array('color' => $col2, 'offset' => 1, 'exponent' => 1)), array(), false); } /** * Paints a radial colour gradient. - * @param $x (float) abscissa of the top left corner of the rectangle. - * @param $y (float) ordinate of the top left corner of the rectangle. - * @param $w (float) width of the rectangle. - * @param $h (float) height of the rectangle. - * @param $col1 (array) first color (Grayscale, RGB or CMYK components). - * @param $col2 (array) second color (Grayscale, RGB or CMYK components). - * @param $coords (array) array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined. + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param array $col1 first color (Grayscale, RGB or CMYK components). + * @param array $col2 second color (Grayscale, RGB or CMYK components). + * @param array $coords array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined. * @author Andreas W\FCrmser, Nicola Asuni * @since 3.1.000 (2008-06-09) * @public */ - public function RadialGradient($x, $y, $w, $h, $col1 = array(), $col2 = array(), $coords = array(0.5,0.5,0.5,0.5,1)) - { + public function RadialGradient($x, $y, $w, $h, $col1=array(), $col2=array(), $coords=array(0.5,0.5,0.5,0.5,1)) { $this->Clip($x, $y, $w, $h); $this->Gradient(3, $coords, array(array('color' => $col1, 'offset' => 0, 'exponent' => 1), array('color' => $col2, 'offset' => 1, 'exponent' => 1)), array(), false); } /** * Paints a coons patch mesh. - * @param $x (float) abscissa of the top left corner of the rectangle. - * @param $y (float) ordinate of the top left corner of the rectangle. - * @param $w (float) width of the rectangle. - * @param $h (float) height of the rectangle. - * @param $col1 (array) first color (lower left corner) (RGB components). - * @param $col2 (array) second color (lower right corner) (RGB components). - * @param $col3 (array) third color (upper right corner) (RGB components). - * @param $col4 (array) fourth color (upper left corner) (RGB components). - * @param $coords (array)
        • for one patch mesh: array(float x1, float y1, .... float x12, float y12): 12 pairs of coordinates (normally from 0 to 1) which specify the Bezier control points that define the patch. First pair is the lower left edge point, next is its right control point (control point 2). Then the other points are defined in the order: control point 1, edge point, control point 2 going counter-clockwise around the patch. Last (x12, y12) is the first edge point's left control point (control point 1).
        • for two or more patch meshes: array[number of patches]: arrays with the following keys for each patch: f: where to put that patch (0 = first patch, 1, 2, 3 = right, top and left of precedent patch - I didn't figure this out completely - just try and error ;-) points: 12 pairs of coordinates of the Bezier control points as above for the first patch, 8 pairs of coordinates for the following patches, ignoring the coordinates already defined by the precedent patch (I also didn't figure out the order of these - also: try and see what's happening) colors: must be 4 colors for the first patch, 2 colors for the following patches
        - * @param $coords_min (array) minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0 - * @param $coords_max (array) maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1 - * @param $antialias (boolean) A flag indicating whether to filter the shading function to prevent aliasing artifacts. + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param array $col1 first color (lower left corner) (RGB components). + * @param array $col2 second color (lower right corner) (RGB components). + * @param array $col3 third color (upper right corner) (RGB components). + * @param array $col4 fourth color (upper left corner) (RGB components). + * @param array $coords
        • for one patch mesh: array(float x1, float y1, .... float x12, float y12): 12 pairs of coordinates (normally from 0 to 1) which specify the Bezier control points that define the patch. First pair is the lower left edge point, next is its right control point (control point 2). Then the other points are defined in the order: control point 1, edge point, control point 2 going counter-clockwise around the patch. Last (x12, y12) is the first edge point's left control point (control point 1).
        • for two or more patch meshes: array[number of patches]: arrays with the following keys for each patch: f: where to put that patch (0 = first patch, 1, 2, 3 = right, top and left of precedent patch - I didn't figure this out completely - just try and error ;-) points: 12 pairs of coordinates of the Bezier control points as above for the first patch, 8 pairs of coordinates for the following patches, ignoring the coordinates already defined by the precedent patch (I also didn't figure out the order of these - also: try and see what's happening) colors: must be 4 colors for the first patch, 2 colors for the following patches
        + * @param array $coords_min minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0 + * @param array $coords_max maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1 + * @param boolean $antialias A flag indicating whether to filter the shading function to prevent aliasing artifacts. * @author Andreas W\FCrmser, Nicola Asuni * @since 3.1.000 (2008-06-09) * @public */ - public function CoonsPatchMesh($x, $y, $w, $h, $col1 = array(), $col2 = array(), $col3 = array(), $col4 = array(), $coords = array(0.00,0.0,0.33,0.00,0.67,0.00,1.00,0.00,1.00,0.33,1.00,0.67,1.00,1.00,0.67,1.00,0.33,1.00,0.00,1.00,0.00,0.67,0.00,0.33), $coords_min = 0, $coords_max = 1, $antialias = false) - { - if ($this->pdfa_mode OR ($this->state != 2)) { + public function CoonsPatchMesh($x, $y, $w, $h, $col1=array(), $col2=array(), $col3=array(), $col4=array(), $coords=array(0.00,0.0,0.33,0.00,0.67,0.00,1.00,0.00,1.00,0.33,1.00,0.67,1.00,1.00,0.67,1.00,0.33,1.00,0.00,1.00,0.00,0.67,0.00,0.33), $coords_min=0, $coords_max=1, $antialias=false) { + if (($this->pdfa_mode && $this->pdfa_version < 2) OR ($this->state != 2)) { return; } $this->Clip($x, $y, $w, $h); @@ -14784,8 +14562,8 @@ class TCPDF if ($patch_array[$i]['points'][$j] > $bpcd) { $patch_array[$i]['points'][$j] = $bpcd; } - $this->gradients[$n]['stream'] .= chr(floor($patch_array[$i]['points'][$j] / 256)); - $this->gradients[$n]['stream'] .= chr(floor($patch_array[$i]['points'][$j] % 256)); + $this->gradients[$n]['stream'] .= chr((int) floor($patch_array[$i]['points'][$j] / 256)); + $this->gradients[$n]['stream'] .= chr((int) floor(intval($patch_array[$i]['points'][$j]) % 256)); } $count_cols = count($patch_array[$i]['colors']); for ($j=0; $j < $count_cols; ++$j) { @@ -14807,16 +14585,15 @@ class TCPDF /** * Set a rectangular clipping area. - * @param $x (float) abscissa of the top left corner of the rectangle (or top right corner for RTL mode). - * @param $y (float) ordinate of the top left corner of the rectangle. - * @param $w (float) width of the rectangle. - * @param $h (float) height of the rectangle. + * @param float $x abscissa of the top left corner of the rectangle (or top right corner for RTL mode). + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. * @author Andreas W\FCrmser, Nicola Asuni * @since 3.1.000 (2008-06-09) * @protected */ - protected function Clip($x, $y, $w, $h) - { + protected function Clip($x, $y, $w, $h) { if ($this->state != 2) { return; } @@ -14834,18 +14611,17 @@ class TCPDF /** * Output gradient. - * @param $type (int) type of gradient (1 Function-based shading; 2 Axial shading; 3 Radial shading; 4 Free-form Gouraud-shaded triangle mesh; 5 Lattice-form Gouraud-shaded triangle mesh; 6 Coons patch mesh; 7 Tensor-product patch mesh). (Not all types are currently supported) - * @param $coords (array) array of coordinates. - * @param $stops (array) array gradient color components: color = array of GRAY, RGB or CMYK color components; offset = (0 to 1) represents a location along the gradient vector; exponent = exponent of the exponential interpolation function (default = 1). - * @param $background (array) An array of colour components appropriate to the colour space, specifying a single background colour value. - * @param $antialias (boolean) A flag indicating whether to filter the shading function to prevent aliasing artifacts. + * @param int $type type of gradient (1 Function-based shading; 2 Axial shading; 3 Radial shading; 4 Free-form Gouraud-shaded triangle mesh; 5 Lattice-form Gouraud-shaded triangle mesh; 6 Coons patch mesh; 7 Tensor-product patch mesh). (Not all types are currently supported) + * @param array $coords array of coordinates. + * @param array $stops array gradient color components: color = array of GRAY, RGB or CMYK color components; offset = (0 to 1) represents a location along the gradient vector; exponent = exponent of the exponential interpolation function (default = 1). + * @param array $background An array of colour components appropriate to the colour space, specifying a single background colour value. + * @param boolean $antialias A flag indicating whether to filter the shading function to prevent aliasing artifacts. * @author Nicola Asuni * @since 3.1.000 (2008-06-09) * @public */ - public function Gradient($type, $coords, $stops, $background = array(), $antialias = false) - { - if ($this->pdfa_mode OR ($this->state != 2)) { + public function Gradient($type, $coords, $stops, $background=array(), $antialias=false) { + if (($this->pdfa_mode && $this->pdfa_version < 2) OR ($this->state != 2)) { return; } $n = count($this->gradients) + 1; @@ -14858,7 +14634,7 @@ class TCPDF // color space $numcolspace = count($stops[0]['color']); $bcolor = array_values($background); - switch ($numcolspace) { + switch($numcolspace) { case 5: // SPOT case 4: { // CMYK $this->gradients[$n]['colspace'] = 'DeviceCMYK'; @@ -14901,7 +14677,7 @@ class TCPDF } if (isset($stop['opacity'])) { $this->gradients[$n]['colors'][$key]['opacity'] = $stop['opacity']; - if ((!$this->pdfa_mode) AND ($stop['opacity'] < 1)) { + if ((!($this->pdfa_mode && $this->pdfa_version < 2)) AND ($stop['opacity'] < 1)) { $this->gradients[$n]['transparency'] = true; } } else { @@ -14915,7 +14691,7 @@ class TCPDF } // set colors $color = array_values($stop['color']); - switch ($numcolspace) { + switch($numcolspace) { case 5: // SPOT case 4: { // CMYK $this->gradients[$n]['colors'][$key]['color'] = sprintf('%F %F %F %F', $color[0]/100, $color[1]/100, $color[2]/100, $color[3]/100); @@ -14951,9 +14727,8 @@ class TCPDF * @since 3.1.000 (2008-06-09) * @protected */ - function _putshaders() - { - if ($this->pdfa_mode) { + function _putshaders() { + if ($this->pdfa_mode && $this->pdfa_version < 2) { return; } $idt = count($this->gradients); //index for transparency gradients @@ -15132,42 +14907,40 @@ class TCPDF /** * Draw the sector of a circle. * It can be used for instance to render pie charts. - * @param $xc (float) abscissa of the center. - * @param $yc (float) ordinate of the center. - * @param $r (float) radius. - * @param $a (float) start angle (in degrees). - * @param $b (float) end angle (in degrees). - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $cw: (float) indicates whether to go clockwise (default: true). - * @param $o: (float) origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). Default: 90. + * @param float $xc abscissa of the center. + * @param float $yc ordinate of the center. + * @param float $r radius. + * @param float $a start angle (in degrees). + * @param float $b end angle (in degrees). + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param float $cw indicates whether to go clockwise (default: true). + * @param float $o origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). Default: 90. * @author Maxime Delorme, Nicola Asuni * @since 3.1.000 (2008-06-09) * @public */ - public function PieSector($xc, $yc, $r, $a, $b, $style = 'FD', $cw = true, $o = 90) - { + public function PieSector($xc, $yc, $r, $a, $b, $style='FD', $cw=true, $o=90) { $this->PieSectorXY($xc, $yc, $r, $r, $a, $b, $style, $cw, $o); } /** * Draw the sector of an ellipse. * It can be used for instance to render pie charts. - * @param $xc (float) abscissa of the center. - * @param $yc (float) ordinate of the center. - * @param $rx (float) the x-axis radius. - * @param $ry (float) the y-axis radius. - * @param $a (float) start angle (in degrees). - * @param $b (float) end angle (in degrees). - * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information. - * @param $cw: (float) indicates whether to go clockwise. - * @param $o: (float) origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). - * @param $nc (integer) Number of curves used to draw a 90 degrees portion of arc. + * @param float $xc abscissa of the center. + * @param float $yc ordinate of the center. + * @param float $rx the x-axis radius. + * @param float $ry the y-axis radius. + * @param float $a start angle (in degrees). + * @param float $b end angle (in degrees). + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param float $cw indicates whether to go clockwise. + * @param float $o origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). + * @param integer $nc Number of curves used to draw a 90 degrees portion of arc. * @author Maxime Delorme, Nicola Asuni * @since 3.1.000 (2008-06-09) * @public */ - public function PieSectorXY($xc, $yc, $rx, $ry, $a, $b, $style = 'FD', $cw = false, $o = 0, $nc = 2) - { + public function PieSectorXY($xc, $yc, $rx, $ry, $a, $b, $style='FD', $cw=false, $o=0, $nc=2) { if ($this->state != 2) { return; } @@ -15195,24 +14968,23 @@ class TCPDF * NOTE: EPS is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library. * Only vector drawing is supported, not text or bitmap. * Although the script was successfully tested with various AI format versions, best results are probably achieved with files that were exported in the AI3 format (tested with Illustrator CS2, Freehand MX and Photoshop CS2). - * @param $file (string) Name of the file containing the image or a '@' character followed by the EPS/AI data string. - * @param $x (float) Abscissa of the upper-left corner. - * @param $y (float) Ordinate of the upper-left corner. - * @param $w (float) Width of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param $h (float) Height of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param $link (mixed) URL or identifier returned by AddLink(). - * @param $useBoundingBox (boolean) specifies whether to position the bounding box (true) or the complete canvas (false) at location (x,y). Default value is true. - * @param $align (string) Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        - * @param $palign (string) Allows to center or align the image on the current line. Possible values are:
        • L : left align
        • C : center
        • R : right align
        • '' : empty string : left for LTR or right for RTL
        - * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param $fitonpage (boolean) if true the image is resized to not exceed page dimensions. - * @param $fixoutvals (boolean) if true remove values outside the bounding box. + * @param string $file Name of the file containing the image or a '@' character followed by the EPS/AI data string. + * @param float|null $x Abscissa of the upper-left corner. + * @param float|null $y Ordinate of the upper-left corner. + * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param mixed $link URL or identifier returned by AddLink(). + * @param boolean $useBoundingBox specifies whether to position the bounding box (true) or the complete canvas (false) at location (x,y). Default value is true. + * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        + * @param string $palign Allows to center or align the image on the current line. Possible values are:
        • L : left align
        • C : center
        • R : right align
        • '' : empty string : left for LTR or right for RTL
        + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param boolean $fitonpage if true the image is resized to not exceed page dimensions. + * @param boolean $fixoutvals if true remove values outside the bounding box. * @author Valentin Schmidt, Nicola Asuni * @since 3.1.000 (2008-06-09) * @public */ - public function ImageEps($file, $x = '', $y = '', $w = 0, $h = 0, $link = '', $useBoundingBox = true, $align = '', $palign = '', $border = 0, $fitonpage = false, $fixoutvals = false) - { + public function ImageEps($file, $x=null, $y=null, $w=0, $h=0, $link='', $useBoundingBox=true, $align='', $palign='', $border=0, $fitonpage=false, $fixoutvals=false) { if ($this->state != 2) { return; } @@ -15220,10 +14992,10 @@ class TCPDF // convert EPS to raster image using GD or ImageMagick libraries return $this->Image($file, $x, $y, $w, $h, 'EPS', $link, $align, true, 300, $palign, false, false, $border, false, false, $fitonpage); } - if ($x === '') { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary @@ -15232,19 +15004,19 @@ class TCPDF if ($file[0] === '@') { // image from string $data = substr($file, 1); } else { // EPS/AI file - $data = TCPDF_STATIC::fileGetContents($file); + $data = $this->getCachedFileContents($file); } - if ($data === false) { + if ($data === FALSE) { $this->Error('EPS file not found: '.$file); } $regs = array(); // EPS/AI compatibility check (only checks files created by Adobe Illustrator!) - preg_match("/%%Creator:([^\r\n]+)/", $data, $regs); // find Creator + preg_match("/%%Creator:([^\r\n]+)/", $data, $regs); # find Creator if (count($regs) > 1) { - $version_str = trim($regs[1]); // e.g. "Adobe Illustrator(R) 8.0" + $version_str = trim($regs[1]); # e.g. "Adobe Illustrator(R) 8.0" if (strpos($version_str, 'Adobe Illustrator') !== false) { $versexp = explode(' ', $version_str); - $version = (float) array_pop($versexp); + $version = (float)array_pop($versexp); if ($version >= 9) { $this->Error('This version of Adobe Illustrator file is not supported: '.$file); } @@ -15333,9 +15105,7 @@ class TCPDF // translate $this->_out(sprintf('%F %F %F %F %F %F cm', 1, 0, 0, 1, $dx, $dy + ($this->hPt - (2 * $y * $k) - ($y2 - $y1)))); // scale - if (isset($scale_x)) { - $this->_out(sprintf('%F %F %F %F %F %F cm', $scale_x, 0, 0, $scale_y, $x1 * (1 - $scale_x), $y2 * (1 - $scale_y))); - } + $this->_out(sprintf('%F %F %F %F %F %F cm', $scale_x, 0, 0, $scale_y, $x1 * (1 - $scale_x), $y2 * (1 - $scale_y))); // handle pc/unix/mac line endings $lines = preg_split('/[\r\n]+/si', $data, -1, PREG_SPLIT_NO_EMPTY); $u=0; @@ -15499,7 +15269,7 @@ class TCPDF $this->Link($ximg, $y, $w, $h, $link, 0); } // set pointer to align the next text/objects - switch ($align) { + switch($align) { case 'T':{ $this->y = $y; $this->x = $this->img_rb_x; @@ -15516,7 +15286,7 @@ class TCPDF break; } case 'N':{ - $this->SetY($this->img_rb_y); + $this->setY($this->img_rb_y); break; } default:{ @@ -15528,11 +15298,10 @@ class TCPDF /** * Set document barcode. - * @param $bc (string) barcode + * @param string $bc barcode * @public */ - public function setBarcode($bc = '') - { + public function setBarcode($bc='') { $this->barcode = $bc; } @@ -15542,53 +15311,51 @@ class TCPDF * @public * @since 4.0.012 (2008-07-24) */ - public function getBarcode() - { + public function getBarcode() { return $this->barcode; } /** * Print a Linear Barcode. - * @param $code (string) code to print - * @param $type (string) type of barcode (see tcpdf_barcodes_1d.php for supported formats). - * @param $x (int) x position in user units (empty string = current x position) - * @param $y (int) y position in user units (empty string = current y position) - * @param $w (int) width in user units (empty string = remaining page width) - * @param $h (int) height in user units (empty string = remaining page height) - * @param $xres (float) width of the smallest bar in user units (empty string = default value = 0.4mm) - * @param $style (array) array of options:
          - *
        • boolean $style['border'] if true prints a border
        • - *
        • int $style['padding'] padding to leave around the barcode in user units (set to 'auto' for automatic padding)
        • - *
        • int $style['hpadding'] horizontal padding in user units (set to 'auto' for automatic padding)
        • - *
        • int $style['vpadding'] vertical padding in user units (set to 'auto' for automatic padding)
        • - *
        • array $style['fgcolor'] color array for bars and text
        • - *
        • mixed $style['bgcolor'] color array for background (set to false for transparent)
        • - *
        • boolean $style['text'] if true prints text below the barcode
        • - *
        • string $style['label'] override default label
        • - *
        • string $style['font'] font name for text
        • int $style['fontsize'] font size for text
        • - *
        • int $style['stretchtext']: 0 = disabled; 1 = horizontal scaling only if necessary; 2 = forced horizontal scaling; 3 = character spacing only if necessary; 4 = forced character spacing.
        • - *
        • string $style['position'] horizontal position of the containing barcode cell on the page: L = left margin; C = center; R = right margin.
        • - *
        • string $style['align'] horizontal position of the barcode on the containing rectangle: L = left; C = center; R = right.
        • - *
        • string $style['stretch'] if true stretch the barcode to best fit the available width, otherwise uses $xres resolution for a single bar.
        • - *
        • string $style['fitwidth'] if true reduce the width to fit the barcode width + padding. When this option is enabled the 'stretch' option is automatically disabled.
        • - *
        • string $style['cellfitalign'] this option works only when 'fitwidth' is true and 'position' is unset or empty. Set the horizontal position of the containing barcode cell inside the specified rectangle: L = left; C = center; R = right.
        - * @param $align (string) Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        + * @param string $code code to print + * @param string $type type of barcode (see tcpdf_barcodes_1d.php for supported formats). + * @param float|null $x x position in user units (null = current x position) + * @param float|null $y y position in user units (null = current y position) + * @param float|null $w width in user units (null = remaining page width) + * @param float|null $h height in user units (null = remaining page height) + * @param float|null $xres width of the smallest bar in user units (null = default value = 0.4mm) + * @param array $style array of options:
          + *
        • boolean $style['border'] if true prints a border
        • + *
        • int $style['padding'] padding to leave around the barcode in user units (set to 'auto' for automatic padding)
        • + *
        • int $style['hpadding'] horizontal padding in user units (set to 'auto' for automatic padding)
        • + *
        • int $style['vpadding'] vertical padding in user units (set to 'auto' for automatic padding)
        • + *
        • array $style['fgcolor'] color array for bars and text
        • + *
        • mixed $style['bgcolor'] color array for background (set to false for transparent)
        • + *
        • boolean $style['text'] if true prints text below the barcode
        • + *
        • string $style['label'] override default label
        • + *
        • string $style['font'] font name for text
        • int $style['fontsize'] font size for text
        • + *
        • int $style['stretchtext']: 0 = disabled; 1 = horizontal scaling only if necessary; 2 = forced horizontal scaling; 3 = character spacing only if necessary; 4 = forced character spacing.
        • + *
        • string $style['position'] horizontal position of the containing barcode cell on the page: L = left margin; C = center; R = right margin.
        • + *
        • string $style['align'] horizontal position of the barcode on the containing rectangle: L = left; C = center; R = right.
        • + *
        • string $style['stretch'] if true stretch the barcode to best fit the available width, otherwise uses $xres resolution for a single bar.
        • + *
        • string $style['fitwidth'] if true reduce the width to fit the barcode width + padding. When this option is enabled the 'stretch' option is automatically disabled.
        • + *
        • string $style['cellfitalign'] this option works only when 'fitwidth' is true and 'position' is unset or empty. Set the horizontal position of the containing barcode cell inside the specified rectangle: L = left; C = center; R = right.
        + * @param string $align Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        * @author Nicola Asuni * @since 3.1.000 (2008-06-09) * @public */ - public function write1DBarcode($code, $type, $x = '', $y = '', $w = '', $h = '', $xres = '', $style = array(), $align = '') - { + public function write1DBarcode($code, $type, $x=null, $y=null, $w=null, $h=null, $xres=null, $style=array(), $align='') { if (TCPDF_STATIC::empty_string(trim($code))) { return; } - require_once dirname(__FILE__).'/tcpdf_barcodes_1d.php'; + require_once(dirname(__FILE__).'/tcpdf_barcodes_1d.php'); // save current graphic settings $gvars = $this->getGraphicVars(); // create new barcode object $barcodeobj = new TCPDFBarcode($code, $type); $arrcode = $barcodeobj->getBarcodeArray(); - if (($arrcode === false) OR empty($arrcode) OR ($arrcode['maxw'] <= 0)) { + if (empty($arrcode) OR ($arrcode['maxw'] <= 0)) { $this->Error('Error in 1D barcode string'); } if ($arrcode['maxh'] <= 0) { @@ -15637,20 +15404,20 @@ class TCPDF if (isset($style['fontsize'])) { $fontsize = $style['fontsize']; } - $this->SetFont($style['font'], '', $fontsize); + $this->setFont($style['font'], '', $fontsize); } if (!isset($style['stretchtext'])) { $style['stretchtext'] = 4; } - if ($x === '') { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary list($x, $y) = $this->checkPageRegions($h, $x, $y); - if (($w === '') OR ($w <= 0)) { + if (TCPDF_STATIC::empty_string($w) OR ($w <= 0)) { if ($this->rtl) { $w = $x - $this->lMargin; } else { @@ -15734,7 +15501,7 @@ class TCPDF } $text_height = $this->getCellHeight($fontsize / $this->k); // height - if (($h === '') OR ($h <= 0)) { + if (TCPDF_STATIC::empty_string($h) OR ($h <= 0)) { // set default height $h = (($arrcode['maxw'] * $xres) / 3) + (2 * $vpadding) + $text_height; } @@ -15744,7 +15511,7 @@ class TCPDF if ($text_height > $h) { $fontsize = (($h * $this->k) / (4 * $this->cell_height_ratio)); $text_height = $this->getCellHeight($fontsize / $this->k); - $this->SetFont($style['font'], '', $fontsize); + $this->setFont($style['font'], '', $fontsize); } if ($vpadding > 0) { $vpadding = (($h - $text_height) / 4); @@ -15809,8 +15576,8 @@ class TCPDF $this->Rect($xpos_rect, $y, $w, $h, 'D'); } // set foreground color - $this->SetDrawColorArray($style['fgcolor']); - $this->SetTextColorArray($style['fgcolor']); + $this->setDrawColorArray($style['fgcolor']); + $this->setTextColorArray($style['fgcolor']); // print bars foreach ($arrcode['bcode'] as $k => $v) { $bw = ($v['w'] * $xres); @@ -15836,8 +15603,8 @@ class TCPDF $this->x = $xpos_text; $this->y = $y + $vpadding + $barh; $cellpadding = $this->cell_padding; - $this->SetCellPadding(0); - $this->Cell($txtwidth, '', $label, 0, 0, 'C', false, '', $style['stretchtext'], false, 'T', 'T'); + $this->setCellPadding(0); + $this->Cell($txtwidth, 0, $label, 0, 0, 'C', false, '', $style['stretchtext'], false, 'T', 'T'); $this->cell_padding = $cellpadding; } // restore original direction @@ -15845,7 +15612,7 @@ class TCPDF // restore previous settings $this->setGraphicVars($gvars); // set pointer to align the next text/objects - switch ($align) { + switch($align) { case 'T':{ $this->y = $y; $this->x = $this->img_rb_x; @@ -15862,7 +15629,7 @@ class TCPDF break; } case 'N':{ - $this->SetY($this->img_rb_y); + $this->setY($this->img_rb_y); break; } default:{ @@ -15874,40 +15641,39 @@ class TCPDF /** * Print 2D Barcode. - * @param $code (string) code to print - * @param $type (string) type of barcode (see tcpdf_barcodes_2d.php for supported formats). - * @param $x (int) x position in user units - * @param $y (int) y position in user units - * @param $w (int) width in user units - * @param $h (int) height in user units - * @param $style (array) array of options:
          - *
        • boolean $style['border'] if true prints a border around the barcode
        • - *
        • int $style['padding'] padding to leave around the barcode in barcode units (set to 'auto' for automatic padding)
        • - *
        • int $style['hpadding'] horizontal padding in barcode units (set to 'auto' for automatic padding)
        • - *
        • int $style['vpadding'] vertical padding in barcode units (set to 'auto' for automatic padding)
        • - *
        • int $style['module_width'] width of a single module in points
        • - *
        • int $style['module_height'] height of a single module in points
        • - *
        • array $style['fgcolor'] color array for bars and text
        • - *
        • mixed $style['bgcolor'] color array for background or false for transparent
        • - *
        • string $style['position'] barcode position on the page: L = left margin; C = center; R = right margin; S = stretch
        • - * @param $align (string) Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:
          • T: top-right for LTR or top-left for RTL
          • M: middle-right for LTR or middle-left for RTL
          • B: bottom-right for LTR or bottom-left for RTL
          • N: next line
          - * @param $distort (boolean) if true distort the barcode to fit width and height, otherwise preserve aspect ratio + * @param string $code code to print + * @param string $type type of barcode (see tcpdf_barcodes_2d.php for supported formats). + * @param float|null $x x position in user units + * @param float|null $y y position in user units + * @param float|null $w width in user units + * @param float|null $h height in user units + * @param array $style array of options:
            + *
          • boolean $style['border'] if true prints a border around the barcode
          • + *
          • int $style['padding'] padding to leave around the barcode in barcode units (set to 'auto' for automatic padding)
          • + *
          • int $style['hpadding'] horizontal padding in barcode units (set to 'auto' for automatic padding)
          • + *
          • int $style['vpadding'] vertical padding in barcode units (set to 'auto' for automatic padding)
          • + *
          • int $style['module_width'] width of a single module in points
          • + *
          • int $style['module_height'] height of a single module in points
          • + *
          • array $style['fgcolor'] color array for bars and text
          • + *
          • mixed $style['bgcolor'] color array for background or false for transparent
          • + *
          • string $style['position'] barcode position on the page: L = left margin; C = center; R = right margin; S = stretch
          • + * @param string $align Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:
            • T: top-right for LTR or top-left for RTL
            • M: middle-right for LTR or middle-left for RTL
            • B: bottom-right for LTR or bottom-left for RTL
            • N: next line
            + * @param boolean $distort if true distort the barcode to fit width and height, otherwise preserve aspect ratio * @author Nicola Asuni * @since 4.5.037 (2009-04-07) * @public */ - public function write2DBarcode($code, $type, $x = '', $y = '', $w = '', $h = '', $style = array(), $align = '', $distort = false) - { + public function write2DBarcode($code, $type, $x=null, $y=null, $w=null, $h=null, $style=array(), $align='', $distort=false) { if (TCPDF_STATIC::empty_string(trim($code))) { return; } - require_once dirname(__FILE__).'/tcpdf_barcodes_2d.php'; + require_once(dirname(__FILE__).'/tcpdf_barcodes_2d.php'); // save current graphic settings $gvars = $this->getGraphicVars(); // create new barcode object $barcodeobj = new TCPDF2DBarcode($code, $type); $arrcode = $barcodeobj->getBarcodeArray(); - if (($arrcode === false) OR empty($arrcode) OR !isset($arrcode['num_rows']) OR ($arrcode['num_rows'] == 0) OR !isset($arrcode['num_cols']) OR ($arrcode['num_cols'] == 0)) { + if (empty($arrcode) OR !isset($arrcode['num_rows']) OR ($arrcode['num_rows'] == 0) OR !isset($arrcode['num_cols']) OR ($arrcode['num_cols'] == 0)) { $this->Error('Error in 2D barcode string'); } // set default values @@ -15948,10 +15714,10 @@ class TCPDF if (!isset($style['module_height'])) { $style['module_height'] = 1; // height of a single module in points } - if ($x === '') { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary @@ -15959,7 +15725,7 @@ class TCPDF // number of barcode columns and rows $rows = $arrcode['num_rows']; $cols = $arrcode['num_cols']; - if (($rows <= 0) || ($cols <= 0)) { + if (($rows <= 0) || ($cols <= 0)){ $this->Error('Error in 2D barcode string'); } // module width and height @@ -15993,7 +15759,7 @@ class TCPDF $h = $maxh; } // set dimensions - if ((($w === '') OR ($w <= 0)) AND (($h === '') OR ($h <= 0))) { + if ((TCPDF_STATIC::empty_string($w) OR ($w <= 0)) AND (TCPDF_STATIC::empty_string($h) OR ($h <= 0))) { $w = ($cols + $hpad) * ($mw / $this->k); $h = ($rows + $vpad) * ($mh / $this->k); } elseif (($w === '') OR ($w <= 0)) { @@ -16060,7 +15826,7 @@ class TCPDF $this->Rect($xpos, $y, $w, $h, 'D'); } // set foreground color - $this->SetDrawColorArray($style['fgcolor']); + $this->setDrawColorArray($style['fgcolor']); // print barcode cells // for each row for ($r = 0; $r < $rows; ++$r) { @@ -16080,7 +15846,7 @@ class TCPDF // restore previous settings $this->setGraphicVars($gvars); // set pointer to align the next text/objects - switch ($align) { + switch($align) { case 'T':{ $this->y = $y; $this->x = $this->img_rb_x; @@ -16097,7 +15863,7 @@ class TCPDF break; } case 'N':{ - $this->SetY($this->img_rb_y); + $this->setY($this->img_rb_y); break; } default:{ @@ -16126,8 +15892,7 @@ class TCPDF * @public * @since 3.2.000 (2008-06-23) */ - public function getMargins() - { + public function getMargins() { $ret = array( 'left' => $this->lMargin, 'right' => $this->rMargin, @@ -16154,8 +15919,7 @@ class TCPDF * @public * @since 4.0.012 (2008-07-24) */ - public function getOriginalMargins() - { + public function getOriginalMargins() { $ret = array( 'left' => $this->original_lMargin, 'right' => $this->original_rMargin @@ -16165,23 +15929,21 @@ class TCPDF /** * Returns the current font size. - * @return current font size + * @return float current font size * @public * @since 3.2.000 (2008-06-23) */ - public function getFontSize() - { + public function getFontSize() { return $this->FontSize; } /** * Returns the current font size in points unit. - * @return current font size in points unit + * @return int current font size in points unit * @public * @since 3.2.000 (2008-06-23) */ - public function getFontSizePt() - { + public function getFontSizePt() { return $this->FontSizePt; } @@ -16191,8 +15953,7 @@ class TCPDF * @public * @since 4.3.008 (2008-12-05) */ - public function getFontFamily() - { + public function getFontFamily() { return $this->FontFamily; } @@ -16202,37 +15963,34 @@ class TCPDF * @public * @since 4.3.008 (2008-12-05) */ - public function getFontStyle() - { + public function getFontStyle() { return $this->FontStyle; } /** * Cleanup HTML code (requires HTML Tidy library). - * @param $html (string) htmlcode to fix - * @param $default_css (string) CSS commands to add - * @param $tagvs (array) parameters for setHtmlVSpace method - * @param $tidy_options (array) options for tidy_parse_string function + * @param string $html htmlcode to fix + * @param string $default_css CSS commands to add + * @param array|null $tagvs parameters for setHtmlVSpace method + * @param array|null $tidy_options options for tidy_parse_string function * @return string XHTML code cleaned up * @author Nicola Asuni * @public * @since 5.9.017 (2010-11-16) * @see setHtmlVSpace() */ - public function fixHTMLCode($html, $default_css = '', $tagvs = '', $tidy_options = '') - { + public function fixHTMLCode($html, $default_css='', $tagvs=null, $tidy_options=null) { return TCPDF_STATIC::fixHTMLCode($html, $default_css, $tagvs, $tidy_options, $this->tagvspaces); } /** * Returns the border width from CSS property - * @param $width (string) border width + * @param string $width border width * @return int with in user units * @protected * @since 5.7.000 (2010-08-02) */ - protected function getCSSBorderWidth($width) - { + protected function getCSSBorderWidth($width) { if ($width == 'thin') { $width = (2 / $this->k); } elseif ($width == 'medium') { @@ -16247,13 +16005,12 @@ class TCPDF /** * Returns the border dash style from CSS property - * @param $style (string) border style to convert + * @param string $style border style to convert * @return int sash style (return -1 in case of none or hidden border) * @protected * @since 5.7.000 (2010-08-02) */ - protected function getCSSBorderDashStyle($style) - { + protected function getCSSBorderDashStyle($style) { switch (strtolower($style)) { case 'none': case 'hidden': { @@ -16284,22 +16041,21 @@ class TCPDF /** * Returns the border style array from CSS border properties - * @param $cssborder (string) border properties + * @param string $cssborder border properties * @return array containing border properties * @protected * @since 5.7.000 (2010-08-02) */ - protected function getCSSBorderStyle($cssborder) - { + protected function getCSSBorderStyle($cssborder) { $bprop = preg_split('/[\s]+/', trim($cssborder)); + $count = count($bprop); + if ($count > 0 && $bprop[$count - 1] === '!important') { + unset($bprop[$count - 1]); + --$count; + } + $border = array(); // value to be returned - switch (count($bprop)) { - case 3: { - $width = $bprop[0]; - $style = $bprop[1]; - $color = $bprop[2]; - break; - } + switch ($count) { case 2: { $width = 'medium'; $style = $bprop[0]; @@ -16312,12 +16068,18 @@ class TCPDF $color = 'black'; break; } - default: { + case 0: { $width = 'medium'; $style = 'solid'; $color = 'black'; break; } + default: { + $width = $bprop[0]; + $style = $bprop[1]; + $color = $bprop[2]; + break; + } } if ($style == 'none') { return array(); @@ -16335,14 +16097,13 @@ class TCPDF /** * Get the internal Cell padding from CSS attribute. - * @param $csspadding (string) padding properties - * @param $width (float) width of the containing element + * @param string $csspadding padding properties + * @param float $width width of the containing element * @return array of cell paddings * @public * @since 5.9.000 (2010-10-04) */ - public function getCSSPadding($csspadding, $width = 0) - { + public function getCSSPadding($csspadding, $width=0) { $padding = preg_split('/[\s]+/', trim($csspadding)); $cell_padding = array(); // value to be returned switch (count($padding)) { @@ -16390,14 +16151,13 @@ class TCPDF /** * Get the internal Cell margin from CSS attribute. - * @param $cssmargin (string) margin properties - * @param $width (float) width of the containing element + * @param string $cssmargin margin properties + * @param float $width width of the containing element * @return array of cell margins * @public * @since 5.9.000 (2010-10-04) */ - public function getCSSMargin($cssmargin, $width = 0) - { + public function getCSSMargin($cssmargin, $width=0) { $margin = preg_split('/[\s]+/', trim($cssmargin)); $cell_margin = array(); // value to be returned switch (count($margin)) { @@ -16445,14 +16205,13 @@ class TCPDF /** * Get the border-spacing from CSS attribute. - * @param $cssbspace (string) border-spacing CSS properties - * @param $width (float) width of the containing element + * @param string $cssbspace border-spacing CSS properties + * @param float $width width of the containing element * @return array of border spacings * @public * @since 5.9.010 (2010-10-27) */ - public function getCSSBorderMargin($cssbspace, $width = 0) - { + public function getCSSBorderMargin($cssbspace, $width=0) { $space = preg_split('/[\s]+/', trim($cssbspace)); $border_spacing = array(); // value to be returned switch (count($space)) { @@ -16480,14 +16239,13 @@ class TCPDF /** * Returns the letter-spacing value from CSS value - * @param $spacing (string) letter-spacing value - * @param $parent (float) font spacing (tracking) value of the parent element + * @param string $spacing letter-spacing value + * @param float $parent font spacing (tracking) value of the parent element * @return float quantity to increases or decreases the space between characters in a text. * @protected * @since 5.9.000 (2010-10-02) */ - protected function getCSSFontSpacing($spacing, $parent = 0) - { + protected function getCSSFontSpacing($spacing, $parent=0) { $val = 0; // value to be returned $spacing = trim($spacing); switch ($spacing) { @@ -16512,14 +16270,13 @@ class TCPDF /** * Returns the percentage of font stretching from CSS value - * @param $stretch (string) stretch mode - * @param $parent (float) stretch value of the parent element + * @param string $stretch stretch mode + * @param float $parent stretch value of the parent element * @return float font stretching percentage * @protected * @since 5.9.000 (2010-10-02) */ - protected function getCSSFontStretching($stretch, $parent = 100) - { + protected function getCSSFontStretching($stretch, $parent=100) { $val = 100; // value to be returned $stretch = trim($stretch); switch ($stretch) { @@ -16584,15 +16341,14 @@ class TCPDF /** * Convert HTML string containing font size value to points - * @param $val (string) String containing font size value and unit. - * @param $refsize (float) Reference font size in points. - * @param $parent_size (float) Parent font size in points. - * @param $defaultunit (string) Default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt). + * @param string $val String containing font size value and unit. + * @param float $refsize Reference font size in points. + * @param float $parent_size Parent font size in points. + * @param string $defaultunit Default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt). * @return float value in points * @public */ - public function getHTMLFontUnits($val, $refsize = 12, $parent_size = 12, $defaultunit = 'pt') - { + public function getHTMLFontUnits($val, $refsize=12, $parent_size=12, $defaultunit='pt') { $refsize = TCPDF_FONTS::getFontRefSize($refsize); $parent_size = TCPDF_FONTS::getFontRefSize($parent_size, $refsize); switch ($val) { @@ -16633,6 +16389,7 @@ class TCPDF break; } default: { + $parentSize = $this->getHTMLUnitToUnits($parent_size, $refsize, $defaultunit, true); $size = $this->getHTMLUnitToUnits($val, $parent_size, $defaultunit, true); } } @@ -16641,26 +16398,72 @@ class TCPDF /** * Returns the HTML DOM array. - * @param $html (string) html code + * @param string $html html code * @return array * @protected * @since 3.2.000 (2008-06-20) */ - protected function getHtmlDomArray($html) - { + protected function getHtmlDomArray($html) { + // set inheritable properties fot the first void element + // possible inheritable properties are: azimuth, border-collapse, border-spacing, caption-side, color, cursor, direction, empty-cells, font, font-family, font-stretch, font-size, font-size-adjust, font-style, font-variant, font-weight, letter-spacing, line-height, list-style, list-style-image, list-style-position, list-style-type, orphans, page, page-break-inside, quotes, speak, speak-header, text-align, text-indent, text-transform, volume, white-space, widows, word-spacing + $dom = array( + array( + 'tag' => false, + 'block' => false, + 'value' => '', + 'parent' => 0, + 'hide' => false, + 'fontname' => $this->FontFamily, + 'fontstyle' => $this->FontStyle, + 'fontsize' => $this->FontSizePt, + 'font-stretch' => $this->font_stretching, + 'letter-spacing' => $this->font_spacing, + 'stroke' => $this->textstrokewidth, + 'fill' => (($this->textrendermode % 2) == 0), + 'clip' => ($this->textrendermode > 3), + 'line-height' => $this->cell_height_ratio, + 'bgcolor' => false, + 'fgcolor' => $this->fgcolor, // color + 'strokecolor' => $this->strokecolor, + 'align' => '', + 'listtype' => '', + 'text-indent' => 0, + 'text-transform' => '', + 'border' => array(), + 'dir' => $this->rtl?'rtl':'ltr', + 'width' => 0, + 'height' => 0, + 'x' => 0, + 'y' => 0, + 'w' => 0, + 'h' => 0, + 'l' => 0, + 't' => 0, + 'r' => 0, + 'b' => 0, + 'padding' => array('T' => 0, 'R' => 0, 'B' => 0, 'L' => 0), + 'margin' => array('T' => 0, 'R' => 0, 'B' => 0, 'L' => 0), + 'border-spacing' => array('H' => 0, 'V' => 0), + 'border-collapse' => 'separate', + ) + ); + + if(empty($html)) { + return $dom; + } // array of CSS styles ( selector => properties). $css = array(); // get CSS array defined at previous call $matches = array(); - if (preg_match_all('/([^\<]*)<\/cssarray>/isU', $html, $matches) > 0) { + if (preg_match_all('/([^\<]*?)<\/cssarray>/is', $html, $matches) > 0) { if (isset($matches[1][0])) { $css = array_merge($css, json_decode($this->unhtmlentities($matches[1][0]), true)); } - $html = preg_replace('/(.*?)<\/cssarray>/isU', '', $html); + $html = preg_replace('/(.*?)<\/cssarray>/is', '', $html); } // extract external CSS files $matches = array(); - if (preg_match_all('/]*)>/isU', $html, $matches) > 0) { + if (preg_match_all('/]*?)>/is', $html, $matches) > 0) { foreach ($matches[1] as $key => $link) { $type = array(); if (preg_match('/type[\s]*=[\s]*"text\/css"/', $link, $type)) { @@ -16672,8 +16475,8 @@ class TCPDF $type = array(); if (preg_match('/href[\s]*=[\s]*"([^"]*)"/', $link, $type) > 0) { // read CSS data file - $cssdata = TCPDF_STATIC::fileGetContents(trim($type[1])); - if (($cssdata !== false) AND (strlen($cssdata) > 0)) { + $cssdata = $this->getCachedFileContents(trim($type[1])); + if (($cssdata !== FALSE) AND (strlen($cssdata) > 0)) { $css = array_merge($css, TCPDF_STATIC::extractCSSproperties($cssdata)); } } @@ -16683,7 +16486,7 @@ class TCPDF } // extract style tags $matches = array(); - if (preg_match_all('/]*)>([^\<]*)<\/style>/isU', $html, $matches) > 0) { + if (preg_match_all('/]*?)>([^\<]*?)<\/style>/is', $html, $matches) > 0) { foreach ($matches[1] as $key => $media) { $type = array(); preg_match('/media[\s]*=[\s]*"([^"]*)"/', $media, $type); @@ -16698,8 +16501,8 @@ class TCPDF // create a special tag to contain the CSS array (used for table content) $csstagarray = ''.htmlentities(json_encode($css)).''; // remove head and style blocks - $html = preg_replace('/]*)>(.*?)<\/head>/siU', '', $html); - $html = preg_replace('/]*)>([^\<]*)<\/style>/isU', '', $html); + $html = preg_replace('/]*?)>(.*?)<\/head>/is', '', $html); + $html = preg_replace('/]*?)>([^\<]*?)<\/style>/is', '', $html); // define block tags $blocktags = array('blockquote','br','dd','dl','div','dt','h1','h2','h3','h4','h5','h6','hr','li','ol','p','pre','ul','tcpdf','table','tr','td'); // define self-closing tags @@ -16792,37 +16595,8 @@ class TCPDF // count elements $maxel = count($a); $elkey = 0; - $key = 0; - // create an array of elements - $dom = array(); - $dom[$key] = array(); - // set inheritable properties fot the first void element - // possible inheritable properties are: azimuth, border-collapse, border-spacing, caption-side, color, cursor, direction, empty-cells, font, font-family, font-stretch, font-size, font-size-adjust, font-style, font-variant, font-weight, letter-spacing, line-height, list-style, list-style-image, list-style-position, list-style-type, orphans, page, page-break-inside, quotes, speak, speak-header, text-align, text-indent, text-transform, volume, white-space, widows, word-spacing - $dom[$key]['tag'] = false; - $dom[$key]['block'] = false; - $dom[$key]['value'] = ''; - $dom[$key]['parent'] = 0; - $dom[$key]['hide'] = false; - $dom[$key]['fontname'] = $this->FontFamily; - $dom[$key]['fontstyle'] = $this->FontStyle; - $dom[$key]['fontsize'] = $this->FontSizePt; - $dom[$key]['font-stretch'] = $this->font_stretching; - $dom[$key]['letter-spacing'] = $this->font_spacing; - $dom[$key]['stroke'] = $this->textstrokewidth; - $dom[$key]['fill'] = (($this->textrendermode % 2) == 0); - $dom[$key]['clip'] = ($this->textrendermode > 3); - $dom[$key]['line-height'] = $this->cell_height_ratio; - $dom[$key]['bgcolor'] = false; - $dom[$key]['fgcolor'] = $this->fgcolor; // color - $dom[$key]['strokecolor'] = $this->strokecolor; - $dom[$key]['align'] = ''; - $dom[$key]['listtype'] = ''; - $dom[$key]['text-indent'] = 0; - $dom[$key]['text-transform'] = ''; - $dom[$key]['border'] = array(); - $dom[$key]['dir'] = $this->rtl?'rtl':'ltr'; $thead = false; // true when we are inside the THEAD tag - ++$key; + $key = 1; $level = array(); array_push($level, 0); // root while ($elkey < $maxel) { @@ -16893,7 +16667,11 @@ class TCPDF $dom[($dom[$key]['parent'])]['content'] = str_replace('', '', $dom[($dom[$key]['parent'])]['content']); } // store header rows on a new table - if (($dom[$key]['value'] == 'tr') AND ($dom[($dom[$key]['parent'])]['thead'] === true)) { + if ( + ($dom[$key]['value'] === 'tr') + && !empty($dom[($dom[$key]['parent'])]['thead']) + && ($dom[($dom[$key]['parent'])]['thead'] === true) + ) { if (TCPDF_STATIC::empty_string($dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'])) { $dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'] = $csstagarray.$a[$dom[($dom[($dom[$key]['parent'])]['parent'])]['elkey']]; } @@ -16950,9 +16728,9 @@ class TCPDF // get attributes preg_match_all('/([^=\s]*)[\s]*=[\s]*"([^"]*)"/', $element, $attr_array, PREG_PATTERN_ORDER); $dom[$key]['attribute'] = array(); // reset attribute array - foreach ($attr_array[1] as $id => $name) { - $dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id]; - } + foreach($attr_array[1] as $id => $name) { + $dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id]; + } if (!empty($css)) { // merge CSS style to current style list($dom[$key]['csssel'], $dom[$key]['cssdata']) = TCPDF_STATIC::getCSSdataArray($dom, $key, $css); @@ -16963,10 +16741,10 @@ class TCPDF // get style attributes preg_match_all('/([^;:\s]*):([^;]*)/', $dom[$key]['attribute']['style'], $style_array, PREG_PATTERN_ORDER); $dom[$key]['style'] = array(); // reset style attribute array - foreach ($style_array[1] as $id => $name) { - // in case of duplicate attribute the last replace the previous - $dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]); - } + foreach($style_array[1] as $id => $name) { + // in case of duplicate attribute the last replace the previous + $dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]); + } // --- get some style attributes --- // text direction if (isset($dom[$key]['style']['direction'])) { @@ -17323,10 +17101,20 @@ class TCPDF // rows on thead block are printed as a separate table } else { $dom[$key]['thead'] = false; + $parent = $dom[$key]['parent']; + + if (!isset($dom[$parent]['rows'])) { + $dom[$parent]['rows'] = 0; + } // store the number of rows on table element - ++$dom[($dom[$key]['parent'])]['rows']; + ++$dom[$parent]['rows']; + + if (!isset($dom[$parent]['trids'])) { + $dom[$parent]['trids'] = array(); + } + // store the TR elements IDs on table element - array_push($dom[($dom[$key]['parent'])]['trids'], $key); + array_push($dom[$parent]['trids'], $key); } } if (($dom[$key]['value'] == 'th') OR ($dom[$key]['value'] == 'td')) { @@ -17419,6 +17207,7 @@ class TCPDF } } } + $element = preg_replace("/&NBSP;/i", " ", $element); } $dom[$key]['value'] = stripslashes($this->unhtmlentities($element)); } @@ -17435,8 +17224,7 @@ class TCPDF * @author Nicola Asuni * @since 4.8.024 (2010-01-15) */ - protected function getSpaceString() - { + protected function getSpaceString() { $spacestr = chr(32); if ($this->isUnicodeFont()) { $spacestr = chr(0).chr(32); @@ -17445,44 +17233,59 @@ class TCPDF } /** - * Return an hash code used to ensure that the serialized data has been generated by this TCPDF instance. - * @param $data (string) serialized data - * @return string - * @public static + * Calculates the hash value of the given data. + * + * @param string $data The data to be hashed. + * @return string The hashed value of the data. */ - protected function getHashForTCPDFtagParams($data) - { - return md5(strlen($data).$this->file_id.$data); + protected function hashTCPDFtag($data) { + return hash_hmac('sha256', $data, $this->hash_key, false); } /** - * Serialize an array of parameters to be used with TCPDF tag in HTML code. - * @param $data (array) parameters array - * @return string containing serialized data + * Serialize data to be used with TCPDF tag in HTML code. + * @param string $method TCPDF method name + * @param array $params Method parameters + * @return string Serialized data * @public static */ - public function serializeTCPDFtagParameters($data) - { + public function serializeTCPDFtag($method, $params=array()) { + $data = array('m' => $method, 'p' => $params); $encoded = urlencode(json_encode($data)); - return $this->getHashForTCPDFtagParams($encoded).$encoded; + $hash = $this->hashTCPDFtag($encoded); + return strlen($hash).'+'.$hash.'+'.$encoded; } /** - * Unserialize parameters to be used with TCPDF tag in HTML code. - * @param $data (string) serialized data + * Unserialize data to be used with TCPDF tag in HTML code. + * @param string $data serialized data * @return array containing unserialized data * @protected static */ - protected function unserializeTCPDFtagParameters($data) - { - $hash = substr($data, 0, 32); - $encoded = substr($data, 32); - if ($hash != $this->getHashForTCPDFtagParams($encoded)) { + protected function unserializeTCPDFtag($data) { + $hpos = strpos($data, '+'); + $hlen = intval(substr($data, 0, $hpos)); + $hash = substr($data, $hpos + 1, $hlen); + $encoded = substr($data, $hpos + 2 + $hlen); + if ($hash != $this->hashTCPDFtag($encoded)) { $this->Error('Invalid parameters'); } return json_decode(urldecode($encoded), true); } + /** + * Check if a TCPDF tag is allowed + * @param string $method TCPDF method name + * @return boolean + * @protected + */ + protected function allowedTCPDFtag($method) { + if (defined('K_ALLOWED_TCPDF_TAGS')) { + return (strpos(K_ALLOWED_TCPDF_TAGS, '|'.$method.'|') !== false); + } + return false; + } + /** * Prints a cell (rectangular area) with optional borders, background color and html text string. * The upper-left corner of the cell corresponds to the current position. After the call, the current position moves to the right or to the next line.
            @@ -17490,22 +17293,21 @@ class TCPDF * IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting. * Supported tags are: a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul * NOTE: all the HTML attributes must be enclosed in double-quote. - * @param $w (float) Cell width. If 0, the cell extends up to the right margin. - * @param $h (float) Cell minimum height. The cell extends automatically if needed. - * @param $x (float) upper-left corner X coordinate - * @param $y (float) upper-left corner Y coordinate - * @param $html (string) html text to print. Default value: empty string. - * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
            • 0: no border (default)
            • 1: frame
            or a string containing some or all of the following characters (in any order):
            • L: left
            • T: top
            • R: right
            • B: bottom
            or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param $ln (int) Indicates where the current position should go after the call. Possible values are:
            • 0: to the right (or left for RTL language)
            • 1: to the beginning of the next line
            • 2: below
            Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. - * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false). - * @param $reseth (boolean) if true reset the last cell height (default true). - * @param $align (string) Allows to center or align the text. Possible values are:
            • L : left align
            • C : center
            • R : right align
            • '' : empty string : left for LTR or right for RTL
            - * @param $autopadding (boolean) if true, uses internal padding and automatically adjust it to account for line width. + * @param float $w Cell width. If 0, the cell extends up to the right margin. + * @param float $h Cell minimum height. The cell extends automatically if needed. + * @param float|null $x upper-left corner X coordinate + * @param float|null $y upper-left corner Y coordinate + * @param string $html html text to print. Default value: empty string. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
            • 0: no border (default)
            • 1: frame
            or a string containing some or all of the following characters (in any order):
            • L: left
            • T: top
            • R: right
            • B: bottom
            or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param int $ln Indicates where the current position should go after the call. Possible values are:
            • 0: to the right (or left for RTL language)
            • 1: to the beginning of the next line
            • 2: below
            Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param boolean $reseth if true reset the last cell height (default true). + * @param string $align Allows to center or align the text. Possible values are:
            • L : left align
            • C : center
            • R : right align
            • '' : empty string : left for LTR or right for RTL
            + * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width. * @see Multicell(), writeHTML() * @public */ - public function writeHTMLCell($w, $h, $x, $y, $html = '', $border = 0, $ln = 0, $fill = false, $reseth = true, $align = '', $autopadding = true) - { + public function writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=false, $reseth=true, $align='', $autopadding=true) { return $this->MultiCell($w, $h, $html, $border, $align, $fill, $ln, $x, $y, $reseth, 0, true, $autopadding, 0, 'T', false); } @@ -17514,16 +17316,15 @@ class TCPDF * IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting. * Supported tags are: a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul * NOTE: all the HTML attributes must be enclosed in double-quote. - * @param $html (string) text to display - * @param $ln (boolean) if true add a new line after text (default = true) - * @param $fill (boolean) Indicates if the background must be painted (true) or transparent (false). - * @param $reseth (boolean) if true reset the last cell height (default false). - * @param $cell (boolean) if true add the current left (or right for RTL) padding to each Write (default false). - * @param $align (string) Allows to center or align the text. Possible values are:
            • L : left align
            • C : center
            • R : right align
            • '' : empty string : left for LTR or right for RTL
            + * @param string $html text to display + * @param boolean $ln if true add a new line after text (default = true) + * @param boolean $fill Indicates if the background must be painted (true) or transparent (false). + * @param boolean $reseth if true reset the last cell height (default false). + * @param boolean $cell if true add the current left (or right for RTL) padding to each Write (default false). + * @param string $align Allows to center or align the text. Possible values are:
            • L : left align
            • C : center
            • R : right align
            • '' : empty string : left for LTR or right for RTL
            * @public */ - public function writeHTML($html, $ln = true, $fill = false, $reseth = false, $cell = false, $align = '') - { + public function writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='') { $gvars = $this->getGraphicVars(); // store current values $prev_cell_margin = $this->cell_margin; @@ -17631,6 +17432,7 @@ class TCPDF ++$key; } } + if ($key == $maxel) break; if ($dom[$key]['tag'] AND isset($dom[$key]['attribute']['pagebreak'])) { // check for pagebreak if (($dom[$key]['attribute']['pagebreak'] == 'true') OR ($dom[$key]['attribute']['pagebreak'] == 'left') OR ($dom[$key]['attribute']['pagebreak'] == 'right')) { @@ -17910,7 +17712,7 @@ class TCPDF $this->cell_height_ratio = $dom[$key]['line-height']; $fontaligned = true; } - $this->SetFont($fontname, $fontstyle, $fontsize); + $this->setFont($fontname, $fontstyle, $fontsize); // reset row height $this->resetLastH(); $curfontname = $fontname; @@ -17937,16 +17739,16 @@ class TCPDF // get current position on page buffer $curpos = $this->pagelen[$startlinepage]; if (isset($dom[$key]['bgcolor']) AND ($dom[$key]['bgcolor'] !== false)) { - $this->SetFillColorArray($dom[$key]['bgcolor']); + $this->setFillColorArray($dom[$key]['bgcolor']); $wfill = true; } else { $wfill = $fill | false; } if (isset($dom[$key]['fgcolor']) AND ($dom[$key]['fgcolor'] !== false)) { - $this->SetTextColorArray($dom[$key]['fgcolor']); + $this->setTextColorArray($dom[$key]['fgcolor']); } if (isset($dom[$key]['strokecolor']) AND ($dom[$key]['strokecolor'] !== false)) { - $this->SetDrawColorArray($dom[$key]['strokecolor']); + $this->setDrawColorArray($dom[$key]['strokecolor']); } if (isset($dom[$key]['align'])) { $lalign = $dom[$key]['align']; @@ -18004,7 +17806,7 @@ class TCPDF $pend = ''; } } - if ((isset($plalign) AND ((($plalign == 'C') OR ($plalign == 'J') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { + if ((((($plalign == 'C') OR ($plalign == 'J') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { // calculate shifting amount $tw = $w; if (($plalign == 'J') AND $this->isRTLTextDir() AND ($this->num_columns > 1)) { @@ -18181,7 +17983,7 @@ class TCPDF } // justify block if (preg_match('/([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s]('.$strpiece[2][0].')([\s]*)/x', $pmid, $pmatch) == 1) { - $newpmid = sprintf('%F', (floatval($pmatch[1]) + $spacew)).' '.$pmatch[2].' x*#!#*x'.$pmatch[3].$pmatch[4]; + $newpmid = sprintf('%F',(floatval($pmatch[1]) + $spacew)).' '.$pmatch[2].' x*#!#*x'.$pmatch[3].$pmatch[4]; $pmid = str_replace($pmatch[0], $newpmid, $pmid); unset($pmatch, $newpmid); } @@ -18226,8 +18028,8 @@ class TCPDF } } if (preg_match('/('.$xmatches[1].')[\s]('.$xmatches[2].')[\s]('.$xmatches[3].')[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x', $pmid, $pmatch) == 1) { - $newx = sprintf('%F', (floatval($pmatch[1]) + $x_diff)); - $neww = sprintf('%F', (floatval($pmatch[3]) + $w_diff)); + $newx = sprintf('%F',(floatval($pmatch[1]) + $x_diff)); + $neww = sprintf('%F',(floatval($pmatch[3]) + $w_diff)); $newpmid = $newx.' '.$pmatch[2].' '.$neww.' '.$pmatch[4].' x*#!#*x'.$pmatch[5].$pmatch[6]; $pmid = str_replace($pmatch[0], $newpmid, $pmid); unset($pmatch, $newpmid, $newx, $neww); @@ -18243,9 +18045,9 @@ class TCPDF $currentxpos = $xmatches[1]; // justify block if (preg_match('/('.$xmatches[1].')[\s]('.$xmatches[2].')[\s]('.$xmatches[3].')[\s]('.$xmatches[4].')[\s]('.$xmatches[5].')[\s]('.$strpiece[1][0].')[\s](c)([\s]*)/x', $pmid, $pmatch) == 1) { - $newx1 = sprintf('%F', (floatval($pmatch[1]) + $spacew)); - $newx2 = sprintf('%F', (floatval($pmatch[3]) + $spacew)); - $newx3 = sprintf('%F', (floatval($pmatch[5]) + $spacew)); + $newx1 = sprintf('%F',(floatval($pmatch[1]) + $spacew)); + $newx2 = sprintf('%F',(floatval($pmatch[3]) + $spacew)); + $newx3 = sprintf('%F',(floatval($pmatch[5]) + $spacew)); $newpmid = $newx1.' '.$pmatch[2].' '.$newx2.' '.$pmatch[4].' '.$newx3.' '.$pmatch[6].' x*#!#*x'.$pmatch[7].$pmatch[8]; $pmid = str_replace($pmatch[0], $newpmid, $pmid); unset($pmatch, $newpmid, $newx1, $newx2, $newx3); @@ -18297,13 +18099,13 @@ class TCPDF $pmid = preg_replace('/[\\\][\(]/x', '\\#!#OP#!#', $pmid); $pmid = preg_replace('/[\\\][\)]/x', '\\#!#CP#!#', $pmid); if (preg_match_all('/\[\(([^\)]*)\)\]/x', $pmid, $pamatch) > 0) { - foreach ($pamatch[0] as $pk => $pmatch) { + foreach($pamatch[0] as $pk => $pmatch) { $replace = $pamatch[1][$pk]; $replace = str_replace('#!#OP#!#', '(', $replace); $replace = str_replace('#!#CP#!#', ')', $replace); $newpmid = '[('.str_replace(chr(0).chr(32), ') '.sprintf('%F', $spacew).' (', $replace).')]'; $pos = strpos($pmid, $pmatch, $pos); - if ($pos !== false) { + if ($pos !== FALSE) { $pmid = substr_replace($pmid, $newpmid, $pos, strlen($pmatch)); } ++$pos; @@ -18405,9 +18207,9 @@ class TCPDF if (!($dom[$key]['tag'] AND !$dom[$key]['opening'] AND ($dom[$key]['value'] == 'table') AND (isset($this->emptypagemrk[$this->page])) AND ($this->emptypagemrk[$this->page] == $this->pagelen[$this->page]))) { - $this->SetFont($fontname, $fontstyle, $fontsize); + $this->setFont($fontname, $fontstyle, $fontsize); if ($wfill) { - $this->SetFillColorArray($this->bgcolor); + $this->setFillColorArray($this->bgcolor); } } } // end newline @@ -18610,7 +18412,7 @@ class TCPDF $dom[$trid]['cellpos'][($cellid - 1)]['bgcolor'] = $dom[$parentid]['bgcolor']; } // store border info - if (isset($tdborder) AND !empty($tdborder)) { + if (!empty($tdborder)) { $dom[$trid]['cellpos'][($cellid - 1)]['border'] = $tdborder; } $prevLastH = $this->lasth; @@ -18707,14 +18509,14 @@ class TCPDF } elseif (strlen($dom[$key]['value']) > 0) { // print list-item if (!TCPDF_STATIC::empty_string($this->lispacer) AND ($this->lispacer != '^')) { - $this->SetFont($pfontname, $pfontstyle, $pfontsize); + $this->setFont($pfontname, $pfontstyle, $pfontsize); $this->resetLastH(); $minstartliney = $this->y; $maxbottomliney = ($startliney + $this->getCellHeight($this->FontSize)); if (is_numeric($pfontsize) AND ($pfontsize > 0)) { $this->putHtmlListBullet($this->listnum, $this->lispacer, $pfontsize); } - $this->SetFont($curfontname, $curfontstyle, $curfontsize); + $this->setFont($curfontname, $curfontstyle, $curfontsize); $this->resetLastH(); if (is_numeric($pfontsize) AND ($pfontsize > 0) AND is_numeric($curfontsize) AND ($curfontsize > 0) AND ($pfontsize != $curfontsize)) { $pfontascent = $this->getFontAscent($pfontname, $pfontstyle, $pfontsize); @@ -18846,7 +18648,7 @@ class TCPDF $strrest = $this->Write($this->lasth, $dom[$key]['value'], '', $wfill, '', false, 0, true, $firstblock, 0, $wadj); // restore default direction if ($reverse_dir AND ($wadj == 0)) { - $this->x = $xws; + $this->x = $xws; // @phpstan-ignore-line $this->rtl = !$this->rtl; $reverse_dir = false; } @@ -18876,8 +18678,8 @@ class TCPDF } else { $loop = 0; // add the positive font spacing of the last character (if any) - if ($this->font_spacing > 0) { - if ($this->rtl) { + if ($this->font_spacing > 0) { + if ($this->rtl) { $this->x -= $this->font_spacing; } else { $this->x += $this->font_spacing; @@ -18955,7 +18757,7 @@ class TCPDF $pend = ''; } } - if ((isset($plalign) AND ((($plalign == 'C') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { + if ((((($plalign == 'C') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { // calculate shifting amount $tw = $w; if ($this->lMargin != $prevlMargin) { @@ -19075,14 +18877,13 @@ class TCPDF /** * Process opening tags. - * @param $dom (array) html dom array - * @param $key (int) current element id - * @param $cell (boolean) if true add the default left (or right if RTL) padding to each new line (default false). - * @return $dom array + * @param array $dom html dom array + * @param int $key current element id + * @param boolean $cell if true add the default left (or right if RTL) padding to each new line (default false). + * @return array $dom * @protected */ - protected function openHTMLTagHandler($dom, $key, $cell) - { + protected function openHTMLTagHandler($dom, $key, $cell) { $tag = $dom[$key]; $parent = $dom[($dom[$key]['parent'])]; $firsttag = ($key == 1); @@ -19147,7 +18948,7 @@ class TCPDF } } // Opening tag - switch ($tag['value']) { + switch($tag['value']) { case 'table': { $cp = 0; $cs = 0; @@ -19173,7 +18974,7 @@ class TCPDF $dom[$key]['old_cell_padding'] = $this->cell_padding; if (isset($tag['attribute']['cellpadding'])) { $pad = $this->getHTMLUnitToUnits($tag['attribute']['cellpadding'], 1, 'px'); - $this->SetCellPadding($pad); + $this->setCellPadding($pad); } elseif (isset($tag['padding'])) { $this->cell_padding = $tag['padding']; } @@ -19214,9 +19015,37 @@ class TCPDF $hrWidth = $wtmp; } $prevlinewidth = $this->GetLineWidth(); - $this->SetLineWidth($hrHeight); - $this->Line($x, $y, $x + $hrWidth, $y); - $this->SetLineWidth($prevlinewidth); + $this->setLineWidth($hrHeight); + + $lineStyle = array(); + if (isset($tag['fgcolor'])) { + $lineStyle['color'] = $tag['fgcolor']; + } + + if (isset($tag['fgcolor'])) { + $lineStyle['color'] = $tag['fgcolor']; + } + + if (isset($tag['style']['cap'])) { + $lineStyle['cap'] = $tag['style']['cap']; + } + + if (isset($tag['style']['join'])) { + $lineStyle['join'] = $tag['style']['join']; + } + + if (isset($tag['style']['dash'])) { + $lineStyle['dash'] = $tag['style']['dash']; + } + + if (isset($tag['style']['phase'])) { + $lineStyle['phase'] = $tag['style']['phase']; + } + + $lineStyle = array_filter($lineStyle); + + $this->Line($x, $y, $x + $hrWidth, $y, $lineStyle); + $this->setLineWidth($prevlinewidth); $this->addHTMLVertSpace(max($hbc, ($hrHeight / 2)), 0, $cell, !isset($dom[($key + 1)])); break; } @@ -19235,7 +19064,14 @@ class TCPDF // data stream $imgsrc = '@'.base64_decode(substr($imgsrc, 1)); $type = ''; - } else { + } else if (preg_match('@^data:image/([^;]*);base64,(.*)@', $imgsrc, $reg)) { + $imgsrc = '@'.base64_decode($reg[2]); + $type = $reg[1]; + } elseif ( $this->allowLocalFiles && substr($imgsrc, 0, 7) === 'file://') { + // get image type from a local file path + $imgsrc = substr($imgsrc, 7); + $type = TCPDF_IMAGES::getImageFileType($imgsrc); + } else { // @CHANGE LDR Add support for src="file://..." links if (strpos($imgsrc, 'file://') === 0) { $imgsrc = str_replace('file://', '/', $imgsrc); @@ -19249,7 +19085,7 @@ class TCPDF $imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc); } } elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { - // fix image path + // fix image path $findroot = strpos($imgsrc, $_SERVER['DOCUMENT_ROOT']); if (($findroot === false) OR ($findroot > 1)) { if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') { @@ -19268,7 +19104,6 @@ class TCPDF $imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc); } } - // get image type $type = TCPDF_IMAGES::getImageFileType($imgsrc); } @@ -19283,7 +19118,7 @@ class TCPDF // further development is required for other modes. $tag['attribute']['align'] = 'bottom'; //} - switch ($tag['attribute']['align']) { + switch($tag['attribute']['align']) { case 'top': { $align = 'T'; break; @@ -19320,7 +19155,7 @@ class TCPDF $lnky = 0; } $imglink = $this->AddLink(); - $this->SetLink($imglink, $lnky, $page); + $this->setLink($imglink, $lnky, $page); } } } @@ -19344,7 +19179,7 @@ class TCPDF } else { $this->Image($imgsrc, $xpos, $this->y, $iw, $ih, '', $imglink, $align, false, 300, '', false, false, $border, false, false, true); } - switch ($align) { + switch($align) { case 'T': { $this->y = $prevy; break; @@ -19474,11 +19309,11 @@ class TCPDF break; } case 'sup': { - $this->SetXY($this->GetX(), $this->GetY() - ((0.7 * $this->FontSizePt) / $this->k)); + $this->setXY($this->GetX(), $this->GetY() - ((0.7 * $this->FontSizePt) / $this->k)); break; } case 'sub': { - $this->SetXY($this->GetX(), $this->GetY() + ((0.3 * $this->FontSizePt) / $this->k)); + $this->setXY($this->GetX(), $this->GetY() + ((0.3 * $this->FontSizePt) / $this->k)); break; } case 'h1': @@ -19737,17 +19572,14 @@ class TCPDF case 'tcpdf': { if (defined('K_TCPDF_CALLS_IN_HTML') AND (K_TCPDF_CALLS_IN_HTML === true)) { // Special tag used to call TCPDF methods - if (isset($tag['attribute']['method'])) { - $tcpdf_method = $tag['attribute']['method']; - if (method_exists($this, $tcpdf_method)) { - if (isset($tag['attribute']['params']) AND (!empty($tag['attribute']['params']))) { - $params = $this->unserializeTCPDFtagParameters($tag['attribute']['params']); - call_user_func_array(array($this, $tcpdf_method), $params); - } else { - $this->$tcpdf_method(); - } - $this->newline = true; + // This tag is disabled by default by the K_TCPDF_CALLS_IN_HTML constant on TCPDF configuration file. + // Please use this feature only if you are in control of the HTML content and you are sure that it does not contain any harmful code. + if (!empty($tag['attribute']['data'])) { + $tcpdf_tag_data = $this->unserializeTCPDFtag($tag['attribute']['data']); + if ($this->allowedTCPDFtag($tcpdf_tag_data['m'])) { + call_user_func_array(array($this, $tcpdf_tag_data['m']), $tcpdf_tag_data['p']); } + $this->newline = true; } } break; @@ -19780,15 +19612,14 @@ class TCPDF /** * Process closing tags. - * @param $dom (array) html dom array - * @param $key (int) current element id - * @param $cell (boolean) if true add the default left (or right if RTL) padding to each new line (default false). - * @param $maxbottomliney (int) maximum y value of current line - * @return $dom array + * @param array $dom html dom array + * @param int $key current element id + * @param boolean $cell if true add the default left (or right if RTL) padding to each new line (default false). + * @param int $maxbottomliney maximum y value of current line + * @return array $dom * @protected */ - protected function closeHTMLTagHandler($dom, $key, $cell, $maxbottomliney = 0) - { + protected function closeHTMLTagHandler($dom, $key, $cell, $maxbottomliney=0) { $tag = $dom[$key]; $parent = $dom[($dom[$key]['parent'])]; $lasttag = ((!isset($dom[($key + 1)])) OR ((!isset($dom[($key + 2)])) AND ($dom[($key + 1)]['value'] == 'marker'))); @@ -19829,7 +19660,7 @@ class TCPDF } } // Closing tag - switch ($tag['value']) { + switch($tag['value']) { case 'tr': { $table_el = $dom[($dom[$key]['parent'])]['parent']; if (!isset($parent['endy'])) { @@ -19918,394 +19749,394 @@ class TCPDF // closing tag used for the thead part $in_table_head = true; $this->inthead = false; - case 'table': { - $table_el = $parent; + case 'table': { + $table_el = $parent; + // set default border + if (isset($table_el['attribute']['border']) AND ($table_el['attribute']['border'] > 0)) { // set default border - if (isset($table_el['attribute']['border']) AND ($table_el['attribute']['border'] > 0)) { - // set default border - $border = array('LTRB' => array('width' => $this->getCSSBorderWidth($table_el['attribute']['border']), 'cap'=>'square', 'join'=>'miter', 'dash'=> 0, 'color'=>array(0,0,0))); - } else { - $border = 0; + $border = array('LTRB' => array('width' => $this->getCSSBorderWidth($table_el['attribute']['border']), 'cap'=>'square', 'join'=>'miter', 'dash'=> 0, 'color'=>array(0,0,0))); + } else { + $border = 0; + } + $default_border = $border; + // fix bottom line alignment of last line before page break + foreach ($dom[($dom[$key]['parent'])]['trids'] as $j => $trkey) { + // update row-spanned cells + if (isset($dom[($dom[$key]['parent'])]['rowspans'])) { + foreach ($dom[($dom[$key]['parent'])]['rowspans'] as $k => $trwsp) { + if (isset($prevtrkey) AND ($trwsp['trid'] == $prevtrkey) AND ($trwsp['mrowspan'] > 0)) { + $dom[($dom[$key]['parent'])]['rowspans'][$k]['trid'] = $trkey; + } + if ($dom[($dom[$key]['parent'])]['rowspans'][$k]['trid'] == $trkey) { + $dom[($dom[$key]['parent'])]['rowspans'][$k]['mrowspan'] -= 1; + } + } } - $default_border = $border; - // fix bottom line alignment of last line before page break - foreach ($dom[($dom[$key]['parent'])]['trids'] as $j => $trkey) { + if (isset($prevtrkey) AND ($dom[$trkey]['startpage'] > $dom[$prevtrkey]['endpage'])) { + $pgendy = $this->pagedim[$dom[$prevtrkey]['endpage']]['hk'] - $this->pagedim[$dom[$prevtrkey]['endpage']]['bm']; + $dom[$prevtrkey]['endy'] = $pgendy; // update row-spanned cells if (isset($dom[($dom[$key]['parent'])]['rowspans'])) { foreach ($dom[($dom[$key]['parent'])]['rowspans'] as $k => $trwsp) { - if (isset($prevtrkey) AND ($trwsp['trid'] == $prevtrkey) AND ($trwsp['mrowspan'] > 0)) { - $dom[($dom[$key]['parent'])]['rowspans'][$k]['trid'] = $trkey; - } - if ($dom[($dom[$key]['parent'])]['rowspans'][$k]['trid'] == $trkey) { - $dom[($dom[$key]['parent'])]['rowspans'][$k]['mrowspan'] -= 1; + if (($trwsp['trid'] == $prevtrkey) AND ($trwsp['mrowspan'] >= 0) AND ($trwsp['endpage'] == $dom[$prevtrkey]['endpage'])) { + $dom[($dom[$key]['parent'])]['rowspans'][$k]['endy'] = $pgendy; + $dom[($dom[$key]['parent'])]['rowspans'][$k]['mrowspan'] = -1; } } } - if (isset($prevtrkey) AND ($dom[$trkey]['startpage'] > $dom[$prevtrkey]['endpage'])) { - $pgendy = $this->pagedim[$dom[$prevtrkey]['endpage']]['hk'] - $this->pagedim[$dom[$prevtrkey]['endpage']]['bm']; - $dom[$prevtrkey]['endy'] = $pgendy; - // update row-spanned cells - if (isset($dom[($dom[$key]['parent'])]['rowspans'])) { - foreach ($dom[($dom[$key]['parent'])]['rowspans'] as $k => $trwsp) { - if (($trwsp['trid'] == $prevtrkey) AND ($trwsp['mrowspan'] >= 0) AND ($trwsp['endpage'] == $dom[$prevtrkey]['endpage'])) { - $dom[($dom[$key]['parent'])]['rowspans'][$k]['endy'] = $pgendy; - $dom[($dom[$key]['parent'])]['rowspans'][$k]['mrowspan'] = -1; - } - } - } - } - $prevtrkey = $trkey; - $table_el = $dom[($dom[$key]['parent'])]; } - // for each row - if (count($table_el['trids']) > 0) { - unset($xmax); + $prevtrkey = $trkey; + $table_el = $dom[($dom[$key]['parent'])]; + } + // for each row + if (!empty($table_el['trids'])) { + unset($xmax); + } + foreach ($table_el['trids'] as $j => $trkey) { + $parent = $dom[$trkey]; + if (!isset($xmax)) { + $xmax = $parent['cellpos'][(count($parent['cellpos']) - 1)]['endx']; } - foreach ($table_el['trids'] as $j => $trkey) { - $parent = $dom[$trkey]; - if (!isset($xmax)) { - $xmax = $parent['cellpos'][(count($parent['cellpos']) - 1)]['endx']; + // for each cell on the row + foreach ($parent['cellpos'] as $k => $cellpos) { + if (isset($cellpos['rowspanid']) AND ($cellpos['rowspanid'] >= 0)) { + $cellpos['startx'] = $table_el['rowspans'][($cellpos['rowspanid'])]['startx']; + $cellpos['endx'] = $table_el['rowspans'][($cellpos['rowspanid'])]['endx']; + $endy = $table_el['rowspans'][($cellpos['rowspanid'])]['endy']; + $startpage = $table_el['rowspans'][($cellpos['rowspanid'])]['startpage']; + $endpage = $table_el['rowspans'][($cellpos['rowspanid'])]['endpage']; + $startcolumn = $table_el['rowspans'][($cellpos['rowspanid'])]['startcolumn']; + $endcolumn = $table_el['rowspans'][($cellpos['rowspanid'])]['endcolumn']; + } else { + $endy = $parent['endy']; + $startpage = $parent['startpage']; + $endpage = $parent['endpage']; + $startcolumn = $parent['startcolumn']; + $endcolumn = $parent['endcolumn']; } - // for each cell on the row - foreach ($parent['cellpos'] as $k => $cellpos) { - if (isset($cellpos['rowspanid']) AND ($cellpos['rowspanid'] >= 0)) { - $cellpos['startx'] = $table_el['rowspans'][($cellpos['rowspanid'])]['startx']; - $cellpos['endx'] = $table_el['rowspans'][($cellpos['rowspanid'])]['endx']; - $endy = $table_el['rowspans'][($cellpos['rowspanid'])]['endy']; - $startpage = $table_el['rowspans'][($cellpos['rowspanid'])]['startpage']; - $endpage = $table_el['rowspans'][($cellpos['rowspanid'])]['endpage']; - $startcolumn = $table_el['rowspans'][($cellpos['rowspanid'])]['startcolumn']; - $endcolumn = $table_el['rowspans'][($cellpos['rowspanid'])]['endcolumn']; - } else { - $endy = $parent['endy']; - $startpage = $parent['startpage']; - $endpage = $parent['endpage']; - $startcolumn = $parent['startcolumn']; - $endcolumn = $parent['endcolumn']; + if ($this->num_columns == 0) { + $this->num_columns = 1; + } + if (isset($cellpos['border'])) { + $border = $cellpos['border']; + } + if (isset($cellpos['bgcolor']) AND ($cellpos['bgcolor']) !== false) { + $this->setFillColorArray($cellpos['bgcolor']); + $fill = true; + } else { + $fill = false; + } + $x = $cellpos['startx']; + $y = $parent['starty']; + $starty = $y; + $w = abs($cellpos['endx'] - $cellpos['startx']); + // get border modes + $border_start = TCPDF_STATIC::getBorderMode($border, $position='start', $this->opencell); + $border_end = TCPDF_STATIC::getBorderMode($border, $position='end', $this->opencell); + $border_middle = TCPDF_STATIC::getBorderMode($border, $position='middle', $this->opencell); + // design borders around HTML cells. + for ($page = $startpage; $page <= $endpage; ++$page) { // for each page + $ccode = ''; + $this->setPage($page); + if ($this->num_columns < 2) { + // single-column mode + $this->x = $x; + $this->y = $this->tMargin; } - if ($this->num_columns == 0) { - $this->num_columns = 1; - } - if (isset($cellpos['border'])) { - $border = $cellpos['border']; - } - if (isset($cellpos['bgcolor']) AND ($cellpos['bgcolor']) !== false) { - $this->SetFillColorArray($cellpos['bgcolor']); - $fill = true; - } else { - $fill = false; - } - $x = $cellpos['startx']; - $y = $parent['starty']; - $starty = $y; - $w = abs($cellpos['endx'] - $cellpos['startx']); - // get border modes - $border_start = TCPDF_STATIC::getBorderMode($border, $position='start', $this->opencell); - $border_end = TCPDF_STATIC::getBorderMode($border, $position='end', $this->opencell); - $border_middle = TCPDF_STATIC::getBorderMode($border, $position='middle', $this->opencell); - // design borders around HTML cells. - for ($page = $startpage; $page <= $endpage; ++$page) { // for each page - $ccode = ''; - $this->setPage($page); - if ($this->num_columns < 2) { - // single-column mode - $this->x = $x; - $this->y = $this->tMargin; + // account for margin changes + if ($page > $startpage) { + if (($this->rtl) AND ($this->pagedim[$page]['orm'] != $this->pagedim[$startpage]['orm'])) { + $this->x -= ($this->pagedim[$page]['orm'] - $this->pagedim[$startpage]['orm']); + } elseif ((!$this->rtl) AND ($this->pagedim[$page]['olm'] != $this->pagedim[$startpage]['olm'])) { + $this->x += ($this->pagedim[$page]['olm'] - $this->pagedim[$startpage]['olm']); } - // account for margin changes - if ($page > $startpage) { - if (($this->rtl) AND ($this->pagedim[$page]['orm'] != $this->pagedim[$startpage]['orm'])) { - $this->x -= ($this->pagedim[$page]['orm'] - $this->pagedim[$startpage]['orm']); - } elseif ((!$this->rtl) AND ($this->pagedim[$page]['olm'] != $this->pagedim[$startpage]['olm'])) { - $this->x += ($this->pagedim[$page]['olm'] - $this->pagedim[$startpage]['olm']); - } - } - if ($startpage == $endpage) { // single page - $deltacol = 0; - $deltath = 0; - for ($column = $startcolumn; $column <= $endcolumn; ++$column) { // for each column - $this->selectColumn($column); - if ($startcolumn == $endcolumn) { // single column - $cborder = $border; - $h = $endy - $parent['starty']; - $this->y = $y; - $this->x = $x; - } elseif ($column == $startcolumn) { // first column - $cborder = $border_start; - $this->y = $starty; - $this->x = $x; - $h = $this->h - $this->y - $this->bMargin; - if ($this->rtl) { - $deltacol = $this->x + $this->rMargin - $this->w; - } else { - $deltacol = $this->x - $this->lMargin; - } - } elseif ($column == $endcolumn) { // end column - $cborder = $border_end; - if (isset($this->columns[$column]['th']['\''.$page.'\''])) { - $this->y = $this->columns[$column]['th']['\''.$page.'\'']; - } - $this->x += $deltacol; - $h = $endy - $this->y; - } else { // middle column - $cborder = $border_middle; - if (isset($this->columns[$column]['th']['\''.$page.'\''])) { - $this->y = $this->columns[$column]['th']['\''.$page.'\'']; - } - $this->x += $deltacol; - $h = $this->h - $this->y - $this->bMargin; + } + if ($startpage == $endpage) { // single page + $deltacol = 0; + $deltath = 0; + for ($column = $startcolumn; $column <= $endcolumn; ++$column) { // for each column + $this->selectColumn($column); + if ($startcolumn == $endcolumn) { // single column + $cborder = $border; + $h = $endy - $parent['starty']; + $this->y = $y; + $this->x = $x; + } elseif ($column == $startcolumn) { // first column + $cborder = $border_start; + $this->y = $starty; + $this->x = $x; + $h = $this->h - $this->y - $this->bMargin; + if ($this->rtl) { + $deltacol = $this->x + $this->rMargin - $this->w; + } else { + $deltacol = $this->x - $this->lMargin; } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } elseif ($page == $startpage) { // first page - $deltacol = 0; - $deltath = 0; - for ($column = $startcolumn; $column < $this->num_columns; ++$column) { // for each column - $this->selectColumn($column); - if ($column == $startcolumn) { // first column - $cborder = $border_start; - $this->y = $starty; - $this->x = $x; - $h = $this->h - $this->y - $this->bMargin; - if ($this->rtl) { - $deltacol = $this->x + $this->rMargin - $this->w; - } else { - $deltacol = $this->x - $this->lMargin; - } - } else { // middle column - $cborder = $border_middle; - if (isset($this->columns[$column]['th']['\''.$page.'\''])) { - $this->y = $this->columns[$column]['th']['\''.$page.'\'']; - } - $this->x += $deltacol; - $h = $this->h - $this->y - $this->bMargin; + } elseif ($column == $endcolumn) { // end column + $cborder = $border_end; + if (isset($this->columns[$column]['th']['\''.$page.'\''])) { + $this->y = $this->columns[$column]['th']['\''.$page.'\'']; } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } elseif ($page == $endpage) { // last page - $deltacol = 0; - $deltath = 0; - for ($column = 0; $column <= $endcolumn; ++$column) { // for each column - $this->selectColumn($column); - if ($column == $endcolumn) { // end column - $cborder = $border_end; - if (isset($this->columns[$column]['th']['\''.$page.'\''])) { - $this->y = $this->columns[$column]['th']['\''.$page.'\'']; - } - $this->x += $deltacol; - $h = $endy - $this->y; - } else { // middle column - $cborder = $border_middle; - if (isset($this->columns[$column]['th']['\''.$page.'\''])) { - $this->y = $this->columns[$column]['th']['\''.$page.'\'']; - } - $this->x += $deltacol; - $h = $this->h - $this->y - $this->bMargin; - } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } else { // middle page - $deltacol = 0; - $deltath = 0; - for ($column = 0; $column < $this->num_columns; ++$column) { // for each column - $this->selectColumn($column); + $this->x += $deltacol; + $h = $endy - $this->y; + } else { // middle column $cborder = $border_middle; if (isset($this->columns[$column]['th']['\''.$page.'\''])) { $this->y = $this->columns[$column]['th']['\''.$page.'\'']; } $this->x += $deltacol; $h = $this->h - $this->y - $this->bMargin; - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } - if (!empty($cborder) OR !empty($fill)) { - $offsetlen = strlen($ccode); - // draw border and fill - if ($this->inxobj) { - // we are inside an XObject template - if (end($this->xobjects[$this->xobjid]['transfmrk']) !== false) { - $pagemarkkey = key($this->xobjects[$this->xobjid]['transfmrk']); - $pagemark = $this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey]; - $this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey] += $offsetlen; - } else { - $pagemark = $this->xobjects[$this->xobjid]['intmrk']; - $this->xobjects[$this->xobjid]['intmrk'] += $offsetlen; - } - $pagebuff = $this->xobjects[$this->xobjid]['outdata']; - $pstart = substr($pagebuff, 0, $pagemark); - $pend = substr($pagebuff, $pagemark); - $this->xobjects[$this->xobjid]['outdata'] = $pstart.$ccode.$pend; - } else { - // draw border and fill - if (end($this->transfmrk[$this->page]) !== false) { - $pagemarkkey = key($this->transfmrk[$this->page]); - $pagemark = $this->transfmrk[$this->page][$pagemarkkey]; - } elseif ($this->InFooter) { - $pagemark = $this->footerpos[$this->page]; - } else { - $pagemark = $this->intmrk[$this->page]; - } - $pagebuff = $this->getPageBuffer($this->page); - $pstart = substr($pagebuff, 0, $pagemark); - $pend = substr($pagebuff, $pagemark); - $this->setPageBuffer($this->page, $pstart.$ccode.$pend); } - } - } // end for each page - // restore default border - $border = $default_border; - } // end for each cell on the row - if (isset($table_el['attribute']['cellspacing'])) { - $this->y += $this->getHTMLUnitToUnits($table_el['attribute']['cellspacing'], 1, 'px'); - } elseif (isset($table_el['border-spacing'])) { - $this->y += $table_el['border-spacing']['V']; - } - $this->Ln(0, $cell); - $this->x = $parent['startx']; - if ($endpage > $startpage) { - if (($this->rtl) AND ($this->pagedim[$endpage]['orm'] != $this->pagedim[$startpage]['orm'])) { - $this->x += ($this->pagedim[$endpage]['orm'] - $this->pagedim[$startpage]['orm']); - } elseif ((!$this->rtl) AND ($this->pagedim[$endpage]['olm'] != $this->pagedim[$startpage]['olm'])) { - $this->x += ($this->pagedim[$endpage]['olm'] - $this->pagedim[$startpage]['olm']); + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } elseif ($page == $startpage) { // first page + $deltacol = 0; + $deltath = 0; + for ($column = $startcolumn; $column < $this->num_columns; ++$column) { // for each column + $this->selectColumn($column); + if ($column == $startcolumn) { // first column + $cborder = $border_start; + $this->y = $starty; + $this->x = $x; + $h = $this->h - $this->y - $this->bMargin; + if ($this->rtl) { + $deltacol = $this->x + $this->rMargin - $this->w; + } else { + $deltacol = $this->x - $this->lMargin; + } + } else { // middle column + $cborder = $border_middle; + if (isset($this->columns[$column]['th']['\''.$page.'\''])) { + $this->y = $this->columns[$column]['th']['\''.$page.'\'']; + } + $this->x += $deltacol; + $h = $this->h - $this->y - $this->bMargin; + } + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } elseif ($page == $endpage) { // last page + $deltacol = 0; + $deltath = 0; + for ($column = 0; $column <= $endcolumn; ++$column) { // for each column + $this->selectColumn($column); + if ($column == $endcolumn) { // end column + $cborder = $border_end; + if (isset($this->columns[$column]['th']['\''.$page.'\''])) { + $this->y = $this->columns[$column]['th']['\''.$page.'\'']; + } + $this->x += $deltacol; + $h = $endy - $this->y; + } else { // middle column + $cborder = $border_middle; + if (isset($this->columns[$column]['th']['\''.$page.'\''])) { + $this->y = $this->columns[$column]['th']['\''.$page.'\'']; + } + $this->x += $deltacol; + $h = $this->h - $this->y - $this->bMargin; + } + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } else { // middle page + $deltacol = 0; + $deltath = 0; + for ($column = 0; $column < $this->num_columns; ++$column) { // for each column + $this->selectColumn($column); + $cborder = $border_middle; + if (isset($this->columns[$column]['th']['\''.$page.'\''])) { + $this->y = $this->columns[$column]['th']['\''.$page.'\'']; + } + $this->x += $deltacol; + $h = $this->h - $this->y - $this->bMargin; + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column } - } - } - if (!$in_table_head) { // we are not inside a thead section - $this->cell_padding = $table_el['old_cell_padding']; - // reset row height - $this->resetLastH(); - if (($this->page == ($this->numpages - 1)) AND ($this->pageopen[$this->numpages])) { - $plendiff = ($this->pagelen[$this->numpages] - $this->emptypagemrk[$this->numpages]); - if (($plendiff > 0) AND ($plendiff < 60)) { - $pagediff = substr($this->getPageBuffer($this->numpages), $this->emptypagemrk[$this->numpages], $plendiff); - if (substr($pagediff, 0, 5) == 'BT /F') { - // the difference is only a font setting - $plendiff = 0; + if (!empty($cborder) OR !empty($fill)) { + $offsetlen = strlen($ccode); + // draw border and fill + if ($this->inxobj) { + // we are inside an XObject template + if (end($this->xobjects[$this->xobjid]['transfmrk']) !== false) { + $pagemarkkey = key($this->xobjects[$this->xobjid]['transfmrk']); + $pagemark = $this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey]; + $this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey] += $offsetlen; + } else { + $pagemark = $this->xobjects[$this->xobjid]['intmrk']; + $this->xobjects[$this->xobjid]['intmrk'] += $offsetlen; + } + $pagebuff = $this->xobjects[$this->xobjid]['outdata']; + $pstart = substr($pagebuff, 0, $pagemark); + $pend = substr($pagebuff, $pagemark); + $this->xobjects[$this->xobjid]['outdata'] = $pstart.$ccode.$pend; + } else { + // draw border and fill + if (end($this->transfmrk[$this->page]) !== false) { + $pagemarkkey = key($this->transfmrk[$this->page]); + $pagemark = $this->transfmrk[$this->page][$pagemarkkey]; + } elseif ($this->InFooter) { + $pagemark = $this->footerpos[$this->page]; + } else { + $pagemark = $this->intmrk[$this->page]; + } + $pagebuff = $this->getPageBuffer($this->page); + $pstart = substr($pagebuff, 0, $pagemark); + $pend = substr($pagebuff, $pagemark); + $this->setPageBuffer($this->page, $pstart.$ccode.$pend); } } - if ($plendiff == 0) { - // remove last blank page - $this->deletePage($this->numpages); + } // end for each page + // restore default border + $border = $default_border; + } // end for each cell on the row + if (isset($table_el['attribute']['cellspacing'])) { + $this->y += $this->getHTMLUnitToUnits($table_el['attribute']['cellspacing'], 1, 'px'); + } elseif (isset($table_el['border-spacing'])) { + $this->y += $table_el['border-spacing']['V']; + } + $this->Ln(0, $cell); + $this->x = $parent['startx']; + if ($endpage > $startpage) { + if (($this->rtl) AND ($this->pagedim[$endpage]['orm'] != $this->pagedim[$startpage]['orm'])) { + $this->x += ($this->pagedim[$endpage]['orm'] - $this->pagedim[$startpage]['orm']); + } elseif ((!$this->rtl) AND ($this->pagedim[$endpage]['olm'] != $this->pagedim[$startpage]['olm'])) { + $this->x += ($this->pagedim[$endpage]['olm'] - $this->pagedim[$startpage]['olm']); + } + } + } + if (!$in_table_head) { // we are not inside a thead section + $this->cell_padding = isset($table_el['old_cell_padding']) ? $table_el['old_cell_padding'] : null; + // reset row height + $this->resetLastH(); + if (($this->page == ($this->numpages - 1)) AND ($this->pageopen[$this->numpages])) { + $plendiff = ($this->pagelen[$this->numpages] - $this->emptypagemrk[$this->numpages]); + if (($plendiff > 0) AND ($plendiff < 60)) { + $pagediff = substr($this->getPageBuffer($this->numpages), $this->emptypagemrk[$this->numpages], $plendiff); + if (substr($pagediff, 0, 5) == 'BT /F') { + // the difference is only a font setting + $plendiff = 0; } } - if (isset($this->theadMargins['top'])) { - // restore top margin - $this->tMargin = $this->theadMargins['top']; - } - if (!isset($table_el['attribute']['nested']) OR ($table_el['attribute']['nested'] != 'true')) { - // reset main table header - $this->thead = ''; - $this->theadMargins = array(); - $this->pagedim[$this->page]['tm'] = $this->tMargin; + if ($plendiff == 0) { + // remove last blank page + $this->deletePage($this->numpages); } } - $parent = $table_el; - break; - } - case 'a': { - $this->HREF = array(); - break; - } - case 'sup': { - $this->SetXY($this->GetX(), $this->GetY() + ((0.7 * $parent['fontsize']) / $this->k)); - break; - } - case 'sub': { - $this->SetXY($this->GetX(), $this->GetY() - ((0.3 * $parent['fontsize']) / $this->k)); - break; - } - case 'div': { - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - break; - } - case 'blockquote': { - if ($this->rtl) { - $this->rMargin -= $this->listindent; - } else { - $this->lMargin -= $this->listindent; + if (isset($this->theadMargins['top'])) { + // restore top margin + $this->tMargin = $this->theadMargins['top']; } - --$this->listindentlevel; - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - break; - } - case 'p': { - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - break; - } - case 'pre': { - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - $this->premode = false; - break; - } - case 'dl': { - --$this->listnum; - if ($this->listnum <= 0) { - $this->listnum = 0; - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - } else { - $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); + if (!isset($table_el['attribute']['nested']) OR ($table_el['attribute']['nested'] != 'true')) { + // reset main table header + $this->thead = ''; + $this->theadMargins = array(); + $this->pagedim[$this->page]['tm'] = $this->tMargin; } - $this->resetLastH(); - break; } - case 'dt': { - $this->lispacer = ''; + $parent = $table_el; + break; + } + case 'a': { + $this->HREF = array(); + break; + } + case 'sup': { + $this->setXY($this->GetX(), $this->GetY() + ((0.7 * $parent['fontsize']) / $this->k)); + break; + } + case 'sub': { + $this->setXY($this->GetX(), $this->GetY() - ((0.3 * $parent['fontsize']) / $this->k)); + break; + } + case 'div': { + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + break; + } + case 'blockquote': { + if ($this->rtl) { + $this->rMargin -= $this->listindent; + } else { + $this->lMargin -= $this->listindent; + } + --$this->listindentlevel; + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + break; + } + case 'p': { + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + break; + } + case 'pre': { + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + $this->premode = false; + break; + } + case 'dl': { + --$this->listnum; + if ($this->listnum <= 0) { + $this->listnum = 0; + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + } else { $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); - break; } - case 'dd': { - $this->lispacer = ''; - if ($this->rtl) { - $this->rMargin -= $this->listindent; - } else { - $this->lMargin -= $this->listindent; - } - --$this->listindentlevel; - $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); - break; + $this->resetLastH(); + break; + } + case 'dt': { + $this->lispacer = ''; + $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); + break; + } + case 'dd': { + $this->lispacer = ''; + if ($this->rtl) { + $this->rMargin -= $this->listindent; + } else { + $this->lMargin -= $this->listindent; } - case 'ul': - case 'ol': { - --$this->listnum; - $this->lispacer = ''; - if ($this->rtl) { - $this->rMargin -= $this->listindent; - } else { - $this->lMargin -= $this->listindent; - } - --$this->listindentlevel; - if ($this->listnum <= 0) { - $this->listnum = 0; - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - } else { - $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); - } - $this->resetLastH(); - break; + --$this->listindentlevel; + $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); + break; + } + case 'ul': + case 'ol': { + --$this->listnum; + $this->lispacer = ''; + if ($this->rtl) { + $this->rMargin -= $this->listindent; + } else { + $this->lMargin -= $this->listindent; } - case 'li': { - $this->lispacer = ''; - $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); - break; - } - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': { + --$this->listindentlevel; + if ($this->listnum <= 0) { + $this->listnum = 0; $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - break; - } - // Form fields (since 4.8.000 - 2009-09-07) - case 'form': { - $this->form_action = ''; - $this->form_enctype = 'application/x-www-form-urlencoded'; - break; - } - default : { - break; + } else { + $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); } + $this->resetLastH(); + break; + } + case 'li': { + $this->lispacer = ''; + $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); + break; + } + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': { + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + break; + } + // Form fields (since 4.8.000 - 2009-09-07) + case 'form': { + $this->form_action = ''; + $this->form_enctype = 'application/x-www-form-urlencoded'; + break; + } + default : { + break; + } } // draw border and background (if any) $this->drawHTMLTagBorder($parent, $xmax); @@ -20328,15 +20159,14 @@ class TCPDF /** * Add vertical spaces if needed. - * @param $hbz (string) Distance between current y and line bottom. - * @param $hb (string) The height of the break. - * @param $cell (boolean) if true add the default left (or right if RTL) padding to each new line (default false). - * @param $firsttag (boolean) set to true when the tag is the first. - * @param $lasttag (boolean) set to true when the tag is the last. + * @param string $hbz Distance between current y and line bottom. + * @param string $hb The height of the break. + * @param boolean $cell if true add the default left (or right if RTL) padding to each new line (default false). + * @param boolean $firsttag set to true when the tag is the first. + * @param boolean $lasttag set to true when the tag is the last. * @protected */ - protected function addHTMLVertSpace($hbz = 0, $hb = 0, $cell = false, $firsttag = false, $lasttag = false) - { + protected function addHTMLVertSpace($hbz=0, $hb=0, $cell=false, $firsttag=false, $lasttag=false) { if ($firsttag) { $this->Ln(0, $cell); $this->htmlvspace = 0; @@ -20362,8 +20192,7 @@ class TCPDF * @protected * @since 5.7.000 (2010-08-03) */ - protected function getBorderStartPosition() - { + protected function getBorderStartPosition() { if ($this->rtl) { $xmax = $this->lMargin; } else { @@ -20374,13 +20203,12 @@ class TCPDF /** * Draw an HTML block border and fill - * @param $tag (array) array of tag properties. - * @param $xmax (int) end X coordinate for border. + * @param array $tag array of tag properties. + * @param int $xmax end X coordinate for border. * @protected * @since 5.7.000 (2010-08-03) */ - protected function drawHTMLTagBorder($tag, $xmax) - { + protected function drawHTMLTagBorder($tag, $xmax) { if (!isset($tag['borderposition'])) { // nothing to draw return; @@ -20402,7 +20230,7 @@ class TCPDF if (isset($tag['bgcolor']) AND ($tag['bgcolor'] !== false)) { // get background color $old_bgcolor = $this->bgcolor; - $this->SetFillColorArray($tag['bgcolor']); + $this->setFillColorArray($tag['bgcolor']); $fill = true; } if (!$border AND !$fill) { @@ -20568,7 +20396,7 @@ class TCPDF $this->page_regions = $temp_page_regions; if (isset($old_bgcolor)) { // restore background color - $this->SetFillColorArray($old_bgcolor); + $this->setFillColorArray($old_bgcolor); } // restore pointer position $this->x = $prev_x; @@ -20578,12 +20406,11 @@ class TCPDF /** * Set the default bullet to be used as LI bullet symbol - * @param $symbol (string) character or string to be used (legal values are: '' = automatic, '!' = auto bullet, '#' = auto numbering, 'disc', 'disc', 'circle', 'square', '1', 'decimal', 'decimal-leading-zero', 'i', 'lower-roman', 'I', 'upper-roman', 'a', 'lower-alpha', 'lower-latin', 'A', 'upper-alpha', 'upper-latin', 'lower-greek', 'img|type|width|height|image.ext') + * @param string $symbol character or string to be used (legal values are: '' = automatic, '!' = auto bullet, '#' = auto numbering, 'disc', 'disc', 'circle', 'square', '1', 'decimal', 'decimal-leading-zero', 'i', 'lower-roman', 'I', 'upper-roman', 'a', 'lower-alpha', 'lower-latin', 'A', 'upper-alpha', 'upper-latin', 'lower-greek', 'img|type|width|height|image.ext') * @public * @since 4.0.028 (2008-09-26) */ - public function setLIsymbol($symbol = '!') - { + public function setLIsymbol($symbol='!') { // check for custom image symbol if (substr($symbol, 0, 4) == 'img|') { $this->lisymbol = $symbol; @@ -20600,14 +20427,13 @@ class TCPDF /** * Set the booklet mode for double-sided pages. - * @param $booklet (boolean) true set the booklet mode on, false otherwise. - * @param $inner (float) Inner page margin. - * @param $outer (float) Outer page margin. + * @param boolean $booklet true set the booklet mode on, false otherwise. + * @param float $inner Inner page margin. + * @param float $outer Outer page margin. * @public * @since 4.2.000 (2008-10-29) */ - public function SetBooklet($booklet = true, $inner = -1, $outer = -1) - { + public function setBooklet($booklet=true, $inner=-1, $outer=-1) { $this->booklet = $booklet; if ($inner >= 0) { $this->lMargin = $inner; @@ -20619,12 +20445,11 @@ class TCPDF /** * Swap the left and right margins. - * @param $reverse (boolean) if true swap left and right margins. + * @param boolean $reverse if true swap left and right margins. * @protected * @since 4.2.000 (2008-10-29) */ - protected function swapMargins($reverse = true) - { + protected function swapMargins($reverse=true) { if ($reverse) { // swap left and right margins $mtemp = $this->original_lMargin; @@ -20644,62 +20469,57 @@ class TCPDF * the second level contains 0 for opening tags or 1 for closing tags, * the third level contains the vertical space unit (h) and the number spaces to add (n). * If the h parameter is not specified, default values are used. - * @param $tagvs (array) array of tags and relative vertical spaces. + * @param array $tagvs array of tags and relative vertical spaces. * @public * @since 4.2.001 (2008-10-30) */ - public function setHtmlVSpace($tagvs) - { + public function setHtmlVSpace($tagvs) { $this->tagvspaces = $tagvs; } /** * Set custom width for list indentation. - * @param $width (float) width of the indentation. Use negative value to disable it. + * @param float $width width of the indentation. Use negative value to disable it. * @public * @since 4.2.007 (2008-11-12) */ - public function setListIndentWidth($width) - { + public function setListIndentWidth($width) { return $this->customlistindent = floatval($width); } /** * Set the top/bottom cell sides to be open or closed when the cell cross the page. - * @param $isopen (boolean) if true keeps the top/bottom border open for the cell sides that cross the page. + * @param boolean $isopen if true keeps the top/bottom border open for the cell sides that cross the page. * @public * @since 4.2.010 (2008-11-14) */ - public function setOpenCell($isopen) - { + public function setOpenCell($isopen) { $this->opencell = $isopen; } /** * Set the color and font style for HTML links. - * @param $color (array) RGB array of colors - * @param $fontstyle (string) additional font styles to add + * @param array $color RGB array of colors + * @param string $fontstyle additional font styles to add * @public * @since 4.4.003 (2008-12-09) */ - public function setHtmlLinksStyle($color = array(0,0,255), $fontstyle = 'U') - { + public function setHtmlLinksStyle($color=array(0,0,255), $fontstyle='U') { $this->htmlLinkColorArray = $color; $this->htmlLinkFontStyle = $fontstyle; } /** * Convert HTML string containing value and unit of measure to user's units or points. - * @param $htmlval (string) String containing values and unit. - * @param $refsize (string) Reference value in points. - * @param $defaultunit (string) Default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt). - * @param $points (boolean) If true returns points, otherwise returns value in user's units. + * @param string $htmlval String containing values and unit. + * @param string $refsize Reference value in points. + * @param string $defaultunit Default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt). + * @param boolean $points If true returns points, otherwise returns value in user's units. * @return float value in user's unit or point if $points=true * @public * @since 4.4.004 (2008-12-10) */ - public function getHTMLUnitToUnits($htmlval, $refsize = 1, $defaultunit = 'px', $points = false) - { + public function getHTMLUnitToUnits($htmlval, $refsize=1, $defaultunit='px', $points=false) { $supportedunits = array('%', 'em', 'ex', 'px', 'in', 'cm', 'mm', 'pc', 'pt'); $retval = 0; $value = 0; @@ -20777,14 +20597,13 @@ class TCPDF /** * Output an HTML list bullet or ordered item symbol - * @param $listdepth (int) list nesting level - * @param $listtype (string) type of list - * @param $size (float) current font size + * @param int $listdepth list nesting level + * @param string $listtype type of list + * @param float $size current font size * @protected * @since 4.4.004 (2008-12-10) */ - protected function putHtmlListBullet($listdepth, $listtype = '', $size = 10) - { + protected function putHtmlListBullet($listdepth, $listtype='', $size=10) { if ($this->state != 2) { return; } @@ -20975,9 +20794,9 @@ class TCPDF $this->x = $tmpx; $this->lispacer = '^'; // restore colors - $this->SetFillColorArray($bgcolor); - $this->SetDrawColorArray($strokecolor); - $this->SettextColorArray($color); + $this->setFillColorArray($bgcolor); + $this->setDrawColorArray($strokecolor); + $this->settextColorArray($color); } /** @@ -20986,8 +20805,7 @@ class TCPDF * @protected * @since 4.2.010 (2008-11-14) */ - protected function getGraphicVars() - { + protected function getGraphicVars() { $grapvars = array( 'FontFamily' => $this->FontFamily, 'FontStyle' => $this->FontStyle, @@ -21043,13 +20861,12 @@ class TCPDF /** * Set graphic variables. - * @param $gvars (array) array of graphic variablesto restore - * @param $extended (boolean) if true restore extended graphic variables + * @param array $gvars array of graphic variablesto restore + * @param boolean $extended if true restore extended graphic variables * @protected * @since 4.2.010 (2008-11-14) */ - protected function setGraphicVars($gvars, $extended = false) - { + protected function setGraphicVars($gvars, $extended=false) { if ($this->state != 2) { return; } @@ -21105,7 +20922,7 @@ class TCPDF } $this->_out(''.$this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor.' '.$this->FillColor.''); if (!TCPDF_STATIC::empty_string($this->FontFamily)) { - $this->SetFont($this->FontFamily, $this->FontStyle, $this->FontSizePt); + $this->setFont($this->FontFamily, $this->FontStyle, $this->FontSizePt); } } @@ -21113,8 +20930,7 @@ class TCPDF * Outputs the "save graphics state" operator 'q' * @protected */ - protected function _outSaveGraphicsState() - { + protected function _outSaveGraphicsState() { $this->_out('q'); } @@ -21122,31 +20938,28 @@ class TCPDF * Outputs the "restore graphics state" operator 'Q' * @protected */ - protected function _outRestoreGraphicsState() - { + protected function _outRestoreGraphicsState() { $this->_out('Q'); } /** * Set buffer content (always append data). - * @param $data (string) data + * @param string $data data * @protected * @since 4.5.000 (2009-01-02) */ - protected function setBuffer($data) - { + protected function setBuffer($data) { $this->bufferlen += strlen($data); $this->buffer .= $data; } /** * Replace the buffer content - * @param $data (string) data + * @param string $data data * @protected * @since 5.5.000 (2010-06-22) */ - protected function replaceBuffer($data) - { + protected function replaceBuffer($data) { $this->bufferlen = strlen($data); $this->buffer = $data; } @@ -21157,21 +20970,19 @@ class TCPDF * @protected * @since 4.5.000 (2009-01-02) */ - protected function getBuffer() - { + protected function getBuffer() { return $this->buffer; } /** * Set page buffer content. - * @param $page (int) page number - * @param $data (string) page data - * @param $append (boolean) if true append data, false replace. + * @param int $page page number + * @param string $data page data + * @param boolean $append if true append data, false replace. * @protected * @since 4.5.000 (2008-12-31) */ - protected function setPageBuffer($page, $data, $append = false) - { + protected function setPageBuffer($page, $data, $append=false) { if ($append) { $this->pages[$page] .= $data; } else { @@ -21186,13 +20997,12 @@ class TCPDF /** * Get page buffer content. - * @param $page (int) page number + * @param int $page page number * @return string page buffer content or false in case of error * @protected * @since 4.5.000 (2008-12-31) */ - protected function getPageBuffer($page) - { + protected function getPageBuffer($page) { if (isset($this->pages[$page])) { return $this->pages[$page]; } @@ -21201,15 +21011,14 @@ class TCPDF /** * Set image buffer content. - * @param $image (string) image key - * @param $data (array) image data + * @param string $image image key + * @param array $data image data * @return int image index number * @protected * @since 4.5.000 (2008-12-31) */ - protected function setImageBuffer($image, $data) - { - if (($data['i'] = array_search($image, $this->imagekeys)) === false) { + protected function setImageBuffer($image, $data) { + if (($data['i'] = array_search($image, $this->imagekeys)) === FALSE) { $this->imagekeys[$this->numimages] = $image; $data['i'] = $this->numimages; ++$this->numimages; @@ -21220,14 +21029,13 @@ class TCPDF /** * Set image buffer content for a specified sub-key. - * @param $image (string) image key - * @param $key (string) image sub-key - * @param $data (array) image data + * @param string $image image key + * @param string $key image sub-key + * @param array $data image data * @protected * @since 4.5.000 (2008-12-31) */ - protected function setImageSubBuffer($image, $key, $data) - { + protected function setImageSubBuffer($image, $key, $data) { if (!isset($this->images[$image])) { $this->setImageBuffer($image, array()); } @@ -21236,13 +21044,12 @@ class TCPDF /** * Get image buffer content. - * @param $image (string) image key - * @return string image buffer content or false in case of error + * @param string $image image key + * @return string|false image buffer content or false in case of error * @protected * @since 4.5.000 (2008-12-31) */ - protected function getImageBuffer($image) - { + protected function getImageBuffer($image) { if (isset($this->images[$image])) { return $this->images[$image]; } @@ -21251,13 +21058,12 @@ class TCPDF /** * Set font buffer content. - * @param $font (string) font key - * @param $data (array) font data + * @param string $font font key + * @param array $data font data * @protected * @since 4.5.000 (2009-01-02) */ - protected function setFontBuffer($font, $data) - { + protected function setFontBuffer($font, $data) { $this->fonts[$font] = $data; if (!in_array($font, $this->fontkeys)) { $this->fontkeys[] = $font; @@ -21270,14 +21076,13 @@ class TCPDF /** * Set font buffer content. - * @param $font (string) font key - * @param $key (string) font sub-key - * @param $data (array) font data + * @param string $font font key + * @param string $key font sub-key + * @param mixed $data font data * @protected * @since 4.5.000 (2009-01-02) */ - protected function setFontSubBuffer($font, $key, $data) - { + protected function setFontSubBuffer($font, $key, $data) { if (!isset($this->fonts[$font])) { $this->setFontBuffer($font, array()); } @@ -21286,13 +21091,12 @@ class TCPDF /** * Get font buffer content. - * @param $font (string) font key - * @return string font buffer content or false in case of error + * @param string $font font key + * @return string|false font buffer content or false in case of error * @protected * @since 4.5.000 (2009-01-02) */ - protected function getFontBuffer($font) - { + protected function getFontBuffer($font) { if (isset($this->fonts[$font])) { return $this->fonts[$font]; } @@ -21301,14 +21105,13 @@ class TCPDF /** * Move a page to a previous position. - * @param $frompage (int) number of the source page - * @param $topage (int) number of the destination page (must be less than $frompage) - * @return true in case of success, false in case of error. + * @param int $frompage number of the source page + * @param int $topage number of the destination page (must be less than $frompage) + * @return bool true in case of success, false in case of error. * @public * @since 4.5.000 (2009-01-02) */ - public function movePage($frompage, $topage) - { + public function movePage($frompage, $topage) { if (($frompage > $this->numpages) OR ($frompage <= $topage)) { return false; } @@ -21452,7 +21255,7 @@ class TCPDF $jfrompage = $frompage; $jtopage = $topage; if (preg_match_all('/this\.addField\(\'([^\']*)\',\'([^\']*)\',([0-9]+)/', $this->javascript, $pamatch) > 0) { - foreach ($pamatch[0] as $pk => $pmatch) { + foreach($pamatch[0] as $pk => $pmatch) { $pagenum = intval($pamatch[3][$pk]) + 1; if (($pagenum >= $jtopage) AND ($pagenum < $jfrompage)) { $newpage = ($pagenum + 1); @@ -21474,13 +21277,12 @@ class TCPDF /** * Remove the specified page. - * @param $page (int) page to remove - * @return true in case of success, false in case of error. + * @param int $page page to remove + * @return bool true in case of success, false in case of error. * @public * @since 4.6.004 (2009-04-23) */ - public function deletePage($page) - { + public function deletePage($page) { if (($page < 1) OR ($page > $this->numpages)) { return false; } @@ -21492,7 +21294,7 @@ class TCPDF unset($this->bordermrk[$page]); unset($this->cntmrk[$page]); foreach ($this->pageobjects[$page] as $oid) { - if (isset($this->offsets[$oid])) { + if (isset($this->offsets[$oid])){ unset($this->offsets[$oid]); } } @@ -21573,7 +21375,7 @@ class TCPDF unset($this->bordermrk[$this->numpages]); unset($this->cntmrk[$this->numpages]); foreach ($this->pageobjects[$this->numpages] as $oid) { - if (isset($this->offsets[$oid])) { + if (isset($this->offsets[$oid])){ unset($this->offsets[$oid]); } } @@ -21641,7 +21443,7 @@ class TCPDF // adjust javascript $jpage = $page; if (preg_match_all('/this\.addField\(\'([^\']*)\',\'([^\']*)\',([0-9]+)/', $this->javascript, $pamatch) > 0) { - foreach ($pamatch[0] as $pk => $pmatch) { + foreach($pamatch[0] as $pk => $pmatch) { $pagenum = intval($pamatch[3][$pk]) + 1; if ($pagenum >= $jpage) { $newpage = ($pagenum - 1); @@ -21665,13 +21467,12 @@ class TCPDF /** * Clone the specified page to a new page. - * @param $page (int) number of page to copy (0 = current page) - * @return true in case of success, false in case of error. + * @param int $page number of page to copy (0 = current page) + * @return bool true in case of success, false in case of error. * @public * @since 4.9.015 (2010-04-20) */ - public function copyPage($page = 0) - { + public function copyPage($page=0) { if ($page == 0) { // default value $page = $this->page; @@ -21737,19 +21538,18 @@ class TCPDF * Before calling this method you have to open the page using the addTOCPage() method. * After calling this method you have to call endTOCPage() to close the TOC page. * You can override this method to achieve different styles. - * @param $page (int) page number where this TOC should be inserted (leave empty for current page). - * @param $numbersfont (string) set the font for page numbers (please use monospaced font for better alignment). - * @param $filler (string) string used to fill the space between text and page number. - * @param $toc_name (string) name to use for TOC bookmark. - * @param $style (string) Font style for title: B = Bold, I = Italic, BI = Bold + Italic. - * @param $color (array) RGB color array for bookmark title (values from 0 to 255). + * @param int|null $page page number where this TOC should be inserted (leave empty for current page). + * @param string $numbersfont set the font for page numbers (please use monospaced font for better alignment). + * @param string $filler string used to fill the space between text and page number. + * @param string $toc_name name to use for TOC bookmark. + * @param string $style Font style for title: B = Bold, I = Italic, BI = Bold + Italic. + * @param array $color RGB color array for bookmark title (values from 0 to 255). * @public * @author Nicola Asuni * @since 4.5.000 (2009-01-02) * @see addTOCPage(), endTOCPage(), addHTMLTOC() */ - public function addTOC($page = '', $numbersfont = '', $filler = '.', $toc_name = 'TOC', $style = '', $color = array(0,0,0)) - { + public function addTOC($page=null, $numbersfont='', $filler='.', $toc_name='TOC', $style='', $color=array(0,0,0)) { $fontsize = $this->FontSizePt; $fontfamily = $this->FontFamily; $fontstyle = $this->FontStyle; @@ -21777,7 +21577,7 @@ class TCPDF $page = 1; } } - $this->SetFont($numbersfont, $fontstyle, $fontsize); + $this->setFont($numbersfont, $fontstyle, $fontsize); $numwidth = $this->GetStringWidth('00000'); $maxpage = 0; //used for pages on attached documents foreach ($this->outlines as $key => $outline) { @@ -21793,11 +21593,11 @@ class TCPDF $alignnum = 'R'; } if ($outline['l'] == 0) { - $this->SetFont($fontfamily, $outline['s'].'B', $fontsize); + $this->setFont($fontfamily, $outline['s'].'B', $fontsize); } else { - $this->SetFont($fontfamily, $outline['s'], $fontsize - $outline['l']); + $this->setFont($fontfamily, $outline['s'], $fontsize - $outline['l']); } - $this->SetTextColorArray($outline['c']); + $this->setTextColorArray($outline['c']); // check for page break $this->checkPageBreak(2 * $this->getCellHeight($this->FontSize)); // set margins and X position @@ -21817,7 +21617,7 @@ class TCPDF $current_page = $this->page; $current_column = $this->current_column; } - $this->SetX($x_start); + $this->setX($x_start); $indent = ($spacer * $outline['l']); if ($this->rtl) { $this->x -= $indent; @@ -21827,7 +21627,7 @@ class TCPDF $this->lMargin = $this->x; } $link = $this->AddLink(); - $this->SetLink($link, $outline['y'], $outline['p']); + $this->setLink($link, $outline['y'], $outline['p']); // write the text if ($this->rtl) { $txt = ' '.$outline['t']; @@ -21840,7 +21640,7 @@ class TCPDF } else { $tw = $this->w - $this->rMargin - $this->x; } - $this->SetFont($numbersfont, $fontstyle, $fontsize); + $this->setFont($numbersfont, $fontstyle, $fontsize); if (TCPDF_STATIC::empty_string($page)) { $pagenum = $outline['p']; } else { @@ -21948,19 +21748,18 @@ class TCPDF * This method must be called after all Bookmarks were set. * Before calling this method you have to open the page using the addTOCPage() method. * After calling this method you have to call endTOCPage() to close the TOC page. - * @param $page (int) page number where this TOC should be inserted (leave empty for current page). - * @param $toc_name (string) name to use for TOC bookmark. - * @param $templates (array) array of html templates. Use: "#TOC_DESCRIPTION#" for bookmark title, "#TOC_PAGE_NUMBER#" for page number. - * @param $correct_align (boolean) if true correct the number alignment (numbers must be in monospaced font like courier and right aligned on LTR, or left aligned on RTL) - * @param $style (string) Font style for title: B = Bold, I = Italic, BI = Bold + Italic. - * @param $color (array) RGB color array for title (values from 0 to 255). + * @param int|null $page page number where this TOC should be inserted (leave empty for current page). + * @param string $toc_name name to use for TOC bookmark. + * @param array $templates array of html templates. Use: "#TOC_DESCRIPTION#" for bookmark title, "#TOC_PAGE_NUMBER#" for page number. + * @param boolean $correct_align if true correct the number alignment (numbers must be in monospaced font like courier and right aligned on LTR, or left aligned on RTL) + * @param string $style Font style for title: B = Bold, I = Italic, BI = Bold + Italic. + * @param array $color RGB color array for title (values from 0 to 255). * @public * @author Nicola Asuni * @since 5.0.001 (2010-05-06) * @see addTOCPage(), endTOCPage(), addTOC() */ - public function addHTMLTOC($page = '', $toc_name = 'TOC', $templates = array(), $correct_align = true, $style = '', $color = array(0,0,0)) - { + public function addHTMLTOC($page=null, $toc_name='TOC', $templates=array(), $correct_align=true, $style='', $color=array(0,0,0)) { $filler = ' '; $prev_htmlLinkColorArray = $this->htmlLinkColorArray; $prev_htmlLinkFontStyle = $this->htmlLinkFontStyle; @@ -21976,12 +21775,12 @@ class TCPDF $dom = $this->getHtmlDomArray($html); foreach ($dom as $key => $value) { if ($value['value'] == '#TOC_PAGE_NUMBER#') { - $this->SetFont($dom[($key - 1)]['fontname']); + $this->setFont($dom[($key - 1)]['fontname']); $templates['F'.$level] = $this->isUnicodeFont(); } } } - $this->SetFont($current_font); + $this->setFont($current_font); $maxpage = 0; //used for pages on attached documents foreach ($this->outlines as $key => $outline) { // get HTML template @@ -22093,8 +21892,7 @@ class TCPDF * @public * @since 4.5.029 (2009-03-19) */ - public function startTransaction() - { + public function startTransaction() { if (isset($this->objcopy)) { // remove previous copy $this->commitTransaction(); @@ -22111,48 +21909,53 @@ class TCPDF * @public * @since 4.5.029 (2009-03-19) */ - public function commitTransaction() - { + public function commitTransaction() { if (isset($this->objcopy)) { $this->objcopy->_destroy(true, true); + /* The unique file_id should not be used during cleanup again */ + $this->objcopy->file_id = NULL; unset($this->objcopy); } } /** * This method allows to undo the latest transaction by returning the latest saved TCPDF object with startTransaction(). - * @param $self (boolean) if true restores current class object to previous state without the need of reassignment via the returned value. + * @param boolean $self if true restores current class object to previous state without the need of reassignment via the returned value. * @return TCPDF object. * @public * @since 4.5.029 (2009-03-19) */ - public function rollbackTransaction($self = false) - { - if (isset($this->objcopy)) { - $this->_destroy(true, true); - if ($self) { - $objvars = get_object_vars($this->objcopy); - foreach ($objvars as $key => $value) { - $this->$key = $value; - } - } - return $this->objcopy; + public function rollbackTransaction($self=false) { + if (!isset($this->objcopy)) { + return $this; } - return $this; + $file_id = $this->file_id; + $objcopy = $this->objcopy; + $this->_destroy(true, true); + if ($self) { + $objvars = get_object_vars($objcopy); + foreach ($objvars as $key => $value) { + $this->$key = $value; + } + $objcopy->_destroy(true, true); + unset($objcopy); + return $this; + } + $this->file_id = $file_id; + return $objcopy; } // --- MULTI COLUMNS METHODS ----------------------- /** * Set multiple columns of the same size - * @param $numcols (int) number of columns (set to zero to disable columns mode) - * @param $width (int) column width - * @param $y (int) column starting Y position (leave empty for current Y position) + * @param int $numcols number of columns (set to zero to disable columns mode) + * @param int $width column width + * @param int|null $y column starting Y position (leave empty for current Y position) * @public * @since 4.9.001 (2010-03-28) */ - public function setEqualColumns($numcols = 0, $width = 0, $y = '') - { + public function setEqualColumns($numcols=0, $width=0, $y=null) { $this->columns = array(); if ($numcols < 2) { $numcols = 0; @@ -22184,8 +21987,7 @@ class TCPDF * @public * @since 5.9.072 (2011-04-26) */ - public function resetColumns() - { + public function resetColumns() { $this->lMargin = $this->original_lMargin; $this->rMargin = $this->original_rMargin; $this->setEqualColumns(); @@ -22194,12 +21996,11 @@ class TCPDF /** * Set columns array. * Each column is represented by an array of arrays with the following keys: (w = width, s = space between columns, y = column top position). - * @param $columns (array) + * @param array $columns * @public * @since 4.9.001 (2010-03-28) */ - public function setColumnsArray($columns) - { + public function setColumnsArray($columns) { $this->columns = $columns; $this->num_columns = count($columns); $this->current_column = 0; @@ -22209,13 +22010,12 @@ class TCPDF /** * Set position at a given column - * @param $col (int) column number (from 0 to getNumberOfColumns()-1); empty string = current column. + * @param int|null $col column number (from 0 to getNumberOfColumns()-1); empty string = current column. * @public * @since 4.9.001 (2010-03-28) */ - public function selectColumn($col = '') - { - if (is_string($col)) { + public function selectColumn($col=null) { + if (TCPDF_STATIC::empty_string($col)) { $col = $this->current_column; } elseif ($col >= $this->num_columns) { $col = 0; @@ -22293,8 +22093,7 @@ class TCPDF * @public * @since 5.5.011 (2010-07-08) */ - public function getColumn() - { + public function getColumn() { return $this->current_column; } @@ -22304,24 +22103,22 @@ class TCPDF * @public * @since 5.8.018 (2010-08-25) */ - public function getNumberOfColumns() - { + public function getNumberOfColumns() { return $this->num_columns; } /** * Set Text rendering mode. - * @param $stroke (int) outline size in user units (0 = disable). - * @param $fill (boolean) if true fills the text (default). - * @param $clip (boolean) if true activate clipping mode + * @param int $stroke outline size in user units (0 = disable). + * @param boolean $fill if true fills the text (default). + * @param boolean $clip if true activate clipping mode * @public * @since 4.9.008 (2009-04-02) */ - public function setTextRenderingMode($stroke = 0, $fill = true, $clip = false) - { + public function setTextRenderingMode($stroke=0, $fill=true, $clip=false) { // Ref.: PDF 32000-1:2008 - 9.3.6 Text Rendering Mode // convert text rendering parameters - if ($stroke < 0) { + if ($stroke < 0 || !is_numeric($stroke)) { $stroke = 0; } if ($fill === true) { @@ -22369,12 +22166,11 @@ class TCPDF /** * Set parameters for drop shadow effect for text. - * @param $params (array) Array of parameters: enabled (boolean) set to true to enable shadow; depth_w (float) shadow width in user units; depth_h (float) shadow height in user units; color (array) shadow color or false to use the stroke color; opacity (float) Alpha value: real value from 0 (transparent) to 1 (opaque); blend_mode (string) blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity. + * @param array $params Array of parameters: enabled (boolean) set to true to enable shadow; depth_w (float) shadow width in user units; depth_h (float) shadow height in user units; color (array) shadow color or false to use the stroke color; opacity (float) Alpha value: real value from 0 (transparent) to 1 (opaque); blend_mode (string) blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity. * @since 5.9.174 (2012-07-25) * @public */ - public function setTextShadow($params = array('enabled'=>false, 'depth_w'=>0, 'depth_h'=>0, 'color'=>false, 'opacity'=>1, 'blend_mode'=>'Normal')) - { + public function setTextShadow($params=array('enabled'=>false, 'depth_w'=>0, 'depth_h'=>0, 'color'=>false, 'opacity'=>1, 'blend_mode'=>'Normal')) { if (isset($params['enabled'])) { $this->txtshadow['enabled'] = $params['enabled']?true:false; } else { @@ -22412,31 +22208,29 @@ class TCPDF /** * Return the text shadow parameters array. - * @return Array of parameters. + * @return array array of parameters. * @since 5.9.174 (2012-07-25) * @public */ - public function getTextShadow() - { + public function getTextShadow() { return $this->txtshadow; } /** * 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 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 algorithm. - * @param $charmax (int) Maximum length of broken piece of word. + * @param array $word array of chars + * @param array $patterns Array of hypenation patterns. + * @param array $dictionary Array of words to be returned without applying the hyphenation algorithm. + * @param int $leftmin Minimum number of character to leave on the left of the word without applying the hyphens. + * @param int $rightmin Minimum number of character to leave on the right of the word without applying the hyphens. + * @param int $charmin Minimum word length to apply the hyphenation algorithm. + * @param int $charmax Maximum length of broken piece of word. * @return array text with soft hyphens * @author Nicola Asuni * @since 4.9.012 (2010-04-12) * @protected */ - protected function hyphenateWord($word, $patterns, $dictionary = array(), $leftmin = 1, $rightmin = 2, $charmin = 1, $charmax = 8) - { + protected function hyphenateWord($word, $patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8) { $hyphenword = array(); // hyphens positions $numchars = count($word); if ($numchars <= $charmin) { @@ -22504,20 +22298,19 @@ class TCPDF /** * 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 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 algorithm. - * @param $charmax (int) Maximum length of broken piece of word. - * @return array text with soft hyphens + * @param string $text text to process + * @param mixed $patterns 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 array $dictionary Array of words to be returned without applying the hyphenation algorithm. + * @param int $leftmin Minimum number of character to leave on the left of the word without applying the hyphens. + * @param int $rightmin Minimum number of character to leave on the right of the word without applying the hyphens. + * @param int $charmin Minimum word length to apply the hyphenation algorithm. + * @param int $charmax Maximum length of broken piece of word. + * @return string text with soft hyphens * @author Nicola Asuni * @since 4.9.012 (2010-04-12) * @public */ - public function hyphenateText($text, $patterns, $dictionary = array(), $leftmin = 1, $rightmin = 2, $charmin = 1, $charmax = 8) - { + public function hyphenateText($text, $patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8) { $text = $this->unhtmlentities($text); $word = array(); // last word $txtarr = array(); // text to be returned @@ -22577,24 +22370,22 @@ class TCPDF /** * Enable/disable rasterization of vector images using ImageMagick library. - * @param $mode (boolean) if true enable rasterization, false otherwise. + * @param boolean $mode if true enable rasterization, false otherwise. * @public * @since 5.0.000 (2010-04-27) */ - public function setRasterizeVectorImages($mode) - { + public function setRasterizeVectorImages($mode) { $this->rasterize_vector_images = $mode; } /** * Enable or disable default option for font subsetting. - * @param $enable (boolean) if true enable font subsetting by default. + * @param boolean $enable if true enable font subsetting by default. * @author Nicola Asuni * @public * @since 5.3.002 (2010-06-07) */ - public function setFontSubsetting($enable = true) - { + public function setFontSubsetting($enable=true) { if ($this->pdfa_mode) { $this->font_subsetting = false; } else { @@ -22604,55 +22395,51 @@ class TCPDF /** * Return the default option for font subsetting. - * @return boolean default font subsetting state. + * @return bool default font subsetting state. * @author Nicola Asuni * @public * @since 5.3.002 (2010-06-07) */ - public function getFontSubsetting() - { + public function getFontSubsetting() { return $this->font_subsetting; } /** * Left trim the input string - * @param $str (string) string to trim - * @param $replace (string) string that replace spaces. - * @return left trimmed string + * @param string $str string to trim + * @param string $replace string that replace spaces. + * @return string left trimmed string * @author Nicola Asuni * @public * @since 5.8.000 (2010-08-11) */ - public function stringLeftTrim($str, $replace = '') - { + public function stringLeftTrim($str, $replace='') { return preg_replace('/^'.$this->re_space['p'].'+/'.$this->re_space['m'], $replace, $str); } /** * Right trim the input string - * @param $str (string) string to trim - * @param $replace (string) string that replace spaces. - * @return right trimmed string + * @param string $str string to trim + * @param string $replace string that replace spaces. + * @return string right trimmed string * @author Nicola Asuni * @public * @since 5.8.000 (2010-08-11) */ - public function stringRightTrim($str, $replace = '') - { + public function stringRightTrim($str, $replace='') { return preg_replace('/'.$this->re_space['p'].'+$/'.$this->re_space['m'], $replace, $str); } /** * Trim the input string - * @param $str (string) string to trim - * @param $replace (string) string that replace spaces. - * @return trimmed string + * @param string $str string to trim + * @param string $replace string that replace spaces. + * @return string trimmed string * @author Nicola Asuni * @public * @since 5.8.000 (2010-08-11) */ - public function stringTrim($str, $replace = '') - { + public function stringTrim($str, $replace='') { $str = $this->stringLeftTrim($str, $replace); $str = $this->stringRightTrim($str, $replace); return $str; @@ -22660,26 +22447,24 @@ class TCPDF /** * Return true if the current font is unicode type. - * @return true for unicode font, false otherwise. + * @return bool true for unicode font, false otherwise. * @author Nicola Asuni * @public * @since 5.8.002 (2010-08-14) */ - public function isUnicodeFont() - { + public function isUnicodeFont() { return (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')); } /** * Return normalized font name - * @param $fontfamily (string) property string containing font family names + * @param string $fontfamily property string containing font family names * @return string normalized font name * @author Nicola Asuni * @public * @since 5.8.004 (2010-08-17) */ - public function getFontFamilyName($fontfamily) - { + public function getFontFamilyName($fontfamily) { // remove spaces and symbols $fontfamily = preg_replace('/[^a-z0-9_\,]/', '', strtolower($fontfamily)); // extract all font names @@ -22714,17 +22499,16 @@ class TCPDF * An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). * An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked. * Note: X,Y coordinates will be reset to 0,0. - * @param $w (int) Template width in user units (empty string or zero = page width less margins). - * @param $h (int) Template height in user units (empty string or zero = page height less margins). - * @param $group (mixed) Set transparency group. Can be a boolean value or an array specifying optional parameters: 'CS' (solour space name), 'I' (boolean flag to indicate isolated group) and 'K' (boolean flag to indicate knockout group). - * @return int the XObject Template ID in case of success or false in case of error. + * @param int $w Template width in user units (empty string or zero = page width less margins). + * @param int $h Template height in user units (empty string or zero = page height less margins). + * @param mixed $group Set transparency group. Can be a boolean value or an array specifying optional parameters: 'CS' (solour space name), 'I' (boolean flag to indicate isolated group) and 'K' (boolean flag to indicate knockout group). + * @return string|false the XObject Template ID in case of success or false in case of error. * @author Nicola Asuni * @public * @since 5.8.017 (2010-08-24) * @see endTemplate(), printTemplate() */ - public function startTemplate($w = 0, $h = 0, $group = false) - { + public function startTemplate($w=0, $h=0, $group=false) { if ($this->inxobj) { // we are already inside an XObject template return false; @@ -22751,7 +22535,7 @@ class TCPDF // set new environment $this->num_columns = 1; $this->current_column = 0; - $this->SetAutoPageBreak(false); + $this->setAutoPageBreak(false); if (($w === '') OR ($w <= 0)) { $w = $this->w - $this->lMargin - $this->rMargin; } @@ -22783,14 +22567,13 @@ class TCPDF * End the current XObject Template started with startTemplate() and restore the previous graphic state. * An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). * An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked. - * @return int the XObject Template ID in case of success or false in case of error. + * @return string|false the XObject Template ID in case of success or false in case of error. * @author Nicola Asuni * @public * @since 5.8.017 (2010-08-24) * @see startTemplate(), printTemplate() */ - public function endTemplate() - { + public function endTemplate() { if (!$this->inxobj) { // we are not inside a template return false; @@ -22806,21 +22589,20 @@ class TCPDF * You can print an XObject Template inside the currently opened Template. * An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). * An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked. - * @param $id (string) The ID of XObject Template to print. - * @param $x (int) X position in user units (empty string = current x position) - * @param $y (int) Y position in user units (empty string = current y position) - * @param $w (int) Width in user units (zero = remaining page width) - * @param $h (int) Height in user units (zero = remaining page height) - * @param $align (string) Indicates the alignment of the pointer next to template insertion relative to template height. The value can be:
            • T: top-right for LTR or top-left for RTL
            • M: middle-right for LTR or middle-left for RTL
            • B: bottom-right for LTR or bottom-left for RTL
            • N: next line
            - * @param $palign (string) Allows to center or align the template on the current line. Possible values are:
            • L : left align
            • C : center
            • R : right align
            • '' : empty string : left for LTR or right for RTL
            - * @param $fitonpage (boolean) If true the template is resized to not exceed page dimensions. + * @param string $id The ID of XObject Template to print. + * @param float|null $x X position in user units (empty string = current x position) + * @param float|null $y Y position in user units (empty string = current y position) + * @param float $w Width in user units (zero = remaining page width) + * @param float $h Height in user units (zero = remaining page height) + * @param string $align Indicates the alignment of the pointer next to template insertion relative to template height. The value can be:
            • T: top-right for LTR or top-left for RTL
            • M: middle-right for LTR or middle-left for RTL
            • B: bottom-right for LTR or bottom-left for RTL
            • N: next line
            + * @param string $palign Allows to center or align the template on the current line. Possible values are:
            • L : left align
            • C : center
            • R : right align
            • '' : empty string : left for LTR or right for RTL
            + * @param boolean $fitonpage If true the template is resized to not exceed page dimensions. * @author Nicola Asuni * @public * @since 5.8.017 (2010-08-24) * @see startTemplate(), endTemplate() */ - public function printTemplate($id, $x = '', $y = '', $w = 0, $h = 0, $align = '', $palign = '', $fitonpage = false) - { + public function printTemplate($id, $x=null, $y=null, $w=0, $h=0, $align='', $palign='', $fitonpage=false) { if ($this->state != 2) { return; } @@ -22837,10 +22619,10 @@ class TCPDF } } // set default values - if ($x === '') { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary @@ -22920,7 +22702,7 @@ class TCPDF } } // set pointer to align the next text/objects - switch ($align) { + switch($align) { case 'T': { $this->y = $y; $this->x = $rb_x; @@ -22937,7 +22719,7 @@ class TCPDF break; } case 'N': { - $this->SetY($rb_y); + $this->setY($rb_y); break; } default:{ @@ -22948,13 +22730,12 @@ class TCPDF /** * Set the percentage of character stretching. - * @param $perc (int) percentage of stretching (100 = no stretching) + * @param int $perc percentage of stretching (100 = no stretching) * @author Nicola Asuni * @public * @since 5.9.000 (2010-09-29) */ - public function setFontStretching($perc = 100) - { + public function setFontStretching($perc=100) { $this->font_stretching = $perc; } @@ -22965,20 +22746,18 @@ class TCPDF * @public * @since 5.9.000 (2010-09-29) */ - public function getFontStretching() - { + public function getFontStretching() { return $this->font_stretching; } /** * Set the amount to increase or decrease the space between characters in a text. - * @param $spacing (float) amount to increase or decrease the space between characters in a text (0 = default spacing) + * @param float $spacing amount to increase or decrease the space between characters in a text (0 = default spacing) * @author Nicola Asuni * @public * @since 5.9.000 (2010-09-29) */ - public function setFontSpacing($spacing = 0) - { + public function setFontSpacing($spacing=0) { $this->font_spacing = $spacing; } @@ -22989,8 +22768,7 @@ class TCPDF * @public * @since 5.9.000 (2010-09-29) */ - public function getFontSpacing() - { + public function getFontSpacing() { return $this->font_spacing; } @@ -23002,8 +22780,7 @@ class TCPDF * @since 5.9.003 (2010-10-13) * @see setPageRegions(), addPageRegion() */ - public function getPageRegions() - { + public function getPageRegions() { return $this->page_regions; } @@ -23012,14 +22789,13 @@ class TCPDF * A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. * A region is always aligned on the left or right side of the page ad is defined using a vertical segment. * You can set multiple regions for the same page. - * @param $regions (array) array of no-write regions. For each region you can define an array as follow: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right). Omit this parameter to remove all regions. + * @param array $regions array of no-write regions. For each region you can define an array as follow: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right). Omit this parameter to remove all regions. * @author Nicola Asuni * @public * @since 5.9.003 (2010-10-13) * @see addPageRegion(), getPageRegions() */ - public function setPageRegions($regions = array()) - { + public function setPageRegions($regions=array()) { // empty current regions array $this->page_regions = array(); // add regions @@ -23033,14 +22809,13 @@ class TCPDF * A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. * A region is always aligned on the left or right side of the page ad is defined using a vertical segment. * You can set multiple regions for the same page. - * @param $region (array) array of a single no-write region array: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right). + * @param array $region array of a single no-write region array: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right). * @author Nicola Asuni * @public * @since 5.9.003 (2010-10-13) * @see setPageRegions(), getPageRegions() */ - public function addPageRegion($region) - { + public function addPageRegion($region) { if (!isset($region['page']) OR empty($region['page'])) { $region['page'] = $this->page; } @@ -23053,14 +22828,13 @@ class TCPDF /** * Remove a single no-write region. - * @param $key (int) region key + * @param int $key region key * @author Nicola Asuni * @public * @since 5.9.003 (2010-10-13) * @see setPageRegions(), getPageRegions() */ - public function removePageRegion($key) - { + public function removePageRegion($key) { if (isset($this->page_regions[$key])) { unset($this->page_regions[$key]); } @@ -23070,16 +22844,15 @@ class TCPDF * Check page for no-write regions and adapt current coordinates and page margins if necessary. * A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. * A region is always aligned on the left or right side of the page ad is defined using a vertical segment. - * @param $h (float) height of the text/image/object to print in user units - * @param $x (float) current X coordinate in user units - * @param $y (float) current Y coordinate in user units - * @return array($x, $y) + * @param float $h height of the text/image/object to print in user units + * @param float $x current X coordinate in user units + * @param float $y current Y coordinate in user units + * @return float[] array($x, $y) * @author Nicola Asuni * @protected * @since 5.9.003 (2010-10-13) */ - protected function checkPageRegions($h, $x, $y) - { + protected function checkPageRegions($h, $x, $y) { // set default values if ($x === '') { $x = $this->x; @@ -23168,22 +22941,21 @@ class TCPDF /** * Embedd a Scalable Vector Graphics (SVG) image. * NOTE: SVG standard is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library. - * @param $file (string) Name of the SVG file or a '@' character followed by the SVG data string. - * @param $x (float) Abscissa of the upper-left corner. - * @param $y (float) Ordinate of the upper-left corner. - * @param $w (float) Width of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param $h (float) Height of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param $link (mixed) URL or identifier returned by AddLink(). - * @param $align (string) Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
            • T: top-right for LTR or top-left for RTL
            • M: middle-right for LTR or middle-left for RTL
            • B: bottom-right for LTR or bottom-left for RTL
            • N: next line
            If the alignment is an empty string, then the pointer will be restored on the starting SVG position. - * @param $palign (string) Allows to center or align the image on the current line. Possible values are:
            • L : left align
            • C : center
            • R : right align
            • '' : empty string : left for LTR or right for RTL
            - * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
            • 0: no border (default)
            • 1: frame
            or a string containing some or all of the following characters (in any order):
            • L: left
            • T: top
            • R: right
            • B: bottom
            or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param $fitonpage (boolean) if true the image is resized to not exceed page dimensions. + * @param string $file Name of the SVG file or a '@' character followed by the SVG data string. + * @param float|null $x Abscissa of the upper-left corner. + * @param float|null $y Ordinate of the upper-left corner. + * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param mixed $link URL or identifier returned by AddLink(). + * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
            • T: top-right for LTR or top-left for RTL
            • M: middle-right for LTR or middle-left for RTL
            • B: bottom-right for LTR or bottom-left for RTL
            • N: next line
            If the alignment is an empty string, then the pointer will be restored on the starting SVG position. + * @param string $palign Allows to center or align the image on the current line. Possible values are:
            • L : left align
            • C : center
            • R : right align
            • '' : empty string : left for LTR or right for RTL
            + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
            • 0: no border (default)
            • 1: frame
            or a string containing some or all of the following characters (in any order):
            • L: left
            • T: top
            • R: right
            • B: bottom
            or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param boolean $fitonpage if true the image is resized to not exceed page dimensions. * @author Nicola Asuni * @since 5.0.000 (2010-05-02) * @public */ - public function ImageSVG($file, $x = '', $y = '', $w = 0, $h = 0, $link = '', $align = '', $palign = '', $border = 0, $fitonpage = false) - { + public function ImageSVG($file, $x=null, $y=null, $w=0, $h=0, $link='', $align='', $palign='', $border=0, $fitonpage=false) { if ($this->state != 2) { return; } @@ -23207,15 +22979,15 @@ class TCPDF $svgdata = substr($file, 1); } else { // SVG file $this->svgdir = dirname($file); - $svgdata = TCPDF_STATIC::fileGetContents($file); + $svgdata = $this->getCachedFileContents($file); } - if ($svgdata === false) { + if ($svgdata === FALSE) { $this->Error('SVG file not found: '.$file); } - if ($x === '') { + if (TCPDF_STATIC::empty_string($x)) { $x = $this->x; } - if ($y === '') { + if (TCPDF_STATIC::empty_string($y)) { $y = $this->y; } // check page for no-write regions and adapt page margins if necessary @@ -23406,8 +23178,8 @@ class TCPDF $page_break_mode = $this->AutoPageBreak; $page_break_margin = $this->getBreakMargin(); $cell_padding = $this->cell_padding; - $this->SetCellPadding(0); - $this->SetAutoPageBreak(false); + $this->setCellPadding(0); + $this->setAutoPageBreak(false); // save the current graphic state $this->_out('q'.$this->epsmarker); // set initial clipping mask @@ -23417,22 +23189,26 @@ class TCPDF $f = ($this->h - $oy) * $this->k * (1 - $svgscale_y); $this->_out(sprintf('%F %F %F %F %F %F cm', $svgscale_x, 0, 0, $svgscale_y, ($e + $svgoffset_x), ($f + $svgoffset_y))); // creates a new XML parser to be used by the other XML functions - $this->parser = xml_parser_create('UTF-8'); + $parser = xml_parser_create('UTF-8'); // the following function allows to use parser inside object - xml_set_object($this->parser, $this); + xml_set_object($parser, $this); // disable case-folding for this XML parser - xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); // sets the element handler functions for the XML parser - xml_set_element_handler($this->parser, 'startSVGElementHandler', 'endSVGElementHandler'); + xml_set_element_handler($parser, 'startSVGElementHandler', 'endSVGElementHandler'); // sets the character data handler function for the XML parser - xml_set_character_data_handler($this->parser, 'segSVGContentHandler'); + xml_set_character_data_handler($parser, 'segSVGContentHandler'); // start parsing an XML document - if (!xml_parse($this->parser, $svgdata)) { - $error_message = sprintf('SVG Error: %s at line %d', xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser)); + if (!xml_parse($parser, $svgdata)) { + $error_message = sprintf('SVG Error: %s at line %d', xml_error_string(xml_get_error_code($parser)), xml_get_current_line_number($parser)); $this->Error($error_message); } // free this XML parser - xml_parser_free($this->parser); + xml_parser_free($parser); + + // >= PHP 7.0.0 "explicitly unset the reference to parser to avoid memory leaks" + unset($parser); + // restore previous graphic state $this->_out($this->epsmarker.'Q'); // restore graphic vars @@ -23454,7 +23230,7 @@ class TCPDF $this->Link($ximg, $y, $w, $h, $link, 0); } // set pointer to align the next text/objects - switch ($align) { + switch($align) { case 'T':{ $this->y = $y; $this->x = $this->img_rb_x; @@ -23471,7 +23247,7 @@ class TCPDF break; } case 'N':{ - $this->SetY($this->img_rb_y); + $this->setY($this->img_rb_y); break; } default:{ @@ -23493,19 +23269,18 @@ class TCPDF } $this->endlinex = $this->img_rb_x; // restore page break - $this->SetAutoPageBreak($page_break_mode, $page_break_margin); + $this->setAutoPageBreak($page_break_mode, $page_break_margin); $this->cell_padding = $cell_padding; } /** * Convert SVG transformation matrix to PDF. - * @param $tm (array) original SVG transformation matrix + * @param array $tm original SVG transformation matrix * @return array transformation matrix * @protected * @since 5.0.000 (2010-05-02) */ - protected function convertSVGtMatrix($tm) - { + protected function convertSVGtMatrix($tm) { $a = $tm[0]; $b = -$tm[1]; $c = -$tm[2]; @@ -23521,32 +23296,30 @@ class TCPDF /** * Apply SVG graphic transformation matrix. - * @param $tm (array) original SVG transformation matrix + * @param array $tm original SVG transformation matrix * @protected * @since 5.0.000 (2010-05-02) */ - protected function SVGTransform($tm) - { + protected function SVGTransform($tm) { $this->Transform($this->convertSVGtMatrix($tm)); } /** * Apply the requested SVG styles (*** TO BE COMPLETED ***) - * @param $svgstyle (array) array of SVG styles to apply - * @param $prevsvgstyle (array) array of previous SVG style - * @param $x (int) X origin of the bounding box - * @param $y (int) Y origin of the bounding box - * @param $w (int) width of the bounding box - * @param $h (int) height of the bounding box - * @param $clip_function (string) clip function - * @param $clip_params (array) array of parameters for clipping function - * @return object style + * @param array $svgstyle array of SVG styles to apply + * @param array $prevsvgstyle array of previous SVG style + * @param int $x X origin of the bounding box + * @param int $y Y origin of the bounding box + * @param int $w width of the bounding box + * @param int $h height of the bounding box + * @param string $clip_function clip function + * @param array $clip_params array of parameters for clipping function + * @return string style * @author Nicola Asuni * @since 5.0.000 (2010-05-02) * @protected */ - protected function setSVGStyles($svgstyle, $prevsvgstyle, $x = 0, $y = 0, $w = 1, $h = 1, $clip_function = '', $clip_params = array()) - { + protected function setSVGStyles($svgstyle, $prevsvgstyle, $x=0, $y=0, $w=1, $h=1, $clip_function='', $clip_params=array()) { if ($this->state != 2) { return; } @@ -23569,10 +23342,10 @@ class TCPDF } // color $fill_color = TCPDF_COLORS::convertHTMLColorToDec($svgstyle['color'], $this->spot_colors); - $this->SetFillColorArray($fill_color); + $this->setFillColorArray($fill_color); // text color $text_color = TCPDF_COLORS::convertHTMLColorToDec($svgstyle['text-color'], $this->spot_colors); - $this->SetTextColorArray($text_color); + $this->setTextColorArray($text_color); // clip if (preg_match('/rect\(([a-z0-9\-\.]*)[\s]*([a-z0-9\-\.]*)[\s]*([a-z0-9\-\.]*)[\s]*([a-z0-9\-\.]*)\)/si', $svgstyle['clip'], $regs)) { $top = (isset($regs[1])?$this->getHTMLUnitToUnits($regs[1], 0, $this->svgunit, false):0); @@ -23661,7 +23434,7 @@ class TCPDF $gradient['coords'][3] = (($gradient['coords'][3] - $y) / $h); $gradient['coords'][4] /= $w; } elseif ($gradient['mode'] == 'percentage') { - foreach ($gradient['coords'] as $key => $val) { + foreach($gradient['coords'] as $key => $val) { $gradient['coords'][$key] = (intval($val) / 100); if ($val < 0) { $gradient['coords'][$key] = 0; @@ -23699,7 +23472,7 @@ class TCPDF if ($svgstyle['fill-opacity'] != 1) { $this->setAlpha($this->alpha['CA'], 'Normal', $svgstyle['fill-opacity'], false); } - $this->SetFillColorArray($fill_color); + $this->setFillColorArray($fill_color); if ($svgstyle['fill-rule'] == 'evenodd') { $objstyle .= 'F*'; } else { @@ -23722,7 +23495,7 @@ class TCPDF if (isset($svgstyle['stroke-dasharray']) AND !empty($svgstyle['stroke-dasharray']) AND ($svgstyle['stroke-dasharray'] != 'none')) { $stroke_style['dash'] = $svgstyle['stroke-dasharray']; } - $this->SetLineStyle($stroke_style); + $this->setLineStyle($stroke_style); $objstyle .= 'D'; } // font @@ -23817,7 +23590,7 @@ class TCPDF break; } } - $this->SetFont($font_family, $font_style, $font_size); + $this->setFont($font_family, $font_style, $font_size); $this->setFontStretching($font_stretch); $this->setFontSpacing($font_spacing); return $objstyle; @@ -23825,26 +23598,25 @@ class TCPDF /** * Draws an SVG path - * @param $d (string) attribute d of the path SVG element - * @param $style (string) Style of rendering. Possible values are: - *
              - *
            • D or empty string: Draw (default).
            • - *
            • F: Fill.
            • - *
            • F*: Fill using the even-odd rule to determine which regions lie inside the clipping path.
            • - *
            • DF or FD: Draw and fill.
            • - *
            • DF* or FD*: Draw and fill using the even-odd rule to determine which regions lie inside the clipping path.
            • - *
            • CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
            • - *
            • CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
            • - *
            + * @param string $d attribute d of the path SVG element + * @param string $style Style of rendering. Possible values are: + *
              + *
            • D or empty string: Draw (default).
            • + *
            • F: Fill.
            • + *
            • F*: Fill using the even-odd rule to determine which regions lie inside the clipping path.
            • + *
            • DF or FD: Draw and fill.
            • + *
            • DF* or FD*: Draw and fill using the even-odd rule to determine which regions lie inside the clipping path.
            • + *
            • CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
            • + *
            • CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
            • + *
            * @return array of container box measures (x, y, w, h) * @author Nicola Asuni * @since 5.0.000 (2010-05-02) * @protected */ - protected function SVGPath($d, $style = '') - { + protected function SVGPath($d, $style='') { if ($this->state != 2) { - return; + return; } // set fill/stroke style $op = TCPDF_STATIC::getPathPaintOperator($style, ''); @@ -23853,6 +23625,7 @@ class TCPDF } $paths = array(); $d = preg_replace('/([0-9ACHLMQSTVZ])([\-\+])/si', '\\1 \\2', $d); + $d = preg_replace('/(\.[0-9]+)(\.)/s', '\\1 \\2', $d); preg_match_all('/([ACHLMQSTVZ])[\s]*([^ACHLMQSTVZ\"]*)/si', $d, $paths, PREG_SET_ORDER); $x = 0; $y = 0; @@ -23864,6 +23637,8 @@ class TCPDF $xmax = 0; $ymin = 2147483647; $ymax = 0; + $xinitial = 0; + $yinitial = 0; $relcoord = false; $minlen = (0.01 / $this->k); // minimum acceptable length (3 point) $firstcmd = true; // used to print first point @@ -23908,6 +23683,8 @@ class TCPDF if ($ck == 1) { $this->_outPoint($x, $y); $firstcmd = false; + $xinitial = $x; + $yinitial = $y; } else { $this->_outLine($x, $y); } @@ -24095,8 +23872,8 @@ class TCPDF if ((($ck + 1) % 7) == 0) { $x0 = $x; $y0 = $y; - $rx = abs($params[($ck - 6)]); - $ry = abs($params[($ck - 5)]); + $rx = max(abs($params[($ck - 6)]), .000000001); + $ry = max(abs($params[($ck - 5)]), .000000001); $ang = -$rawparams[($ck - 4)]; $angle = deg2rad($ang); $fa = $rawparams[($ck - 3)]; // large-arc-flag @@ -24133,7 +23910,7 @@ class TCPDF } else { $root = sqrt($numerator / (($rx2 * $ya2) + ($ry2 * $xa2))); } - if ($fa == $fs) { + if ($fa == $fs){ $root *= -1; } $cax = $root * (($rx * $ya) / $ry); @@ -24183,25 +23960,24 @@ class TCPDF } case 'Z': { $this->_out('h'); + $x = $x0 = $xinitial; + $y = $y0 = $yinitial; break; } } $firstcmd = false; } // end foreach - if (!empty($op)) { - $this->_out($op); - } + $this->_out($op); return array($xmin, $ymin, ($xmax - $xmin), ($ymax - $ymin)); } /** * Return the tag name without the namespace - * @param $name (string) Tag name + * @param string $name Tag name * @protected */ - protected function removeTagNamespace($name) - { - if (strpos($name, ':') !== false) { + protected function removeTagNamespace($name) { + if(strpos($name, ':') !== false) { $parts = explode(':', $name); return $parts[(sizeof($parts) - 1)]; } @@ -24210,16 +23986,15 @@ class TCPDF /** * Sets the opening SVG element handler function for the XML parser. (*** TO BE COMPLETED ***) - * @param $parser (resource) The first parameter, parser, is a reference to the XML parser calling the handler. - * @param $name (string) The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. - * @param $attribs (array) The third parameter, attribs, contains an associative array with the element's attributes (if any). The keys of this array are the attribute names, the values are the attribute values. Attribute names are case-folded on the same criteria as element names. Attribute values are not case-folded. The original order of the attributes can be retrieved by walking through attribs the normal way, using each(). The first key in the array was the first attribute, and so on. - * @param $ctm (array) tranformation matrix for clipping mode (starting transformation matrix). + * @param resource|string $parser The first parameter, parser, is a reference to the XML parser calling the handler. + * @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. + * @param array $attribs The third parameter, attribs, contains an associative array with the element's attributes (if any). The keys of this array are the attribute names, the values are the attribute values. Attribute names are case-folded on the same criteria as element names. Attribute values are not case-folded. The original order of the attributes can be retrieved by walking through attribs the normal way, using each(). The first key in the array was the first attribute, and so on. + * @param array $ctm tranformation matrix for clipping mode (starting transformation matrix). * @author Nicola Asuni * @since 5.0.000 (2010-05-02) * @protected */ - protected function startSVGElementHandler($parser, $name, $attribs, $ctm = array()) - { + protected function startSVGElementHandler($parser, $name, $attribs, $ctm=array()) { $name = $this->removeTagNamespace($name); // check if we are in clip mode if ($this->svgclipmode) { @@ -24232,7 +24007,7 @@ class TCPDF $this->svgdefs[$attribs['id']] = array('name' => $name, 'attribs' => $attribs); return; } - if (end($this->svgdefs) !== false) { + if (end($this->svgdefs) !== FALSE) { $last_svgdefs_id = key($this->svgdefs); if (isset($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'])) { $attribs['id'] = 'DF_'.(count($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements']) + 1); @@ -24248,7 +24023,7 @@ class TCPDF $clipping = true; } // get styling properties - $prev_svgstyle = $this->svgstyles[max(0, (count($this->svgstyles) - 1))]; // previous style + $prev_svgstyle = $this->svgstyles[max(0,(count($this->svgstyles) - 1))]; // previous style $svgstyle = $this->svgstyles[0]; // set default style if ($clipping AND !isset($attribs['fill']) AND (!isset($attribs['style']) OR (!preg_match('/[;\"\s]{1}fill[\s]*:[\s]*([^;\"]*)/si', $attribs['style'], $attrval)))) { // default fill attribute for clipping @@ -24298,7 +24073,7 @@ class TCPDF $invisible = true; } // process tag - switch ($name) { + switch($name) { case 'defs': { $this->svgdefsmode = true; break; @@ -24319,7 +24094,7 @@ class TCPDF } case 'svg': { // start of SVG object - if (++$this->svg_tag_depth <= 1) { + if(++$this->svg_tag_depth <= 1) { break; } // inner SVG @@ -24355,7 +24130,7 @@ class TCPDF $aspectY = 'YMid'; $fit = 'meet'; if (isset($attribs['preserveAspectRatio'])) { - if ($attribs['preserveAspectRatio'] == 'none') { + if($attribs['preserveAspectRatio'] == 'none') { $fit = 'none'; } else { preg_match_all('/[a-zA-Z]+/', $attribs['preserveAspectRatio'], $tmp); @@ -24409,7 +24184,7 @@ class TCPDF break; } case 'linearGradient': { - if ($this->pdfa_mode) { + if ($this->pdfa_mode && $this->pdfa_version < 2) { break; } if (!isset($attribs['id'])) { @@ -24449,7 +24224,7 @@ class TCPDF break; } case 'radialGradient': { - if ($this->pdfa_mode) { + if ($this->pdfa_mode && $this->pdfa_version < 2) { break; } if (!isset($attribs['id'])) { @@ -24851,7 +24626,7 @@ class TCPDF } if (!empty($use['attribs']['style'])) { // merge styles - $attribs['style'] = str_replace(';;', ';', ';'.$use['attribs']['style'].$attribs['style']); + $attribs['style'] = str_replace(';;',';',';'.$use['attribs']['style'].$attribs['style']); } $attribs = array_merge($use['attribs'], $attribs); $this->startSVGElementHandler($parser, $use['name'], $attribs); @@ -24868,7 +24643,7 @@ class TCPDF if (!empty($attribs['child_elements'])) { $child_elements = $attribs['child_elements']; unset($attribs['child_elements']); - foreach ($child_elements as $child_element) { + foreach($child_elements as $child_element) { if (empty($child_element['attribs']['closing_tag'])) { $this->startSVGElementHandler('child-tag', $child_element['name'], $child_element['attribs']); } else { @@ -24883,34 +24658,33 @@ class TCPDF /** * Sets the closing SVG element handler function for the XML parser. - * @param $parser (resource) The first parameter, parser, is a reference to the XML parser calling the handler. - * @param $name (string) The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. + * @param resource|string $parser The first parameter, parser, is a reference to the XML parser calling the handler. + * @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. * @author Nicola Asuni * @since 5.0.000 (2010-05-02) * @protected */ - protected function endSVGElementHandler($parser, $name) - { + protected function endSVGElementHandler($parser, $name) { $name = $this->removeTagNamespace($name); if ($this->svgdefsmode AND !in_array($name, array('defs', 'clipPath', 'linearGradient', 'radialGradient', 'stop'))) {; - if (end($this->svgdefs) !== false) { + if (end($this->svgdefs) !== FALSE) { $last_svgdefs_id = key($this->svgdefs); if (isset($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'])) { - foreach ($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'] as $child_element) { + foreach($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'] as $child_element) { if (isset($child_element['attribs']['id']) AND ($child_element['name'] == $name)) { - $this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'][$child_element['attribs']['id'].'_CLOSE'] = array('name' => $name, 'attribs' => array('closing_tag' => true, 'content' => $this->svgtext)); + $this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'][$child_element['attribs']['id'].'_CLOSE'] = array('name' => $name, 'attribs' => array('closing_tag' => TRUE, 'content' => $this->svgtext)); return; } } if ($this->svgdefs[$last_svgdefs_id]['name'] == $name) { - $this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'][$last_svgdefs_id.'_CLOSE'] = array('name' => $name, 'attribs' => array('closing_tag' => true, 'content' => $this->svgtext)); + $this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'][$last_svgdefs_id.'_CLOSE'] = array('name' => $name, 'attribs' => array('closing_tag' => TRUE, 'content' => $this->svgtext)); return; } } } return; } - switch ($name) { + switch($name) { case 'defs': { $this->svgdefsmode = false; break; @@ -24991,18 +24765,45 @@ class TCPDF /** * Sets the character data handler function for the XML parser. - * @param $parser (resource) The first parameter, parser, is a reference to the XML parser calling the handler. - * @param $data (string) The second parameter, data, contains the character data as a string. + * @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler. + * @param string $data The second parameter, data, contains the character data as a string. * @author Nicola Asuni * @since 5.0.000 (2010-05-02) * @protected */ - protected function segSVGContentHandler($parser, $data) - { + protected function segSVGContentHandler($parser, $data) { $this->svgtext .= $data; } // --- END SVG METHODS ----------------------------------------------------- + + /** + * Keeps files in memory, so it doesn't need to downloaded everytime in a loop + * @param string $file + * @return string + */ + protected function getCachedFileContents($file) + { + if (!isset($this->fileContentCache[$file])) { + $this->fileContentCache[$file] = TCPDF_STATIC::fileGetContents($file); + } + return $this->fileContentCache[$file]; + } + + /** + * Avoid multiple calls to an external server to see if a file exists + * @param string $file + * @return bool + */ + protected function fileExists($file) + { + if (isset($this->fileContentCache[$file]) || false !== $this->getImageBuffer($file)) { + return true; + } + + return TCPDF_STATIC::file_exists($file); + } + } // END OF TCPDF CLASS //============================================================+ diff --git a/htdocs/includes/tecnickcom/tcpdf/tcpdf_autoconfig.php b/htdocs/includes/tecnickcom/tcpdf/tcpdf_autoconfig.php index 3767b823442..1b5e2484ce7 100644 --- a/htdocs/includes/tecnickcom/tcpdf/tcpdf_autoconfig.php +++ b/htdocs/includes/tecnickcom/tcpdf/tcpdf_autoconfig.php @@ -228,6 +228,10 @@ if (!defined('K_TCPDF_CALLS_IN_HTML')) { define('K_TCPDF_CALLS_IN_HTML', false); } +if (!defined('K_ALLOWED_TCPDF_TAGS')) { + define('K_ALLOWED_TCPDF_TAGS', ''); +} + if (!defined('K_TCPDF_THROW_EXCEPTION_ERROR')) { define('K_TCPDF_THROW_EXCEPTION_ERROR', false); } diff --git a/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_1d.php b/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_1d.php index 2fea49ef4ce..45d35616c8e 100644 --- a/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_1d.php +++ b/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_1d.php @@ -53,7 +53,7 @@ class TCPDFBarcode { * Array representation of barcode. * @protected */ - protected $barcode_array; + protected $barcode_array = array(); /** * This is the class constructor. @@ -66,8 +66,8 @@ class TCPDFBarcode { *
          • $arrcode['bcode'][$k]['w'] bar width in units.
          • *
          • $arrcode['bcode'][$k]['h'] bar height in units.
          • *
          • $arrcode['bcode'][$k]['p'] bar top position (0 = top, 1 = middle)
          - * @param $code (string) code to print - * @param $type (string) type of barcode:
          • C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
          • C39+ : CODE 39 with checksum
          • C39E : CODE 39 EXTENDED
          • C39E+ : CODE 39 EXTENDED + CHECKSUM
          • C93 : CODE 93 - USS-93
          • S25 : Standard 2 of 5
          • S25+ : Standard 2 of 5 + CHECKSUM
          • I25 : Interleaved 2 of 5
          • I25+ : Interleaved 2 of 5 + CHECKSUM
          • C128 : CODE 128
          • C128A : CODE 128 A
          • C128B : CODE 128 B
          • C128C : CODE 128 C
          • EAN2 : 2-Digits UPC-Based Extension
          • EAN5 : 5-Digits UPC-Based Extension
          • EAN8 : EAN 8
          • EAN13 : EAN 13
          • UPCA : UPC-A
          • UPCE : UPC-E
          • MSI : MSI (Variation of Plessey code)
          • MSI+ : MSI + CHECKSUM (modulo 11)
          • POSTNET : POSTNET
          • PLANET : PLANET
          • RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
          • KIX : KIX (Klant index - Customer index)
          • IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200
          • CODABAR : CODABAR
          • CODE11 : CODE 11
          • PHARMA : PHARMACODE
          • PHARMA2T : PHARMACODE TWO-TRACKS
          + * @param string $code code to print + * @param string $type type of barcode:
          • C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
          • C39+ : CODE 39 with checksum
          • C39E : CODE 39 EXTENDED
          • C39E+ : CODE 39 EXTENDED + CHECKSUM
          • C93 : CODE 93 - USS-93
          • S25 : Standard 2 of 5
          • S25+ : Standard 2 of 5 + CHECKSUM
          • I25 : Interleaved 2 of 5
          • I25+ : Interleaved 2 of 5 + CHECKSUM
          • C128 : CODE 128
          • C128A : CODE 128 A
          • C128B : CODE 128 B
          • C128C : CODE 128 C
          • EAN2 : 2-Digits UPC-Based Extension
          • EAN5 : 5-Digits UPC-Based Extension
          • EAN8 : EAN 8
          • EAN13 : EAN 13
          • UPCA : UPC-A
          • UPCE : UPC-E
          • MSI : MSI (Variation of Plessey code)
          • MSI+ : MSI + CHECKSUM (modulo 11)
          • POSTNET : POSTNET
          • PLANET : PLANET
          • RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
          • KIX : KIX (Klant index - Customer index)
          • IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200
          • CODABAR : CODABAR
          • CODE11 : CODE 11
          • PHARMA : PHARMACODE
          • PHARMA2T : PHARMACODE TWO-TRACKS
          * @public */ public function __construct($code, $type) { @@ -85,9 +85,9 @@ class TCPDFBarcode { /** * Send barcode as SVG image object to the standard output. - * @param $w (int) Minimum width of a single bar in user units. - * @param $h (int) Height of barcode in user units. - * @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent). + * @param int $w Minimum width of a single bar in user units. + * @param int $h Height of barcode in user units. + * @param string $color Foreground color (in SVG format) for bar elements (background is transparent). * @public */ public function getBarcodeSVG($w=2, $h=30, $color='black') { @@ -105,9 +105,9 @@ class TCPDFBarcode { /** * Return a SVG string representation of barcode. - * @param $w (int) Minimum width of a single bar in user units. - * @param $h (int) Height of barcode in user units. - * @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent). + * @param int $w Minimum width of a single bar in user units. + * @param int $h Height of barcode in user units. + * @param string $color Foreground color (in SVG format) for bar elements (background is transparent). * @return string SVG code. * @public */ @@ -138,9 +138,9 @@ class TCPDFBarcode { /** * Return an HTML representation of barcode. - * @param $w (int) Width of a single bar element in pixels. - * @param $h (int) Height of a single bar element in pixels. - * @param $color (string) Foreground color for bar elements (background is transparent). + * @param int $w Width of a single bar element in pixels. + * @param int $h Height of a single bar element in pixels. + * @param string $color Foreground color for bar elements (background is transparent). * @return string HTML code. * @public */ @@ -164,9 +164,9 @@ class TCPDFBarcode { /** * Send a PNG image representation of barcode (requires GD or Imagick library). - * @param $w (int) Width of a single bar element in pixels. - * @param $h (int) Height of a single bar element in pixels. - * @param $color (array) RGB (0-255) foreground color for bar elements (background is transparent). + * @param int $w Width of a single bar element in pixels. + * @param int $h Height of a single bar element in pixels. + * @param array $color RGB (0-255) foreground color for bar elements (background is transparent). * @public */ public function getBarcodePNG($w=2, $h=30, $color=array(0,0,0)) { @@ -183,10 +183,10 @@ class TCPDFBarcode { /** * Return a PNG image representation of barcode (requires GD or Imagick library). - * @param $w (int) Width of a single bar element in pixels. - * @param $h (int) Height of a single bar element in pixels. - * @param $color (array) RGB (0-255) foreground color for bar elements (background is transparent). - * @return image or false in case of error. + * @param int $w Width of a single bar element in pixels. + * @param int $h Height of a single bar element in pixels. + * @param array $color RGB (0-255) foreground color for bar elements (background is transparent). + * @return string|Imagick|false image or false in case of error. * @public */ public function getBarcodePngData($w=2, $h=30, $color=array(0,0,0)) { @@ -241,9 +241,9 @@ class TCPDFBarcode { /** * Set the barcode. - * @param $code (string) code to print - * @param $type (string) type of barcode:
          • C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
          • C39+ : CODE 39 with checksum
          • C39E : CODE 39 EXTENDED
          • C39E+ : CODE 39 EXTENDED + CHECKSUM
          • C93 : CODE 93 - USS-93
          • S25 : Standard 2 of 5
          • S25+ : Standard 2 of 5 + CHECKSUM
          • I25 : Interleaved 2 of 5
          • I25+ : Interleaved 2 of 5 + CHECKSUM
          • C128 : CODE 128
          • C128A : CODE 128 A
          • C128B : CODE 128 B
          • C128C : CODE 128 C
          • EAN2 : 2-Digits UPC-Based Extension
          • EAN5 : 5-Digits UPC-Based Extension
          • EAN8 : EAN 8
          • EAN13 : EAN 13
          • UPCA : UPC-A
          • UPCE : UPC-E
          • MSI : MSI (Variation of Plessey code)
          • MSI+ : MSI + CHECKSUM (modulo 11)
          • POSTNET : POSTNET
          • PLANET : PLANET
          • RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
          • KIX : KIX (Klant index - Customer index)
          • IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200
          • IMBPRE: Pre-processed Intelligent Mail Barcode - Onecode - USPS-B-3200, using only F,A,D,T letters
          • CODABAR : CODABAR
          • CODE11 : CODE 11
          • PHARMA : PHARMACODE
          • PHARMA2T : PHARMACODE TWO-TRACKS
          - * @return array barcode array + * @param string $code code to print + * @param string $type type of barcode:
          • C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
          • C39+ : CODE 39 with checksum
          • C39E : CODE 39 EXTENDED
          • C39E+ : CODE 39 EXTENDED + CHECKSUM
          • C93 : CODE 93 - USS-93
          • S25 : Standard 2 of 5
          • S25+ : Standard 2 of 5 + CHECKSUM
          • I25 : Interleaved 2 of 5
          • I25+ : Interleaved 2 of 5 + CHECKSUM
          • C128 : CODE 128
          • C128A : CODE 128 A
          • C128B : CODE 128 B
          • C128C : CODE 128 C
          • EAN2 : 2-Digits UPC-Based Extension
          • EAN5 : 5-Digits UPC-Based Extension
          • EAN8 : EAN 8
          • EAN13 : EAN 13
          • UPCA : UPC-A
          • UPCE : UPC-E
          • MSI : MSI (Variation of Plessey code)
          • MSI+ : MSI + CHECKSUM (modulo 11)
          • POSTNET : POSTNET
          • PLANET : PLANET
          • RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
          • KIX : KIX (Klant index - Customer index)
          • IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200
          • IMBPRE: Pre-processed Intelligent Mail Barcode - Onecode - USPS-B-3200, using only F,A,D,T letters
          • CODABAR : CODABAR
          • CODE11 : CODE 11
          • PHARMA : PHARMACODE
          • PHARMA2T : PHARMACODE TWO-TRACKS
          + * @return void * @public */ public function setBarcode($code, $type) { @@ -373,7 +373,7 @@ class TCPDFBarcode { break; } default: { - $this->barcode_array = false; + $this->barcode_array = array(); $arrcode = false; break; } @@ -384,9 +384,9 @@ class TCPDFBarcode { /** * CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9. * General-purpose code in very wide use world-wide - * @param $code (string) code to represent. - * @param $extended (boolean) if true uses the extended mode. - * @param $checksum (boolean) if true add a checksum to the code. + * @param string $code code to represent. + * @param boolean $extended if true uses the extended mode. + * @param boolean $checksum if true add a checksum to the code. * @return array barcode representation. * @protected */ @@ -479,8 +479,8 @@ class TCPDFBarcode { /** * Encode a string to be used for CODE 39 Extended mode. - * @param $code (string) code to represent. - * @return encoded string. + * @param string $code code to represent. + * @return string encoded string. * @protected */ protected function encode_code39_ext($code) { @@ -530,8 +530,8 @@ class TCPDFBarcode { /** * Calculate CODE 39 checksum (modulo 43). - * @param $code (string) code to represent. - * @return char checksum. + * @param string $code code to represent. + * @return string char checksum. * @protected */ protected function checksum_code39($code) { @@ -553,7 +553,7 @@ class TCPDFBarcode { /** * CODE 93 - USS-93 * Compact code similar to Code 39 - * @param $code (string) code to represent. + * @param string $code code to represent. * @return array barcode representation. * @protected */ @@ -681,7 +681,7 @@ class TCPDFBarcode { /** * Calculate CODE 93 checksum (modulo 47). - * @param $code (string) code to represent. + * @param string $code code to represent. * @return string checksum code. * @protected */ @@ -730,7 +730,7 @@ class TCPDFBarcode { /** * Checksum for standard 2 of 5 barcodes. - * @param $code (string) code to process. + * @param string $code code to process. * @return int checksum. * @protected */ @@ -755,8 +755,8 @@ class TCPDFBarcode { * MSI. * Variation of Plessey code, with similar applications * Contains digits (0 to 9) and encodes the data only in the width of bars. - * @param $code (string) code to represent. - * @param $checksum (boolean) if true add a checksum to the code (modulo 11) + * @param string $code code to represent. + * @param boolean $checksum if true add a checksum to the code (modulo 11) * @return array barcode representation. * @protected */ @@ -814,8 +814,8 @@ class TCPDFBarcode { * Standard 2 of 5 barcodes. * Used in airline ticket marking, photofinishing * Contains digits (0 to 9) and encodes the data only in the width of bars. - * @param $code (string) code to represent. - * @param $checksum (boolean) if true add a checksum to the code + * @param string $code code to represent. + * @param boolean $checksum if true add a checksum to the code * @return array barcode representation. * @protected */ @@ -828,7 +828,7 @@ class TCPDFBarcode { $chr['5'] = '11101011101010'; $chr['6'] = '10111011101010'; $chr['7'] = '10101011101110'; - $chr['8'] = '10101110111010'; + $chr['8'] = '11101010111010'; $chr['9'] = '10111010111010'; if ($checksum) { // add checksum @@ -838,7 +838,7 @@ class TCPDFBarcode { // add leading zero if code-length is odd $code = '0'.$code; } - $seq = '11011010'; + $seq = '1110111010'; $clen = strlen($code); for ($i = 0; $i < $clen; ++$i) { $digit = $code[$i]; @@ -848,16 +848,15 @@ class TCPDFBarcode { } $seq .= $chr[$digit]; } - $seq .= '1101011'; + $seq .= '111010111'; $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); return $this->binseq_to_array($seq, $bararray); } /** - * Convert binary barcode sequence to TCPDF barcode array. - * @param $seq (string) barcode as binary sequence. - * @param $bararray (array) barcode array. - * òparam array $bararray TCPDF barcode array to fill up + * Convert binary barcode sequence to WarnockPDF barcode array. + * @param string $seq barcode as binary sequence. + * @param array $bararray barcode array to fill up * @return array barcode representation. * @protected */ @@ -886,8 +885,8 @@ class TCPDFBarcode { * Interleaved 2 of 5 barcodes. * Compact numeric code, widely used in industry, air cargo * Contains digits (0 to 9) and encodes the data in the width of both bars and spaces. - * @param $code (string) code to represent. - * @param $checksum (boolean) if true add a checksum to the code + * @param string $code code to represent. + * @param boolean $checksum if true add a checksum to the code * @return array barcode representation. * @protected */ @@ -938,7 +937,7 @@ class TCPDFBarcode { } else { $t = false; // space } - $w = $seq[$j]; + $w = (float)$seq[$j]; $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); $bararray['maxw'] += $w; ++$k; @@ -950,8 +949,8 @@ class TCPDFBarcode { /** * C128 barcodes. * Very capable code, excellent density, high reliability; in very wide use world-wide - * @param $code (string) code to represent. - * @param $type (string) barcode type: A, B, C or empty for automatic switch (AUTO mode) + * @param string $code code to represent. + * @param string $type barcode type: A, B, C or empty for automatic switch (AUTO mode) * @return array barcode representation. * @protected */ @@ -1271,7 +1270,7 @@ class TCPDFBarcode { } else { $t = false; // space } - $w = $seq[$j]; + $w = (float)$seq[$j]; $bararray['bcode'][] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); $bararray['maxw'] += $w; } @@ -1281,7 +1280,7 @@ class TCPDFBarcode { /** * Split text code in A/B sequence for 128 code - * @param $code (string) code to split. + * @param string $code code to split. * @return array sequence * @protected */ @@ -1319,8 +1318,8 @@ class TCPDFBarcode { * EAN13: European Article Numbering international retail product code * UPC-A: Universal product code seen on almost all retail products in the USA and Canada * UPC-E: Short version of UPC symbol - * @param $code (string) code to represent. - * @param $len (string) barcode type: 6 = UPC-E, 8 = EAN8, 13 = EAN13, 12 = UPC-A + * @param string $code code to represent. + * @param string $len barcode type: 6 = UPC-E, 8 = EAN8, 13 = EAN13, 12 = UPC-A * @return array barcode representation. * @protected */ @@ -1337,14 +1336,14 @@ class TCPDFBarcode { // calculate check digit $sum_a = 0; for ($i = 1; $i < $data_len; $i+=2) { - $sum_a += (int) $code[$i]; + $sum_a += $code[$i]; } if ($len > 12) { $sum_a *= 3; } $sum_b = 0; for ($i = 0; $i < $data_len; $i+=2) { - $sum_b += (int) ($code[$i]); + $sum_b += ($code[$i]); } if ($len < 13) { $sum_b *= 3; @@ -1512,8 +1511,8 @@ class TCPDFBarcode { * UPC-Based Extensions * 2-Digit Ext.: Used to indicate magazines and newspaper issue numbers * 5-Digit Ext.: Used to mark suggested retail price of books - * @param $code (string) code to represent. - * @param $len (string) barcode type: 2 = 2-Digit, 5 = 5-Digit + * @param string $code code to represent. + * @param string $len barcode type: 2 = 2-Digit, 5 = 5-Digit * @return array barcode representation. * @protected */ @@ -1587,8 +1586,8 @@ class TCPDFBarcode { /** * POSTNET and PLANET barcodes. * Used by U.S. Postal Service for automated mail sorting - * @param $code (string) zip code to represent. Must be a string containing a zip code of the form DDDDD or DDDDD-DDDD. - * @param $planet (boolean) if true print the PLANET barcode, otherwise print POSTNET + * @param string $code zip code to represent. Must be a string containing a zip code of the form DDDDD or DDDDD-DDDD. + * @param boolean $planet if true print the PLANET barcode, otherwise print POSTNET * @return array barcode representation. * @protected */ @@ -1660,8 +1659,8 @@ class TCPDFBarcode { * RMS4CC - CBC - KIX * RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) - KIX (Klant index - Customer index) * RM4SCC is the name of the barcode symbology used by the Royal Mail for its Cleanmail service. - * @param $code (string) code to print - * @param $kix (boolean) if true prints the KIX variation (doesn't use the start and end symbols, and the checksum) - in this case the house number must be sufficed with an X and placed at the end of the code. + * @param string $code code to print + * @param boolean $kix if true prints the KIX variation (doesn't use the start and end symbols, and the checksum) - in this case the house number must be sufficed with an X and placed at the end of the code. * @return array barcode representation. * @protected */ @@ -1812,7 +1811,7 @@ class TCPDFBarcode { /** * CODABAR barcodes. * Older code often used in library systems, sometimes in blood banks - * @param $code (string) code to represent. + * @param string $code code to represent. * @return array barcode representation. * @protected */ @@ -1856,7 +1855,7 @@ class TCPDFBarcode { } else { $t = false; // space } - $w = $seq[$j]; + $w = (float)$seq[$j]; $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); $bararray['maxw'] += $w; ++$k; @@ -1868,7 +1867,7 @@ class TCPDFBarcode { /** * CODE11 barcodes. * Used primarily for labeling telecommunications equipment - * @param $code (string) code to represent. + * @param string $code code to represent. * @return array barcode representation. * @protected */ @@ -1947,7 +1946,7 @@ class TCPDFBarcode { } else { $t = false; // space } - $w = $seq[$j]; + $w = (float)$seq[$j]; $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); $bararray['maxw'] += $w; ++$k; @@ -1959,7 +1958,7 @@ class TCPDFBarcode { /** * Pharmacode * Contains digits (0 to 9) - * @param $code (string) code to represent. + * @param string $code code to represent. * @return array barcode representation. * @protected */ @@ -1985,7 +1984,7 @@ class TCPDFBarcode { /** * Pharmacode two-track * Contains digits (0 to 9) - * @param $code (string) code to represent. + * @param string $code code to represent. * @return array barcode representation. * @protected */ @@ -2047,7 +2046,7 @@ class TCPDFBarcode { * (requires PHP bcmath extension) * Intelligent Mail barcode is a 65-bar code for use on mail in the United States. * The fields are described as follows:
          • The Barcode Identifier shall be assigned by USPS to encode the presort identification that is currently printed in human readable form on the optional endorsement line (OEL) as well as for future USPS use. This shall be two digits, with the second digit in the range of 0–4. The allowable encoding ranges shall be 00–04, 10–14, 20–24, 30–34, 40–44, 50–54, 60–64, 70–74, 80–84, and 90–94.
          • The Service Type Identifier shall be assigned by USPS for any combination of services requested on the mailpiece. The allowable encoding range shall be 000http://it2.php.net/manual/en/function.dechex.php–999. Each 3-digit value shall correspond to a particular mail class with a particular combination of service(s). Each service program, such as OneCode Confirm and OneCode ACS, shall provide the list of Service Type Identifier values.
          • The Mailer or Customer Identifier shall be assigned by USPS as a unique, 6 or 9 digit number that identifies a business entity. The allowable encoding range for the 6 digit Mailer ID shall be 000000- 899999, while the allowable encoding range for the 9 digit Mailer ID shall be 900000000-999999999.
          • The Serial or Sequence Number shall be assigned by the mailer for uniquely identifying and tracking mailpieces. The allowable encoding range shall be 000000000–999999999 when used with a 6 digit Mailer ID and 000000-999999 when used with a 9 digit Mailer ID. e. The Delivery Point ZIP Code shall be assigned by the mailer for routing the mailpiece. This shall replace POSTNET for routing the mailpiece to its final delivery point. The length may be 0, 5, 9, or 11 digits. The allowable encoding ranges shall be no ZIP Code, 00000–99999, 000000000–999999999, and 00000000000–99999999999.
          - * @param $code (string) code to print, separate the ZIP (routing code) from the rest using a minus char '-' (BarcodeID_ServiceTypeID_MailerID_SerialNumber-RoutingCode) + * @param string $code code to print, separate the ZIP (routing code) from the rest using a minus char '-' (BarcodeID_ServiceTypeID_MailerID_SerialNumber-RoutingCode) * @return array barcode representation. * @protected */ @@ -2172,7 +2171,7 @@ class TCPDFBarcode { /** * IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200 * - * @param $code (string) pre-formatted IMB barcode (65 chars "FADT") + * @param string $code pre-formatted IMB barcode (65 chars "FADT") * @return array barcode representation. * @protected */ @@ -2223,7 +2222,7 @@ class TCPDFBarcode { /** * Convert large integer number to hexadecimal representation. * (requires PHP bcmath extension) - * @param $number (string) number to convert specified as a string + * @param string $number number to convert specified as a string * @return string hexadecimal representation */ public function dec_to_hex($number) { @@ -2247,7 +2246,7 @@ class TCPDFBarcode { /** * Convert large hexadecimal number to decimal representation (string). * (requires PHP bcmath extension) - * @param $hex (string) hexadecimal number to convert specified as a string + * @param string $hex hexadecimal number to convert specified as a string * @return string hexadecimal representation */ public function hex_to_dec($hex) { @@ -2263,7 +2262,7 @@ class TCPDFBarcode { /** * Intelligent Mail Barcode calculation of Frame Check Sequence - * @param $code_arr (string) array of hexadecimal values (13 bytes holding 102 bits right justified). + * @param string $code_arr array of hexadecimal values (13 bytes holding 102 bits right justified). * @return int 11 bit Frame Check Sequence as integer (decimal base) * @protected */ @@ -2299,7 +2298,7 @@ class TCPDFBarcode { /** * Reverse unsigned short value - * @param $num (int) value to reversr + * @param int $num value to reversr * @return int reversed value * @protected */ @@ -2315,8 +2314,8 @@ class TCPDFBarcode { /** * generate Nof13 tables used for Intelligent Mail Barcode - * @param $n (int) is the type of table: 2 for 2of13 table, 5 for 5of13table - * @param $size (int) size of table (78 for n=2 and 1287 for n=5) + * @param int $n is the type of table: 2 for 2of13 table, 5 for 5of13table + * @param int $size size of table (78 for n=2 and 1287 for n=5) * @return array requested table * @protected */ diff --git a/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_2d.php b/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_2d.php index 13e23655274..730361bd8c6 100644 --- a/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_2d.php +++ b/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_2d.php @@ -53,7 +53,7 @@ class TCPDF2DBarcode { * Array representation of barcode. * @protected */ - protected $barcode_array = false; + protected $barcode_array = array(); /** * This is the class constructor. @@ -62,8 +62,8 @@ class TCPDF2DBarcode { *
        • $arrcode['num_rows'] required number of rows
        • *
        • $arrcode['num_cols'] required number of columns
        • *
        • $arrcode['bcode'][$r][$c] value of the cell is $r row and $c column (0 = transparent, 1 = black)
        - * @param $code (string) code to print - * @param $type (string) type of barcode:
        • DATAMATRIX : Datamatrix (ISO/IEC 16022)
        • PDF417 : PDF417 (ISO/IEC 15438:2006)
        • PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".
        • QRCODE : QRcode Low error correction
        • QRCODE,L : QRcode Low error correction
        • QRCODE,M : QRcode Medium error correction
        • QRCODE,Q : QRcode Better error correction
        • QRCODE,H : QR-CODE Best error correction
        • RAW: raw mode - comma-separad list of array rows
        • RAW2: raw mode - array rows are surrounded by square parenthesis.
        • TEST : Test matrix
        + * @param string $code code to print + * @param string $type type of barcode:
        • DATAMATRIX : Datamatrix (ISO/IEC 16022)
        • PDF417 : PDF417 (ISO/IEC 15438:2006)
        • PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parameters are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".
        • QRCODE : QRcode Low error correction
        • QRCODE,L : QRcode Low error correction
        • QRCODE,M : QRcode Medium error correction
        • QRCODE,Q : QRcode Better error correction
        • QRCODE,H : QR-CODE Best error correction
        • RAW: raw mode - comma-separad list of array rows
        • RAW2: raw mode - array rows are surrounded by square parenthesis.
        • TEST : Test matrix
        */ public function __construct($code, $type) { $this->setBarcode($code, $type); @@ -79,9 +79,9 @@ class TCPDF2DBarcode { /** * Send barcode as SVG image object to the standard output. - * @param $w (int) Width of a single rectangle element in user units. - * @param $h (int) Height of a single rectangle element in user units. - * @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent). + * @param int $w Width of a single rectangle element in user units. + * @param int $h Height of a single rectangle element in user units. + * @param string $color Foreground color (in SVG format) for bar elements (background is transparent). * @public */ public function getBarcodeSVG($w=3, $h=3, $color='black') { @@ -99,9 +99,9 @@ class TCPDF2DBarcode { /** * Return a SVG string representation of barcode. - * @param $w (int) Width of a single rectangle element in user units. - * @param $h (int) Height of a single rectangle element in user units. - * @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent). + * @param int $w Width of a single rectangle element in user units. + * @param int $h Height of a single rectangle element in user units. + * @param string $color Foreground color (in SVG format) for bar elements (background is transparent). * @return string SVG code. * @public */ @@ -135,9 +135,9 @@ class TCPDF2DBarcode { /** * Return an HTML representation of barcode. - * @param $w (int) Width of a single rectangle element in pixels. - * @param $h (int) Height of a single rectangle element in pixels. - * @param $color (string) Foreground color for bar elements (background is transparent). + * @param int $w Width of a single rectangle element in pixels. + * @param int $h Height of a single rectangle element in pixels. + * @param string $color Foreground color for bar elements (background is transparent). * @return string HTML code. * @public */ @@ -164,9 +164,9 @@ class TCPDF2DBarcode { /** * Send a PNG image representation of barcode (requires GD or Imagick library). - * @param $w (int) Width of a single rectangle element in pixels. - * @param $h (int) Height of a single rectangle element in pixels. - * @param $color (array) RGB (0-255) foreground color for bar elements (background is transparent). + * @param int $w Width of a single rectangle element in pixels. + * @param int $h Height of a single rectangle element in pixels. + * @param array $color RGB (0-255) foreground color for bar elements (background is transparent). * @public */ public function getBarcodePNG($w=3, $h=3, $color=array(0,0,0)) { @@ -184,10 +184,10 @@ class TCPDF2DBarcode { /** * Return a PNG image representation of barcode (requires GD or Imagick library). - * @param $w (int) Width of a single rectangle element in pixels. - * @param $h (int) Height of a single rectangle element in pixels. - * @param $color (array) RGB (0-255) foreground color for bar elements (background is transparent). - * @return image or false in case of error. + * @param int $w Width of a single rectangle element in pixels. + * @param int $h Height of a single rectangle element in pixels. + * @param array $color RGB (0-255) foreground color for bar elements (background is transparent). + * @return string|Imagick|false image or false in case of error. * @public */ public function getBarcodePngData($w=3, $h=3, $color=array(0,0,0)) { @@ -245,9 +245,9 @@ class TCPDF2DBarcode { /** * Set the barcode. - * @param $code (string) code to print - * @param $type (string) type of barcode:
        • DATAMATRIX : Datamatrix (ISO/IEC 16022)
        • PDF417 : PDF417 (ISO/IEC 15438:2006)
        • PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".
        • QRCODE : QRcode Low error correction
        • QRCODE,L : QRcode Low error correction
        • QRCODE,M : QRcode Medium error correction
        • QRCODE,Q : QRcode Better error correction
        • QRCODE,H : QR-CODE Best error correction
        • RAW: raw mode - comma-separad list of array rows
        • RAW2: raw mode - array rows are surrounded by square parenthesis.
        • TEST : Test matrix
        - * @return array + * @param string $code code to print + * @param string $type type of barcode:
        • DATAMATRIX : Datamatrix (ISO/IEC 16022)
        • PDF417 : PDF417 (ISO/IEC 15438:2006)
        • PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parameters are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".
        • QRCODE : QRcode Low error correction
        • QRCODE,L : QRcode Low error correction
        • QRCODE,M : QRcode Medium error correction
        • QRCODE,Q : QRcode Better error correction
        • QRCODE,H : QR-CODE Best error correction
        • RAW: raw mode - comma-separad list of array rows
        • RAW2: raw mode - array rows are surrounded by square parenthesis.
        • TEST : Test matrix
        + * @return void */ public function setBarcode($code, $type) { $mode = explode(',', $type); @@ -338,7 +338,7 @@ class TCPDF2DBarcode { break; } default: { - $this->barcode_array = false; + $this->barcode_array = array(); } } } diff --git a/htdocs/includes/tecnickcom/tcpdf/tcpdf_import.php b/htdocs/includes/tecnickcom/tcpdf/tcpdf_import.php index 09d726ba030..57f9f4f4bda 100644 --- a/htdocs/includes/tecnickcom/tcpdf/tcpdf_import.php +++ b/htdocs/includes/tecnickcom/tcpdf/tcpdf_import.php @@ -60,8 +60,8 @@ class TCPDF_IMPORT extends TCPDF { /** * Import an existing PDF document - * @param $filename (string) Filename of the PDF document to import. - * @return true in case of success, false otherwise + * @param string $filename Filename of the PDF document to import. + * @return void * @public * @since 1.0.000 (2011-05-24) */ diff --git a/htdocs/includes/tecnickcom/tcpdf/tcpdf_parser.php b/htdocs/includes/tecnickcom/tcpdf/tcpdf_parser.php index bd3d719c7ac..4156230a389 100644 --- a/htdocs/includes/tecnickcom/tcpdf/tcpdf_parser.php +++ b/htdocs/includes/tecnickcom/tcpdf/tcpdf_parser.php @@ -91,8 +91,8 @@ class TCPDF_PARSER { /** * Parse a PDF document an return an array of objects. - * @param $data (string) PDF data to parse. - * @param $cfg (array) Array of configuration parameters: + * @param string $data PDF data to parse. + * @param array $cfg Array of configuration parameters: * 'die_for_errors' : if true termitate the program execution in case of error, otherwise thows an exception; * 'ignore_filter_decoding_errors' : if true ignore filter decoding errors; * 'ignore_missing_filter_decoders' : if true ignore missing filter decoding errors. @@ -130,7 +130,7 @@ class TCPDF_PARSER { /** * Set the configuration parameters. - * @param $cfg (array) Array of configuration parameters: + * @param array $cfg Array of configuration parameters: * 'die_for_errors' : if true termitate the program execution in case of error, otherwise thows an exception; * 'ignore_filter_decoding_errors' : if true ignore filter decoding errors; * 'ignore_missing_filter_decoders' : if true ignore missing filter decoding errors. @@ -150,7 +150,7 @@ class TCPDF_PARSER { /** * Return an array of parsed PDF document objects. - * @return (array) Array of parsed PDF document objects. + * @return array Array of parsed PDF document objects. * @public * @since 1.0.000 (2011-06-26) */ @@ -160,9 +160,9 @@ class TCPDF_PARSER { /** * Get Cross-Reference (xref) table and trailer data from PDF document data. - * @param $offset (int) xref offset (if know). - * @param $xref (array) previous xref array (if any). - * @return Array containing xref and trailer data. + * @param int $offset xref offset (if know). + * @param array $xref previous xref array (if any). + * @return array containing xref and trailer data. * @protected * @since 1.0.000 (2011-05-24) */ @@ -202,9 +202,9 @@ class TCPDF_PARSER { /** * Decode the Cross-Reference section - * @param $startxref (int) Offset at which the xref section starts (position of the 'xref' keyword). - * @param $xref (array) Previous xref array (if any). - * @return Array containing xref and trailer data. + * @param int $startxref Offset at which the xref section starts (position of the 'xref' keyword). + * @param array $xref Previous xref array (if any). + * @return array containing xref and trailer data. * @protected * @since 1.0.000 (2011-06-20) */ @@ -274,9 +274,9 @@ class TCPDF_PARSER { /** * Decode the Cross-Reference Stream section - * @param $startxref (int) Offset at which the xref section starts. - * @param $xref (array) Previous xref array (if any). - * @return Array containing xref and trailer data. + * @param int $startxref Offset at which the xref section starts. + * @param array $xref Previous xref array (if any). + * @return array containing xref and trailer data. * @protected * @since 1.0.003 (2013-03-16) */ @@ -489,7 +489,7 @@ class TCPDF_PARSER { /** * Get object type, raw value and offset to next object - * @param $offset (int) Object offset. + * @param int $offset Object offset. * @return array containing object type, raw value and offset to next object * @protected * @since 1.0.000 (2011-06-20) @@ -667,9 +667,9 @@ class TCPDF_PARSER { /** * Get content of indirect object. - * @param $obj_ref (string) Object number and generation number separated by underscore character. - * @param $offset (int) Object offset. - * @param $decoding (boolean) If true decode streams. + * @param string $obj_ref Object number and generation number separated by underscore character. + * @param int $offset Object offset. + * @param boolean $decoding If true decode streams. * @return array containing object data. * @protected * @since 1.0.000 (2011-05-24) @@ -712,7 +712,7 @@ class TCPDF_PARSER { /** * Get the content of object, resolving indect object reference if necessary. - * @param $obj (string) Object value. + * @param string $obj Object value. * @return array containing object data. * @protected * @since 1.0.000 (2011-06-26) @@ -734,8 +734,8 @@ class TCPDF_PARSER { /** * Decode the specified stream. - * @param $sdic (array) Stream's dictionary array. - * @param $stream (string) Stream to decode. + * @param array $sdic Stream's dictionary array. + * @param string $stream Stream to decode. * @return array containing decoded stream data and remaining filters. * @protected * @since 1.0.000 (2011-06-22) @@ -796,7 +796,7 @@ class TCPDF_PARSER { /** * Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true. - * @param $msg (string) The error message + * @param string $msg The error message * @public * @since 1.0.000 (2011-05-23) */