Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use accessibility options to scale fonts within a WebView?

I'd like my app to take advantage of accessbility options for the visually impaired. All of my lists, menu items and text views scale appropriately, but WebView does not.

I'm using WebSettings.setTextZoom to set the scale, but I need to access the global font size settings (on my phone it is Tiny, Small, Normal, Large, Huge).

How do I access Font Size from the device settings to scale WebView fonts accordingly?

like image 382
Slackarse Avatar asked May 23 '13 00:05

Slackarse


1 Answers

Try getResources().getConfiguration().fontScale (http://developer.android.com/reference/android/content/res/Configuration.html#fontScale)

like image 170
CommonsWare Avatar answered Sep 23 '22 17:09

CommonsWare