如何制作Android设备显示复杂的指示字符? -- languages 领域 和 localization 领域 和 fonts 领域 android 相关 的问题

How to make an Android device to display complex rendering of Indic characters?


简体版||繁體版
42
vote

问题

中文

请原谅这个问题的长度。我需要解释所有这一切来帮助他人,并避免有用的贡献者在不要求澄清的情况下提供答案。

我的要求一行:"启用Android手机正确显示泰米尔字符" 。

阐述: 泰米尔,就像任何其他印度语言都有复杂的角色渲染系统。与英语或其他拉丁文脚本不同,它具有由多个字符组成的字形(在屏幕中看到的)。 Android无法呈现此类复杂脚本(具有异常)。我的目标是知道如何为Android手机或平板电脑提供这样的能力。

我迄今为止收集的小背景: 要在屏幕中显示字形,Android首先需要一个合适的字体文件。 Android设备有一个文件夹 / system / fonts ,其中很少。该文件夹中最有趣的文件是DROIDSANSPALLBACK.TTF。顾名思义,当Android的系统未能在系统字体中找到一个字符时(可以是droidsans.ttf或droidsans-bold.ttf等)它返回以在Droidsanshallback.ttf中搜索它。

通过从PC替换合适的字体文件(Latha.ttf或lohit-tamil.ttf - 这些是Tamil的字体),并且Droidsanshalback.ttf将启用在设备中显示Tamil字符。 替换并不是那么容易,它涉及为设备生根并将系统安装为可写。

尽管替换了Droidsanshallback.ttf,即使替换了Droidsanshallback.ttf,也不会正确呈现显示的Tamil字符。泰米尔字符"தி" 是两个字符的混合,而不是显示为"தி" ,它将显示为"தி" 而没有空间。虽然这足以阅读短信,但它不能用于阅读书籍等。

从android 4.x API概述中所说的,通过浏览器支持Android 4.0,泰米尔和其他几种语言如下所示。

  Support for Indic fonts (Devanagari, Bengali, and Tamil, including the complex character support needed for combining glyphs) in WebView and the built-in Browser   

要注意的单词是"在WebView和内置浏览器中" ,这意味着如果渲染为HTML内容,则将呈现Tamil字符,否则不会呈现。 opera和其他几个浏览器甚至通过代替图像而不是字符来完成Android 4.0。

我注意到,在少数目标印度市场(例如:Lg Optimus One,大多数三星手机和平板电脑)中能够在浏览器中正确显示泰米尔岛,甚至在浏览器中的位置,如联系人,文本消息,文件名称等到我的惊喜,即使在Android 2.3之外也这样做。我还注意到同样的型号,目标是不安全的国家运行相同版本的Android不支持泰米尔字符显示。

这让我进一步调查并得出了一个结论,即Android(作为其他基于Linux的OS)取决于字体渲染引擎以显示此类复杂字符。我遇到的两个发动机是滑雪和哈布里夫。我注意到LG使用Skia和Samsung在他们的设备中使用Harfbuzz库来带来这种能力。

我遇到了许多网站,建议替换这些库和字体。它没有工作并导致冻结。幸运的是,我用ClockworkMod备份,因此我恢复了手机。

虽然我用泰米尔解释了这个,这适用于大多数印度语言。

这里来了我的问题(如果你仍在阅读;))) 现在,肯定很明显,应该存在TTF文件以提供字符,并且需要一个合适的库(libskia.so或libharfbuzz.so)来正确呈现它们。有谁知道这些制造商如何提供能力?我甚至准备从AOSP(Android开源项目)建立自己的ROM。

英文原文

Please excuse the length of this question. I need to explain all this to help others and to avoid helpful contributors to provide answer without asking clarifications.

My requirement in one line: "to enable an Android phone to display Tamil characters properly".

Elaboration: Tamil, like any other Indian language has complex character rendering system. Unlike English or other Latin based script, it has glyph (what you see in screen) composed of more than one character. Android does not have ability to render such complex scripts (with exceptions). My aim is to know how I can provide such an ability to an Android phone or tablet.

