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

Font features break line drawing #13662

Closed
registerGen opened this issue Aug 3, 2022 · 6 comments · Fixed by #14959
Closed

Font features break line drawing #13662

registerGen opened this issue Aug 3, 2022 · 6 comments · Fixed by #14959
Assignees
Labels
Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal.

Comments

@registerGen
Copy link

Windows Terminal version

1.15.2003.0

Windows build number

10.0.22000.0

Other Software

No response

Steps to reproduce

Modify the config file as below:

image

Expected Behavior

Unicode isn't broken.

image

Actual Behavior

image

@registerGen registerGen added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Aug 3, 2022
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Aug 3, 2022
@registerGen
Copy link
Author

The font can be downloaded from here.

@zadjii-msft zadjii-msft changed the title Font features break unicode Font features break line drawing Aug 3, 2022
@zadjii-msft
Copy link
Member

Huh. I wonder why stylistic set 0 would break line drawing like that. Maybe we're just disabling the scaling for line drawing characters whenever a stylistic set is picked? Or maybe ss01 in Delugia has the line drawing characters specifically drawn to avoid merging them across lines.

I wonder if this repros for the Cascadia family, or any other fonts...

@zadjii-msft zadjii-msft added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Area-Fonts Related to the font Product-Terminal The new Windows Terminal. labels Aug 3, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Aug 3, 2022
@registerGen
Copy link
Author

I tried many stylistic sets of Cascadia Code and Delugia, this all repro-ed.

But if Fira Code is used, this won't happen.

@lhecker
Copy link
Member

lhecker commented Aug 6, 2022

Unless I'm testing incorrectly, this issue doesn't seem to occur with AtlasEngine, after #13549.

@registerGen
Copy link
Author

Well this issue still occurs in the latest release yesterday, but the "gap" is much unnoticeable now.

image

@lhecker lhecker self-assigned this Sep 14, 2022
@lhecker
Copy link
Member

lhecker commented Sep 14, 2022

I'm glad it's much better! Very slight gaps are something I've also noticed myself for fonts that aren't particularly pixel-perfect, but I haven't had time to investigate it further yet. This is the worst that I could produce myself (magnified 400%):
image

Yours seem to be the exact same kind, which means I can reproduce and thus hopefully fix it.

@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Mar 6, 2023
microsoft-github-policy-service bot pushed a commit that referenced this issue Apr 26, 2023
This is practically a from scratch rewrite of AtlasEngine.

The initial approach used a very classic monospace text renderer, where
the viewport is subdivided into cells and each cell is assigned one
glyph texture, just like how real terminals used to work.
While we knew that it would have problems with overly large glyphs,
like those found in less often used languages, we didn't expect the
absolutely massive number of fonts that this approach would break.
For one, the assumption that monospace fonts are actually mostly
monospace has turned out to be a complete lie and we can't force users
to use better designed fonts. But more importantly, we can't just
design an entire Unicode fallback font collection from scratch where
every major glyph is monospace either. This is especially problematic
for vertical overhangs which are extremely difficult to handle in a
way that outperforms the much simpler alternative approach:
Just implementing a bog-standard, modern, quad-based text renderer.

Such an approach is both, less code and runs faster due to a less
complex CPU-side. The text shaping engine (in our case DirectWrite)
has to resolve text into glyph indices anyways, so using them directly
for text rendering allows reduces the effort of turning it back into
text ranges and hashing those. It's memory overhead is also reduced,
because we can now break up long ligatures into their individual glyphs.
Especially on AMD APUs I found this approach to run much faster.

A list of issues I think are either obsolete (and could be closed)
or resolved with this PR in combination with #14255:

Closes #6864
Closes #6974
Closes #8993
Closes #9940
Closes #10128
Closes #12537
Closes #13064
Closes #13527
Closes #13662
Closes #13700
Closes #13989
Closes #14022
Closes #14057
Closes #14094
Closes #14098
Closes #14117
Closes #14533
Closes #14877

## PR Checklist
* Enabling software rendering enables D2D mode ✅
* Both D2D and D3D:
  * Background appears correctly ✅✅
  * Text appears correctly
    * Cascadia Code Regular ✅✅
    * Cascadia Code Bold ✅✅
    * Cascadia Code Italic ✅✅
    * Cascadia Code block chars leave (almost) no gaps ✅✅
    * Terminus TTF at 13.5pt leaves no gaps between block chars ✅✅
    * ``"`u{e0b2}`u{e0b0}"`` in Fira Code Nerd Font forms a square ✅✅
  * Cursor appears correctly
    * Legacy small/medium/large ✅✅
    * Vertical bar ✅✅
    * Underscore ✅✅
    * Empty box ✅✅
    * Full box ✅✅
    * Double underscore ✅✅
  * Changing the cursor color works ✅✅
  * Selection appears correctly ✅✅
  * Scrolling in various manners always renders correctly ✅✅
  * Changing the text antialising mode works ✅✅
  * Semi-transparent backgrounds work ✅✅
  * Scroll-zooming the font size works ✅✅
  * Double-size characters work ✅✅
  * Resizing while text is printing works ✅✅
  * DWM `+Heatmap_ShowDirtyRegions` shows that only the cursor
    region is dirty when it's blinking ✅✅
* D2D
  * Margins are filled with background color ❌
    They're filled with the neighboring's cell background color for
    convenience, as D2D doesn't support `D3D11_TEXTURE_ADDRESS_BORDER`
* D3D
  * Margins are filled with background color ✅
  * Soft fonts work ✅
  * Custom shaders enable continous redraw if time constant is used ✅
  * Retro shader appears correctly ✅
  * Resizing while a custom shader is running works ✅
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants