Dear ilan,
Your tip worked for list view but in webview, I could not display the same regional font. I m new for html, css, etc. stuff. Here I m giving the code. Please correct if there is anything wrong.
Following code that I m using to populate records in webview. It works fine if I used normal english font.
Now I want to use regional language font named Shivaji01.ttf.
But it does not reflect the proper font effect.
Here is the code.....
Sub ExecuteHtml(SQL As SQL, Query As String, StringArgs() As String, Limit As Int, Clickable As Boolean) As String
'
Private cur As Cursor
Dim ColName As String
If StringArgs <> Null Then
cur = SQL.ExecQuery2(Query, StringArgs)
Else
cur = SQL.ExecQuery(Query)
End If
Log("ExecuteHtml: " & Query)
If Limit > 0 Then Limit = Min(Limit, cur.RowCount) Else Limit = cur.RowCount
Private sb As StringBuilder
sb.Initialize
sb.Append("<html><body>").Append(CRLF)
sb.Append("<style>").Append(CRLF)
sb.Append("p.ex1 {").Append(CRLF)
sb.Append("font: bold 15px shivaji01, sans-serif;").Append(CRLF)
sb.Append("}").Append(CRLF)
sb.Append("</style>").Append(CRLF)
sb.Append("<table><tr>").Append(CRLF)
sb.Append("<p class='ex1'>Aibar</p>").Append(CRLF)
For i = 0 To cur.ColumnCount - 1
'sb.Append("<th>").Append(cur.GetColumnName(i)).Append("</th>")
If i=0 Then
ColName="C.No."
else if i=1 Then
ColName="M. No."
else if i=2 Then
ColName="Member Name"
else if i=3 Then
ColName="Milk"
else if i=4 Then
ColName="Ltr"
else if i=5 Then
ColName="Fat"
else if i=6 Then
ColName="Rate Rs."
else if i=7 Then
ColName="Amt. Rs."
End If
sb.Append("<th>").Append(ColName).Append("</th>")
Next
'sb.Append("<p style='font-family:shivaji01; 'size:160%;'>jaya kipsa ithU laaok ]jaagar</p>")
sb.Append("</tr>").Append(CRLF)
For row = 0 To Limit - 1
cur.Position = row
If row Mod 2 = 0 Then
sb.Append("<tr>")
Else
sb.Append("<tr class='odd'>")
End If
For i = 0 To cur.ColumnCount - 1
sb.Append("<td>")
If Clickable Then
sb.Append("<a href='http://").Append(i).Append(".")
sb.Append(row)
sb.Append(".com'>").Append(cur.GetString2(i)).Append("</a>")
Else
sb.Append(cur.GetString2(i))
End If
sb.Append("</td>")
Next
sb.Append("</tr>").Append(CRLF)
Next
cur.Close
sb.Append("</table></body></html>")
Return sb.ToString
End Sub
Important:
This code runs well on desktop browser as I used the font Shivaji01.ttf from windows font folder.
But I can not understand from where and how to use Shivaji01.ttf font file in android.