Android Question Responsive Font Size?

Maxcfgos

Member
Licensed User
Hi everyone,

Is there a reliable way to calculate font sizes so they are truly responsive across different screen sizes and densities?

I'm looking for a method or formula that ensures the text scales proportionally, rather than just relying on standard scaling. Any suggestions or best practices would be appreciated.

Thanks!
 

William Lancee

Well-Known Member
Licensed User
Longtime User
Just a note to remind you that perceived font size is not only dependent on physical and pixel screen size,
but also on the distance of the viewer to the screen - think TV, desktop, tablet, phone, watch.

One technique I have experimented with is to use a standard phrase "The quick brown fox jumped over the lazy dog"
Then make sure that phrase can be read from the "usual" distance to the screen of the target device.

Measure the phrase using B4XCanvas.MeasureText and determine the scaling factor for font size.
You'll find that there are some upper and lower limits on readability - so the scaling will need to accommodate that.
 
Upvote 0
Top