Skip to content
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

Open
cxcxiaochuan opened this issue Nov 26, 2024 · 7 comments
Open

BUG that Khmer language displays incorrectly using ttf text #2249

cxcxiaochuan opened this issue Nov 26, 2024 · 7 comments

Comments

@cxcxiaochuan
Copy link

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);

@rh101
Copy link
Contributor

rh101 commented Nov 26, 2024

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?

@cxcxiaochuan
Copy link
Author

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.

@cxcxiaochuan
Copy link
Author

The original text on the button below is as follows:ចាប់ផ្តើម

But the content displayed by the program becomes the following screenshot
屏幕截图 2024-11-26 131948

@cxcxiaochuan
Copy link
Author

This is the Khmer ttf file our app uses:
NotoSansKhmer-SemiBold.zip

@rh101
Copy link
Contributor

rh101 commented Nov 26, 2024

Can reproduce this issue.

Just as a test, using the system font, it displays correctly:
image

@cxcxiaochuan
Copy link
Author

Yes, it will display correctly when using system characters, but will display incorrectly when using ttf characters.

@rh101
Copy link
Contributor

rh101 commented Nov 26, 2024

After looking into this, and as a complete guess, the problem may be in Label::multilineTextWrap or FontAtlas::prepareLetterDefinitions, but I'm not familiar with the logic to figure out why.

Also, the text that reproduces the issue can be narrowed down to the following:
ផ្តើ

which ends up rendering as:
image

The problem could also be that the generated font atlas has bitmaps of the individual letters that would be combined to make up that glyph, 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 ផ្តើ from individual bitmaps, and I don't understand how that would ever work, since they're all bitmap images of individual characters. This is all assuming that the FontAtlas contains bitmaps, and that I am not confused about how it works (please correct me if I'm wrong).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants