1

I'm trying to convert some text dimension from a PSD representation to Android DP format. All over the internet there are resources that explain what are DP, SP an how to convert them but I still don't understand what exactly to do. I need an example for my case.

Let's say I have PSD with 3 lines of text with different dimensions:

18px font - ? dp
21px font - ? dp
28px font - ? dp

Which dimensions to choose for a handheld device if I want to maintain roughly the same apparent dimension? How to make my GUI to look similar to my PSD template?

shadox
  • 3,238
  • 4
  • 24
  • 38
  • You can find some converters out there. Like [this](http://labs.rampinteractive.co.uk/android_dp_px_calculator/) one. !OPS! you should use `sp` for font sizes – Detilium Aug 25 '15 at 09:29
  • dp/sp are pixel density dependant sizes. that means than on 10 different devices, all with 18dp text, each dp will have a different pixel value. don't work with absolute values (px). – CptEric Aug 25 '15 at 09:32
  • Look a this answer: http://stackoverflow.com/questions/2025282/difference-between-px-dp-dip-and-sp-in-android – M Penades Aug 25 '15 at 09:32
  • http://stackoverflow.com/questions/2025282/difference-between-px-dp-dip-and-sp-in-android – Anis LOUNIS aka AnixPasBesoin Aug 25 '15 at 09:37
  • I know how to use Google, find converters, find other stackoverflow answers. What I don't fully understand is how to convert it well. Converters usually say that 14dp is 14px on mdp some more on hdpi, a lot more on xhdpi and so on. It's not what I'm looking for. – shadox Aug 25 '15 at 09:42

0 Answers0