From: Janusz Dobrowolski Date: Mon, 15 Nov 2010 15:25:06 +0000 (+0000) Subject: Default font for graphics changed from Vera to LiberationSans-Regular. X-Git-Tag: v2.4.2~19^2~483 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=05a768ccc59943a7c56ed88b8b76e29c92570f46;p=fa-stable.git Default font for graphics changed from Vera to LiberationSans-Regular. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 56dc02de..7fd1b14e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -24,6 +24,14 @@ $ -> Affected files $ /purchasing/includes/ui/po_ui.inc # Fixed text encoding in graphics $ /reporting/includes/class.graphic.inc +! Default font for graphics changed from Vera to LiberationSans-Regular +$ /reporting/fonts/LiberationSans-Regular.ttf (new) + /reporting/fonts/Vera.ttf (removed) + /reporting/includes/class.graphic.inc + /reporting/rep102.php + /reporting/rep202.php + /reporting/rep706.php + /reporting/rep707.php 13-Nov-2010 Janusz Dobrowolski + New hooks system added diff --git a/reporting/fonts/LiberationSans-Regular.ttf b/reporting/fonts/LiberationSans-Regular.ttf new file mode 100644 index 00000000..2de10634 Binary files /dev/null and b/reporting/fonts/LiberationSans-Regular.ttf differ diff --git a/reporting/fonts/Vera.ttf b/reporting/fonts/Vera.ttf deleted file mode 100644 index 58cd6b5e..00000000 Binary files a/reporting/fonts/Vera.ttf and /dev/null differ diff --git a/reporting/includes/class.graphic.inc b/reporting/includes/class.graphic.inc index 30daf8a1..d10cc5db 100644 --- a/reporting/includes/class.graphic.inc +++ b/reporting/includes/class.graphic.inc @@ -147,12 +147,18 @@ class graph var $h3d = 15; // 3D height var $built_in = true; var $fontfile = ""; - + var $encoding; + function graph() { + $this->encoding = $_SESSION['language']->encoding; + putenv('GDFONTPATH='.dirname(__FILE__).'/../fonts'); - $this->x = $this->y = $this->z = array(); + // If you use utf-8 encoding you have to download and install FreeSans.ttf font. + // It is not bundled with application due to its size. + $this->fontfile = $this->encoding=='UTF-8' ? 'FreeSans' : 'LiberationSans-Regular'; + $this->x = $this->y = $this->z = array(); $this->biggest_x = NULL; $this->biggest_y = NULL; $this->alternate_x = false; @@ -946,12 +952,11 @@ class graph if ($alt && strlen($string) > 12) $string = substr($string, 0, 12); - $encoding = $_SESSION['language']->encoding; - if ($encoding != 'UTF-8') { + if ($this->encoding != 'UTF-8') { if (function_exists('iconv')) - $string = iconv($encoding, 'UTF-8', $string); + $string = iconv($this->encoding, 'UTF-8', $string); else - $string = mb_convert_encoding($string, 'UTF-8', $encoding); + $string = mb_convert_encoding($string, 'UTF-8', $this->encoding); } if ($this->built_in) diff --git a/reporting/rep102.php b/reporting/rep102.php index 7892e2eb..2daae18d 100644 --- a/reporting/rep102.php +++ b/reporting/rep102.php @@ -230,7 +230,6 @@ function print_aged_customer_analysis() $pg->type = $graphics; $pg->skin = $graph_skin; $pg->built_in = false; - $pg->fontfile = $path_to_root . "/reporting/fonts/Vera.ttf"; $pg->latin_notation = ($decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != "."); $filename = company_path(). "/images/test.png"; $pg->display($filename, true); diff --git a/reporting/rep202.php b/reporting/rep202.php index f921d308..c77b657b 100644 --- a/reporting/rep202.php +++ b/reporting/rep202.php @@ -236,7 +236,6 @@ function print_aged_supplier_analysis() $pg->type = $graphics; $pg->skin = $graph_skin; $pg->built_in = false; - $pg->fontfile = $path_to_root . "/reporting/fonts/Vera.ttf"; $pg->latin_notation = ($decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != "."); $filename = company_path(). "/pdf_files/test.png"; $pg->display($filename, true); diff --git a/reporting/rep706.php b/reporting/rep706.php index 674e2502..ef975869 100644 --- a/reporting/rep706.php +++ b/reporting/rep706.php @@ -306,7 +306,6 @@ function print_balance_sheet() $pg->type = $graphics; $pg->skin = $graph_skin; $pg->built_in = false; - $pg->fontfile = $path_to_root . "/reporting/fonts/Vera.ttf"; $pg->latin_notation = ($decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != "."); $filename = company_path(). "/pdf_files/test.png"; $pg->display($filename, true); diff --git a/reporting/rep707.php b/reporting/rep707.php index 73180d2e..68b62694 100644 --- a/reporting/rep707.php +++ b/reporting/rep707.php @@ -324,7 +324,6 @@ function print_profit_and_loss_statement() $pg->type = $graphics; $pg->skin = $graph_skin; $pg->built_in = false; - $pg->fontfile = $path_to_root . "/reporting/fonts/Vera.ttf"; $pg->latin_notation = ($decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != "."); $filename = company_path(). "/pdf_files/test.png"; $pg->display($filename, true);