Block Elements not rendering correctly with AtlasEngine enabled #18558

Closed
opened 2026-01-31 06:17:36 +00:00 by claunia · 5 comments
Owner

Originally created by @Dan-Albrecht on GitHub (Sep 28, 2022).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version

1.16.2642.0

Windows build number

10.0.22000.0

Other Software

No response

Steps to reproduce

In PowerShell with the default Cascadia Mono font, run: Write-Host "`u{2595}`u{2594}`n`u{2595}`u{2581}"

Expected Behavior

In version 1.15.2525.0 or 1.16.2642.0 with AtlasEngine disabled:
image

Actual Behavior

The top is cut off:
image

Originally created by @Dan-Albrecht on GitHub (Sep 28, 2022). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version 1.16.2642.0 ### Windows build number 10.0.22000.0 ### Other Software _No response_ ### Steps to reproduce In PowerShell with the default Cascadia Mono font, run: ``Write-Host "`u{2595}`u{2594}`n`u{2595}`u{2581}"`` ### Expected Behavior In version 1.15.2525.0 or 1.16.2642.0 with AtlasEngine disabled: <img width="401" alt="image" src="https://user-images.githubusercontent.com/7351388/192859338-6757f670-6bb3-4993-a349-e93f466929bd.png"> ### Actual Behavior The top is cut off: <img width="404" alt="image" src="https://user-images.githubusercontent.com/7351388/192859478-619f29e5-f8da-4633-a567-70b9c12ce3a1.png">
Author
Owner

@Dan-Albrecht commented on GitHub (Sep 28, 2022):

Might be same underlying issue as #14022

@Dan-Albrecht commented on GitHub (Sep 28, 2022): Might be same underlying issue as #14022
Author
Owner

@lhecker commented on GitHub (Sep 28, 2022):

Note to self/team: The block character scaling technique in _getCachedGlyphLayout is inherently flawed as I realized yesterday. What it does is:

  • Get the glyph's advance width/height
  • Resize to match the cell size

This doesn't work with fonts that use side bearings for block characters. A better way would be to assume that all fonts that define any block character also probably define the U+2588 Full Block character. That way we can do:

  • Get the font's full block glyph
  • Get the actual size including side bearings of the full block
  • Resize to match the cell size but apply the scale to the given glyph instead
@lhecker commented on GitHub (Sep 28, 2022): Note to self/team: The block character scaling technique in `_getCachedGlyphLayout` is inherently flawed as I realized yesterday. What it does is: * Get the glyph's advance width/height * Resize to match the cell size This doesn't work with fonts that use side bearings for block characters. A better way would be to assume that all fonts that define any block character also probably define the U+2588 Full Block character. That way we can do: * Get the font's full block glyph * Get the actual size including side bearings of the full block * Resize to match the cell size but apply the scale to the given glyph instead
Author
Owner

@Dan-Albrecht commented on GitHub (Oct 19, 2022):

@lhecker, while I agree your change is correctly called righer-er, I think we need a even-more-righter followup as my issue is not resolved. I'm built from source at bfd480b. U+2594 seems to be causing problems and doesn't seem to be in the torture test.

Write-Host "`u{2595}`u{2594}`n`u{2595}`u{2581}"
Write-Host "`nXXX`n`u{2594}`nXXX`n"

Atlas Off:
image

Atlas On:
image

@Dan-Albrecht commented on GitHub (Oct 19, 2022): @lhecker, while I agree your change is correctly called `righer-er`, I think we need a `even-more-righter` followup as my issue is not resolved. I'm built from source at bfd480b. `U+2594` seems to be causing problems and doesn't seem to be in the torture test. ``` Write-Host "`u{2595}`u{2594}`n`u{2595}`u{2581}" Write-Host "`nXXX`n`u{2594}`nXXX`n" ``` Atlas Off: <img width="570" alt="image" src="https://user-images.githubusercontent.com/7351388/196575674-384be401-e5c1-4692-8ab4-1f4f160adab7.png"> Atlas On: <img width="574" alt="image" src="https://user-images.githubusercontent.com/7351388/196575339-58596b72-7912-4691-bf86-9072318616eb.png">
Author
Owner

@lhecker commented on GitHub (Oct 19, 2022):

@Dan-Albrecht Somewhat "late" in the development cycle I changed the algorithm so that it doesn't touch characters found in the given user font. My intention was that glyphs in the user's font remain untouched. If we don't do that this leads to other display issues (incorrect alginment, etc.). U+2594 is part of Cascadia Mono and so it won't get "adjusted" to fit the cell and I forgot to re-test it as part of the PR, focusing only on Consolas, etc.

Not sure what to do about this issue now: I should try to see if it helps to round up ascend/descend after all. But I'm not certain we can merge that - people have complained in the past when I did that. Otherwise we'll either have to wait for the next big AtlasEngine update which brings support for overlapping glyphs, or support for line height adjustments (which I'm submitting tomorrow).

@lhecker commented on GitHub (Oct 19, 2022): @Dan-Albrecht Somewhat "late" in the development cycle I changed the algorithm so that it doesn't touch characters found in the given user font. My intention was that glyphs in the user's font remain untouched. If we don't do that this leads to other display issues (incorrect alginment, etc.). U+2594 is part of Cascadia Mono and so it won't get "adjusted" to fit the cell and I forgot to re-test it as part of the PR, focusing only on Consolas, etc. Not sure what to do about this issue now: I should try to see if it helps to round up ascend/descend after all. But I'm not certain we can merge that - people have complained in the past when I did that. Otherwise we'll either have to wait for the next big AtlasEngine update which brings support for overlapping glyphs, or support for line height adjustments (which I'm submitting tomorrow).
Author
Owner

@ghost commented on GitHub (Dec 14, 2022):

:tada:This issue was addressed in #14099, which has now been successfully released as Windows Terminal Preview v1.16.3463.0 and v1.16.3464.0.🎉

Handy links:

@ghost commented on GitHub (Dec 14, 2022): :tada:This issue was addressed in #14099, which has now been successfully released as `Windows Terminal Preview v1.16.3463.0 and v1.16.3464.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.16.3464.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18558