Jump to content

[SOLVED] Can you arc a font with PHP?


phpknight

Recommended Posts

It's certainly possible if you know the trigonometry involved. You'd have to place each character individually. positioned on the curve and at an angle tangential to the curve at that point. Character spacing would also need calculating.

 

Or, as in my sig, do it by displacing pixels to follow (in this case) a sine wave

Barand,

 

Thanks.  It seems like the latter option--getting it to follow a curve--is more like what I would be looking for since the characters themselves would be curved.  Please send any info along to help me get started--possible useful functions, etc.

 

phpknight

You need a source image containing the text placed using

 

      http://www.php.net/imagettftext

 

and you need a destination image.

 

Loop through the rows and columns of the source image to get each individual pixel

 

      http://www.php.net/imagecolorat

 

Place them in the destination image off-setting the y position according the curve you want to follow

 

        http://www.php.net/imagesetpixel

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.