font styles not working when set custom font for webview
<p>Main.java:</p>

<pre><code>Main instanceMain = this;
    String Dataz = FN.getHtmlData(instanceMain,"BMitra",20,(getResources().getString(R.string.matn2)));
    btne.loadDataWithBaseURL("file:///android_asset/", Dataz, "text/html", "utf-8", null);
</code></pre>

<p>FN.java:</p>

<pre><code>public static String getHtmlData(Context context,String fontname,Integer fontsize, String data){
    String head = "&lt;head&gt;&lt;style type=\"text/css\"&gt;@font-face {font-family: 'MYFNT';src: url('"+fontname+".ttf');} body {text-align:justify;font-family: 'MYFNT';color: Black;}&lt;/style&gt;&lt;/head&gt;";
    String htmlData= "&lt;html&gt;"+head+"&lt;body dir=\"rtl\"&gt;"+data+"&lt;/body&gt;&lt;/html&gt;" ;
    return htmlData;
 }
</code></pre>

<p>strings.xml:</p>

<pre><code>&lt;string name="matn2"&gt;
    &lt;![CDATA[
    &lt;html&gt;&lt;body&gt;&lt;b&gt;سلام&lt;/b&gt; non bold text . &lt;b&gt;english bold&lt;/b&gt;&lt;/body&gt;&lt;/html&gt;
    ]]&gt;
&lt;/string&gt;
</code></pre>

<p>but <strong>bold</strong> tag not working and output is : سلام english bold . non bold text</p>

<p>by the way i found <a href="http://code.google.com/p/android/issues/detail?can=1&amp;q=SharedPreferences&amp;colspec=ID%20Type%20Version%20Security%20Status%20Owner%20Summary&amp;id=30520" rel="nofollow">some report issue</a></p>

<hr>

<p>in another way :</p>

<p>Main.java :</p>

<pre><code>Main instanceMain = this;
    String Dataz = FN.getHtmlData(instanceMain,getResources().getString(R.string.matn2)));
    btne.loadDataWithBaseURL("file:///android_asset/", Dataz, "text/html", "utf-8", null);
</code></pre>

<p>FN.java:</p>

<pre><code>public static String getHtmlData(Context paramContext, String paramString)
  {
    return "&lt;!DOCTYPE HTML&gt;&lt;html lang=\"fa-ir\" dir=\"rtl\"&gt;&lt;head&gt;" + "&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"justified_textview.css\" /&gt;" + "&lt;/head&gt;" + "    &lt;body&gt;" + paramString + "&lt;/body&gt;&lt;/html&gt;";
  }
</code></pre>

<p>justified_textview.css (in assest folder) :</p>

<pre><code>/*@font-face {
font-family:"MyFont";
src:url('file:///android_asset/BMITRA.TTF');
}

@font-face {
font-family:"MyFont";
src:url('file:///android_asset/BMITRABD.TTF');
font-weight: bold;
}*/

@font-face {
font-family: 'Conv_BMITRA';
src: url('file:///android_asset/BMITRA.ttf');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'Conv_BMITRA';
src: url('file:///android_asset/BMITRABD.ttf');
font-weight: bold;
font-style: normal;
}


body {
font-family:'Conv_BMITRA';
text-align:justify;
line-height: 20pt;  
color: Black;      
}
</code></pre>

<p>and matn2(strings.xml) :</p>

<pre><code>&lt;string name="matn"&gt;
    &lt;![CDATA[
    م ولادت توی وب با سی اس اس
    normal text
    &lt;b&gt;ولایت بولد م bold text&lt;/b&gt;
    ]]&gt;
    &lt;/string&gt;
</code></pre>

<p>and now its work on android 2.3.3 or 2.3.5 but <strong>not working</strong> on android 4.0.x</p>
