php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17717 Error: could not find/open font
Submitted: 2002-06-11 18:23 UTC Modified: 2002-06-12 13:58 UTC
From: enrico dot kliesch at mind-building dot de Assigned:
Status: Closed Package: GD related
PHP Version: 4.2.1 OS: Windows 2000
Private report: No CVE-ID: None
 [2002-06-11 18:23 UTC] enrico dot kliesch at mind-building dot de
When I use the function:

ImageTTFText($im, $size, $angle, $x, $y, $black, $font, $text);

I see the error: Could not open/find font.

I tried to use a font the following things:

- $font="../arial.ttf"; //the font was on directory above
- $font="arial.ttf";    //the font was in the same dir
- $font="f:\\www\\script\\arial.ttf"; //the real path
- $font="./arial.ttf";  //in the same dir

in the Version 4.2.0 it works but i thougt the gd2 lib is better in 4.2.1 than 4.2.0.

Enrico

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-11 18:34 UTC] sniper@php.net
Please don't open ANOTHER report about exactly same issue.
Use the 'Advaced search' to find the other ones about this
and add your comment there.

 [2002-06-11 18:50 UTC] enrico dot kliesch at mind-building dot de
I also tried:

$font="./arial" //without .ttf

Enrico
 [2002-06-12 07:34 UTC] webmaster at tsn dot dk
The correct way is

$font = "/WINNT/Fonts/arial.ttf";

and sniper is right, this is a GDlib bug, and not PHP related..

It's a shame GDlib is never updated
 [2002-06-12 13:58 UTC] enrico dot kliesch at mind-building dot de
I found the soulution in another question.

You first have to define the GD font path:
putenv('GDFONTPATH=f:\www\radioshow\fonts');

then it works with:
ImageTTFText($im, $size, $angle, $x, $y, $black, $font, $text);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC