如何从Photoshop中获取正确的字体大小到iOS [英] How to get the correct font sizes from Photoshop into iOS

查看:187
本文介绍了如何从Photoshop中获取正确的字体大小到iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个psd文件的设计。所以我把所有的文本属性(fontname,size(in pt),color等)复制到代码中并运行它。我做了一个截图,并将其与设计进行了比较。
我想知道,为什么iOS(在我的情况下)渲染的字体大小(磅)比Photoshop小吗?



pt取决于屏幕解析度?是否有一个帮助函数,我可以从一个PX尺寸计算?



谢谢...

解决方案

我认为最简单的方法(不确定是否是最准确的)将从Photoshop中取像素值(而不是点),并使用它们。假设你正在设计的是320x480(不是视网膜)的Photoshop文件,这应该很好,相当准确。

这里是一个示例,左边是在Photoshop中的大小12px,在iOS模拟器在12pt。


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...

解决方案

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.

这篇关于如何从Photoshop中获取正确的字体大小到iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