Back to vBulletin 3 Articles

Small Tutorial on GD Library [Freetype]
by mr e 23 May 2003

Ok this is pretty much an addition of my previous thread about the http://www.vbulletin.org/forum/showthread.php?s=&postid=372738. This is just a small tutorial on how to get Freetype to work since it took me far too long before I realized it came with PHP.

Requirements
PHP 4.3.1 (this comes with the GD Library & Freetype

This is actually pretty easy to get working and makes your text look way cool if you get a nice font

1) Create a folder on the server (in my case it was /fonts) and put the .ttf file in there.

2)
PHP Code:
//Instead of this
//ImageString(resource image, int font, int x, int y, string s, int col);
//Ex:
ImageString($img123060'Text'$white);

//You need to do this
//ImageTTFText(resource image, int size, int angle, int x, int y, int color, string fontfile, string text);
//Ex:
ImageTTFText($img10021065$white'PATH/TO/FONT/FILE.ttf''Text'); 
As you can see it's really not that hard, but it took me forever and a day to figure out how to do this, and it really improves the look of your text Have fun!

vblts.ru supports vBulletin®, 2022-2024