php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #25899 imageloadfont built in function that indefinately reports errors
Submitted: 2003-10-17 15:00 UTC Modified: 2004-07-27 18:30 UTC
From: gabaod at hotmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.3 OS: Debian Woody
Private report: No CVE-ID: None
 [2003-10-17 15:00 UTC] gabaod at hotmail dot com
Description:
------------
I run debian woody, 

Php 4.3.3 is installed
Php4-gd 4.3.3 is installed
libgd2 2.0.15 is installed
libpng2 1.0.15 is installed

I have also tried the "stable" versions to debian of these which are

Php 4.1.2
Php-gd2 4.1.2
libgd2 2.0.1
libpng2 1.0.12

anytime you call the function  imageloadfont($font) or die('function does not work');   it always states that the function does not work.

I have tried $font to be doc-relative path, root-relative path and aboslute path and each time it always states function does not work.

the manual states:   imageloadfont() loads a user-defined bitmap font and returns an identifier for the font (that is always greater than 5, so it will not conflict with the built-in fonts).

Several problems here.

1. Even if it does load, which it never does, it just states it will be greater than 5, that does not state first time the function  imageloadfont() is called it will make it as font #6, second time its called in the same file then it will be #7 etc?  Is that how its intended to work? if so document it.

2. Only available help that has shown on this function is to use an outside program called bdf2gd which all it does is create the source files for a gd font.   is imageloadfont() looking for a source font file for gd? or a binary source file for gd?  I have tested both, and each time its reported function does not work.

3. I have searched your bug reports on this, and only came across 1 valid one that the closed outcome was to use the newer image-font functions.  How can the ticket be closed without even fixing the function this was reported on?

4. Last thing i would like to ask is to give a better description of exactly how does this function work, with at least just 1 working example that shows this function does truely work.  And Yes i do know it requires a gd font file, how about possibly stating the format of that font file.  Source or binary?

A gd font source appears as

char nameoffontData[]
{
  0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0,
  1, 0, 0, 0, 0, 1, 0,
  1, 1, 0, 0, 1, 1, 0,
  1, 1, 1, 1, 1, 1, 0,
  1, 1, 1, 1, 1, 1, 0,
  1, 1, 0, 0, 1, 1, 0,
  1, 1, 0, 0, 1, 1, 0,
  1, 1, 0, 0, 1, 1, 0,
  1, 1, 0, 0, 1, 1, 0,
  0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0,
};

gdFont nameoffontRep = {
numberofchars;
valueoffirstchar;
widthofchar;
heightofchar;
nameoffontData
};

So please document exactly what is needed to properly use the function imageloadfont() or remove that function completely from the documentation so people like me are not wasting well over 12 hours on trying to figure it out.


Reproduce code:
---------------
$font = "myfont.gd"

imageloadfont($font) or die('function does not work');


Expected result:
----------------
To have it successfully load the font into your function without reporting an error.

Actual result:
--------------
function does not work

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-27 18:30 UTC] vrana@php.net
1. No need to document this.

2. Binary file is used, it's written in the doc.

3. Irrelevant.

4. Format of the file is described. I have added an example.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 19 10:00:03 2025 UTC