Home  >  Article  >  Backend Development  >  Discuss whether GDFONTPATH ​​can be supported by PHP under winxp_PHP tutorial

Discuss whether GDFONTPATH ​​can be supported by PHP under winxp_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:04:31778browse

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.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327777.htmlTechArticleI encountered a problem while learning PHP. I used the GD library to draw and set the font path variable: putenv('GDFONTPATH=c: windowsFonts'); $fontname='arial'; $bbox=imagettfbbox($font_size,0,$fontname,$but...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn