如何在android中使用tamil字体

tam*_*mil 7 fonts android

这是我的泰米尔UTF-8 unicode字符串

"\ u00e0\u00ae转移\ u009c\u00e0\u00af\u0086\u00e0\u00ae转移\ u00a9\u00e0\u00ae转移\ u00bf\u00e0\u00ae转移\ u00b2\u00e0\u00ae转移\ u00bf\u00e0\u00ae转移\ u00af\u00e0\u00ae转移\ u00be\u00e0\u00ae转移\ u00aa\u00e0\u00af\u0081\u00e0\u00ae转移\ u0095\u00e0\u00af\u0088\u00e0\u00ae转移\ u00aa\u00e0\u00af\u008d\u00e0\u00ae转移\ u00aa\u00e0\u00ae转移\ u009f\u00e0\u00ae转移\ u00ae转移\ u00e0\u00af\u008d"

我想解码它并显示泰米尔语字体

在android中是这个posible,该怎么办?

请帮我

spa*_*mat 9

您可以将tamil(ttf)字体保存在assets文件夹中,并像这样使用它:

TextView text; // initialize to your textview
Typeface tf = Typeface.createFromAsset(this.getAssets(),"fonts/tamil.ttf");
text.setTypeface(tf);
Run Code Online (Sandbox Code Playgroud)


Sam*_*uel 0

如果您使用的是 webview,请将字体文件“tamilfont.ttf”放在资产文件夹中。\njava 代码将与此类似。注意CSS中应用了字体

\n\n
    data = "<html><head><style>@font-face {font-family: \'tamilfont\';src: url(\'file:///android_asset/tamilfont.ttf\');} h1 { font-family: \'tamilfont\'; } </style></head><body> <h1>\xe0\xae\xa4\xe0\xae\xae\xe0\xae\xbf\xe0\xae\xb4\xe0\xae\xa9\xe0\xaf\x8d!</h1> </body></html>"; \n    WebView wv = (WebView)findViewById(R.id.webview);\n    wv.loadDataWithBaseURL(null, data, "text/html", "UTF-8", null);\n
Run Code Online (Sandbox Code Playgroud)\n\n

这种方法在android 2.0和2.1中不起作用。

\n