Little background that I gathered so far: To display a glyph in screen, Android first needs a suitable font file. Android device has a folder /system/fonts which has few of them. The most interesting file in that folder is the DroidSansFallback.ttf. As the name suggests, when Android's system fails to find a character in system fonts (that could be DroidSans.ttf or DroidSans-Bold.ttf etc) it falls back to search it in DroidSansFallback.ttf.

By replacing a suitable font file from PC (Latha.ttf or Lohit-Tamil.ttf - these are fonts for Tamil) and DroidSansFallback.ttf will enable to display Tamil characters in the device. It is not so easy to replace and it involves rooting the device and mounting the system as writable.

In spite of those troubles, even if the DroidSansFallback.ttf is replaced, the Tamil characters that are displayed are not rendered properly. The Tamil character "xe0xaexa4xe0xaexbf" is a conjunct of two characters and instead of getting displayed as "xe0xaexa4xe0xaexbf", it will be displayed as "xe0xaexa4 xe0xaexbf" without space in between. Though this is enough to read short messages, it cannot be used to read books etc.

From Android 4.0 on wards, Tamil and other few languages are supported through browser as said in Android 4.x API overview as seen below.

Support for Indic fonts (Devanagari, Bengali, and Tamil, including the complex character support needed for combining glyphs) in WebView and the built-in Browser 

The words to notice is "in WebView and the built-in Browser", which means that Tamil characters will be rendered perfectly if it is rendered as HTML content and will not be rendered otherwise. Opera and other few browsers did this even before Android 4.0 by substituting image instead of character.

I noticed that in few devices that target Indian market (ex: LG Optimus One, most of Samsung phones and tablets) are able to display Tamil properly both in browser and even in places out of browser like in contacts, text messages, file names etc. To my surprise they do this even in Android 2.3 onwards. I also noticed that the same model targeting non-Indian country running same version of Android does not support Tamil character display.

This made me to investigate further and reached a conclusion that Android (as other Linux based OS) depends on a font rendering engine to display such complex characters. The two engines that I came across are Skia and Harfbuzz. I noticed LG uses skia and Samsung uses Harfbuzz libraries in their devices to bring this ability.

I came across many websites suggesting to replaces these libraries and fonts. It did not work and results in freezing. Fortunately I backed up using clockworkmod and hence I restored my phone.

Though I had explained this with Tamil, this is applicable for most of the Indian languages.

Here comes my question (if you are still reading;) ) Now, far sure it is clear that a TTF file should be present to provide characters and an appropriate libraries (libskia.so or libharfbuzz.so) are required to render them correctly. Does any one know how these manufacturers are able to provide the ability? I am even ready to build my own ROM from AOSP (Android Open Source Project).

        
   
   

回答列表

9
 
vote

rooted手机

android在文件夹 /system/fonts 中包含一个名为"droidsansallacalback.ttf" 的文件,它应该包含所有语言字符。目前它缺乏对许多人的支持,包括泰米尔。

一个可以始终用包含泰米尔字符的文件替换文件,从而允许在手机上使用泰米尔。

从 xda开发人员线程 - droidsans回退indic font ,用户已经尝试并成功使用了他们的手机上的泰米尔。

  • 下载 droidsanshallback.ttf 文件< / li>
  • 下载原始 droidhindi.ttf 文件

本方法,您需要root访问手机,以访问 /system 并更改回退文件:

  • read 如何root我的设备?如果您的手机尚未扎根。
  • 关注 xda开发人员线程看如何替换文件:

      Using and Android SDK environment:  First Copy the DroidSansFallback.ttf file into your sdcard, then issue the following commands:  adb shell su mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system cd /sdcard busybox cp DroidSansFallback.ttf /system/fonts mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system exit exit  Lastly, rebooted the phone   

    注意:所有手机的安装点不一样。


Android App

虽然上述方法可能会吸引一些用户,但我更喜欢在可用时更喜欢应用程序。

