terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Gaps between block elements when using Direct2D

Open o-sdn-o opened this issue 1 year ago • 7 comments

Windows Terminal version

Current main

Windows build number

10.0.19045.4291

Other Software

No response

Steps to reproduce

  • System-wide scale and layout (display settings): 100%

  • WT PowerShell profile settings:

    • Font face: "Cascadia Mono"
    • Font size: "12.2"
    • Line height: "1.2"
    • Font weight: "Normal"
    • Builtin Glyphs: "On"
    • image
    • Graphics API: "Direct2D"
    • image
  • Type "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄" at the pwsh prompt

    "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄"
    

Expected Behavior

Block elements are fused into a solid bar.

Actual Behavior

image

o-sdn-o avatar May 09 '24 09:05 o-sdn-o

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar May 09 '24 09:05 github-actions[bot]

It seems that despite the fact that Direct2D provides graphics acceleration, builtin glyphs are not activated in this mode. If this is intended, then it would probably be worth rephrasing the "Builtin Glyphs On/Off" option description, specifically indicating the need for "Direct3D".

https://github.com/microsoft/terminal/blob/49e4eea60f737b46b8aeda505f4693df8a9d44a6/src/renderer/atlas/AtlasEngine.h#L130-L140

https://github.com/microsoft/terminal/blob/49e4eea60f737b46b8aeda505f4693df8a9d44a6/src/renderer/atlas/AtlasEngine.r.cpp#L281-L299

o-sdn-o avatar May 09 '24 11:05 o-sdn-o

Right... I wrote that "This feature only works when GPU Acceleration is available." text before I added the Graphics API setting (at which time that statement was mostly true), but now that doesn't work anymore of course. The question is, which one is best?

  • This feature is only available when the Direct3D Graphics API is used.
  • This feature is unavailable when the Direct2D Graphics API is used.
  • This feature is unavailable when Direct2D is used for text rendering.
  • something else?

lhecker avatar May 10 '24 00:05 lhecker

It seems to me that since the "Builtin Glyphs" option is completely dependent on the "Graphics API" option, it makes sense to make it a sub-option of the "Graphics API" option that becomes available when "Direct3D 11" is selected.

I don't think the "Builtin Glyphs" option should necessarily be per-profile, as a global option it is quite appropriate for me.

o-sdn-o avatar May 10 '24 04:05 o-sdn-o

Oof that's a tricky one. Cause I'd expect it on the appearance page, but the renderer option doesn't really need to be on the appearance page. That's definitely an advance option.

Maybe when d2d is enabled, we could disable the builtin glyphs menu item, and add a message box with a deeplink to the advanced page... but that sounds overly complicated.

I guess making it a sub-item of the renderer entry is probably the most elegant solution

zadjii-msft avatar May 10 '24 11:05 zadjii-msft

I suspect most people will keep it on the default option "Automatic", in which case Direct2D is only used if the system lacks a GPU (or it's a very old GPU, but that's fairly rare nowadays). This is commonly the case when using RDP to remote into a server or VM.

The reason I put the "Builtin Glyphs" option on the profile appearance page is because the font setting is per-profile and so I guess the builtin-glyph option (which overwrites glyphs in the font) should be per-profile too.

The problem is that the settings UI doesn't really have any idea about this "Automatic" API choice. It could be hooked up of course, but I think that's somewhat annoying to do (different DLLs, with different components, on different threads, and it may change at any given moment = needs event hooks). The upside on the other hand is potentially fairly small, because >95% of users are using the Direct3D renderer anyway.

Unless Dustin/Mike think about this differently, I think I'll only change the sub-text on the setting for now. If more people run into this issue (even just a few), I'll try to improve it by hooking up the render thread to the settings UI, or something similar.

lhecker avatar May 10 '24 13:05 lhecker

I'd love those specific feature toggles to get grayed out when the feature is unavailable for any reason. We could give additional context as to why they're grayed out with a ⓘ button treatment to the grayed-out toggles.

image

tusharsnx avatar May 10 '24 14:05 tusharsnx

Unanimous team consent: It's just easier to add builtin glyph support to d2d rather than finagle the SUI to support this

zadjii-msft avatar May 13 '24 20:05 zadjii-msft