[PR #4671] [MERGED] Clip text to within the row we expect #25882

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4671
Author: @miniksa
Created: 2/21/2020
Status: Merged
Merged: 2/21/2020
Merged by: @undefined

Base: masterHead: dev/miniksa/draw3


📝 Commits (3)

  • 6a4347e Clip text to within the row we expect.
  • dc419da noexcept!!!!
  • 94d0ec8 Merge branch 'master' into dev/miniksa/draw3

📊 Changes

2 files changed (+13 additions, -0 deletions)

View changed files

📝 OpenConsole.sln (+6 -0)
📝 src/renderer/dx/CustomTextRenderer.cpp (+7 -0)

📄 Description

Summary of the Pull Request

Adjusts DrawGlyphRun method inside DirectX renderer to restrict text
to be clipped within the boundaries of the row.

PR Checklist

Detailed Description of the Pull Request / Additional comments

For whatever reason, some of these shade glyphs near U+2591 tend to
extend way above the height of where we expect they should. This didn't
look like a problem in conhost because it clipped every draw inside the
bounds. This therefore applies the same clip logic as people don't
really expect text to pour out of the box.

It could, theoretically, get us into trouble later should someone
attempt zalgo text. But doing zalgo text is more of a silliness that
varies in behavior across rendering platforms anyway.

Validation Steps Performed

  • Ran the old conhost GDI renderer and observed
  • Ran the new Terminal DX renderer and observed
  • Made the code change
  • Observed that the height and approximate display characteristics of
    the U+2591 shade and neighboring characters now matches with the conhost
    GDI style to stay within its lane.

🔄 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/4671 **Author:** [@miniksa](https://github.com/miniksa) **Created:** 2/21/2020 **Status:** ✅ Merged **Merged:** 2/21/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/miniksa/draw3` --- ### 📝 Commits (3) - [`6a4347e`](https://github.com/microsoft/terminal/commit/6a4347ea71af6cb35de7e4026812fa5b1b09a584) Clip text to within the row we expect. - [`dc419da`](https://github.com/microsoft/terminal/commit/dc419daf49eff04ff26300499960ca61de2497fe) noexcept!!!! - [`94d0ec8`](https://github.com/microsoft/terminal/commit/94d0ec8a5c19241abb2cbd55c1b9bb5c7f1c98ee) Merge branch 'master' into dev/miniksa/draw3 ### 📊 Changes **2 files changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `OpenConsole.sln` (+6 -0) 📝 `src/renderer/dx/CustomTextRenderer.cpp` (+7 -0) </details> ### 📄 Description ## Summary of the Pull Request Adjusts `DrawGlyphRun` method inside DirectX renderer to restrict text to be clipped within the boundaries of the row. ## PR Checklist * [x] Closes #1703 * [x] I work here. * [x] No tests. * [x] No docs. * [x] I am core contributor. ## Detailed Description of the Pull Request / Additional comments For whatever reason, some of these shade glyphs near U+2591 tend to extend way above the height of where we expect they should. This didn't look like a problem in conhost because it clipped every draw inside the bounds. This therefore applies the same clip logic as people don't really expect text to pour out of the box. It could, theoretically, get us into trouble later should someone attempt zalgo text. But doing zalgo text is more of a silliness that varies in behavior across rendering platforms anyway. ## Validation Steps Performed - Ran the old conhost GDI renderer and observed - Ran the new Terminal DX renderer and observed - Made the code change - Observed that the height and approximate display characteristics of the U+2591 shade and neighboring characters now matches with the conhost GDI style to stay within its lane. --- <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:12:24 +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#25882