feat(text): Add contextual shaping for single-line UI text - #3231
feat(text): Add contextual shaping for single-line UI text#3231OmarAglan wants to merge 1 commit into
Conversation
PR Summary by QodoShape complex single-line UI text with Uniscribe
AI Description
Diagram
High-Level Assessment
Files changed (12)
|
Code Review by Qodo
1.
|
|
| Filename | Overview |
|---|---|
| Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp | Implements bounded complex-text layout and rasterization, safe texture chunking, and legacy fallback; the previously reported oversized-text failures are resolved. |
| Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayString.cpp | Rebuilds sentence data before layout-dependent queries or drawing and refreshes fallback extents and hotkey state correctly. |
| GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayString.cpp | Mirrors the Generals display-string fixes for fallback ordering, cached dimensions, resources, and hotkeys. |
| Core/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp | Explicitly disables complex shaping for editable strings whose caret metrics still use the legacy model. |
Reviews (20): 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
|
draft to fix the vc6 issue |
|
We can handle VC6 in a small prerequisite PR by runtime-loading |
eff4156 to
74c1e27
Compare
|
Code review by qodo was updated up to the latest commit 74c1e27 |
yes im working on it! |
|
In what shape is the arabic text you tested with? As far as I am aware the old translations had the words reversed to accomodate the game implementation. Can arabic text now be supplied normally? |
i used noraml text arabic, i didnt reverse the text, this fixes the hack that is to reverse the arabic text! |
|
needs rebase and conflict fix, working on it. |
a845dfe to
80cebad
Compare
80cebad to
60951d4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60951d4c23
ℹ️ 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".
a5a59b9 to
42b2337
Compare
42b2337 to
2220c79
Compare
4985fdf to
c986ded
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Rebased! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c986dedf67
ℹ️ 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".
c986ded to
f881a12
Compare
|
This change adds a lot of new code for the text rendering. Is all of it absolutely required? And is there no code duplication, aka new code doing the same as nearby other code, in part? |
f881a12 to
614ddc6
Compare
right now, i can't simplify more than that! |
c333fd1 to
a2e24f3
Compare
|
rebased and fixed all the apparent issues, ready for review! |
a2e24f3 to
ec473e0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec473e0955
ℹ️ 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".
ec473e0 to
bbe8b9b
Compare
|
There are left-over bot comments. |
bbe8b9b to
1f8fc22
Compare
|
rebased and fixed and ready for review |


Adds a Windows Uniscribe rendering path for eligible complex single-line UI text in Generals and Zero Hour. The existing renderer draws individual UTF-16 characters, preventing normally authored Arabic text from displaying its contextual letter forms.
The new path itemizes the paragraph, splits font runs at character-cluster boundaries, and rasterizes the accepted line once per sentence build before copying it into the existing A4R4G4B4 sentence textures. It preserves the primary font for characters below U+0100 and the configured Unicode font for other font runs, keeping combining sequences together.
Plain Latin-only strings, multiline text, lines rejected by the wrapping width or texture-height limits, monospaced text, and labels with active hotkey markers use the legacy renderer. Editable text, password text, and IME construction strings also remain on that path because shaped caret and selection metrics are outside this change.
The change also refreshes hotkey data when labels change, reconciles measured dimensions when rendering falls back, and tracks resources created by complex-text size queries, including at frame zero. Uniscribe is loaded through #3241, unavailable or unsuccessful shaping falls back to the legacy renderer.
current limitations
Validation
Before
After
Implementation developed with AI assistance.