Skip to content

CJK text wrapping tests for imgui#8890#89

Open
xuboying wants to merge 5 commits intoocornut:mainfrom
xuboying:cjk_wrap_tests
Open

CJK text wrapping tests for imgui#8890#89
xuboying wants to merge 5 commits intoocornut:mainfrom
xuboying:cjk_wrap_tests

Conversation

@xuboying
Copy link

This work depends on:
ocornut/imgui@master...xuboying:imgui:feature-cjk-wrap

As discussed in ocornut/imgui#8990, this PR updates the ImGui test suite to support studying CJK word‑wrapping behavior.

Added test cases

  • widgets_text_wrapped_cjk_legacy_headless
  • widgets_text_wrapped_cjk_zh_cn_mixed_char_with_pronunciation_mark_not_allow_at_head
  • widgets_text_wrapped_cjk_zh_cn_mixed_char_with_pronunciation_mark_not_allow_at_tail
  • widgets_text_wrapped_cjk_zh_cn_mixed_with_english

Helper

  • cjk_wrap_test_helper (requires IMGUI_TEST_ENGINE_ENABLE_STD_FUNCTION)

Notes

The CJK wrapping rules are generally straightforward, with the main complexity coming from handling pronunciation marks.
In the screenshots below, the yellow line indicates the wrap width, and the green rectangle shows the actual wrapped region.

2026-01-23_201151 2026-01-23_201111

By the way, I added a HiDPI manifest to my local build to avoid blurry text (ideally every Win32 application should ship with one by default). As expected, the text became quite small afterward, so I set the Font DPI Scale to 2, which matches my monitor. However, this value resets every time the test engine closes — possibly a TE bug.

@ocornut ocornut changed the title Cjk wrap tests CJK text wrapping tests for imgui#8890 Jan 30, 2026
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

Successfully merging this pull request may close these issues.

1 participant