Skip to content
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

Clip text to within the row we expect #4671

Merged
3 commits merged into from
Feb 21, 2020
Merged

Clip text to within the row we expect #4671

3 commits merged into from
Feb 21, 2020

Conversation

miniksa
Copy link
Member

@miniksa miniksa commented Feb 21, 2020

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.

@miniksa miniksa added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. labels Feb 21, 2020
@miniksa miniksa self-assigned this Feb 21, 2020
@miniksa miniksa added the AutoMerge Marked for automatic merge by the bot when requirements are met label Feb 21, 2020
@ghost
Copy link

ghost commented Feb 21, 2020

Hello @miniksa!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 7 hours 44 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@miniksa
Copy link
Member Author

miniksa commented Feb 21, 2020

@msftbot merge in 1 minute

@ghost
Copy link

ghost commented Feb 21, 2020

Hello @miniksa!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Fri, 21 Feb 2020 00:24:12 GMT, which is in 1 minute

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit 671110c into master Feb 21, 2020
@ghost ghost deleted the dev/miniksa/draw3 branch February 21, 2020 00:57
DHowett-MSFT pushed a commit that referenced this pull request Feb 28, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Certain characters taking up more than one line in height
3 participants