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

Adding support for drawing CJK characters with ImTui #73414

Merged
merged 1 commit into from
May 10, 2024

Conversation

katemonster33
Copy link
Contributor

Summary

Features "Adding support for ImTui to draw unicode characters"

Purpose of change

Fixes: #73205
ImTui out of the box does not support drawing unicode characters. We are adding that here.

Describe the solution

Use a variation of the method employed by #72579 to interrupt the normal drawing flow of imgui to tell ImTui to render the intended characters.

Describe alternatives you've considered

Same as with #72579 , we could simply add all unicode characters to the ImGui cache, which would balloon the memory usage by several gigabytes. this is gross though and we're not doing that

Testing

build curses build, set language to Chinese, Japanese or Korean, load keybindings UI from the main menu and verify the characters draw properly.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) <Enhancement / Feature> New features, or enhancements on existing json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Apr 30, 2024
@github-actions github-actions bot added the ImGui Anything related to the new ImGui UI for SDL/tiles or ImTui for curses builds label May 4, 2024
@github-actions github-actions bot removed astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels May 6, 2024
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions Info / User Interface Game - player communication, menus, etc. and removed astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels May 6, 2024
@katemonster33 katemonster33 marked this pull request as ready for review May 10, 2024 21:07
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label May 10, 2024
@I-am-Erk
Copy link
Member

i went in and tried to review your code and then I remembered that no, i don't. so far you haven't destroyed the game though.

@I-am-Erk I-am-Erk merged commit b584335 into CleverRaven:master May 10, 2024
20 of 33 checks passed
@katemonster33
Copy link
Contributor Author

@I-am-Erk thank you for the vote of confidence but I believe this branch had a clang tidy error >.>

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 10, 2024
@katemonster33 katemonster33 deleted the imtui_cjk_chars branch May 11, 2024 00:17
@I-am-Erk
Copy link
Member

Number of times you have destroy game += 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing ImGui Anything related to the new ImGui UI for SDL/tiles or ImTui for curses builds Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImTUI does not support CJK
2 participants