I don't know how it convert to the unit of pixels. For example, if I assign 10sp to my font size on 160 dpi device, how much px of my font size is it ? Or, if I assign 10sp to my font on 240 dpi device, how much px of my font size is it ?
They're just the same as dip
, but they also take into account the font scaling factor that the user sets on his device. So if he/she left font size set to "normal", it's just like dip
. If there is a font scaling factor, you can get the whole scaled density from DisplayMetrics.scaledDensity.
(I have to admit I just tried to look for some "font size" option in my Android phone global settings and I couldn't find it, so I wonder if it is of any use right now. Am I missing something?)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With