Finding out fontpath in PHP

  • Thread starter Thread starter Zom
  • Start date Start date
Nope, not a native to php thing anyway.

You should know what your own 'font path' is anyway. The OS may have an env var for it, thus you could shell_exec('echo $FONT_PATH'); where $FONT_PATH is replaced for the actual env var, but other than that you'll need to hard-wire it into your code.
 
Dj_Jestar said:
Nope, not a native to php thing anyway.

You should know what your own 'font path' is anyway. The OS may have an env var for it, thus you could shell_exec('echo $FONT_PATH'); where $FONT_PATH is replaced for the actual env var, but other than that you'll need to hard-wire it into your code.

That would also be the font path on the server since that's where its running.

Just do a phpinfo(); to find out what variables are available to PHP by default on your host :)
 
Dj_Jestar said:
Nope, not a native to php thing anyway.

You should know what your own 'font path' is anyway. The OS may have an env var for it, thus you could shell_exec('echo $FONT_PATH'); where $FONT_PATH is replaced for the actual env var, but other than that you'll need to hard-wire it into your code.

:confused:

PHP:
<?php

var_dump( getenv('GDFONTPATH') );

?>
 
is that the same as (on windows for ex.) c:\windows\fonts?

EDIT: tested... bool(false) here (gd is loaded)
 
Last edited:
Back
Top Bottom