Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android App: how to read Font Size under Settings?

I am developing an Android Application and I would like to read the Font Size under Settings->Display->Font Size.

So if a user has set his Font Size to Small/Big/Huge, I would like to apply this automaticly to all my text

I am using a Samsung Galaxy Nexus, Android 4.1.2

Thank you in advance for your help

like image 712
Luke94 Avatar asked Oct 20 '12 11:10

Luke94


2 Answers

Try reading FONT_SCALE from android.provider.Settings.System.

like image 125
CommonsWare Avatar answered Sep 28 '22 01:09

CommonsWare


You can also define your text size using "sp" units which is the same like "dp" but scales according to the users system setting for text size. No need to read the font size from the system yourself.

like image 23
Hokascha Avatar answered Sep 28 '22 02:09

Hokascha