forked from microsoft/terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for the "italic" graphic rendition attribute (microsoft#8580
) This PR adds support for the ANSI _italic_ graphic rendition attribute, which is enabled by the `SGR 3` escape sequence. For the GDI renderer, I've just created an additional italic variant of the font, and then the `UpdateDrawingBrushes` method selects the appropriate font variant into the device context based on the requested text attributes. It's a bit more complicated in the DX renderer, because we need both an italic variant of the font, and a variant of the text format object. The `CustomTextLayout` class also had to be updated to hold the two font and format instances, and decide which of the variants to use based on a `useItalicFont` property in the drawing context, initially set in the `UpdateDrawingBrushes` method. ## Validation Steps Performed I've created some test content using a range of different character sets (e.g. CJK, block characters, emoji, etc.), then applied the italic attribute mixed with various other SGR attributes to see how they interact. The output isn't always perfect, but I think it seems reasonable given the constraints of a cell-based terminal renderer. Closes microsoft#5461
- Loading branch information
Showing
7 changed files
with
132 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.