【问题标题】:how to show foreign font in web view如何在网页视图中显示外来字体
【发布时间】:2011-08-17 14:43:38
【问题描述】:

我的应用必须在 Web 视图中显示来自 HtmlString 的印地语文本

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, "contentType=text/html", "charset=UTF-8");

我该怎么做。

【问题讨论】:

    标签: android hindi


    【解决方案1】:
     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");
    

    【讨论】:

      猜你喜欢
      • 2019-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-01
      • 1970-01-01
      • 2014-02-07
      • 2019-05-12
      • 1970-01-01
      相关资源
      最近更新 更多