LibGDX RTL字体渲染? [英] LibGDX RTL font rendering?

查看:211
本文介绍了LibGDX RTL字体渲染?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个应该支持两种语言的应用程序,英语和希伯来语。



问题是希伯来语是从右到左的西方语言,英语是从左到右的语言,LibGDX不支持RTL字体。



我已经为字体创建了位图,一切正常





但是当我用希伯来语写作时,它会写出反转的字样。当我单独使用希伯来语编写时,我有一个解决方案,只需使用 StringBuilder 反转单词,但这是一个便宜的修复。但是,如果我想实现聊天或角色名称呢?

解决方案

从我能看到的最简单的解决方案是使用



从那里变得越来越困难。关于这个问题有很多问题(例如在libgdx(Android)中显示从右到左的非西方语言)和更少的解决方案。



您可以选择创建字形库通常使用的单词或表达式的字符串,虽然这是一个艰苦的设置过程,并且在使用聊天时存在时间上的开销,因为你的字符串反转。



libgdx github 中的讨论支持复杂的字体渲染(中文,阿拉伯语......)。进入这些和更多的选项,包括支持Windows sridharsundaram / complexscriptlayout 所做的工作,虽然这不是Android,可能值得研究进一步的发展思路。



从积极的方面来看,这方面的近期发展越来越多,因此RTL和bidi格式应该成为使用libgdx的开发人员越来越容易。



感兴趣的是这个支持问题从右到左文本呈现支持#787 ,因为存在开发资源相同问题的人的痕迹痕迹。


I am creating an application that should support two languages, English, and Hebrew.

The problem is that Hebrew is Right-To-Left western language and English is Left-To-Right language, and LibGDX does not support RTL fonts.

I have created the bitmap for the font and everything works

But when I write in hebrew, it will write the words reversed. I have a solution for this when I write solely in hebrew, just reverse the words using a StringBuilder, but that's a cheap-fix. But what if I want to implemnet a chat, or character name?

解决方案

From what I can see the easiest solution is to use Heiro. If you look at this thread Hiero Rendering Arabic fonts Right to Left where there is recent provision to accomodate RTL

From there it becomes increasingly difficult. There are quite a few questions about this issue (one example Showing non-western language from right to left in libgdx (Android)) and fewer solutions.

You have the option of creating a library of glyphs of strings for commonly used words or expression, though this is a painstaking process to set up and there is an overhead in terms of time when using chat, as there is with your string reversal.

This discussion in the libgdx github Support for complex font rendering (Chinese, Arabic, ...). goes into these and more options including work done to support Windows sridharsundaram/complexscriptlayout, which, although that is not Android, may be worth investigating for further development ideas.

On the positive side, there are an increasing number of recent developments in this front, so RTL and bidi formats should become increasingly easier for developers using libgdx.

Of interest is this support issue Right-To-Left Text Rendering Support #787 as there are breadcrumb trails of people with the same issue developing resources.

这篇关于LibGDX RTL字体渲染?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