fluttercommunity / flutter_webview_plugin

Community WebView Plugin - Allows Flutter to communicate with a native WebView.
https://pub.dev/packages/flutter_webview_plugin
Other
1.48k stars 929 forks source link

Enabling an option to ignore system font setting for the webview in Android #895

Open piumimaheshika opened 3 years ago

piumimaheshika commented 3 years ago

Use case

I am currently facing a limitation with flutter_webview_plugin in Android. When user changes font size on their device (Settings -> Accessibility -> Font Size), webview uses this adjusted font size. That results overlapping texts and layouts of the content being incorrect. So I need the webview to ignore the system font settings and load webview with specified font sizes in HTML/CSS.

Proposal

The font size setting in Settings on user device affects the textZoom property of the webview. In Android webview there is property we can set to force webview to display text in original sizes (specified in html/css of the web).

webView.getSettings().setTextZoom(100);

I am suggesting to add that property into the webview plugin. If there is any event that system font size must be used for webview as well, Please define a new setting in the WebviewScaffold to enable or disable this property.

eg: withTextZoom : true

akinzeman commented 1 year ago

same proposal