View Full Version : [all variants] What is the default font path?

March 9th, 2009, 03:07 PM
I'm developing a php script that will use font files to write on images (with GD), I want the script to guess the right font path, so the user should only set the font name.

On windows it's usually 'C:\Windows\Fonts'

I've searched the net and found these but I can't test them since my host doesn't allow me to read them:

If it's matter, I'll use only TrueType or FreeType fonts.

What is the best guess? is there a way to get it somehow?

Thanks for helping! :D

March 9th, 2009, 03:16 PM

for example, if you want to use windows fonts do
sudo apt-get install msttcorefonts
then this folder will appear

March 9th, 2009, 03:39 PM
But from php usually the user can't use 'apt-get' nor 'sudo', nothing...

That is the reason I'm searching for a default path,
Is there any default pack inside '/usr/share/fonts/truetype/' ?

Thanks again for your help :thumbs up:

March 9th, 2009, 03:40 PM
where are you running your php?

March 9th, 2009, 03:57 PM
Currently on windows, but I want to make a class that will work as best as possible on every server

March 9th, 2009, 04:05 PM
you can't, every linux distro works different, and servers will use any kind of o.s. like solaris, freebsd, linux, ....

So I recomend you to use a config file for you class allowing user to specify the folder where fonts are stored.

Also a well configured server will not let you acces to it's folders, only to the web folder.

March 9th, 2009, 04:15 PM
well, I guess you right :(

Thanks :)