Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Flash, PHP: Font sizes don't match

  1. Sep 9, 2008 #1
    Has anyone noticed that the font size for Flash and the font size for GD images in PHP don't give the same text size?
  2. jcsd
  3. Sep 9, 2008 #2
    Maybe they use different measurements? Flash goes by pixel, PHP by point?
  4. Sep 11, 2008 #3
    Are you sure that Flash uses pixels rather than points? Well that would explain it... Although on some tutorials I found it uses points...
  5. Sep 12, 2008 #4


    User Avatar
    Science Advisor

    Flash has pixel fonts, but they are essentially just images. I have no idea why they would be different sizes.
  6. Sep 12, 2008 #5
    php uses points (using gd2)... but I have no idea how to change the units in either php or flash...
  7. Sep 16, 2008 #6
    You could possibly use a cascading style sheet or set a style attribute for an element and experiment with the different font sizes.

    For example, you could use style="font-size:9pt;" inside an element tag or set the style for a paragraph with the class "example" by saying <style>p.example{font-size:9pt;}</style>

    You can use px instead of pt to get the font size in pixels. Here is some info which might be useful.

    http://www.w3schools.com/css/pr_font_font-size.asp" [Broken]
    Last edited by a moderator: May 3, 2017
  8. Sep 17, 2008 #7
    but that only works with monospaced fonts. I need a way to change size type.
  9. Sep 17, 2008 #8
    You can use imagefontwidth() and imagefontheight() to get the size of a given font in GD. This may help, but if not, you can try drawing with imagettftext() instead of imagestring().
  10. Sep 17, 2008 #9
    that's what I do but I need to see how much space will be required for text to show in flash using php. since flash uses pixels and php uses points, the dimensions will not match.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook