Block graphics and line drawing characters not rendered with AtlasEgine #18545

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

Originally created by @rbanffy on GitHub (Sep 26, 2022).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version

1.16.2641.0

Windows build number

10.0.19042.2006

Other Software

This was seen with both Linux under WSL and Powershell on Windows. Line drawing and some block graphics are not rendered (or, at least, do not appear on the window).

PowerShell under AtlasEngine:
image

PowerShell under the previous renderer:
image

Same happens (unsurprisingly) under WSL with AtlasEngine:
Capture6

and without:
Capture7

Common line drawing and semi-graphic symbols are not rendered, but others, such as the 1FB00 range (which are relatively new, from Unicode 13) are rendered correctly (in our case, because the font used (https://github.com/rbanffy/3270font) has them defined.

The others, seen missing in the lines "Misc glyphs" and "Vttest's ladder", left to right filled boxes and the middle step of the ladder, are also defined in the font..

Steps to reproduce

Easiest way: install zsh and ohmyzsh on a Linux WSL instance and select the "agnoster" theme, which contains some of the characters that aren't rendered.

Hard way: check-out https://github.com/rbanffy/3270font, open a Windows Terminal and run the test_font_rendering.py program.

Expected Behavior

All glyphs should render

Capture7

Actual Behavior

Line drawing and some block graphics characters don't render. Window height is also slightly shorter.

Capture6

Originally created by @rbanffy on GitHub (Sep 26, 2022). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version 1.16.2641.0 ### Windows build number 10.0.19042.2006 ### Other Software This was seen with both Linux under WSL and Powershell on Windows. Line drawing and some block graphics are not rendered (or, at least, do not appear on the window). PowerShell under AtlasEngine: ![image](https://user-images.githubusercontent.com/184714/192295976-de4e7351-e581-4d51-8ed8-12fe27ed17f4.png) PowerShell under the previous renderer: ![image](https://user-images.githubusercontent.com/184714/192296219-15789752-b5d0-4c56-88bf-ca86deaf87db.png) Same happens (unsurprisingly) under WSL with AtlasEngine: ![Capture6](https://user-images.githubusercontent.com/184714/192296344-831f39a1-5d6c-44bc-82c2-b283fe9d7988.PNG) and without: ![Capture7](https://user-images.githubusercontent.com/184714/192296427-252561a6-e6bf-4582-9518-408c7a273c3f.PNG) Common line drawing and semi-graphic symbols are not rendered, but others, such as the 1FB00 range (which are relatively new, from Unicode 13) are rendered correctly (in our case, because the font used (https://github.com/rbanffy/3270font) has them defined. The others, seen missing in the lines "Misc glyphs" and "Vttest's ladder", left to right filled boxes and the middle step of the ladder, are also defined in the font.. ### Steps to reproduce Easiest way: install zsh and ohmyzsh on a Linux WSL instance and select the "agnoster" theme, which contains some of the characters that aren't rendered. Hard way: check-out https://github.com/rbanffy/3270font, open a Windows Terminal and run the `test_font_rendering.py` program. ### Expected Behavior All glyphs should render ![Capture7](https://user-images.githubusercontent.com/184714/192298383-e4375ea3-9d58-4b11-a15d-a3b3dd7fce97.PNG) ### Actual Behavior Line drawing and some block graphics characters don't render. Window height is also slightly shorter. ![Capture6](https://user-images.githubusercontent.com/184714/192298468-cced74c9-52b5-4449-a0a8-39ffe44ecf9d.PNG)
Author
Owner

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

BTW if anyone on the team is curious how this looks like with dev/lhecker/atlas-engine-remastered (text decorations aren't implemented yet):
image

It works! Neat. But it'll be broken as well once it implements "perfectly sized" block characters like the current AtlasEngine.

@lhecker commented on GitHub (Sep 27, 2022): BTW if anyone on the team is curious how this looks like with `dev/lhecker/atlas-engine-remastered` (text decorations aren't implemented yet): ![image](https://user-images.githubusercontent.com/2256941/192406225-019ed92b-0efe-4ade-8dce-b699e9de8a77.png) It works! Neat. But it'll be broken as well once it implements "perfectly sized" block characters like the current AtlasEngine.
Author
Owner

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

@rbanffy I've found in your changelog that you set the vertical advance to 0 in v2.0.4.
Unfortunately AtlasEngine uses the vertical advance / advance height to figure out the design height of a glyph, which according to the OpenType spec is:

advance_height - bottom_side_bearing - top_side_bearing

It uses this information so that it can scale box glyphs to perfectly fill the terminal's cells without leaving gaps. My understanding is that an advance height of 0 is a valid value and the text renderer honors this by drawing the glyph at a height of 0. I would suggest to not emit an vhea / vmtx table at all, which is what Cascadia Code does for instance. (A screenshot of FontForge:)

image

Alternatively you could set the advance height to a valid value. Would that work for you?

@lhecker commented on GitHub (Sep 27, 2022): @rbanffy I've found in your changelog that you set the vertical advance to 0 in v2.0.4. Unfortunately AtlasEngine uses the vertical advance / advance height to figure out the design height of a glyph, which according to the OpenType spec is: ``` advance_height - bottom_side_bearing - top_side_bearing ``` It uses this information so that it can scale box glyphs to perfectly fill the terminal's cells without leaving gaps. My understanding is that an advance height of 0 is a valid value and the text renderer honors this by drawing the glyph at a height of 0. I would suggest to not emit an `vhea` / `vmtx` table at all, which is what Cascadia Code does for instance. (A screenshot of FontForge:) ![image](https://user-images.githubusercontent.com/2256941/192409097-b18586b6-12d3-4d7b-893d-b591befbd1da.png) Alternatively you could set the advance height to a valid value. Would that work for you?
Author
Owner

@rbanffy commented on GitHub (Sep 27, 2022):

Thanks, @lhecker. I'll check those values and roll out a fix if they work.

The` issue, however, is not only present in this font. I used it because it has some of the missing glyphs defined.

Never mind that. I couldn't reproduce the problem on the reference machine. Removing the HasVMetrics line from the .sfd file solved the issue. I'll test in other OSs and terminals to make sure nothing blows up.

There's another thing, with composing glyphs, that don't compose in neither renderer, but that's for another ticket (if there isn't one already).

image

As you described, @lhecker, the renderer is behaving correctly and rendering the glyph with the invalid value the font specified. Unless you want the renderer to try to guess an override value that makes sense, I believe this can be closed.

@rbanffy commented on GitHub (Sep 27, 2022): Thanks, @lhecker. I'll check those values and roll out a fix if they work. ~~The` issue, however, is not only present in this font. I used it because it has some of the missing glyphs defined.~~ Never mind that. I couldn't reproduce the problem on the reference machine. Removing the HasVMetrics line from the .sfd file solved the issue. I'll test in other OSs and terminals to make sure nothing blows up. There's another thing, with composing glyphs, that don't compose in neither renderer, but that's for another ticket (if there isn't one already). ![image](https://user-images.githubusercontent.com/184714/192531209-ae33b146-b9a2-4ea2-9f1f-6196320b4ae6.png) As you described, @lhecker, the renderer is behaving correctly and rendering the glyph with the invalid value the font specified. Unless you want the renderer to try to guess an override value that makes sense, I believe this can be closed.
Author
Owner

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

There's another thing, with composing glyphs, that don't compose in neither renderer, but that's for another ticket (if there isn't one already).

That's a combination of 2 problems:

  • AtlasEngine splitting all text into simple/complex, even though complex text might draw over preceding cells (i.e. complex glyphs can basically draw anywhere, which is the case for that U+20DC character).
    This is solved by the new-new text rendering approach I'm currently working on.
  • Our text buffer assigning each codepoint its own cell. This is tracked by #8000.

As you described, @lhecker, the renderer is behaving correctly and rendering the glyph with the invalid value the font specified. Unless you want the renderer to try to guess an override value that makes sense, I believe this can be closed.

I think I'll do that in case another issue like this is opened. I'd generally prefer if no compatibility logic needs to be maintained indefinitely, unless absolutely needed. I'm glad to hear that removing HasVMetrics seems to have fixed this issue. I'll close the issue now, but please feel free to reopen it at any time if you notice that this issue has popped up again or something in this regard isn't working right. 🙂

@lhecker commented on GitHub (Sep 27, 2022): > There's another thing, with composing glyphs, that don't compose in neither renderer, but that's for another ticket (if there isn't one already). That's a combination of 2 problems: * AtlasEngine splitting all text into simple/complex, even though complex text might draw over preceding cells (i.e. complex glyphs can basically draw anywhere, which is the case for that U+20DC character). This is solved by the new-new text rendering approach I'm currently working on. * Our text buffer assigning each codepoint its own cell. This is tracked by #8000. > As you described, @lhecker, the renderer is behaving correctly and rendering the glyph with the invalid value the font specified. Unless you want the renderer to try to guess an override value that makes sense, I believe this can be closed. I think I'll do that in case another issue like this is opened. I'd generally prefer if no compatibility logic needs to be maintained indefinitely, unless absolutely needed. I'm glad to hear that removing `HasVMetrics` seems to have fixed this issue. I'll close the issue now, but please feel free to reopen it at any time if you notice that this issue has popped up again or something in this regard isn't working right. 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18545