flex中的字体以毫米(mm)为单位,如何将point转换为mm?
我是一名 Flex 开发人员,大多数时候我都在处理以点为单位的字体,例如 12,14,23 点等。
现在客户需求来了,要求采用毫米(mm)为单位的字体大小。
我找到了mm计算的公式,但我需要找出屏幕DPI,
$mm = ($pixels * $25.4) / dpi
对于DPI,我使用了flash.system.Capability.screenDPI,但我想这不是完美的找到屏幕 DPI 的方法,因为我读过一些博客,提到这总是给出 72 结果。
我找到了这个字体转换公式,(指向毫米)
1 PostScript 点 = 0.352777778 毫米
但这是针对 Postscript 字体的,我有点困惑,因为我使用 swf 文件作为字体(在 flex3 中)。
这里有人可以指导我,如何处理这种情况,而且我的设计舞台尺寸以毫米为单位(例如 1000mm X 1000mm),所以在这种情况下我将使用比率来减小屏幕尺寸
这将是800mm X 200mm的屏幕尺寸,所以这里每个测量都必须以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
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
点通常为 1/72 英寸。由于 1 英寸等于 25.4 毫米,您可以使用以下公式安全地将点转换为毫米。
您无需担心 DPI,因为仅当您处理以像素为单位的字体大小时,它才相关。
参考
维基
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
You don't need to worry about DPI as its relevant only if you are dealing with font size in pixels.
Reference
Wiki
不幸的是,Flash 总是会告诉您正在以 72 DPI 运行,而在大多数系统中,甚至操作系统都不知道像素实际上有多大——人们很少“正确”设置,尤其是在 Windows 中不能很好地处理人们更改 DPI 设置的情况。
我们所做的是假设 96 DPI,因为这是 Windows 通常所期望的。
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.