$ /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
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;
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)
$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);
$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);
$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);
$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);