iOS: Xcode font size Vs Adobe XD font size

Viewed 5700

Units of font size: I'm searching answers for the following, please help me to find it.

1. Which unit does Xcode use for font sizes? I mean, is it Pixels or Points or some other term?

One of the members of my designed team pointed at a label in iOS app that I'm working on and asked what is the font size of that label. What should I say? 12Px or 12Pt or just 12 (Saying a number without unit may lead to confusion)

2. Can we put the same Adobe XD font size for a UILabel in Xcode?

I'm developing iOS application UI from the designs in Abode XD. Which unit does Abode XD use for font sizes? I have tried to put the same font size(80) in Xcode, but it has slight differences, attached a screenshot. Do we need a conversion here?

enter image description here

2 Answers

According to this forum thread Adobe XD uses pixels:

XD currently uses a virtual pixel for most of its measurements (including font size), which should be the same unit of measure as a CSS pixel, or most measurements in iOS. It's roughly equal to 1 physical pixel on a 72 dpi monitor (and, incidentally, a point).

I'm not sure if this calculation is completely correct or not but after using it, the text size looks almost the same to me.

I was reading this discussion forum and found one image related to various measurements of a font. The unit of those fonts was in pt.

Adobe XD - font size

Then, I came across this table provided by W3schools enter image description here

As you can see, px is 1/96th of 1 inch and pt is 1/72th of 1 inch. With this, we can form an equation like this -

enter image description here

Since we are provided pt value by Adobe XD, we can easily calculate the px value.

Maybe this can solve the issue of different font sizes. The one provided by Adobe XD is completely different from the one used in CSS.

Related