Question

I am setting a custom font to all subviews (such as UILabels) inside my view by a custom function. However, if I try to correct the font size for specific UILabels only via

[lbl_EXAM_Statistics setFont:[UIFont fontWithName:@"PTSans-Regular" size:13]];

The 13point seems to be a little "too small" from what was given me from the Screendesign. In the psd file however its 13pt to be exact.

Why does the 13pt font size differ from the 13pt font size in my app?

In the screenshot the above text is from the psd file, the bottom one from the iphone simulator.

If I want to get near the text size from the Screendesign to my app I'd have to use somewhat of 18pt - but I cant waste time playing around how to get the exact pt, thats a huge timewaste with all the font size I have to specify directly. So there must be a better way.

enter image description here

Was it helpful?

Solution

Totally depends on your psd. Best is to set your metrics in Photoshop in pixels. So you can see the size of your font in pixels.

Then if your PSD is at retina size (640 px width), you just have to devide by 2 the px size of your font and you will have the good result on your app.

In the end, don't use pt but px in your PSD and it will be allright (just have to think that 1point in iOS is 2px on retina screen and 1px on non-retina)

OTHER TIPS

Photoshop's font size and the iPhone's should match assuming the PSD file is set to 72dpi (or 144 for retina images).

You can check this in Photoshop using Image->Image Size... and then set the resolution to 72 pixels/inch (keeping the pixels untouched by unchecking "Resample Image:"). If the image is for retina resolution, use 144 pixels/inch.

This will not change the image in any way but make all pt measurements in Photoshop match the iPhone's coordinate system, retina or not.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top