Fonts goes bigger in high resolution device

254 Views Asked by At

In my App, I set font sizes and run my Nexus 4. Everything is ok. But in some phones, Font size is bigger than i set. For example, in Samsung A5 2016, Font sized is 3 times bigger than Nexus 4.

Nexus 4 screen: 768 x 1280 pixels, 5:3 ratio (~318 ppi density)

A5 screen: 1080 x 1920 pixels, 16:9 ratio (~424 ppi density)

As I know, When a phone has better resolution, Everything goes smaller not bigger!

I have just one Layout folder for all resolutions and have two values folders for setting sizes for different resolutions:

values-xhdp  : for Nexus 4

and

values-xxhdp  : for Samsung A5

When i decrease font sizes in values-xxhdp folder, Samsung A5 shows fonts in proper size. I set font sizes in sp unit.

What I confused is that already I was thinking that in values-xxhdp folder I have to increase values because is this for high resolution phone, Not decreasing... What happening? What i should do?

2

There are 2 best solutions below

1
AYUSH ARYA On

Give fontSize in sp like 20sp, 30sp, then it will automatically adjust font as per the device.

4
Hasan Saykın On

Scaled pixels change according to the user set font size preferences. Read about screen and resolution support.