question about imagettftext (and flash)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Belanger

    question about imagettftext (and flash)

    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

    #2
    Re: question about imagettftext (and flash)

    Steve Belanger wrote:
    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!

    Comment

    Working...