Text Arcs

images php coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply

Tue Jun 10, 2003 12:46 am

Anyone know how to make text arc? I know theres no gd function except arc'ing some shapes but i need to arc TEXT. Perhaps someone has created an open source function? Thanks, i doubt anyone has since I have looked everywhere but you never know?

User avatar
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Sat Jul 05, 2003 11:44 pm

For something that sounds relatively simple, this is a very tall order. I looked about a bit and it seems you have three options, all of which are going to take a lot of work.

You can try to use The Gimp. Apparently there's a Text Circle function in Script-Fu that might do what you want, if you want your text on a circle and not a more complex shape.

You can learn to program PostScript, create what you're after in a PostScript file, and then convert it to the image format of your choice.

Or you can do a whole lot of math. Make sure your know your trigonometry and maybe a bit of calculus. Basically, you're going to need to be able to plot a curve and then iterate along that curve. At every point in the curve where you want to print a new character, you must determine the tangent of the curve at that point, rotate the character (you can probably find a script that handles arbitrary rotation) according to the tangent's slope, and print the character. Then move again along the curve according to the width of the previous character.

Sounds like fun, no? At this point, you must ask yourself, is this really worth it? Think of it this way: GD doesn't produce pretty text, ever. It's best suited for things like graphs and such that don't need to be pretty. So why go through the trouble of using it to create some curved text if it's going to be ugly anyway? The Gimp, if you're willing to learn everything about it, can yeild a lot prettier results if you dedicate yourself to it. And if you do, I'd really like to see what you churn out.

New php-forum User
New php-forum User
Posts: 5
Joined: Fri Aug 08, 2003 11:26 am

Fri Aug 08, 2003 11:46 am

i've heard about things like the following done before:
if you learned how to use the gimp, could you not have a copy of the gimp on your server and use php to automatically open the gimp and fill in the text in any dialog boxes? then export the output from the gimp and print it to a file/webpage? like, create a connection between PHP and the gimp?
print "|2|-||2 R0><0R\$!!";

Post Reply