[PR #12722] [MERGED] Force LTR / logical order for text in GdiEngine #29200

Open
opened 2026-01-31 09:33:28 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12722
Author: @lhecker
Created: 3/18/2022
Status: ✅ Merged
Merged: 3/21/2022
Merged by: @undefined

Base: main ← Head: dev/lhecker/12294-bidi-override


📝 Commits (5)

  • 5c75707 Force LTR / logical order for text in GdiEngine
  • 6e14796 Fix build
  • 5839167 Address feedback
  • 213c4be Add usp10.lib to all relevant sources files
  • 2208d6b Restore sources files

📊 Changes

6 files changed (+70 additions, -22 deletions)

View changed files

📝 .github/actions/spelling/expect/expect.txt (+6 -2)
📝 src/renderer/gdi/gdirenderer.hpp (+5 -1)
📝 src/renderer/gdi/lib/gdi.vcxproj (+6 -1)
📝 src/renderer/gdi/paint.cpp (+46 -3)
📝 src/renderer/gdi/precomp.h (+2 -1)
📝 src/renderer/gdi/state.cpp (+5 -14)

📄 Description

Some applications like vim -H implement their own BiDi reordering.
Previously we used PolyTextOutW which supported such arrangements,
but with a0527a1 and the switch to ExtTextOutW we broke such applications.
This commit restores the old behavior by reimplementing the basics
of ExtTextOutW's internal workings while enforcing LTR ordering.

Validation Steps Performed

  • Create a text file with "ץחסק פחופפסנ חס קוח ז׳חסש ץקקטק פחטסץ"
    Viewing the text file with vim -H presents the contents as expected ✅
  • Printing enwik8 is as fast as before ✅
  • Font fallback for various eastern scripts in enwik8 works as expected ✅
  • DECDWL double-width sequences ✅
  • Horizontal scrolling (apart from producing expected artifacts) ✅

Closes #12294


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/12722 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 3/18/2022 **Status:** ✅ Merged **Merged:** 3/21/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/12294-bidi-override` --- ### 📝 Commits (5) - [`5c75707`](https://github.com/microsoft/terminal/commit/5c75707d377624de4bca5d59223073e2a9275092) Force LTR / logical order for text in GdiEngine - [`6e14796`](https://github.com/microsoft/terminal/commit/6e1479639136692431f150f378c9c02913b3d6c0) Fix build - [`5839167`](https://github.com/microsoft/terminal/commit/5839167ddd11cf0b376befaadea5920699647616) Address feedback - [`213c4be`](https://github.com/microsoft/terminal/commit/213c4beb21fa7618ed0d87b00912f5568ca5794e) Add usp10.lib to all relevant sources files - [`2208d6b`](https://github.com/microsoft/terminal/commit/2208d6ba8dd106b36588c61a06c26bd8067ea6a9) Restore sources files ### 📊 Changes **6 files changed** (+70 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/expect/expect.txt` (+6 -2) 📝 `src/renderer/gdi/gdirenderer.hpp` (+5 -1) 📝 `src/renderer/gdi/lib/gdi.vcxproj` (+6 -1) 📝 `src/renderer/gdi/paint.cpp` (+46 -3) 📝 `src/renderer/gdi/precomp.h` (+2 -1) 📝 `src/renderer/gdi/state.cpp` (+5 -14) </details> ### 📄 Description Some applications like `vim -H` implement their own BiDi reordering. Previously we used `PolyTextOutW` which supported such arrangements, but with a0527a1 and the switch to `ExtTextOutW` we broke such applications. This commit restores the old behavior by reimplementing the basics of `ExtTextOutW`'s internal workings while enforcing LTR ordering. ## Validation Steps Performed * Create a text file with "ץחסק פחופפסנ חס קוח ז׳חסש ץקקטק פחטסץ" Viewing the text file with `vim -H` presents the contents as expected ✅ * Printing enwik8 is as fast as before ✅ * Font fallback for various eastern scripts in enwik8 works as expected ✅ * `DECDWL` double-width sequences ✅ * Horizontal scrolling (apart from producing expected artifacts) ✅ Closes #12294 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:33:28 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29200