iZettle / android-html2bitmap

Generates a bitmap from html by rendering the content inside an off screen webview
MIT License
57 stars 20 forks source link

text zoom parameter #21

Closed Kikju closed 6 years ago

Kikju commented 6 years ago

Hi, I encountered to the problem with font size across multiple devices. After some investigation, I found out, problem was with Android font size setting (Settings -> Display -> Font size). WebView follows this changes, which normally is fine, but in my case, I'm using scale meta tag inside html, which does the work. So when I call setTextZoom(100) on webview's settings, everything works fine for me. What do you think about adding this param to the builder?

erikeelde commented 6 years ago

Hi! Excited to see your contribution. I had an idea of how to facilitate "unforseen" configuration needs in the library aswell. I'll put a PR up for that in case you run into any additional configuration needs going forward. I do feel that the builder should provide the facilities needed for most circumstances and hence I like your addition for this specific case better than my own.

erikeelde commented 6 years ago

I will try to release a new version of the library by the end of today.

erikeelde commented 6 years ago

https://github.com/iZettle/android-html2bitmap/pull/22 introduces a callback to do additional configuration on the webview before the process starts.