android
  • hindi
  • 2011-05-03 36 views 3 likes 
    3

    我的應用程序,以顯示在Web視圖如何顯示在Web視圖外國字體

    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"); 
    

    我如何能做到這一點從HtmlString印地文文本。

    回答

    6
    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"); 
    
    相關問題