How to programmatically change font settings of Device: font style and font size?

孤街醉人 提交于 2019-12-02 07:19:41

You can change system font using below code

Settings.System.putFloat(getBaseContext().getContentResolver(),
            Settings.System.FONT_SCALE, (float) 1.0);

and after this give permission in menifest file

  <uses-permission android:name="android.permission.WRITE_SETTINGS"/>

and then restart your device to show effect..

Note: Its fully applicable for rooted device and in Unrooted device some font may change and some are not.

Shadow

You can use FONT_SCALE from android.provider.Settings.System.

and also see this.

Read font size from Settings

Hope this might help you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!