How To Set Custom Font In Webview In Android

Velmurugan Murugesan
Sep 19 · 2 min read
Image for post
Image for post

This is an Example of Set typeface for webview in android using HTML. In this view set the typeface in HTML String and load with Webview. Put the font in the Assets folder.

Image for post
Image for post

Every android device having default font. By using typeface is required to give your application look and feel good.CLICK HERE to know more about the typeface.

Step: 1

create a new Android application project and copy these code into the XML file.

activity_main.xml

Step: 2

create a MainActivity.java in the src folder and copy these code.

Screenshots

Image for post
Image for post

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store