-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed DirectX RTL text issue where it'd be over other text / offscreen #1873
Conversation
…ly over existing text
Just a note: the boxes in the prompt aren't a problem, they're just because Courier New doesn't support powerline. |
This reverts commit 3535bc3.
Honestly, this fix seems reasonable to me, with the caveat that RTL definitely still won't work right just better. We'll need a comprehensive design on the right way to handle RTL in the future, but this seems to me like it'll make |
Pretty much, it'll make basic input / output with RTL in general work tolerably. It's not just |
Yeah, this is righteous for that reason. Let's get it cleaned up and merged! |
Co-Authored-By: Michael Niksa <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thank you. Just get the code formatter check happy and I think this is good to go.
Format check is now pleased, praised be the Clang-Format VStudio add-on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is straightforward! Thanks for working on it.
microsoft#1873) This is a partial fix of microsoft#538 . This does *not* change the Console RTL behavior, it does however fix an issue in the rendering. Basically, DirectX expects the origin to be on the right if it is going to draw RTL text. This PR is a simple fix for that. Rather than draw with the left point and then move the origin rightwards, we check if it's RTL, if so, we move the origin rightwards immediately, and then draw. LTR rendering is unchanged. This doesn't fix underlying questions of RTL handling in the console. It's just a render bugfix. However, this render bugfix should still be a big help and solve the low-hanging issues. ## Validation Steps Performed Behavior was tested. No changes were made to underlying console. Three sample cases: 1. RTL text input Before: ![image](https://user-images.githubusercontent.com/16987694/60816422-6737e100-a1a2-11e9-9e14-c62323fd5b02.png) After: ![image](https://user-images.githubusercontent.com/16987694/60816395-5ab38880-a1a2-11e9-9f0a-17b03f8268ce.png) 2. Hebrew Output Before (the Hebrew text is all being drawn to the left of the screen, hence the phantom text): ![image](https://user-images.githubusercontent.com/16987694/60816527-93ebf880-a1a2-11e9-9ba3-d3ebb46cc404.png) After: ![image](https://user-images.githubusercontent.com/16987694/60816456-77e85700-a1a2-11e9-9783-9e69849f026d.png) 3. Mixed Output So, this is where this is partial. Due to inherent stuff with RTL behavior, it doesn't look perfect. But the rendering itself is no longer at fault. Before: ![image](https://user-images.githubusercontent.com/16987694/60816593-b5e57b00-a1a2-11e9-82be-0fcabb80f7d4.png) After: ![image](https://user-images.githubusercontent.com/16987694/60816607-bb42c580-a1a2-11e9-849a-12846ec4d5c0.png)
🎉 Handy links: |
This is a partial fix of #538 . This does not change the Console RTL behavior, it does however fix an issue in the rendering. Basically, DirectX expects the origin to be on the right if it is going to draw RTL text. This PR is a simple fix for that. Rather than draw with the left point and then move the origin rightwards, we check if it's RTL, if so, we move the origin rightwards immediately, and then draw. LTR rendering is unchanged.
This doesn't fix underlying questions of RTL handling in the console. It's just a render bugfix. However, this render bugfix should still be a big help and solve the low-hanging issues.
PR Checklist
Validation Steps Performed
Behavior was tested. No changes were made to underlying console.
Three sample cases:
Before:
After:
Before (the Hebrew text is all being drawn to the left of the screen, hence the phantom text):
After:
So, this is where this is partial. Due to inherent stuff with RTL behavior, it doesn't look perfect. But the rendering itself is no longer at fault.
Before:
After: