Where can I find GD compatible fonts?

15,639

Solution 1

I hadn't seen the imagettftext function in the documentation. Thanks @Pekka for the advice. Finally I just copied the consolas.ttf file in the same directory of the script and did:

imagettftext ( $image, 12, 0, 200, 100, 0, 'consolas.ttf' , "thanks!");

It works perfectly.

Solution 2

This question already has an accepted answer but I am sharing a useful link to get gdf fonts.

http://www.danceswithferrets.org/lab/gdfs/

Solution 3

Have you tried using a converter to convert a truetype font file into gdf?

http://www.lunar.lu/ttf-to-gdf/convert.php

Share:
15,639

Related videos on Youtube

Cristian
Author by

Cristian

http://cristian.io

Updated on June 04, 2022

Comments

  • Cristian
    Cristian almost 2 years

    I'm using GD to display some text. The default font is Courier (or something similar)... I want to use another font and I found this function: imageloadfont that requires a .gdf file. I've search on Google to see if I find some nice fonts, but I didn't find anything. I see there's a script to convert a PNG file to a GDF, but I can't waste too much time so I'd like to know where can I get some nice fonts, or maybe there's another easier way to do what I want.

    • Pekka
      Pekka almost 14 years
      Why not use GD`s TrueType capabilities?
  • Cristian
    Cristian almost 14 years
    Thanks for your help. I tried to convert 'Consolas' but the result is not good: i.imgur.com/BpPWc.png Thanks again!
  • Mark
    Mark almost 14 years
    ahh I guess it doesn't do anti aliasing well. But I see you've found the solution you were looking for :)
  • Kishor Kundan
    Kishor Kundan about 12 years
    i think even the link is now broken, i got "404"
  • Tim
    Tim over 8 years
    Please format this nicely as no one can understand this. Stack overflow has a nice embedded code feature by indenting each line with 4 spaces.