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

Make CJK chars work finally #255

Merged
merged 14 commits into from
Jun 2, 2021
Merged

Make CJK chars work finally #255

merged 14 commits into from
Jun 2, 2021

Conversation

smolck
Copy link
Owner

@smolck smolck commented May 31, 2021

Still needs some work but I'm fairly confident I can finally fix #140 with this.

@SilverRainZ would you mind giving this branch a test? The chars (both Latin and CJK) aren't displayed perfectly (still need some tweaking on that front I think), but it seems to mostly display CJK chars properly from my testing.

@smolck smolck added the enhancement New feature or request label May 31, 2021
@SilverRainZ
Copy link

wow, In my field of vision, all Chinese chars rendered correctly, emoji is okay too.

2021-06-01_17:51:50
2021-06-01_17:51:04

@SilverRainZ
Copy link

There are still some words that can not be correctly rendered, hope it is helpful for you debgging:

@smolck
Copy link
Owner Author

smolck commented Jun 1, 2021

There are still some words that can not be correctly rendered, hope it is helpful for you debgging:

* **实**习

* 加**载**

* **直**接

* 同**样**

@SilverRainZ Would you mind explaining what renders incorrectly about those characters? They seem to look fine on my end:

chars

The only reason I'd guess they wouldn't render correctly would be if there were lots of different chars in use in a single file (something I guess could happen pretty often?), and the font atlas could perhaps get filled, causing rendering issues. Might need to work in some way of knowing when that happens and increasing the font atlas size if necessary; but I don't know if that's what's happening for you there?

@SilverRainZ
Copy link

SilverRainZ commented Jun 2, 2021

The original text is 是这**样**子的, but this case only appears one time and now I can not reproduce it.

2021-06-01_17:51:04

@clason
Copy link
Collaborator

clason commented Jun 2, 2021

Just to make sure, it's the bold markup ** ... ** that is the issue? It works for the same character without it?

@SilverRainZ
Copy link

Just to make sure, it's the bold markup ** ... ** that is the issue? It works for the same character without it?

Sorry, it is just for emphasizing, and does not related to this issue.

@smolck
Copy link
Owner Author

smolck commented Jun 2, 2021

Hmm, well since you can't reproduce it anymore, I'll just go ahead and merge this. Feel free to open an issue if the problem re-appears/persists!

@smolck
Copy link
Owner Author

smolck commented Jun 2, 2021

The original text is 是这**样**子的, but this case only appears one time and now I can not reproduce it.

2021-06-01_17:51:04

@SilverRainZ Just a note, I think I was able to fix the issue you were running into via 3f26610; for me the issue looked something like this, although it varied:

In that screenshot you can also see the font atlas, and how the char gets cut off at the edge of the canvas there, causing the char to appear incorrectly. A look at the code revealed I had forgotten to account for double width chars at the edge of the font atlas, and that was the result. So should be fixed in that commit I linked above (and thus on master).

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

Successfully merging this pull request may close these issues.

CJK character is not rendered correctly
3 participants