0

I need to change webview font face , I've searched and I used this but it didn't change the font , I've the font file in asset folder :

wb.loadData(
            "<html><head><style>@font-face { font-family: myface;src: url('file:///android_asset/yekan.ttf');" +
            "BODY, HTML {background: transparent;  } body,div {  font-family: myface;} </style></head><body><div style='text-align: justify; line-height: 23px;float:right' dir='rtl'>"
                    + text + "</div></body></html>",
            "text/html; charset=utf-8", "UTF-8");

is it wrong or webview couldn't change the font face ?

thanks

mohsen
  • 451
  • 2
  • 6
  • 15

1 Answers1

0

change

url('file:///android_asset/yekan.ttf')

to

url(\"file:///android_asset/yekan.ttf\")

prabhakaran
  • 668
  • 2
  • 10
  • 33