Titanium Mobiles 的“字体大小”是什么测量单位?
尝试找到 Titanium 使用什么测量单位来定义移动应用程序中的字体大小。想要将其与 Photoshop 相匹配以用于模型目的。
Trying to find what unit of measurement Titanium uses for defining the font size in mobile applications. Want to match it up to Photoshop for mockup purposes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 iOS 上,字体大小以印刷点(1/72 英寸)为单位,因此字体大小 12 在两种设备上的视觉大小应该相同。 (当然,它在 Retina 模拟器中会更大,因为它的像素是原来的两倍。)
请注意,其他 iOS 尺寸以 Apple“点”为单位,与印刷点不对应。 Apple“点”在 Retina 之前的设备上为 1 像素,在 Retina 设备上为 2 像素。
在 Android 上,您可以指定单位。默认值为像素(例如,12 和“12px”均指定 12 像素)。您还可以以 Android 与密度无关的像素、点、毫米或英寸来指定尺寸。所以:
在中等密度的设备上与 G1 一样,12px == 12dp。在高密度设备(大多数具有 800x480、854x480 或 960x540 屏幕的较新 Android 手机)上,12dp 渲染的大小是 12px 的两倍,就像 Apple“点”系统一样。
为什么 Android 上的默认单位不是 DIP?这我无法回答。我猜安卓就像像素一样。
On iOS, font sizes are in typographical points (1/72 of an inch), so font size 12 should be the same visual size on both devices. (Of course, it will be larger in the Retina simulator, because it's twice as many pixels.)
Note that other iOS sizes are in Apple "points," which don't correspond to typographic points. An Apple "point" is 1px on a pre-Retina device, and 2px on a Retina device.
On Android, you can specify units. The default is pixels (for example, 12 and '12px' both specify 12 pixels). You can also specify sizes in Android's density-independent pixels, points, millimeters or inches. So:
On a medium-density device like the G1, 12px == 12dp. On a high-density device (most of the newer Android phones with 800x480, 854x480, or 960x540 screens), 12dp renders twice as big as 12px--just like the Apple "point" system.
Why aren't DIP the default unit on Android? That I can't answer. I guess Androids just like pixels.
它以像素为单位,但不要忘记你的 Photoshop 模型需要是视网膜显示屏尺寸的两倍。
因此,您的模型的字体大小将是 24px,而在 Titanium 中,您将指定 12px。
Its in pixels, but don't forget your photoshop mockups need to be double the size for the retina display.
So your mockup would be font-size 24px and in Titanium you would specify 12px.
根据this,它是将像素转换为点。根据实际的 Apple UIKit 它是点也一样,但我不确定 Appcelerator 是否改变了它。根据操作系统(名称/类型),它也可能有所不同?
actualFontSize
输入时,指向
浮点
值的指针。返回时,该值包含用于呈现字符串的实际字体大小。According to this it's pixels converted to points. According the actual Apple UIKit it's points as well but I'm not sure if Appcelerator changed it or not. It could also be different based on the OS(name/type)?
actualFontSize
On input, a pointer to a
floating-point
value. On return, this value contains the actual font size that was used to render the string.