View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0010995 | mantisbt | reports | public | 2009-10-01 11:08 | 2014-02-14 02:37 |
Reporter | kabadi | Assigned To | dhx | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Target Version | 1.2.4 | Fixed in Version | 1.2.4 | ||
Summary | 0010995: Graphs Plugin: Unable to read/find font | ||||
Description | I get the above error for all graphs on Linux server. I see config_defaults has an entry, That isn't going to work on my hosted linux server. Any ideas? | ||||
Tags | patch | ||||
Attached Files | 0001-Fix-10995-Unable-to-read-or-find-fonts-when-using-Jp.patch (1,753 bytes)
From e7fd93db2be85398f84f472e7635495e6284219f Mon Sep 17 00:00:00 2001 From: David Hicks <hickseydr@optusnet.com.au> Date: Sat, 18 Sep 2010 13:35:09 +1000 Subject: [PATCH] Fix #10995: Unable to read or find fonts when using JpGraph The logic inside the graph_get_font() function of MantisGraph/core/graph_api.php was completely broken when using JpGraph. Thanks to Kirill Krasnov for the initial patch. --- plugins/MantisGraph/core/graph_api.php | 20 +++----------------- 1 files changed, 3 insertions(+), 17 deletions(-) diff --git a/plugins/MantisGraph/core/graph_api.php b/plugins/MantisGraph/core/graph_api.php index 7a1a196b..1749c17 100644 --- a/plugins/MantisGraph/core/graph_api.php +++ b/plugins/MantisGraph/core/graph_api.php @@ -51,12 +51,9 @@ if( OFF == plugin_config_get( 'eczlibrary' ) ) { } function graph_get_font() { - $t_font = plugin_config_get( 'font', '' ); + $t_font = plugin_config_get( 'font', 'arial' ); if ( plugin_config_get( 'eczlibrary' ) == ON ) { - $ttf_dir = ''; - $t_font = ''; - $t_font_map = array( 'arial' => 'arial.ttf', 'verdana' => 'verdana.ttf', @@ -70,21 +67,10 @@ function graph_get_font() { ); if( isset( $t_font_map[$t_font] ) ) { - $t_font = $t_font_map[$t_font]; + return $t_font_map[$t_font]; } else { - $t_font = 'arial.ttf'; - } - - - $t_font_path = get_font_path(); - if( empty($t_font_path) ) { - error_text('unable to load font(s)', 'unable to load font(s)'); - } - $f = $t_font_path . $t_font; - if( file_exists($f) === false || is_readable($f) === false ) { - error_text('unable to read/find font', 'unable to read/find font'); + return 'arial.ttf'; } - return $f; } else { $t_font_map = array( 'arial' => FF_ARIAL, -- 1.7.2.3 | ||||
has duplicate | 0010808 | closed | dhx | Mantis Graphs cannot work well |
has duplicate | 0011741 | closed | dhx | Mantis Graphs 1.0 unable to read/find font |
has duplicate | 0010720 | closed | dhx | JpGraphs have issues |
has duplicate | 0012364 | closed | dhx | The font configuration of MantisGraph 1.0 does not work |
related to | 0012725 | closed | vboctor | Solution to "font file not readable/does not exist" seems not to work for JPGraph |
Have you looked at http://www.mantisbt.org/manual/manual.troubleshooting.jpgraph.php ? |
|
I can confirm that in the master branch, the MantisGraph plugin does not appear to use $g_system_font_path when finding fonts for the ezC graphing library. The $g_system_font_path setting does work correctly with jpGraph however. |
|
I use jpgraph v3.0.6 I added this to my config_inc.php Changes with $g_font_per_captcha = 'liberation.ttf' was not working. After the renaming/coping of liberation.ttf files to arial.ttf the graphs working. |
|
Targeted to 1.3.x. |
|
I have attached a patch modified from one Kirill Krasnov provided on the developer mailing list. I would appreciate if someone (or multiple people) could confirm whether the patch solves this issue because I commit it. Remember to set the system font path configuration option in config_defaults_inc.php first! Also please provide the version of MantisBT you're using when you provide feedback on the patch. Thanks |
|
No response = assuming this is fixed with the commit of the patch. If it isn't fixed... please reopen. Thanks |
|
For all users that tried to set the mentioned $g_system_font_path |
|
MantisBT: master 3bb92717 2010-09-17 23:35 Details Diff |
Fix 0010995: Unable to read or find fonts when using JpGraph The logic inside the graph_get_font() function of MantisGraph/core/graph_api.php was completely broken when using JpGraph. Thanks to Kirill Krasnov for the initial patch. |
Affected Issues 0010995 |
|
mod - plugins/MantisGraph/core/graph_api.php | Diff File | ||
MantisBT: master-1.2.x ed4de9ae 2010-09-17 23:35 Details Diff |
Fix 0010995: Unable to read or find fonts when using JpGraph The logic inside the graph_get_font() function of MantisGraph/core/graph_api.php was completely broken when using JpGraph. Thanks to Kirill Krasnov for the initial patch. |
Affected Issues 0010995 |
|
mod - plugins/MantisGraph/core/graph_api.php | Diff File | ||
MantisBT: master 10557b04 2010-10-18 07:47 Details Diff |
Fix 0010995: Correct font paths and error messages for ezGraph We need to return errors as an image so that they appear within an <img> tag within HTML. Furthermore, the function needs to return the full path to the font file in use. This is in contrast to the JpGraph mode where we only need to return the file name of the font file. This discrepancy would be good to avoid in the future if possible. |
Affected Issues 0010995 |
|
mod - plugins/MantisGraph/core/graph_api.php | Diff File | ||
MantisBT: master-1.2.x 3f87254d 2010-10-18 07:47 Details Diff |
Fix 0010995: Correct font paths and error messages for ezGraph We need to return errors as an image so that they appear within an <img> tag within HTML. Furthermore, the function needs to return the full path to the font file in use. This is in contrast to the JpGraph mode where we only need to return the file name of the font file. This discrepancy would be good to avoid in the future if possible. |
Affected Issues 0010995 |
|
mod - plugins/MantisGraph/core/graph_api.php | Diff File |