Search code examples
apache-flexactionscript-3flex3flex4mxml

fonts in milimeter(mm) in flex,how to convert point to mm?


I am a flex developer, and most of the time I am dealing with fonts in points, like 12,14, 23 point etc.

Now the client requirement has came, which asks to take the fonts sizes in milimeter(mm).

I found this formula for mm calculation, but I need to find out the screen DPI,

$mm = ($pixels * $25.4) / dpi

For DPI, I used flash.system.Capabilities.screenDPI, but I guess this is not the perfect way to find the screen DPI, as I have read some blogs mentioning that this always gives 72 as a result.

I found this formula for font coneversion, (point to mm)

1 PostScript point = 0.352777778 millimeters

But this is for postscript fonts, and i m bit confused, as I'm using swf files for fonts, (in flex3).

Can someone here guide me, how to deal with this sort of situation, and also I have take my design stage size in mm(like 1000mm X 1000mm), so in this case i'll use ratio to reduce the screen size

enter image description here

enter image description here

This is going to be the screen size in 800mm X 200mm, so here every mesurement has to be in mm, so please explain how to tackle this situation.


Solution

  • Point is usually 1/72 of an inch. As 1 inch equals 25.4 millimeters, you can safely convert point to mm using following formula

    var nFontSizeInMM:Number = (nFontSizeInPoint / 72) * 25.4;
    

    You don't need to worry about DPI as its relevant only if you are dealing with font size in pixels.

    Reference Wiki