I have a TextView placed directly above a WebView. I am attempting to make the font style in the WebView match the font style in the TextView.
I was able to make the fonts the same size but there are still minor differences between the fonts' rendering (see screenshot comparison). Now I think this is very minor but our client was able to see the difference and was questioning it.
Is there any way to eliminate these rendering differences between TextView and WebView? If not can someone explain the reason for the differences? Are these differences caused simply because the WebView uses WebKit which has its own font rendering engine separate from the rest of the Android platform?
I'm not sure about TextView, but I know WebView is capable of positioning text on non-pixel-aligned boundaries, and I think this is what you're seeing. The WebView and TextView output look different because their positions are off by smaller-than-a-pixel amounts.
I assume your client is either using a low-density device or has really sharp eyes = )
If you tweak the position of the text a little it should eventually look the same. Where the WebView is concerned, it may help to ensure that all the zooming and reformatting features are turned off.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With