-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG that Khmer language displays incorrectly using ttf text #2249
Comments
Can you please show screenshots of actual and expected output? Also, are you able to provide the TTF font file that you use for the Khmer text? |
OK, wait a minute. |
This is the Khmer ttf file our app uses: |
Yes, it will display correctly when using system characters, but will display incorrectly when using ttf characters. |
After looking into this, and as a complete guess, the problem may be in Also, the text that reproduces the issue can be narrowed down to the following: The problem could also be that the generated font atlas has bitmaps of the individual glyphs that would be combined to make up that character, but once they are in the font atlas, they look nothing like what they should be when combined together. So, the rendering code is attempting to create a single |
@DelinWorks You may have some insight into this issue. Would something like this require a shaping engine (like Harfbuzz)? |
Text layout that I'm afraid that the only solution is to use some kind of library, where you can supply your text and get a ready image for use. Or have a custom label implementation that would support the languages you need, but that's a lot of work. Maybe using system fonts could also work. |
This kind of small language is a problem. The language is too complicated. We can't understand the basic grammar and rules of the language at all, and we can't modify it specifically. We might as well give up supporting this language. Anyway, the target population of this small language is relatively small. |
Need to close this issue? We discard revisions to this issue. |
@rh101 it's similar to vowels in the arabic language, like عَ اٍ رْ |
Have you guys looked into harfbuzz? or in the unicode list https://www.compart.com/en/unicode/ |
Haven't watched harfbuzz. |
Does the axmol engine support Arabic TTF fonts? |
Arabic is right to left and there's no support for right to left languages. |
yes, axmol does support Arabic script TTF fonts, but the text will look "unconnected" and you would need to use a shaping engine like harfbuzz, I've coded a simple Arabic shaping engine for axmol a while back https://github.com/DelinWorks/arabic-text-renderer-cpp-axmol and it works great, only in the Arabic language category like Persian , Urdu, Pashto, Kurdish and Malay but some modifications have to be made |
there's an option in axmol to view text RTL, but as long as you shape your text you won't really need this |
Thanks |
Does it really? I think it just aligns text to the right side, but in Arabic "abc" needs to be displayed as "cba". I don't think there's support for that, unless I'm mistaken. And it's even more complicated than just reversing letters as you know. :) |
yes, that's what the shaping engine does, it reverses it like "cba" instead of "abc" so it looks right for Arabic, it also does connectives like بـت instead of ب ت |
There is no way. Arabic writing is different from Chinese, English, Japanese and other languages. It is in the opposite direction. |
what do you mean there's no way? I was able to achieve it in axmol pretty easily, |
if you were talking about axmol supporting it right out of the box then no axmol doesn't, but that doesn't mean libraries like harfbuzz can't exist |
It would be better if the Arabic TTF could be integrated into axmol, but it doesn't matter if it can't be integrated. The current TTF is sufficient anyway. It's just that the display in some places does not conform to the habits of Arabs. They should be able to understand it in the context. After all, most of the information they come across on the Internet is from left to right. |
I'm not sure what you mean by some of those remarks, but they can be misconstrued. It's also off-topic, since this issue isn't about the Arabic language or Axmol support for it. As @DelinWorks has explained, using the Harfbuzz library, support can be added on top of Axmol or any other engine in order to generate the correct output. If you wish to go down that path of using Harfbuzz, then look into DelinWorks' own project that was linked above to get some idea of how to implement it. Other than that, I'm not sure that anything more can be done to fix this in Axmol at this point in time. Perhaps in the future it will be revisited, but it's not something trivial to implement. |
OK |
I'm not sure what you mean by that, it's off topic. but yeah it should be easy to implement for any other language, just different complex rulesets, with the renderer at your disposal along with an open source codebase, the sky is the limit for what you can do! |
Sorry, I got off topic and jumped to another question. |
The framework displays Khmer TTF text content incorrectly. The text content pattern displayed is different from the original text content pattern that needs to be displayed, and the Khmer TTF text content is easily triggered
AXLOG("LabelTextFormatter error: can't find letter definition in font file for letter: 0x%x",character);
The text was updated successfully, but these errors were encountered: