Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- question about imagettftext (and flash)
- Steve Belanger
April 9, 2007, 9:35 pm
rate this thread
i am creating a 'design online' flash tool that allows me to design
something with flash, throwing graphics and text elements. i then export
that using XML data and have PHP create a jpeg version of what the flash
my problem is that i use imagettftext to render my text elements (it can be
bolded, italic, different font sizes and different fonts).
i have my font ttl files uplaoded and it works in displaying the text,
however when i compare my flash version against the resulting image, it's
not exactly like the flash version.
flash works in point size, GD2 works also in point size, should it not be
normal that by using the point size right away it should find the proper
spot and ouput the text the way it was set in flash?
i am scratching my head on this since a while. any help would be deeply
Re: question about imagettftext (and flash)
Points don't make very much sense in digital media. One point is defined
as exactly 1/72 of an inch (or just a little bit over 1/3 of a millimetre).
As different screens have different resolutions, there isn't a fixed
ratio for converting from points to pixels. Probably your problem is
caused by the Flash software and GD2 using different methods to convert
from points into pixels.
I'd recommend switching to using pixels in both Flash and GD2, or figure
out what the difference is as a percentage, and have your PHP script
adjust the numbers accordingly.
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
- » Launching a program with exec & pstools/psexec.exe
- — Previous thread in » PHP Scripting Forum