PHP and using fonts with GD
Posted: Sat Nov 04, 2006 1:36 pm
First time poster here. Hope this makes sense and is able to be answered.
I am coding a script that uses gd to create an image. In a perfect world, the user will be able to enter text, choose a font from a dropdown menu and submit the info to the script that generates their custom image.
Thus, I have a question.
In order for this to work, do the fonts have to be ones installed on the USERS pc?
My reason for asking this is that, so far, my script will not use ANY font that is not installed. I am working in a Windows invironment but have attempted to set the font directory using putenv( 'GDFONTPATH='.realpath('./fonts') );. The fonts inside that directory are not installed on my machine. Maybe I am not doing something right with that piece of code? Is this possible without having the fonts "installed" on the PC running the server?
I have written several scripts using PHP, but never have I used anything with GD or fonts. This area is still very new to me and any help with this is much appreciated.
Stanger
I am coding a script that uses gd to create an image. In a perfect world, the user will be able to enter text, choose a font from a dropdown menu and submit the info to the script that generates their custom image.
Thus, I have a question.
In order for this to work, do the fonts have to be ones installed on the USERS pc?
My reason for asking this is that, so far, my script will not use ANY font that is not installed. I am working in a Windows invironment but have attempted to set the font directory using putenv( 'GDFONTPATH='.realpath('./fonts') );. The fonts inside that directory are not installed on my machine. Maybe I am not doing something right with that piece of code? Is this possible without having the fonts "installed" on the PC running the server?
I have written several scripts using PHP, but never have I used anything with GD or fonts. This area is still very new to me and any help with this is much appreciated.
Stanger