[PHP] text to image

2003-02-14 Thread Alex Shi
Hello,

I am thinking to create php script to dynamically convert a text string to
image. My questions are:

1. with a given text string, say hello, world, is it possible to
dynamically
convert it to an image? and what php built-in functions can be utilized?
2. if I want to use true-type verdana font, can I just upload the windows
font file to the web server (linux) and use php to load the font?

Thanks in advance!

Alex Shi



--
==
Cell Phone Batteries at 30-50%+ off retail prices!
http://www.pocellular.com
==
TrafficBuilder Network:
http://www.bestadv.net/index.cfm?ref=7029
==


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] text to image

2003-02-14 Thread Hugh Danaher
Alex,
Easy to do what you want.  Check out the image functions in the php
manual.  There are some font limitations, specifically dealing with
alternate characters, but you'll find out what works and what doesn't soon
enough.
Hugh

- Original Message -
From: Alex Shi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 14, 2003 10:16 AM
Subject: [PHP] text to image


 Hello,

 I am thinking to create php script to dynamically convert a text string to
 image. My questions are:

 1. with a given text string, say hello, world, is it possible to
 dynamically
 convert it to an image? and what php built-in functions can be utilized?
 2. if I want to use true-type verdana font, can I just upload the windows
 font file to the web server (linux) and use php to load the font?

 Thanks in advance!

 Alex Shi



 --
 ==
 Cell Phone Batteries at 30-50%+ off retail prices!
 http://www.pocellular.com
 ==
 TrafficBuilder Network:
 http://www.bestadv.net/index.cfm?ref=7029
 ==


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] text to image

2003-02-14 Thread Alex Shi
Hi, THanks for your reply.

I search the manual and created following script.

