-1

I am calling http://www.createtrips.com/legal/about-us in app browser

On some Android devices, it shows bolder, but some do not show text bolder.

I am using:

    //show info
 mWebViewSettings.setWebViewClient(new WebViewClient()
            mWebViewSettings.getSettings().setJavaScriptEnabled(true);
            mWebViewSettings.getSettings().setLoadsImagesAutomatically(true);
            mWebViewSettings.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    mWebViewSettings.loadUrl(linkPage);
Ed Holloway-George
  • 5,092
  • 2
  • 37
  • 66
QuestionAndroid
  • 881
  • 1
  • 8
  • 25

1 Answers1

0

follow Google webfonts not working using Web View in Android 4.0 and 4.2.2 .

The answers above are valid and give insight into the subject, thanks to moallemi and Vaiden for those. We cannot use web fonts on Android 4.0 that is a shame.

The solution to our problem with webfonts on Android 4.2 was related to the fact that in the CSS that Google uses to include the actual font files they specify the format. This means that in Google's CSS they have code like:

src: url("http://some.google.server/some/path/FontName.ttf") format('ttf'); It turns out that fonts don't render in the WebView on Android 4.2 if the format() clause is present in the CSS (or node of the HTML). The solution is therefore simple; the CSS should have a line like this:

src: url("http://some.google.server/some/path/FontName.ttf"); This makes the font work. This, however, does not make for a "simple" solution. Since Google provides the CSS containing this error you need to create, include/use and supply your own version of the CSS file and if you do not want to be subject of Google updating the location of its font files you need to host the font files yourself.

Community
  • 1
  • 1
QuestionAndroid
  • 881
  • 1
  • 8
  • 25