此外,泰米尔有一个键盘,总共247个字符,而英语只需要26.因此这成为键入时成为一个主要问题:

请参阅 wikipedia :: tamil语言 - 写作系统

当前的泰米尔脚本由12个元音,18个辅音和一个特殊字符,āytam组成。元音和辅音组合形成216个复合特征,共提供247个字符(12 + 18 + 1 +(12 x 18))


谢谢克里希汉,并在这个主题上工作,已经有一个可以处理问题的应用程序,系统广泛使用泰米尔,以及可用于键入Tamil字符的键盘。

阅读krishan的帖子题为 tamil unicode字体Android - 工作有关此解决方案的开发的详细信息。

汇总

Krishan在 google play 这完全解决了在泰米尔的整个Android OS的问题:

  • 泰米尔unicode键盘 < / p>

    tamil Unicode键盘 - 打印屏幕

  • 泰米尔unicode字体

    tamil Unicode字体 - 打印屏幕

 

Rooted Phone

Android under the folder /system/fonts contains a file named "DroidSansFallback.ttf" supposed to contain all the language characters. Currently it lacks support for many, including Tamil.

One can always replace the file with one that contains Tamil characters, thus allowing the usage of Tamil on your phone.

From XDA Developers Thread - DroidSans Fallback Indic Font, users have tried and successfully used Tamil on their phones.

  • Download the DroidSansFallback.ttf file
  • Download the original DroidHindi.ttf file

To acomplish this method, you need root access to your phone, in order to access the /system and change the Fallback file:

  • Read How do I root my device? if your phone isn't rooted yet.
  • Follow XDA Developers thread to see how to replace the file:

    Using and Android SDK environment:  First Copy the DroidSansFallback.ttf file into your sdcard, then issue the following commands:  adb shell su mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system cd /sdcard busybox cp DroidSansFallback.ttf /system/fonts mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system exit exit  Lastly, rebooted the phone 

    Note: mount point isn't the same for all phones.


Android APP

While the above method may appeal to some users, I do prefer an APP when available.

Besides, Tamil has a keyboard with a total of 247 characters, while the English one only needs 26. So this becomes a major problem when typing:

See Wikipedia :: Tamil language - Writing System

The current Tamil script consists of 12 vowels, 18 consonants and one special character, the xc4x81ytam. The vowels and consonants combine to form 216 compound characters, giving a total of 247 characters (12 + 18 + 1 + (12 x 18))


Thanks to Krishan, and is work on this subject, there's already an APP available to deal with both issues, the system wide usage of Tamil, and a keyboard that can be used to type Tamil Characters.

Read Krishan's post entitled Tamil Unicode Font for Android xe2x80x93 Working for detailed information about the development of this solution.

To summarize

Krishan developed and published two APPs at Google Play that completely deal with the problem of having an entire Android OS in Tamil:

  • Tamil Unicode Keyboard

    Tamil Unicode Keyboard - print screen

  • Tamil Unicode Font

    Tamil Unicode Font - print screen

 
 
 
 
3
 
vote

您似乎会描述发行4153 ,a在Android中的已知错误。

此问题已被报告在果冻bean中解决。如果此屏幕截图是正确的,则应解决问题。 (我真的无法告诉自己,但我确实可以访问果冻豆,可以从中拍摄截图。)

unicode

 

You appear to be describing issue 4153, a known bug in Android.

