php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31259 imagettftext fails with some ttf font
Submitted: 2004-12-22 22:22 UTC Modified: 2005-03-28 05:02 UTC
From: dbad732001 at yahoo dot com Assigned: pajoye (profile)
Status: Not a bug Package: GD related
PHP Version: 4CVS, 5CVS (2005-01-14) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dbad732001 at yahoo dot com
New email:
PHP Version: OS:

 

 [2004-12-22 22:22 UTC] dbad732001 at yahoo dot com
Description:
------------
Using the function imagettftext of the GD library fails with some ttf fonts; instead of the letters appears only little boxes, similar to the ones showed in the windows charachter map application when a gliph is not present in a font.

The behavior was OK on the 4.3.9 version

The code works if, for example, i use another ttf file (arial.ttf)

Reproduce code:
---------------
<?php
  header("Content-type: image/gif");
  $im = imagecreate(600, 200);
  $white = imagecolorallocate($im, 221, 221, 221);
  $black = imagecolorallocate($im, 51, 0, 153);
  imagettftext($im, 30, 0, 100, 100, $black, "font/rbb.ttf" ,"This is a test");
  imagegif($im);
  imagedestroy($im);
?>

The font rbb.ttf can be downloaded at

http://www.revelshblindbeholders.net/font/rbb.ttf

Expected result:
----------------
The result should be a gray box with the text "This is a test" written with the chosen font

Actual result:
--------------
The gray box appear, but instead of the text i see only little boxes, alike the ones showed in the Win char map when a char is not implemented within the font.

The code works if, for example i use another ttf file (arial.ttf)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-14 19:13 UTC] sniper@php.net
This bug was caused by "fix" of bug #28598 (reverting the fix fixes this bug)

 [2005-01-14 22:07 UTC] sniper@php.net
Also noticed: This bug is present in GD 2.0.33 too..

 [2005-03-28 05:02 UTC] pajoye@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Broken font, beg MS or your font editor.

--Pierre
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 22:01:29 2024 UTC