Home > Article > Backend Development > Discuss whether GDFONTPATH can be supported by PHP under winxp_PHP tutorial
I encountered a problem while learning PHP.
Use the GD library to draw and set the font path variable:
putenv('GDFONTPATH=c:windowsFonts');
$ fontname='arial';
$bbox=imagettfbbox($font_size,0,$fontname,$button_text);
Tip: The font file cannot be found, but there is clearly one in the Fonts folder. Is the GDFONTPATH environment variable not supported by Windows?
Many people on the Internet have encountered this problem. Unfortunately, I have also encountered it. My test results are that it is really not supported in Windows.
What to do? The problem should be solved, okay, what if we don't use this GDFONTPATH? Of course it cannot be referenced, but what if we manually put the fonts we want to use into the project folder?
Just tried it, this is what I did and it worked. Although it is a bit overwhelming.