开发者

how to show foreign font in web view

MY app has to show hindi text from the HtmlString in a web view

HtmlString ="<html><body style='background-color:#000000; color:ffffff; font-family:georgia,times new roman,times,seri,krutidev010; margin-top:0px; margin-bottom:0px; margin-right:0px; margin-left:0px; padding:0px;'><div style='padding:0px;'></div><div style='padding:5px;'><b>"+SharedVariables.ArrayOfNewsItems.get(SelectedRow).getTitle()+"</b><p align='justify'>"+SharedVariables.ArrayOfNewsItems.get(SelectedRow).getContent()+"</p></div><p></p></body></html>";
MyWebView.loadData(HtmlString, "contentT开发者_开发技巧ype=text/html", "charset=UTF-8");

How can I do that.


 head="<head><style>@font-face {font-family: 'APARAJ';src: url('file:///android_asset/fonts/APARAJ.TTF');}body {font-family: 'APARAJ';}</style></head>";
                HtmlString = "<html>"+head+"<body>"+content+"</body></html>";  
MyWebView.loadData(HtmlString, "contentType=text/html", "charset=UTF-8");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