terminal/src/tools/vtapp
James Holderness 158a1708a6
Render the SGR "underlined" attribute in the style of the font (#7148)
This PR updates the rendering of the _underlined_ graphic rendition
attribute, using the style specified in the active font, instead of just
reusing the grid line at the bottom of the character cell.

* Support for drawing the correct underline effect in the grid line
  renderer was added in #7107.

There was already an `ExtendedAttributes` flag defined for the
underlined state, but I needed to update the `SetUnderlined` and
`IsUnderlined` methods in the `TextAttribute`  class to use that flag
now in place of the legacy `LVB_UNDERSCORE` attribute. This enables
underlines set via a VT sequence to be tracked separately from
`LVB_UNDERSCORE` grid lines set via the console API.

I then needed to update the `Renderer::s_GetGridlines` method to
activate the `GridLines::Underline` style when the `Underlined`
attribute was set. The `GridLines::Bottom` style is still triggered by
the `LVB_UNDERSCORE` attribute to produce the bottom grid line effect.

Validation
----------

Because this is a change from the existing behaviour, certain unit tests
that were expecting the `LVB_UNDERSCORE` to be toggled by `SGR 4` and
`SGR 24` have now had to be updated to check the `Underlined` flag
instead.

There were also some UI Automation tests that were checking for `SGR 4`
mapping to `LVB_UNDERSCORE` attribute, which I've now substituted with a
test of the `SGR 53` overline attribute mapping to
`LVB_GRID_HORIZONTAL`. These tests only work with legacy attributes, so
they can't access the extended underline state, and I thought a
replacement test that covered similar ground would be better than
dropping the tests altogether.

As far as the visual rendering is concerned, I've manually confirmed
that the VT underline sequences now draw the underline in the correct
position and style, while grid lines output via the console API are
still displayed in their original form.

Closes #2915
2020-08-03 12:49:25 +00:00
..
Properties Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
App.config Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
product.pbxproj Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
Program.cs Render the SGR "underlined" attribute in the style of the font (#7148) 2020-08-03 12:49:25 +00:00
Program2.cs Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
sources Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
sources.dep Merged PR 4235821: [Git2Git] Reflect some sources.dep changes from OS 2020-01-31 21:27:33 +00:00
Sources.pkg.xml Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
VTApp.csproj Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00