Flash, PHP: Font sizes don't match

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
8 replies · 4K views
mtanti
Messages
172
Reaction score
0
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?
 
Physics news on Phys.org
mtanti said:
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?

Maybe they use different measurements? Flash goes by pixel, PHP by point?
 
Are you sure that Flash uses pixels rather than points? Well that would explain it... Although on some tutorials I found it uses points...
 
php uses points (using gd2)... but I have no idea how to change the units in either php or flash...
 
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"
 
Last edited by a moderator:
but that only works with monospaced fonts. I need a way to change size type.
 
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().
 
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.