在 iPhone 上渲染某些字符字形

发布于 2024-07-29 13:30:00 字数 462 浏览 11 评论 0原文

我目前正在使用 iPhone SDK 创建一个利用印度语脚本的应用程序。 然而,iPhone 在渲染许多印度文字中的某些字形时存在问题。 例如:

प + ् + र = प्र

ਕ + ੍ + ਰ = ਕ੍ਰ

当您在 Mac(或 Windows)上键入此内容时,计算机将自动将三个字符呈现为一个字形(प्र - 但在 Unicode 中,它仍然表示为三个字符)。 由于 iPhone 不支持 AAT(Apple 高级排版)或高级 OpenType 功能,因此它会将字符呈现为三个独立的字符,这在许多情况下变得不可读。 我认为应该有一种方法在 Objective-C 中进行硬编码,以确保每次这三个字符出现在 UILabel 中时,它们都应该从 Arial Unicode MS(内置)字体中呈现某个字形。 我不介意使用未记录的 API 来完成此任务。

I am currently using the iPhone SDK to create an app that utilizes Indic scripts. However, the iPhone has issues with rendering certain glyphs in many Indic scripts. For example:

प + ् + र = प्र

or

ਕ + ੍ + ਰ = ਕ੍ਰ

When you type this on a Mac (or Windows) the computer will automatically render the three characters into the one glyph (प्र - In Unicode it is still represented as three characters however). Because the iPhone doesn't support AAT (Apple Advanced Typography) or advanced OpenType features it renders the characters as three separate which becomes unreadable in many cases. I'm thinking there should be a way to hard code in Objective-C to ensure that every time the three characters show up in a UILabel they should render a certain glyph from the Arial Unicode MS (built-in) font instead. I do not mind using undocumented APIs to accomplish this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

聚集的泪 2024-08-05 13:30:00

问题不在于iPhone仅支持某些印度语或不支持AAT字体。
iPhone肯定支持AAT表。
问题是不包括您使用的正确 AAT 字体!
您可以显示很少的字形,因为这些字形包含在 arialuni.ttf 或 helvetica.ttf 中。 但这些字体没有任何 OpenType 或 AAT 表。

我可以用图片确认我所说的,我有一部越狱的 iPhone,你可以检查 flickr.com/photos/41161441@N03/ 以获得正确的高棉语渲染图片,这是最复杂的印度文字之一。

我在 modmyi.com 网站论坛上解释了这个问题。
http: //www.modmyi.com/forums/general-iphone-chat/680094-indic-font-rendering-iphone-yes-working.html#post4897261

The problem is not the iPhone supports only certain Indic or do not support AAT fonts.
The iPhone support AAT table for sure.
The problem is the proper AAT font that you use is not included!!
U can have few glyph displayed because those ones are inlcude either in arialuni.ttf or helvetica.ttf. But those font do not have any OpenType or AAT tables.

I can confirm with picture what I state, I have a jailbreak iPhone and you can check flickr.com/photos/41161441@N03/ for picture for proper Khmer rendering, which is one of the most complex Indic script.

I explained the problem on modmyi.com web site forum.
http://www.modmyi.com/forums/general-iphone-chat/680094-indic-font-rendering-iphone-yes-working.html#post4897261

可爱暴击 2024-08-05 13:30:00

首先探索 Apple 使用的内容,如下所示:

  • 尝试在 Notes 和 Mail 中输入单独的字形,看看它们是否组合。 如果不是,则不太可能有隐藏的代码执行此操作。

  • 接下来,在 Mac 上创建一个合成角色并将其通过电子邮件发送到您的 iPhone。 看看 Mail 是否能够显示各种复合字符。 通过托管具有复合字符的网页并观察 MobileSafari 的操作来重复此操作。 我已经通过在 MobileSafari 中查看此页面为您完成了此操作; 它无法正确组合字符。 因此,这告诉我们 iPhone 上的 WebKit 无法帮助您(并且使得 iPhone 根本不可能做到这一点)。

  • 最后,您为什么认为 प्र 可以在 iPhone 上使用? 您是否曾经能够在 iPhone 上的任何应用程序中显示此字形? 很可能没有这样的字形定义,在这种情况下,除非您准备好编写自己的布局管理器(这可能需要创建一个全新的文本视图),否则您可能会陷入困境。 如果您已经能够在某个地方显示它,那么您可以从那里继续了解 Apple 如何显示它。

iPhone 上有印度语键盘吗? 我一直没能找到一个,如果没有,那么他们极不可能在私有方法中隐藏了很多印度支持。

请务必打开 Radars (bugreport.apple.com) 查找 iPhone 上绘制不正确的任何字形。 这就是他们知道如何解决它的方法。

Start by exploring what Apple is using as follows:

  • Try entering the separate glyphs in both Notes and Mail and see if they composite. If not, then there is unlikely a hidden piece of code that does this.

  • Next, created a composited character on Mac and email it to your iPhone. See if Mail is even capable of displaying various composited characters. Repeat by hosting a webpage with composited characters and observing what MobileSafari does. I've done this one for you by viewing this page in MobileSafari; it does not composite the characters correctly. So that tells us that WebKit on iPhone can't help you (and makes it much less likely that iPhone can do this at all).

  • Finally, why do you believe that प्र is available at all on iPhone? Have you ever been able to display this glyph on an iPhone in any app? It's very possible there is no such glyph definition, in which case you may be stuck unless you're ready to write your own layout manager (which would likely require creating a completely new text view). If you've been able to display it somewhere, then you can move forward from there to figuring out how Apple is displaying it.

Is there even an Indic keyboard available on iPhone? I haven't been able to find one, and if there isn't, then it's extremely unlikely that they have very much Indic support hidden in private methods.

Be sure to open Radars (bugreport.apple.com) for any glyphs that are incorrectly drawn on iPhone. That's how they know to fix it.

听风吹 2024-08-05 13:30:00

我从事语言学习应用程序的工作。

iPhone 上几乎不支持印度语脚本。 您将必须编写自己的文本渲染支持和使用它的元素,或者等待 Apple 实现它。

iPhone OS 在 3.0 之前无法渲染阿拉伯文字,而 OS X 仅通过第三方渲染支持某些印度文字。

我支持 iPhone OS 无法渲染的脚本的解决方案是使用预渲染图像。 可能对你没有多大帮助,但这就是我们所做的。

I work on language learning applications.

There is little to no support for Indic scripts on the iPhone. You're going to have to write your own text rendering support and elements that use it or wait for Apple to implement it.

The iPhone OS couldn't render Arabic scripts until 3.0, and OS X only supports certain Indic text with third party rendering support.

My solution for supporting scripts iPhone OS can't render is to use pre-rendered images. Probably not much help to you, but that's what we do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文