Reputation: 2443
the system is window xp
.now, i using GD library to draw a chart set the font path as this:
putenv('GDFONTPATH=c:\windows\Fonts');
$fontname='arial';
$bbox=imagettfbbox($font_size,0,$fontname,$button_text);
the programme gave me a tip: can't find the font? but in my window xp system, there is a font named arial
in the Fonts
file. why ?
test code:
putenv('GDFONTPATH=C:\\WINDOWS\\Fonts');
$fontname='arial';
$char="test";
$size=20;
$bbox=imagettfbbox($size,0,$fontname,$char);
it show invalidate font filename,
Upvotes: 1
Views: 372
Reputation: 2443
GDFONTPATH can't use under window. you should use absolute path directly.
Upvotes: 0
Reputation: 3904
On Windows you have to use double backslashes, like so:
putenv('GDFONTPATH=c:\\windows\\Fonts');
Upvotes: 1