Difffernt fonts in GD library images

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DaiWelsh
Forum Commoner
Posts: 36
Joined: Wed Jan 08, 2003 9:39 am
Location: Derbyshire, UK

Difffernt fonts in GD library images

Post by DaiWelsh »

I am creating dynamic images with PHP on a host's Solaris box. I would like to use fonts other than the standard (ugly) ones available through the GD library.

Firstly am I right in thinking I can get hold of BDF font files, uplaod them into my web space and then load them through GD calls in PHP?

Secondly does anyone have any good sources for some BDF files for 'common' fonts?

TIA,

Dai
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Perhaps this link might help.

Laborate with imagettftext() and you might have something going...
pootergeist
Forum Contributor
Posts: 273
Joined: Thu Feb 27, 2003 7:22 am
Location: UK

Post by pootergeist »

what's a bdf font?

GD can use truetype fonts .ttf through using the functions

imagettftext
imagettfbbox

or

imagefttext
imageftbbox
(if your library is freetype these should work better)
DaiWelsh
Forum Commoner
Posts: 36
Joined: Wed Jan 08, 2003 9:39 am
Location: Derbyshire, UK

Post by DaiWelsh »

Thanks for the answers, are truetype fonts platform dependent, or can I use any TTF on Solaris? Similarly for freetype?

BDF seems to be some form of binary font file that the non-ttf functions in GD uses, or were you being facetious?

Forgive my ignorance, I could survive quite happily with just one font so it all goes over my head...

Dai
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

It should work, tho I have not tested it on Solaris myself.

Reading the manuals comments on the appropiate function for it, you'll see that there are many users discussing it in *nix terms (3rd from the top as example).
Post Reply