?
 header (Content-type: image/gif);
 $im = imagecreate (400, 16);
 $black = imagecolorallocate ($im, 0, 0, 0);
 $white = imagecolorallocate ($im, 255, 255, 255);
 imagettftext ($im, 10, 0, 10, 20, $black, verdana.ttf, date('| l | F | d
| Y |'));
 imagegif ($im);
 imagedestroy ($im);
?

I got following error msg when ran it:

br
bWarning/b:  ImageTtfText: No TTF support in this PHP build in
b/home/dotkard/www/current_time.php/b on line b6/bbr
br
bWarning/b:  ImageGif: No GIF support in this PHP build in
b/home/dotkard/www/current_time.php/b on line b7/bbr

I checked the phpinfo but failed to find which variable I should turn on.

Alex

 Alex,
 Easy to do what you want.  Check out the image functions in the php
 manual.  There are some font limitations, specifically dealing with
 alternate characters, but you'll find out what works and what doesn't soon
 enough.
 Hugh

 - Original Message -
 From: Alex Shi [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, February 14, 2003 10:16 AM
 Subject: [PHP] text to image


  Hello,
 
  I am thinking to create php script to dynamically convert a text string
to
  image. My questions are:
 
  1. with a given text string, say hello, world, is it possible to
  dynamically
  convert it to an image? and what php built-in functions can be utilized?
  2. if I want to use true-type verdana font, can I just upload the
windows
  font file to the web server (linux) and use php to load the font?
 
  Thanks in advance!
 
  Alex Shi
 
 
 
  --
  ==
  Cell Phone Batteries at 30-50%+ off retail prices!
  http://www.pocellular.com
  ==
  TrafficBuilder Network:
  http://www.bestadv.net/index.cfm?ref=7029
  ==
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] text to image

2003-02-14 Thread Alex Shi
forgot somethingwhen try following script in another server I got
500 internal server error.

?
  header (Content-type: image/gif);
  $im = imagecreate (400, 16);
  $black = imagecolorallocate ($im, 0, 0, 0);
  $white = imagecolorallocate ($im, 255, 255, 255);
  imagettftext ($im, 10, 0, 10, 20, $black, verdana.ttf, date('| l | F | d
| Y |'));
  imagegif ($im);
  imagedestroy ($im);
?

Alex again


 I got following error msg when ran it:

 br
 bWarning/b:  ImageTtfText: No TTF support in this PHP build in
 b/home/dotkard/www/current_time.php/b on line b6/bbr
 br
 bWarning/b:  ImageGif: No GIF support in this PHP build in
 b/home/dotkard/www/current_time.php/b on line b7/bbr

 I checked the phpinfo but failed to find which variable I should turn on.

 Alex

  Alex,
  Easy to do what you want.  Check out the image functions in the php
  manual.  There are some font limitations, specifically dealing with
  alternate characters, but you'll find out what works and what doesn't
soon
  enough.
  Hugh
 
  - Original Message -
  From: Alex Shi [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Friday, February 14, 2003 10:16 AM
  Subject: [PHP] text to image
 
 
   Hello,
  
   I am thinking to create php script to dynamically convert a text
string
 to
   image. My questions are:
  
   1. with a given text string, say hello, world, is it possible to
   dynamically
   convert it to an image? and what php built-in functions can be
utilized?
   2. if I want to use true-type verdana font, can I just upload the
 windows
   font file to the web server (linux) and use php to load the font?
  
   Thanks in advance!
  
   Alex Shi
  
  
  
   --
   ==
   Cell Phone Batteries at 30-50%+ off retail prices!
   http://www.pocellular.com
   ==
   TrafficBuilder Network:
   http://www.bestadv.net/index.cfm?ref=7029
   ==
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] text to image

2003-02-14 Thread Jason Wong
On Saturday 15 February 2003 04:49, Alex Shi wrote:
 I got following error msg when ran it:

 br
 bWarning/b:  ImageTtfText: No TTF support in this PHP build in
 b/home/dotkard/www/current_time.php/b on line b6/bbr

You need to configure/recompile php with TTF support.

 bWarning/b:  ImageGif: No GIF support in this PHP build in
 b/home/dotkard/www/current_time.php/b on line b7/bbr

Ditto for GIF support

-- 
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
--
/*
There is no sin but ignorance.
-- Christopher Marlowe
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] text to image

2003-02-14 Thread Hugh Danaher
Alex,
You should either use png or jpg rather than gif.  The most common builds of
the gd library support those image formats--go to the GD Library site to
find out why.  The support of ttf fonts should be taken up with your host.

When testing whether the code in your image creation file works, use
something like
a href=your_image_creation_file_name.phpsay something wonderful here/a
and any error messages will be displayed.  Once you've got it down pat, then
you can just swap out the line with an image tag, img
src=your_image_creation_file_name.php

$font=./fonts/verdana.ttf; // the path to the font is needed if it isn't
in the same directory as the script
$im = imagecreate (400, 16);
$black = imagecolorallocate ($im, 0, 0, 0);
$white = imagecolorallocate ($im, 255, 255, 255);
imagettftext ($im, 10, 0, 10, 20, $black, $font, date('| l | F | d | Y |'));
header (Content-type: image/png);  //header just before the imagepng call.
imagepng ($im);
imagedestroy ($im);

Hope this helps,
Hugh


- Original Message -
From: Alex Shi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 14, 2003 1:00 PM
Subject: Re: [PHP] text to image


 forgot somethingwhen try following script in another server I got
 500 internal server error.

 ?
   header (Content-type: image/gif);
   $im = imagecreate (400, 16);
   $black = imagecolorallocate ($im, 0, 0, 0);
   $white = imagecolorallocate ($im, 255, 255, 255);
   imagettftext ($im, 10, 0, 10, 20, $black, verdana.ttf, date('| l | F |
d
 | Y |'));
   imagegif ($im);
   imagedestroy ($im);
 ?

 Alex again

 
  I got following error msg when ran it:
 
  br
  bWarning/b:  ImageTtfText: No TTF support in this PHP build in
  b/home/dotkard/www/current_time.php/b on line b6/bbr
  br
  bWarning/b:  ImageGif: No GIF support in this PHP build in
  b/home/dotkard/www/current_time.php/b on line b7/bbr
 
  I checked the phpinfo but failed to find which variable I should turn
on.
 
  Alex
 
   Alex,
   Easy to do what you want.  Check out the image functions in the php
   manual.  There are some font limitations, specifically dealing with
   alternate characters, but you'll find out what works and what doesn't
 soon
   enough.
   Hugh
  
   - Original Message -
   From: Alex Shi [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Friday, February 14, 2003 10:16 AM
   Subject: [PHP] text to image
  
  
Hello,
   
I am thinking to create php script to dynamically convert a text
 string
  to
image. My questions are:
   
1. with a given text string, say hello, world, is it possible to
dynamically
convert it to an image? and what php built-in functions can be
 utilized?
2. if I want to use true-type verdana font, can I just upload the
  windows
font file to the web server (linux) and use php to load the font?
   
Thanks in advance!
   
Alex Shi
   
   
   
--
==
Cell Phone Batteries at 30-50%+ off retail prices!
http://www.pocellular.com
==
TrafficBuilder Network:
http://www.bestadv.net/index.cfm?ref=7029
==
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
  
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] text on image

2003-02-10 Thread Jason Wong
On Monday 10 February 2003 15:18, Ilya Nemihin wrote:
 I try to place text on image, but have color problems.

 code:
 $im = imagecreatefromjpeg( 'test.jpg' );
 $white = ImageColorAllocate ($im, 255, 255, 255);
 ImageTTFText ($im, 20, 0, 0, 20, $white, './fonts/times.ttf', 'text text
 text' );
 ImageJpeg( $im, 'test_out.jpg' );

 i.e. I want to have 'white' text, but text absolutely not rgb(255,255,255),
 image truecolor.

 I must use imagecreatetruecolor? but how...?

archives  text on image

-- 
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
--
/*
OKAY!!  Turn on the sound ONLY for TRYNEL CARPETING, FULLY-EQUIPPED
R.V.'S and FLOATATION SYSTEMS!!
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] text on image

2003-02-09 Thread Ilya Nemihin
I try to place text on image, but have color problems.

code:
$im = imagecreatefromjpeg( 'test.jpg' );
$white = ImageColorAllocate ($im, 255, 255, 255);
ImageTTFText ($im, 20, 0, 0, 20, $white, './fonts/times.ttf', 'text text
text' );
ImageJpeg( $im, 'test_out.jpg' );

i.e. I want to have 'white' text, but text absolutely not rgb(255,255,255),
image truecolor.

I must use imagecreatetruecolor? but how...?

Ilya



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php