skip to Main Content

I am developing an android application. My designer gave me designs with font size 48PT in photoshop. For android how many DPs should I set in font size?

2

Answers


  1. Create dimen.xml for your solution.

    Directory will be as follow

    1. res -> values-ldpi –> dimen.xml

    2. res -> values-mdpi –> dimen.xml

    3. res -> values-hdpi –> dimen.xml

    4. res -> values-xhdpi –> dimen.xml

    5. res -> values-xxhdpi –> dimen.xml

    in that file create

    <resources>
    <dimen name="text_size">size in sp</dimen>
    </resources>`
    

    Size will be different for all devices set that according to your layout and requirements.

    Now Give Your Textview size with

    android:textsize="@dimen/text_size"

    Login or Signup to reply.
  2. http://angrytools.com/android/pixelcalc/

    This site helps you to convert your values px,dp,sp,pt,etc..
    make sure you are using the right Density in the drop down.

    Your 48dp equals 107sp and 106dp

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search