Android 2.2 Webview Not Supporting Tamil Font
i am developing new android application...i tried load html content in webview in 2.2 emulator but not supporting tamil font here my code... WebView learn2crack = (WebView)findView
Solution 1:
Typefacetf= Typeface.createFromAsset(getAssets(), "Bamini.ttf");
String tamil_string="செய்திகள்";
//creating intance of TamilFotnUtil ClassTamilFontUtiltfUtil=newTamilFontUtil();
//Convert Tamil font encording using the utility.StringtamilStringEncoded= tfUtil.convertTamilString(tamil_string);
add below line inside the the style
@font-face {font-family: MyCustomFont; src: url("Bamini.ttf")}body {font-family: MyCustomFont, Verdana, Arial, sans-serif; font-size: medium; color: black}"
for example
<html><head><title>example</title><metahttp-equiv="Content-Type"content="text/html; charset=utf-8"><styletype="text/css">@font-face {font-family: MyCustomFont; src:
url(file:///android_asset/Bamini.ttf)}body {font-family: MyCustomFont, Verdana, Arial,
sans-serif; font-size: medium; color: black}</head><body>
<h1>tamilStringEncoded </h1></body></html>
finally load data into webview ....
Post a Comment for "Android 2.2 Webview Not Supporting Tamil Font"