Pass through line rendition attributes over conpty#13933
Conversation
|
It's unfortunate that we're keen on replacing the DX engine here! Thanks for doing all of this. @lhecker we should consider how we'll represent glyphs in the atlas that take up more vertical space than one row (!) |
I haven't really looked at the Atlas renderer, because I assumed I would be a bit out of my depth there, but I had hoped that the line-rendition support I added to the DX renderer could be ported fairly easily by someone that knew what they were doing. And I wouldn't think you'd need to do anything special in the atlas if you're taking the same approach - it's just a transform that's applied when each line is rendered. |
Possibly. The core conceit of atlas is that we rasterize each My gut tells me that we'll want to do the transform in the early phase when we're producing the glyph texture, and somehow mark that glyph as requiring multiple cells much like we would if it were multi-width. Hmm... |
Yeah, I just realised that after I posted my reply. But I'd personally be perfectly happy with that as a solution. It's certainly better than nothing. Obviously this is just me, but right now most of my use cases for double-size text involve soft fonts, which have a fixed resolution anyway, so they're always going to be scaled. On that note, I should mention that I have a plan for soft font support over conpty which I'd like to create a PR for at some point. And again I'm hoping someone smarter than me will be able to port the DX implementation to Atlas so we can have soft fonts working there too. |
Thinking about this some more, double-height glyphs may not actually be a problem, because you only ever render one half of the glyph at a time (i.e. the top is rendered independently of the bottom). So the only additional functionality I think you might need would be some extension to the ID to distinguish between variants of a particular character (single width, double-width, double-height top, double-height bottom). And this is assuming the atlas can already handle glyphs that are multiple cell widths, and not just double width, because any existing double width character, would now potentially be quadruple width. |
|
Ah, right! It's actually just the tops and bottoms of the glyphs cleverly rendered next to eachother. We do have support for glyphs that are >2 cells in width today; that's how we ended up implementing ligatures! That does mean that Cascadia's "infinite arrow" ligatures are, ah, expensive in terms of glyph space... but what can you do? |
|
Yep I'll gladly port everything over to AtlasEngine if you don't feel comfortable with it. Now that the new engine is sorta useable, I'm currently in the process of cleaning up that project to be better structured and easier to deal with. For context:
I'm planning to add double-height glyphs as a flag to |
Just FYI, that's not how double-height rendition works. The top and bottom are completely independent and don't necessarily match. So you can have the top half of the letters So in the same way that you have variants of each character for italic and bold, etc. I'd assume you'd also have double-width, double-height top, and double-height bottom variants. Then when rendering a line with the |
DHowett
left a comment
There was a problem hiding this comment.
Thanks! Now that 1.16 has branched, we're clear to land new fun stuff.
|
Hello @DHowett! Because this pull request has the 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 (
|
|
🎉 Handy links: |


This PR introduces a mechanism for passing through line rendition
attributes to the conpty client, so we can support double-width and
double-height text in Windows Terminal.
Line renditions were first implemented in conhost (with the GDI
renderer) in PR #8664, and were implemented in the DX renderer in PR
#13102.
By default this won't add any additional overhead to the conpty output,
but as soon as there is any usage of double-size text, we switch to a
mode in which every line output will be prefixed with a line rendition
sequence. This is to ensure that the line attributes in the client
terminal are always in sync with the host.
Since this does add some overhead to the conpty output, we'd prefer not
to remain in this mode longer than necessary. So whenever there is a
full repaint of the entire viewport, we check to see if all of the lines
are single-width. If that is the case, we can then safely skip the line
rendition sequences in future updates.
One other small optimization is when the conpty update is only writing
out a single character (this is something we already check for). When
that is the case, we can safely skip the line rendition prefix, because
a single character update should never include a change of the line
rendition.
Validation Steps Performed
I've manually tested that Windows Terminal now passes the double-size
tests in Vttest, and also confirmed various edge cases are working
correctly in my own double-size tests.
Closes #11595