Skip to content

How to set font-size to “larger” or 140% of system default

I want to provide to my users a possibility to display certain <Text/> elements with a larger font-size, than a system default. The documentation provides a number only for that style.

I want to display texts either with web-css “large” or “larger” values or maybe with 140% of the original font size.

I found couple of questions on SO and 3rd party libs, like responsive-fontsize, but they all seem not relavant to me.

What’s the easiest way to do what I want?

Answer

After some experimenting I figured out that the default font size – if not set and for Android at least – corresponds to 14.

From that base one can increment the size to 18 to get roughly 140% of the original size.

Good thing is the font is scaled depending on system-wide font size.