Bold or Italic Text

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JohnDigweed
Forum Newbie
Posts: 18
Joined: Sun Mar 28, 2004 6:24 pm
Location: root/user/hell

Bold or Italic Text

Post by JohnDigweed »

Hi,

I am using the image functions in PHP to make text on a background. I am also using imagetfttext. I was wondering, is there a way to make the text Bold or Italic?

Thanks.
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

i've never figured out, but there aren't any lines on it in the function reference :?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

For bold text, you can place the same string over itself one or more times, and with abit of tweaking you get bold text. Difficult, but...

Italics-shortcut... Thats worse. If it's possible to turn the image, write the text and turn the image back again, it might be possible, but you need a loop that loops through each letter in the string for that to work. Just a theory.

However, http://www.lerdorf.com/tips.pdf shows you (abit down in that file) examples, where they use fonts that are themselves bold or italic. ArialBold and ArialItalic I belive exists. An idea if you don't need to stick with a certain font...

Hope that helped.
Post Reply