This issue has been reported as resolved in Jelly Bean. If this screenshot is correct, then the issue should be resolved. (I can't really tell myself, but I do have access to Jelly Bean and can make screenshots from it.)

ICS Test Page for Unicode

 
 
     
     
1
 
vote

安装Opera Mini Web浏览器

在Opera Mini Web浏览器类型"关于:config"

对复杂脚本的位图字体:选择是

您可以在任何品牌手机中查看泰米尔字体中的所有网站

关于

 

Install Opera Mini web Browser

In Opera Mini Web Browser type "about:Config"

use bitmap fonts for complex scripts : Select Yes

You can view all sites in tamil font in any brand mobile phone

Regards

 
 
 
 
0
 
vote

您不需要root并替换Android系统上的字体。

用类似的印度区域的固件替换设备的固件,以正确渲染devanagari字体。其他区域的固件不会正确呈现Devanagari字体。 Devanagari字体正确渲染印度区域的Android版本2.x。

 

You do not need to root and replace the font on Android system.

Replace the firmware of your device with similar Indian region's firmware to render the Devanagari font correctly. Other regions' firmware do not render the Devanagari fonts correctly. Devanagari fonts correctly render on Indian Region's Android version 2.x.

 
 

相关问题

3  Android中的默认汉语字体是什么?  ( What is the default chinese font in android ) 
是什么默认的汉语字体在Android中,它们存储在哪里,以便我可以获得字体文件? ...

3  如何替换Galaxy选项卡7.7的系统字体?  ( How to replace system font of a galaxy tab 7 7 ) 
如何在Galaxy选项卡7.7上替换默认系统字体,由 .ttf 字体? ...

3  如何帮助Android用户减少能力  ( How to help android users with reduced ability to see ) 
我们可以在Android手机中做些什么,以帮助其能够减少其能够减少的用户? 要清楚他们不是盲人,他们只有55岁,随着年龄的增长,他们有能力降低。 当我的父亲看到xperia有4.0英寸的展示时,他认为他与使用手机的麻烦结束了。当他意识到字体大小仍然很小时,麻烦又来了,因为大量分辨率。 其中大多数只是简单的用户,他们只...

1  在Android 4.3中更改字体的应用程序  ( Application for changing fonts in android 4 3 ) 
您是否可以通过其中更改Android的字体,它还支持希腊语? 不幸,我不拥有一个知名品牌,但不知怎的,我扎根了它! ...

1  Nexus 10平板字符难以辨认  ( Nexus 10 tablet characters illegible ) 
我在我的Nexus 10平板电脑上安装了两个应用程序,并且字符显示为带有X的框,如下所示。我联系了Rosetta Stone应用程序的开发人员,无济于事。 我在Android 4.3中。任何可以解决此问题的设置或安装的建议? ...

2  有没有办法在Nexus One / Nexus s中格式化数字'字体?  ( Is there a way to format numbers font in nexus one nexus s ) 
我喜欢在佐治亚州字体中看到数字,并希望看到他们自动格式化成那个字体!如果您知道此类提示,请分享! 更新 我只想格式化数字,而其他文本仍然是。 ...

42  如何制作Android设备显示复杂的指示字符?  ( How to make an android device to display complex rendering of indic characters ) 
请原谅这个问题的长度。我需要解释所有这一切来帮助他人,并避免有用的贡献者在不要求澄清的情况下提供答案。 我的要求一行:"启用Android手机正确显示泰米尔字符" 。 阐述: 泰米尔,就像任何其他印度语言都有复杂的角色渲染系统。与英语或其他拉丁文脚本不同,它具有由多个字符组成的字形(在屏幕中看到的)。 Andr...

-1  我有XOLO播放智能手机。我想支持它古吉拉蒂字体。我怎样才能做到这一点? [复制]  ( I am having xolo play smartphone i want to support it gujarati font how can i ) 
这个问题已经在这里有答案: 如何在Android上安装自定义字体? [重复] (2个答案) ...

11  如何在Android 2.1中安装Hindi字体?  ( How can install a hindi font in android 2 1 ) 
我有一个三星Galaxy S GT-I9000,我想安装一个印度人字体。我怎样才能做到这一点? ...

7  是否有用户访问的字体大小偏好?  ( Is there a user accessible font size preference ) 
我想在整个操作系统中更改字体大小,而不仅仅在一个应用程序或一个屏幕上。有没有办法做到这一点? 搜索互联网提出了有人说市场上的备件应用程序可以做到这一点,但这是不正确的。它的字体大小首选项仅影响应用程序本身。 开发人员文档似乎暗示有用户字体大小首选项。来自 http://developer.android.com/i...




© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有