[PR #8580] Add support for the "italic" graphic rendition attribute #27243

Closed
opened 2026-01-31 09:20:50 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/8580

State: closed
Merged: Yes


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 #5461

**Original Pull Request:** https://github.com/microsoft/terminal/pull/8580 **State:** closed **Merged:** Yes --- 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 #5461
claunia added the pull-request label 2026-01-31 09:20:50 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27243