Warning: imagettfbbox(): Could not find/open font

#29
241
2 Answer
Question Image

I am facing this error: Warning: imagettfbbox(): Could not find/open font.

I want to convert text to image but font-file not find/open.

my code is:

$font = 'font/pacifico-regular.ttf';
 

I want a solution to this problem.


Related to:
imagettfbbox()fontimage
0
Answer
Answer 1 of 2
# 18

Try this:

$font = dirname(__FILE__) . '/font/NotoSerif-BoldItalic.ttf';
1
0
0
Answer 2 of 2
# 17

Give the full path and replace the path with a backslash:

$font = 'C:\xampp\htdocs\font\pacifico-regular.ttf';
0
0
0
Related Articles

If you still have a question about this, submit it in our Q&A community - Ask Question