Bug #52404 [Com]: All TTF Files are invalid [ALL PHP.NET]

From: Date: Sun, 12 Jun 2011 01:32:02 +0000
Subject: Bug #52404 [Com]: All TTF Files are invalid [ALL PHP.NET]
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-161336@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52404&edit=1

 ID:                 52404
 Comment by:         gozmeu at gmail dot com
 Reported by:        hm2k@php.net
 Summary:            All TTF Files are invalid [ALL PHP.NET]
 Status:             Open
 Type:               Bug
 Package:            *General Issues
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

same here 

Warning: imagettftext() [function.imagettftext]: Could not find/open font in
/home/gozmeu/domains/pwiguilds.com/public_html/travelcounter.php on line 40
‰PNG  IHDRPÆ-q"
PLTEÿÿÿÿÿÿsx¥cIDAT(‘cpÀ±,»ÊQ3GÍÄk&]7>7¡ˆFIEND®B`‚


with a valid or invalid ttf file :s


Previous Comments:
------------------------------------------------------------------------
[2010-12-07 12:51:33] hm2k@php.net

This is not a difficult bug to fix. Anybody with commit access should be able to fix it.

Can somebody fix it?

Thanks.

------------------------------------------------------------------------
[2010-10-18 18:30:24] hm2k@php.net

I would if I could.

I don't think I have commit access to all of the ttf files on the php.net svn.

------------------------------------------------------------------------
[2010-07-27 01:54:48] rasmus@php.net

You may just have to re-import them into Subversion or something.  All I did was 
flip the svn property so Subversion wouldn't mangle them.

------------------------------------------------------------------------
[2010-07-27 01:02:53] kalle@php.net

Confirmed on Windows XP aswell (unreadable font files in the font viewer)

Rasmus: You did this change, should it be reverted or do you have any easy fix on your mind?

------------------------------------------------------------------------
[2010-07-22 15:13:56] hm2k@php.net

Description:
------------
All of the TTF files that are on PHP.net appear to be invalid/corrupt.

A change that happened 12 months ago with the description of "Fix TTF files" appears to be
where the problem lies.

http://svn.php.net/viewvc?view=revision&revision=284292

To fix this, this revision should be reverted to all files.

On Windows, when you try to open any of these files it will say

"The requested file *.ttf was not a valid font file".

Here at PHP, we get a different message when using the imagettfbbox() function...

"Could not read font".

In the example below I am using the arial.ttf file which can be downloaded here:
http://svn.php.net/viewvc/web/php/trunk/bin/arial.ttf?view=co

Test script:
---------------
<?php

$font = 'fonts/arial.ttf';

$read = file_exists($font)?'Yes':'No';
echo "\n<br>Does font '$font' exist? ".$read;

$read = is_readable($font)?'Yes':'No';
echo "\n<br>Is font '$font' readable? ".$read;

$test = @imagettfbbox(1, 1, $font, 1)?'Yes':'No';
echo "\n<br>Is font '$font' valid? ".$test;

echo "\n<br>What PHP version? ".phpversion();

?>

Expected result:
----------------
Does font 'fonts/arial.ttf' exist? Yes
Is font 'fonts/arial.ttf' readable? Yes
Is font 'fonts/arial.ttf' valid? Yes
What PHP version? 5.2.13

Actual result:
--------------
Does font 'fonts/arial.ttf' exist? Yes
Is font 'fonts/arial.ttf' readable? Yes
Is font 'fonts/arial.ttf' valid? No
What PHP version? 5.2.13


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52404&edit=1


Thread (8 messages)

« previous php.bugs (#161336) next »