In Photoshop file font size is 20px. What sp will be for this in Android? Is it the same, that is, 20px = 20sp or something else?
Developer is asking for sp not px. How can I know or define sp in Photoshop?
In Photoshop file font size is 20px. What sp will be for this in Android? Is it the same, that is, 20px = 20sp or something else?
Developer is asking for sp not px. How can I know or define sp in Photoshop?
4
Answers
They are different and you should be using sp and not px. Please see this stackoverflow post
This tool is handy for converting px to sp or dp: http://pixplicity.com/dp-px-converter/
You would use
sp
for font sizesdip
for everything else.dip==dp
From Android Developers center:
You can use this to convert various options to convert between pixels sizes
At mdpi resolutions, 1dp = 1px.
At hdpi resolutions, 1dp = 1,5px.
At xhdpi resolutions, 1dp = 2px.
At xxhdpi resolutions, 1dp = 3px.
At xxxhdpi resolutions, 1dp = 4px.
Just use the px in your photoshop.!
Since, you cant compare px to sp as there are seven variants of DPI!
PX will be equal to DP at mdpi(160 dpi), but the SP will not…
calculating various values
http://angrytools.com/android/pixelcalc/
comparing various DPIs
http://coh.io/adpi/