php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11688 Could not find/open font (ImageTTFBBox, imageTTFText)
Submitted: 2001-06-26 03:34 UTC Modified: 2001-07-20 07:28 UTC
From: Helge-Schulz at t-onlie dot de Assigned:
Status: Closed Package: GD related
PHP Version: 4.0.6 OS: Win 98 SE and Win NT 4.0 SP 6
Private report: No CVE-ID: None
 [2001-06-26 03:34 UTC] Helge-Schulz at t-onlie dot de
Could not find/open font (ImageTTFBBox, imageTTFText)

At version 4.0.5 and earlier it does work.
Now in Version 4.0.6 it doesn't work

<?php
header("Content-type: image/png");


$text = "Test";
$fontfile = "../fonts/times.ttf";
$fontsize = 22;
$fontangle = 0;
$dimtxt = ImageTTFBBox( $fontsize, $fontangle, $fontfile, $text );

$border = 10;
$txtsizex = abs($dimtxt[4] - $dimtxt[0]);
$txtsizey = abs($dimtxt[5] - $dimtxt[1]);
$imgsizex = $txtsizex + 3*$border;
$imgsizey = $txtsizey + 5*$border;
$txtposx = $border;
$txtposy = $txtsizey + $border;

$img = imageCreate( $imgsizex, $imgsizey);

$col1 = imagecolorallocate( $img, 153, 0, 51);
$col2 = imagecolorallocate( $img, 255, 255, 255);
                
imagefill( $img, 0, 0, $col1);
imageTTFText( $img, $fontsize, $fontangle, $txtposx, $txtposy, $col2, $fontfile, $text );

imagepng( $img );
imagedestroy( $img );
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-20 07:28 UTC] dbeu@php.net
fixed in cvs, thanks.
 [2003-08-09 22:38 UTC] mattjp88 at nycap dot rr dot com
hello,
i am having the same problem, how did you fix it?  

thanks alot,
Matt
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jul 06 16:05:46 2022 UTC