Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find fonts #92

Closed
nicman23 opened this issue Mar 30, 2020 · 5 comments · Fixed by #93
Closed

cannot find fonts #92

nicman23 opened this issue Mar 30, 2020 · 5 comments · Fixed by #93

Comments

@nicman23
Copy link

it throws this error

JpGraph Error: 25092There is either a configuration problem with TrueType or a problem reading font file "/usr/share/fonts/TTF/DejaVuSans.ttf" Make sure file exists and is in a readable place for the HTTP process. (If 'basedir' restriction is enabled in PHP then the font file must be located in the document root.). It might also be a wrongly installed FreeType library. Try upgrading to at least FreeType 2.1.13 and recompile GD with the correct setup so it can find the new FT library.

but phpinfo() shows it enabled and the file exists, with no basedir configuration (it is disabled on php.ini open_basedir => no value => no value )

GD Support => enabled
GD headers Version => 2.3.0
GD library Version => 2.3.0
FreeType Support => enabled
FreeType Linkage => with freetype

i recompiled php, resulting in the same issue. also this is from php cli not apache etc.

@murrant
Copy link
Contributor

murrant commented Apr 15, 2020

I noticed I get this error when JpGraph tries to render an empty string...

@richardZhengGR
Copy link

the same error. @nicman23

@richardZhengGR
Copy link

I noticed I get this error when JpGraph tries to render an empty string...

yes, thank u murrant. But i had no idea how to fix it few days ago.
And finally I found out the problem is the GD library. and I did so.
In the path : amenadiel\jpgraph\src\image\Image.php
function:

_StrokeTTF()
$txt
imagettfbbox_fixed()
$text

filter parameters $txt & $text in the function like this:

        if($text == ''){
            $text = '  ';
        }

@octoquad
Copy link

octoquad commented Jul 6, 2020

@murrant @richardZhengGR, thanks for providing workarounds. Both work, even with JPGraph 3.0.7!

@murrant your fix will still emit a PHP warning: PHP Warning: imagettftext(): Problem doing text layout in ... but still renders the graph correctly.

@ffflabs
Copy link
Collaborator

ffflabs commented Apr 25, 2021

I'd still like to know how to reproduce this issue. I tried manually setting wrong titles and legends to no avail.

Is this one of those bugs that won't manifest themselves in testing or mocking environments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants