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

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

Closed
rbanffy opened this issue Sep 26, 2022 · 4 comments
Closed
Assignees
Labels
Area-AtlasEngine Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-External For issues that are outside this codebase

Comments

@rbanffy
Copy link

rbanffy commented Sep 26, 2022

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

@rbanffy rbanffy added 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 labels Sep 26, 2022
@lhecker
Copy link
Member

lhecker commented 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 lhecker self-assigned this Sep 27, 2022
@lhecker
Copy link
Member

lhecker commented 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 lhecker added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Sep 27, 2022
@rbanffy
Copy link
Author

rbanffy commented 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.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 27, 2022
@lhecker
Copy link
Member

lhecker commented 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 [Epic] Text Buffer rewrite  #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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AtlasEngine Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-External For issues that are outside this codebase
Projects
None yet
Development

No branches or pull requests

2 participants