Lost Password?

  #11 (permalink)  
Old 12-05-2006, 12:23 AM
John's Avatar   
John John is online now
Co-Administrator
 
Join Date: Jul 2006
Age: 19
Posts: 2,350
Last Blog:
PHP Function Overloadi...
Rep Power: 50
John is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of light
Send a message via AIM to John
Default

you can change the file the php script looks for by editing this line

PHP Code:
$font 'font.ttf'//font file 
change it to

PHP Code:
$font 'font.TTF'//font file 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 12-05-2006, 06:09 AM
TcM's Avatar   
TcM TcM is offline
Terminator - I'll be back
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 5,718
Rep Power: 47
TcM is a jewel in the roughTcM is a jewel in the roughTcM is a jewel in the rough
Default

Yeah I did that too before but.. still Broken image link :S
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall


Business Directory | Technology Blog | Windows Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 12-29-2006, 04:42 PM
codyg codyg is offline
Newbie
 
Join Date: Dec 2006
Posts: 1
Rep Power: 0
codyg is on a distinguished road
Thumbs up Thanks

Thanks for this, exactly want i needed and VERY helpful
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 01-13-2007, 03:53 AM
major major is offline
Newbie
 
Join Date: Jan 2007
Posts: 2
Rep Power: 0
major is on a distinguished road
Default

thanks!!!
just the thing i was looking for
prozit.net/ilu/index.php?form=sidewinder
prozit.net/merry/index.php?form=Dan

but i have one little problem
how can i place the text in the midlle
or by pixels

and how can i pu the text in an angle

Last edited by major; 01-13-2007 at 04:04 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 01-13-2007, 02:15 PM
John's Avatar   
John John is online now
Co-Administrator
 
Join Date: Jul 2006
Age: 19
Posts: 2,350
Last Blog:
PHP Function Overloadi...
Rep Power: 50
John is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of light
Send a message via AIM to John
Default

Quote:
Originally Posted by major View Post
but i have one little problem
how can i place the text in the midlle
or by pixels
Well by following the tutorial you know that these lines account for the location of the text:

PHP Code:
$size imagettfbbox($fontsize0$font$text);
$dx = (imagesx($im)) - (abs($size[2]-$size[0])) - 20
PHP Code:
imagesx($im
is the width of the image and
PHP Code:
abs($size[2]-$size[0]) 
is the width of the font

In theory taking half the width of the image, and then subtracting half the width of the string should give you centered text so try this

PHP Code:
$dx = (imagesx($im)/2) - (abs($size[2]-$size[0])/2); 
Quote:
Originally Posted by major View Post
and how can i put the text in an angle
Quote:
Originally Posted by Sidewinder
The imagettftext requires 8 arguments which are the resource image, font size, the angle, x location, y location, font color, the actual font, and the string to be printed.
By taking a look at the php manuals reference to the imagettftext [ PHP: imagettftext - Manual ]
Quote:
angle:

The angle in degrees, with 0 degrees being left-to-right reading text. Higher values represent a counter-clockwise rotation. For example, a value of 90 would result in bottom-to-top reading text.
There for to make the text on an angle
You would do
PHP Code:
imagettftext($im$size451512$color$font$text); 
Where 45 is the angel degree.

This code has not been tested

hth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #16 (permalink)  
Old 01-14-2007, 08:19 AM
major major is offline
Newbie
 
Join Date: Jan 2007
Posts: 2
Rep Power: 0
major is on a distinguished road
Default

it is writing
<br />
<b>Fatal error</b>: Call to undefined function: imagettfbbox() in <b>/home/labdan/domains/prozit.net/public_html/gd/in.php</b> on line <b>22</b><br />


http://prozit.net/gd/in.php?text=sadsa
...
how can i solve it
and onther thing
it is the same code for gif and jpg expet from changing image/gif
and
image.gif
?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 01-14-2007, 10:27 AM
ConnorWilson ConnorWilson is offline
Newbie
 
Join Date: Jan 2007
Posts: 4
Rep Power: 0
ConnorWilson is on a distinguished road
Default

I never really understood GD, even though I'm pretty advanced at PHP. This cleared a lot of things up, thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 01-14-2007, 12:18 PM
John's Avatar   
John John is online now
Co-Administrator
 
Join Date: Jul 2006
Age: 19
Posts: 2,350
Last Blog:
PHP Function Overloadi...
Rep Power: 50
John is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of light
Send a message via AIM to John
Default

Quote:
Originally Posted by major View Post
it is writing
<br />
<b>Fatal error</b>: Call to undefined function: imagettfbbox() in <b>/home/labdan/domains/prozit.net/public_html/gd/in.php</b> on line <b>22</b><br />


http://prozit.net/gd/in.php?text=sadsa
...
how can i solve it
and onther thing
it is the same code for gif and jpg expet from changing image/gif
and
image.gif
?
Which part of the changed code is causing the error? And no, this code is only meant for png images, there are other functions you can use for gif's and jpg's such as imagecreatefromgif() or imagecreatefromjpeg() rather than imagecreatefromgif(). Although you have to change the functions the general code should remain the same.

For more information on the GD functions take a look here PHP: gd_info - Manual
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 04-13-2007, 08:37 AM
kraam kraam is offline
Newbie
 
Join Date: Apr 2007
Posts: 1
Rep Power: 0
kraam is on a distinguished road
Default

cool thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 05-09-2007, 06:54 AM
snailofsatan snailofsatan is offline
Newbie
 
Join Date: May 2007
Posts: 4
Rep Power: 0
snailofsatan is on a distinguished road
Default

hello! nice tutorial!! i was just wondering if you know how to wrap the text into a nice paragraph if the string is too long to fit onto the image?

thankyou
kev.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



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

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP:Tutorial - Email Verification John PHP Tutorials 3 09-19-2007 12:19 PM
PHP:Tutorial The Date John PHP Tutorials 0 01-10-2007 06:10 PM


All times are GMT -5. The time now is 09:39 PM.

Contest Stats

dargueta ........ 93.00000
John ........ 87.50000
Xav ........ 50.00000
MeTh0Dz ........ 20.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000

Contest Rules

Ads