[PR #13965] Pass through soft fonts over conpty #29864

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

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

State: closed
Merged: Yes


This PR introduces a mechanism for passing through downloadable soft
fonts to the conpty client, so that we can support DRCS (Dynamically
Redefinable Character Sets) in Windows Terminal.

Soft fonts were first implemented in conhost (with the GDI renderer) in
PR #10011, and were implemented in the DX renderer in PR #13362.

The way this works is by passing through the DECDLD sequence
containing the font definition, but with the character set ID patched to
use a hardcoded value (this is to make sure it's not going to override
the default character set). At the same time we send through an SCS
sequence to map this character set into the G1 table so we can easily
activate it.

We still need to process the DECDLD sequence locally, though, since
the initial character set mapping take place on the host side. This gets
the DRCS characters into our buffer as PUA Unicode characters. Then when
the VT engine needs to output these characters, it masks them with 7F
to map them back to ASCII, and outputs an SO control to activate the
soft font in the conpty client.

Validation Steps Performed

I've manually tested with a number of soft fonts and applications that
make use of soft fonts. But if you're testing with the VT320 fonts from
the vt100.net collection, note that you'll need to enable the ISO-2022
coding system first, since they use 8-bit C1 controls.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/13965 **State:** closed **Merged:** Yes --- This PR introduces a mechanism for passing through downloadable soft fonts to the conpty client, so that we can support DRCS (Dynamically Redefinable Character Sets) in Windows Terminal. Soft fonts were first implemented in conhost (with the GDI renderer) in PR #10011, and were implemented in the DX renderer in PR #13362. The way this works is by passing through the `DECDLD` sequence containing the font definition, but with the character set ID patched to use a hardcoded value (this is to make sure it's not going to override the default character set). At the same time we send through an `SCS` sequence to map this character set into the G1 table so we can easily activate it. We still need to process the `DECDLD` sequence locally, though, since the initial character set mapping take place on the host side. This gets the DRCS characters into our buffer as PUA Unicode characters. Then when the VT engine needs to output these characters, it masks them with `7F` to map them back to ASCII, and outputs an `SO` control to activate the soft font in the conpty client. ## Validation Steps Performed I've manually tested with a number of soft fonts and applications that make use of soft fonts. But if you're testing with the VT320 fonts from the vt100.net collection, note that you'll need to enable the ISO-2022 coding system first, since they use 8-bit C1 controls.
claunia added the pull-request label 2026-01-31 09:37:19 +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#29864