php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33489 Certain true type fonts shows squares instead of text
Submitted: 2005-06-27 13:47 UTC Modified: 2005-07-28 14:41 UTC
From: informatica at diputacionavila dot es Assigned: pajoye (profile)
Status: Not a bug Package: GD related
PHP Version: 5.1.0b2 OS: Linux Fedora Core 2
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: informatica at diputacionavila dot es
New email:
PHP Version: OS:

 

 [2005-06-27 13:47 UTC] informatica at diputacionavila dot es
Description:
------------
Certain true type fonts shows squares instead of text. Common fonts works fine (Times, Arial...) and some symbol fonts too. But weather.tff don't. You can download the font from www.diputacionavila.es/weather.ttf

Reproduce code:
---------------
<?php 
Header("Content-type: image/png"); 
$gif = ImageCreate(200,200); 
$bg =  ImageColorAllocate($gif,22,222,2); 
$ellipse = ImageColorAllocate($gif,2,200,200); 
$tx = ImageColorAllocate($gif,255,255,128); 
ImageFilledRectangle($gif,0,0,200,200,$bg); 
$black = imagecolorallocate($gif, 0,0,0);
ImageTtfText ($gif, 20, 0, 0, 90, $black, "/weather.ttf","123ABCabc...");
ImagePNG($gif); 
?> 


Expected result:
----------------
This is what I see in php5.0.2
http://www.diputacionavila.es/xgarbage/gif3.php

Actual result:
--------------
This is what I see in php5.0.3 and beyond
http://rh.homelinux.net/xgarbage/gif3.php

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-27 14:29 UTC] sniper@php.net
..and the underlying freetype libs, etc. are the same in both systems? And you're reporting this bug to be in 5.1b2, even as you only talk about 5.0.2 / 3..so REALLY try the b2 before reporting something..

 [2005-06-28 08:26 UTC] informatica at diputacionavila dot es
Freetype libs are the same in both systems. I have also tryed other versions of freetype. I'm talking about php 5.0.3 and beyond, so I've tested it in 5.0.3, 5.0.4 and 5.1.0b2 whith the same result. If I get back to 5.0.2 it works fine.
 [2005-06-28 09:08 UTC] sniper@php.net
Pierre, you broke this? :)

 [2005-07-23 18:47 UTC] pajoye@php.net
Please provide a link to the ttf fonts causing problems. I may try to allow broken fonts. But only if the changes will not break well defined fonts.

--Pierre
 [2005-07-26 09:18 UTC] informatica at diputacionavila dot es
Here you have links to some problematic fonts
http://www.diputacionavila.es/weather.ttf
http://www.diputacionavila.es/vacation.ttf
http://www.diputacionavila.es/wingdng3.ttf
http://www.diputacionavila.es/zaf.ttf
If you need anything else...
 [2005-07-27 16:58 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

None of these are somehow valid. Better said they completely broken. The only who do not raise a direct error is weather.

I used freetype directly and various freetype debug tools.

Fix your fonts, sorry.

--Pierre
 [2005-07-28 13:47 UTC] informatica at diputacionavila dot es
First of all thaks a lot for your time and patient. Just one question more ?Why this fonts works fine in previous versions to 5.0.3 (<= 5.0.2)?
I have done a test showing four fonts, in my server with php5.0.2 this is the result http://www.diputacionavila.es/xgarbage/gif4.php, and my server with php5.1.0b2 shows this: http://rh.homelinux.net/xgarbage/gif4.php

Thanks again
 [2005-07-28 14:41 UTC] pajoye@php.net
I dunno but the freetype libs is my reference implementation. The fonts are definitivally not valid.

It's always somehow possible to hack and allow broken formats. But it will introduce more troubles for well formated fonts.

--Pierre
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 20:01:31 2024 UTC