泰米尔语字体在Android的泰米尔、字体、Android

2023-09-12 07:45:49 作者:贩卖孤独

我在开发Android版本2.3.3泰米尔语新闻应用程序。泰米尔语字体适当开发的android 4.0+ only.I要在所有的Andr​​oid版本mobile.I的尝试与一些泰米尔语字体像bamini显示,mylai其在高版本Android版本的工作而已。

I developed Tamil news application in android version 2.3.3. Tamil font properly developed in android version 4.0+ only.I want to display in all version of android mobile.I tried with some tamil fonts like bamini,mylai its worked in higher version android version only.

能否请你帮我,我试过一次星期都还在,现在接近我不会得到它。

Could you please help me i tried near one week still now i won't get it.

推荐答案

首先,你必须明白,没有泰米尔语支持Android操作系统(除了少数三星和放大器; SE手机),直到ICS(4.0)。即使如此,它有缺陷,并全力支持带有果冻豆(4.2)。

First of all you have to understand that there is no Tamil Language support in Android OS (except few Samsung & SE mobiles) till ICS(4.0). Even then it had bugs and full support is provided with Jelly Bean (4.2).

如果您使用的Uni code泰米尔语字体在你的应用程序,你将只能看到盒子。原因是没有泰米尔语字体在系统中。

You will only see boxes if you use Unicode Tamil font in your app. Reason is there are no Tamil fonts in the system.

有一个工作围绕这个解决方案。所有你需要做的是,下载Bamini字体,并把它放在你的资产的文件夹。而创建字体的字体Bamini并将其设置为TextView的。

There is a work around for this solution. All you have to do is, download the Bamini font and place it in your assets folder. And create TypeFace with the font Bamini and set it to the TextView.

Typeface font1 = Typeface.createFromAsset(getAssets(), "fonts/Bamini.ttf");
customText1.setTypeface(font1);

现在使用转换器转换成统一code字体到Bamini 编码。而不是统一code文本提供转换Bamini EN codeD脚本到的setText 方法。

Now use a converter to convert Unicode font into Bamini encoding. instead of the Unicode text provide the converted Bamini encoded script into the setText method.

如果你恨所有这些手工编码转换,然后检查了这库

If you hate all these manual encoding conversion then check out this library

正如我所说的上面行,如果你喜欢动态地更改编码,同时运行的应用程序,然后考虑使用库我写为Android。该库将帮助你统一code字符串转换为Bamini,TSCII,TAB,TAM和Anjal。

As I said in above line, if you like to change the encoding dynamically while running the application then consider using the library I wrote for Android. This library will help you to convert Unicode String to Bamini, TSCII, TAB, TAM and Anjal.

设置非常简单。所有你需要做的就是简单地导入库到你的Andr​​oid项目,并调用库如下图所示。

Set up is very simple. All you have to do is simply import the library into your Android project and call the library as below.

// Initialise the Typeface (assumes TSCII, Bamini, Anjal, TAB or TAM font located inside assets/fonts folder)
Typeface tf = Typeface.createFromAsset(getAssets(),"fonts/mylai.ttf");
// Initialises the TextView
TextView tv = (TextView)findViewById(R.id.textView1);
//Setting the Typeface
tv.setTypeface(tf);
//Magic happens here ;) encoding conversion
String TSCIIString = TamilUtil.convertToTamil(TamilUtil.TSCII, "வணக்கம் அன்ரொயிட்");
//Setting the new string to TextView
tv.setText(TSCIIString);

有一个示例应用可随着库。检查出库如何被用来在UNI code字符串转换为Bamini,TAB,TAM,TSCII和Anjal应用程序。

There is a sample app available along with the library. Check out the app on how the library is utilised to convert the Unicode String to Bamini, TAB, TAM, TSCII and Anjal.

当你使用这个库你会得到这样的事情。

You would get something like this when you use the library.

您需要使用的字体类在Android中使用的。您可以使用Bamini或TSCII编码(Mylai是TSCII字体)。

You need to make use of the TypeFace class available in Android. You can use either Bamini or TSCII encoding (Mylai is a TSCII font).

免责声明:我写这个库。

Disclaimer : I wrote this library.

如果您使用的是HTML和CSS一个web视图里面包梁再看看这个应用程序的源代码开发。你不得不利用CSS3的 fontface 功能。

If you are developing using html and CSS wraped inside a WebView then take a look at this application's source. You gonna have to make use of fontface feature of CSS3.

首先,你需要声明为这种风格

First you need to have style declared as this

@font-face {
 font-family: MyCustomFont;
 src: url("Bamini.ttf") /* TTF file for CSS3 browsers */
}

然后,你必须使用 MyCustomFont 在您的标记。例如,如果你想将其设置为整个身体(其是更容易在这种情况下)

Then you gotta use the MyCustomFont in your tags. For example if you wanna set it to the whole body (which is much easier in this case)

body {
 font-family: MyCustomFont, Verdana, Arial, sans-serif;
 font-size: medium;
 color: black
}

希望这会给你的头了你应得的。希望能看到播放存储更多泰米尔语的应用程序。

Hope this would give you the heads up you deserve. Hope to see more Tamil apps in Play Store.