I have the Photoshop file contains iOS application’s design and I need to get info about font sizes for all labels and other controls. The size in Photoshop is shown in points by default, so how can I convert this value to the XCode one? For example:
Thanks in advance.
3
Answers
An “Adobe Point” is 1/72 of an inch, so 0.01389 inches.
The iPhone 6 screen has 376 by 667 “Apple Points” on a display whose diagonal is 4.7 inches. Now if I can remember my algebra… it’s been so long.
376^2 + 667^2 = d^2
where “d” is the count of Apple Points along the diagonal. d^2 is 579,578; d is the square root of that or 761.3. Divide that by 4.7 inches, we get 161.98 Apple Points per inch.
So an Apple Point is somewhat less than half the height of an Adobe Point.
Does a factor of 0.444 work for you? Or perhaps the inverse of 2.25. Say your Photoshop image has 14-point type. In Xcode, you’d want 31 Points.
Try creating a very simple app that has wide selection of different text sizes, all of them with Xcode points – what I called “Apple Points”. So you could have Helvetica 6, Helvetica 7, Helvetica 8, all the way up to a size that’s clearly larger than you will need for this design.
Then print your Photoshop file on paper. Note that you can’t really count on screen pixels to be any particular size. A hirez monitor with a small screen will also have smaller pixels.
Compare the paper Photoshop design hardcopy to the text on the screen. That should give you an idea of the ratio.
Based on @MichaelCrawford answer, if AdobePoint = 1/72 of inch then we could calculate transition formula to ApplePoints.
What we need to know is:
Then, as I understand, you can calculate iPhone Font size (that actually equals iPhone points), like this
iPhoneFontSize = (Res / 72 ) * PSFont / Factor
Example:
You have mockup for iPhone 5, but all media also good for iPhone6+, then mockup size is iPhone 5 size * 3 = 960×1704, resolution is 401 (for iPhone6+). TabBar title font size on this mockup is 5 pt
Therefore, on iPhone you should setup size as 401 / 72 * 5 / 3 = 9.28
If resolution of file is 72 (for Web), you just need to divide PSFontSize to factor as you usually do to calculate control or imageView size.