Current location: Hot Scripts Forums » Programming Languages » PHP » dynamic images in php - a problem and a question


dynamic images in php - a problem and a question

Reply
  #1 (permalink)  
Old 01-03-06, 07:58 PM
gnznroses gnznroses is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Arrow dynamic images in php - a problem and a question

i'm making dynamic gif files. the user can specify which font to use, and i use a switch statement to set the appropriate font size, but it's not working.


code snippet:

Code:
      switch ($font){
            case "crystal_clear":
                  $textsize = 9;
                  break; 
            case "dungeon":
                  $textsize = 9;
                  break; 
            case "gapstown":
                  $textsize = 12;
                  break; 
            case "sf_espionage":
                  $textsize = 22;
                  break; 
            case "sf_grunge":
                  $textsize = 22;
                  break; 
            case "verdana":
                  $textsize = 9;
                  break;
            default:
                  $textsize = 9;
                  break;  
      } 

imagettftext($mygraphic, $textsize, 0, 10, 10, $black, $font, $text);
actually, those sizes aren't the appropriate ones - i cranked them up really high to see for sure if it was working. and it's not.


it works fine with Verdana, but the others are way too small. to see the results for yourself, you can modify this URL:

http://bashfreebieguide.com/mystatus...g&font=verdana

the resulting image will be:
http://bashfreebieguide.com/mystatus/test.gif

for example, try setting the font to sf_grunge or sf_espionage, then viewing the image. it's really small - definitely not the size i set it to.



also, anyone have any sample code of how to make text have more than one color? like let's say i pass the script text with some of it marked with special tags, like [red]text[/red] and parse that, so that i'd draw each string right after the last-printed string, and get it looking right. know what i mean?
i know i'd have to print each string seperately, keeping track of where i left off, and stuff. i know how to do it, logically, it just seems hard to code, and i just learned php...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 01-05-06, 06:44 AM
olaf's Avatar
olaf olaf is offline
Newbie Coder
 
Join Date: Sep 2004
Location: The Netherlands
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
do you have uploaded the .ttf (font)file?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 01-05-06, 12:58 PM
gnznroses gnznroses is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
heh, yeah.
the fonts work, they're just really small and refuse to get bigger...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 08:57 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.