[PR #5734] [MERGED] Fix RTL regression (fixes #4779) #26438

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5734
Author: @schorrm
Created: 5/4/2020
Status: Merged
Merged: 5/4/2020
Merged by: @undefined

Base: masterHead: master


📝 Commits (3)

📊 Changes

1 file changed (+10 additions, -4 deletions)

View changed files

📝 src/renderer/dx/CustomTextRenderer.cpp (+10 -4)

📄 Description

Summary of the Pull Request

This fixes the RTL regression caused in #4747. We create the rectangle taking the direction (through the BiDi Level) into account, and then the rendering works again. The GlyphRun shaping could still probably use some work to be a polished thingy, and there are still issues with RTL getting chopped up a lot when there's font fallback going on, but this fixes the regression, and it's now functional again.

References

#4779 #4747

PR Checklist

  • Closes WSL home direcotry... (#4779)
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

The baseline is actually direction dependent. So when it was being initialized, the unconditional baseline as left broke it, setting the box off to right of the text. We just check if the GlyphRun->bidiLevel is set, and if so, we adjust it so that the baseline lines up with the right, not with the left.

Validation Steps Performed

image


🔄 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/5734 **Author:** [@schorrm](https://github.com/schorrm) **Created:** 5/4/2020 **Status:** ✅ Merged **Merged:** 5/4/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`8cf1603`](https://github.com/microsoft/terminal/commit/8cf160311c16a42f7b2e12b4df83e8772cb3ea38) Fix RTL regression (fixes #4779) - [`6f17240`](https://github.com/microsoft/terminal/commit/6f17240bba2509203a094f60ef2380062f81474f) Apply suggestions from code review - [`99fdc86`](https://github.com/microsoft/terminal/commit/99fdc86e0bf790b5cbd8035185809a9992622d2d) Apply suggestions from code review ### 📊 Changes **1 file changed** (+10 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/dx/CustomTextRenderer.cpp` (+10 -4) </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request This fixes the RTL regression caused in #4747. We create the rectangle taking the direction (through the BiDi Level) into account, and then the rendering works again. The GlyphRun shaping could still probably use some work to be a polished thingy, and there are still issues with RTL getting chopped up a lot when there's font fallback going on, but this fixes the regression, and it's now functional again. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References #4779 #4747 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #4779 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments The baseline is actually direction dependent. So when it was being initialized, the unconditional baseline as left broke it, setting the box off to right of the text. We just check if the `GlyphRun->bidiLevel` is set, and if so, we adjust it so that the baseline lines up with the right, not with the left. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed ![image](https://user-images.githubusercontent.com/16987694/80968891-681cbc00-8e21-11ea-9e5c-9b7cf6d78d53.png) --- <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:16:07 +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#26438