feat(text): Shape complex single line UI text - #3231
Conversation
PR Summary by QodoShape complex single-line UI text with Uniscribe
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1.
|
|
| Filename | Overview |
|---|---|
| Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp | Adds the shaping, measurement, rasterization, and bounded texture-copy path; the current guards resolve both previously reported oversized-height failures. |
| Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.h | Extends font and sentence renderer interfaces with complex-text operations and per-renderer enablement. |
| Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt | Propagates the Windows Uniscribe link dependency through the shared WW3D2 interface. |
| Core/GameEngine/Include/GameClient/DisplayString.h | Adds the abstract control used to opt individual display strings out of complex shaping. |
| Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayString.cpp | Connects full-string width measurement and complex-text enablement to the Generals display-string implementation. |
| GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayString.cpp | Mirrors the display-string integration for Zero Hour. |
| Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp | Keeps editable Generals text-entry strings on the legacy renderer until shaped caret metrics are supported. |
| GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp | Applies the same editable-text exclusion to Zero Hour. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
Text[UI text] --> Eligible{Eligible single-line complex text?}
Eligible -- No --> Legacy[Legacy per-character renderer]
Eligible -- Yes --> Measure[Measure with Uniscribe]
Measure --> Fits{Height and wrap constraints fit?}
Fits -- No --> Legacy
Fits -- Yes --> Rasterize[Rasterize shaped run]
Rasterize --> Chunk[Copy bounded chunks into sentence textures]
Chunk --> Render[Render sentence]
Reviews (4): Last reviewed commit: "feat(text): Shape complex single-line UI..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a852d41fbb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
I can't tell from the text and images what the problems were and how this fixes it.
Can you give before and afters of each of these individually? |
will provide examples of it as soon as possible |
f88c715 to
d25f054
Compare
d25f054 to
eff4156
Compare


This change adds contextual shaping and bidirectional ordering for complex single-line UI text in
Render2DSentenceClass.The sentence renderer normally processes text one
WCHARat a time. This prevents Arabic letters from using their contextual forms and does not preserve the correct visual order of mixed Arabic and Latin runs. Complex strings are now measured and rendered as one run with Windows Uniscribe before the resulting pixels are copied into the existing A4R4G4B4 sentence textures.Plain Latin strings continue to use the existing per-character rendering path. Wrapped, multiline, hot-key parsed, and monospaced text remain unchanged and can be handled separately in later work.
The implementation uses the Windows
usp10library because the existing font path is based on GDIHFONTobjects. This keeps the change within the current renderer and avoids introducing a broader DirectWrite backend change.The main-menu test confirms correct contextual shaping, bidirectional ordering, digit ordering, centering, and clipping.
Before
After
The temporary main-menu test strings and diagnostic code are not included in this pull request.
The change was validated with:
git diff --checkThe implementation was developed with AI assistance, then reviewed and simplified against the nearby renderer code. The final diff was manually reviewed, and the rendering behavior was manually tested in game.