Android Question How change webview font?

omidaghakhani1368

Well-Known Member
Licensed User
Hi.
I try to change webview font with font-face but i cannot
Is there any way to change font?
It's very very important for me
 

sorex

Expert
Licensed User
here you go

B4X:
    WebView1.LoadHtml("<html><head><style>.f1{font-family:""Arial"";} .f2{font-family:""Times New Roman"";}</style></head><body><p class=f1>abcdef</p><p class=f2>abcdef</p></body></html>")
 

Attachments

NJDude

Expert
Licensed User
You only need to reference the external font, like this for example:
B4X:
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
You have to include that line in the HEAD of your HTML.
 
Top