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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what fonts are supported by php in image creation??? 2

Status
Not open for further replies.

rizza

Programmer
Jul 16, 2002
66
US
I was wondering what is the limits of php when it comes to fonts and using dyanmic image creation to make buttons and stuff on the fly.

If it's something like whatever fonts are installed... can i put fonts that i use on my windows machine like TTF's and put them in a directory on my web server and they work...or do they need to be installed on a web-server...if so can i put them on a unix machine, and if not them, are there any other kind of fonts other than the like 5 that are avaible safely, that i can use to make PHP make me buttons..

Thanks,

rizza
You'll never know, if you dont ask, Right?"
 
I have taken True-Type fonts from a Win32 box, FTPed them to my Linux server, and used them in images without problems.

The ability to manipulate fonts is not automatic, even if you have image functions turned on. The GD library, which PHP uses to create images, requires the FreeType library to use True-Type fonts. ______________________________________________________________________
TANSTAAFL!
 
Where might i be able to find this stuff, and where can i read more about setting this stuff up and installing it.

Thanks,

Rizza
 
The PHP online manual page ( has links to the sites for the GD library, libjpeg, and libt1.

The PHP online manual page ( has a link to the FreeType library.


GD requires the libraries jpeg-6b, libpng, and the FreeType library. Jpeg-6b requires zlib.

Install zlib, then libpng, jpeg-6b, and Freetype. Then install GD. Then recompile PHP to use GD.

______________________________________________________________________
TANSTAAFL!
 
This something my web-hosting company will have to for me then, since i use featureprice they dont allow me shell access. What are the chances of them probally allowing me to do this...

Is something like this common???

Thanks,

Brian
 
I don't know how common it is. I figured out how to do it out of necessity -- a project I'm working on requires me to show text in a user-chosen font.

The chances of your hosting company's allowing you shell access to compile and install the needed libraries are probably none. I know if I were your sysadmin, the answer would be "Not in a million years" just as a matter of policy.

You might be able to sweet-talk them into performing the install for you. It never hurts to ask. The answer in that case may be, "Sure, but it'll cost you."

This whole conversation may be for nothing. Write a script which includes the phpinfo() function. They may have already installed the feature. ______________________________________________________________________
TANSTAAFL!
 
This is everthing that was there for GD will this stuff work..??

GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
T1Lib Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled


and this is the Zlib stuff

zlib
ZLib Support enabled
Compiled Version 1.1.4
Linked Version 1.1.4

I really have no idea what i'm looking at, though???

Thanks for all your help man, i've voted for every post of yours os far by the way.
 
Looks to me like you are good to go.

The "GD support enabled" line means that the "image_" family of PHP functions is available to you.

The "FreeType support enabled", and "T1Lib support enabled" lines tell you that you can use TrueType of Adobe Type-1 fonts, respectively.

The lines "JPG support enabled", "PNG support enabled", and "WBMP support enabled" are telling you you can create JPEG, PNG and WBMP images, respectively, on the fly. ______________________________________________________________________
TANSTAAFL!
 
Thanks for all your help man, where would i install the fonts...can i put them anywhere and refrence them accordingly or do they need to be a specific dir.

Got any good scripts for making buttons..... even simple ones to test this thing..


rizza
 
you could place the font file to any dir

if you want i have an old script for button creation, it was build for old gdlibs, where the gif support was built in ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top