Connecting Tech Pros Worldwide Forums | Help | Site Map

question about imagettftext (and flash)

Steve Belanger
Guest
 
Posts: n/a
#1: Apr 9 '07
Hi,

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
contained.

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
appreciated.

Steve



Toby A Inkster
Guest
 
Posts: n/a
#2: Apr 10 '07

re: question about imagettftext (and flash)


Steve Belanger wrote:
Quote:
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?
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!
Closed Thread