true type fonts again

This is a discussion on true type fonts again within the PHP General forums, part of the PHP Programming Forums category; G'day all I have been able to the the image to display, which is a gif image of a ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-15-2003
Cj
 
Posts: n/a
Default true type fonts again

G'day all
I have been able to the the image to display, which is a gif image of a
rectange.
But the text doesn't get displayed on the image.

There are no error messages on the screen
The other messages entitled true type fonts is a thread I started as well,
but the image was not being displayed on the screen at all.
So now I have the image but no text on the image.

What could be causing this, and what should I have a look at?


Thanks
P.S: the code I use is below

<?php
header("Content-type: image/gif");
$im = imagecreate(400,30);
$white = imagecolorallocate($im, 202,112,112);
$black = imagecolorallocate($im, 255,255,255);
// Replace path by your own font path
imagettftext($im, 20, 0, 10, 20, $black, "arial", "Testing... Omega:
&amp;#937;");
imagegif($im);
imagedestroy($im);
?>

The Glennies Group
P.O. Box 5136
Studfield Post Office
WANTIRNA SOUTH VIC 3152

Ph: 61 3 9800 3906
E-mail: enquiries@glennies.com.au
Website: glennies.com.au
Reply With Quote
  #2 (permalink)  
Old 12-15-2003
Jason Wong
 
Posts: n/a
Default Re: [PHP] true type fonts again

On Monday 15 December 2003 13:26, cj wrote:

> I have been able to the the image to display, which is a gif image of a
> rectange.
> But the text doesn't get displayed on the image.
>
> There are no error messages on the screen
> The other messages entitled true type fonts is a thread I started as well,
> but the image was not being displayed on the screen at all.
> So now I have the image but no text on the image.
>
> What could be causing this, and what should I have a look at?


If you had read and followed the advice given in response to your earlier
posts I'm sure you would've solved your problem by now.

Again:

1) Enable FULL error reporting by including these lines at the top of your
code:

error_reporting (E_ALL);
ini_set('display_errors', 1);

2) Output the image to file. Remember to comment out the header() for the time
being.

3) And someone else suggested that you may have specified the name of your
font file incorrectly. In my experience you *have* to specify a path to your
font file. So if the font file was in the same directory as your script then
use './name_of_font_file'. So if you had followed the above steps (at the
least step 1) you would have seen the following error:

PHP Warning: imagettftext(): Could not find/open font in ...

and would have clued you into what the problem was.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Alone, adj.:
In bad company.
-- Ambrose Bierce, "The Devil's Dictionary"
*/
Reply With Quote
  #3 (permalink)  
Old 12-16-2003
Cj
 
Posts: n/a
Default RE: [PHP] true type fonts again

I included the
error_reporting (E_ALL);
ini_set('display_errors', 1);
and commented out the header information, and I got the cannot open/find
font
So I copied the font to the correct places where I thought the font should
go, and tried the web page again.
The image is displayed but no text, I will be looking through the web pages
for a way to output the image to harddrive directly.
would running php script.php > filename.gif be suitable, or is there another
method.

I do appreciate your help
Thanks
CJ

-----Original Message-----
From: Jason Wong [mailto:php-general@gremlins.biz]
Sent: Monday, 15 December 2003 7:22 PM
To: php-general@lists.php.net
Subject: Re: [php] true type fonts again


On Monday 15 December 2003 13:26, cj wrote:

> I have been able to the the image to display, which is a gif image of a
> rectange.
> But the text doesn't get displayed on the image.
>
> There are no error messages on the screen
> The other messages entitled true type fonts is a thread I started as well,
> but the image was not being displayed on the screen at all.
> So now I have the image but no text on the image.
>
> What could be causing this, and what should I have a look at?


If you had read and followed the advice given in response to your earlier
posts I'm sure you would've solved your problem by now.

Again:

1) Enable FULL error reporting by including these lines at the top of your
code:

error_reporting (E_ALL);
ini_set('display_errors', 1);

2) Output the image to file. Remember to comment out the header() for the
time
being.

3) And someone else suggested that you may have specified the name of your
font file incorrectly. In my experience you *have* to specify a path to your
font file. So if the font file was in the same directory as your script then
use './name_of_font_file'. So if you had followed the above steps (at the
least step 1) you would have seen the following error:

PHP Warning: imagettftext(): Could not find/open font in ...

and would have clued you into what the problem was.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Alone, adj.:
In bad company.
-- Ambrose Bierce, "The Devil's Dictionary"
*/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:19 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0