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

4.3k Views Asked by At

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.

2

There are 2 best solutions below

2
On BEST ANSWER

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

0
On

Unfortunately, Flash will always tell you you're running at 72 DPI, while in most systems even the OS doesn't know how big a pixel actually is -- it's very rare for people to set things up "properly", especially as Windows doesn't deal very well with people changing the DPI settings.

What we do is to assume 96 DPI, as this is what Windows typically expects.