支持复杂的文本布局,在Android的OpenType字体布局、复杂、文本、字体

2023-09-12 08:08:18 作者:▌无所谓的魅惑

我想提出一个OpenType字体在我的资产文件夹,使用 Typeface.createFromAsset 渲染统一code文字在我的Andr​​oid应用程序,它使用一种语言复杂的文本布局(CTL)。

I would like to put an OpenType font in my assets folder and use Typeface.createFromAsset to render Unicode text in my Android application for a language that uses complex text layout (CTL).

我想这样做的传统蒙古文,却是同一个问题(所以我听到的)其他语言,如泰语,阿拉伯语,印度语,许多少数民族语言。 已经包含必要的信息的 OpenType字体以正确显示文本。现在的问题是,并非所有的软件支持OpenType字体的渲染。 有些人,但另一些则不然。据我所知,Android的没用过,但也许现在呢?

I want to do this for traditional Mongolian script, but it is the same issue (so I hear) for other languages like Thai, Arabic, Indic languages, and many minority languages. An OpenType font already includes the information necessary to properly display the text. The problem is that not all software supports OpenType rendering. Some do, but others don't. From what I can gather, Android didn't used to, but maybe now does?

Android的棒棒糖是出了。 是否有在Android的OpenType字体?

Android Lollipop is out now. Is there any support for OpenType fonts in Android?

如果还有什么容易的,那么怎样的程序?我听说过的事情一样攀高和Harfbuzz(声称与Android 的工作),但我还没有找到如何实现他们的任何简单的指令或教程。我已经发现的最接近的是一个印度语进行文本渲染,但它是远离容易理解。

If there is still nothing easy, then what is the process? I have heard of things like Pango and Harfbuzz (which claims to work with Android) but I haven't found any simple instructions or tutorials for how to implement them. The closest thing I have found is an Indic text renderer, but it is far from easy to understand.

这些问题表明,有这个话题的兴趣,但在我看来,他们并没有得到满意的答复。他们中有些人也已经过时。我想知道是否有当前的解决方案。

These questions show that there is interest in this topic, but in my opinion they haven't been satisfactorily answered. Some of them are also outdated. I want to know if there is a current solution.

Android中 使用OpenType字体功能 Display拦截和支持非拉丁文或复杂的脚本语言的Andorid CTL(复杂文本语言)支持的Andr​​oid (原文如此) Indic对于SDK语言支持但不PhoneGap的 HarfBuzz入门 indic-text-renderer使用harfbuzz和FreeType的 Use OpenType font features in Android Display interception and support non-latin or complex scripting language in Andorid CTL (Complex Text Language) support in Android (sic) Indic Language Support for SDK but not PhoneGap HarfBuzz getting started indic-text-renderer using harfbuzz and freetype

我写我自己的渲染引擎来显示传统蒙古统一code文本。但写一个渲染引擎为特定语言是重新发明轮子,如果已经有OpenType字体可用。此外,它是不容易适应其它语言

I have written my own rendering engine to display traditional Mongolian Unicode text. But writing a rendering engine for a specific language is reinventing the wheel if there are already OpenType fonts available. Also, it is not easily adaptable to other languages.

推荐答案

如果你想使用Harfbuzz要做到这一点,我写了一个简单的指南,以实现使用Harfbuzz文本整形:的 http://www.simon-cozens.org/content/duffers-guide-fontconfig-and-harfbuzz

If you want to use Harfbuzz to do this, I have written a simple guide to implementing a text shaper using Harfbuzz: http://www.simon-cozens.org/content/duffers-guide-fontconfig-and-harfbuzz

这应该让你从字体选择,以了解哪些字形应该使用,并在那里把他们的输出。

That should get you from font selection to knowing which glyphs should be used and where to put them in the output.

 
精彩推荐
图片推荐