Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load fonts for GD

Status
Not open for further replies.

MasterKaos

Programmer
Joined
Jan 17, 2004
Messages
107
Location
GB
Hi I'm writing a PHP program using image functions in the GD library.

The server it is running on is from a hosting provider, so i have very limited configuration options. I am unable to use .htaccess and of course i can't modify the php.ini file.

Fortunately PHP is configured with GD enabled, however to use the font fucntions in GD - such as imagefttext() or imagettftext() - i have to have the FreeType library loaded.

My Question: Is there any way of loading libraries in PHP at runtime? For example are there any PHP functions that let me specify a path to a library and to enable it?

For now i'm using the imagestring() function which returns rather primitive looking text but it's better than nothing.

----------------------------------------------------------------------------
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
 
When doing this stuff, I specify the font fiel I want to use like so :
Code:
$font_file = $_SERVER[DOCUMENT_ROOT]."/somefont.ttf";

Never gives me any grief at all.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top