How to get the correct font sizes from Photoshop into iOS

天涯浪子 提交于 2019-12-09 04:39:39

问题


I have a design in an psd file. So I copied all text properties (fontname, size (in pt), color, etc) into code and run it. I did a screenshot and compared that to the design. I am wondering, why is iOS (in my case) rendering the font sizes (in pt) smaller than Photoshop does?

Does pt depend on the screen resolution? Is there maybe a helper function that i could calculate it from a px size?

Thanks...


回答1:


I think the easiest way (not sure if the most accurate one) would be to take pixel values (not point ones) from Photoshop and use those instead. Assuming you are designing Photoshop files that are 320x480 (not retina) this should work nicely and quite accurately.

Here's a sample, left is in Photoshop at size 12px and right is in iOS Simulator at 12pt.




回答2:


You have to change document resolution to 144 pixels/Inch and keep screen width 640px (for portrait orientation). Goto Image > Image Size > Resolution




回答3:


Photoshop ratina images-12Pt = Ios-6Pt(X=2*Y) photoshop not ratina images-12pt = Ios-12pt(X=Y)



来源:https://stackoverflow.com/questions/8834037/how-to-get-the-correct-font-sizes-from-photoshop-into-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!