Remember!!!
When uploading a font to your website you have to set the transfer mode to binary. It took me some time to find out :P. Tried to download the font from my website and it was spoiled.
In your script, the path to your font, use realpath("arial.ttf") so there is no confusion about that.