Flash, PHP: Font sizes don't match

Click For Summary

Discussion Overview

The discussion revolves around the differences in font sizes between Flash and GD images in PHP, focusing on potential discrepancies in measurement units and how to align them for consistent text display.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Exploratory

Main Points Raised

  • Some participants note that Flash and GD images in PHP appear to have different text sizes, suggesting a possible difference in measurement units.
  • One participant questions whether Flash uses pixels instead of points, indicating that some tutorials suggest it uses points.
  • Another participant mentions that Flash uses pixel fonts, which are essentially images, but expresses confusion over why the sizes differ.
  • It is stated that PHP uses points when utilizing GD, but there is uncertainty about how to change units in either PHP or Flash.
  • One suggestion is made to use CSS to experiment with font sizes, including using style attributes to set font sizes in points or pixels.
  • A participant points out that the CSS method may only work with monospaced fonts and expresses a need for a way to change the size type.
  • Another participant suggests using imagefontwidth() and imagefontheight() in GD to determine font size, and mentions drawing with imagettftext() as an alternative.
  • One participant highlights the challenge of determining the required space for text in Flash when PHP uses points and Flash uses pixels, indicating a mismatch in dimensions.

Areas of Agreement / Disagreement

Participants express differing views on the measurement units used by Flash and PHP, and there is no consensus on how to resolve the discrepancies in font sizes.

Contextual Notes

There are unresolved assumptions regarding the measurement units used by Flash and PHP, and the discussion includes various methods to address font size discrepancies without reaching a definitive solution.

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?
 
Technology 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...
 
Flash has pixel fonts, but they are essentially just images. I have no idea why they would be different sizes.
 
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.
 

Similar threads

Replies
4
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
7K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 9 ·
Replies
9
Views
7K