Support for downloadable "soft fonts" (DRCS) #12582

Open
opened 2026-01-31 03:19:24 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (Feb 14, 2021).

Description of the new feature/enhancement

Starting with the VT220 terminal, it was possible for apps to define their own "soft fonts", also known as dynamically replaceable character sets (DRCS). You would download the font to the terminal with a DECDLD escape sequence, and assign it a character set ID that could then be designated via the usual SCS escape sequences.

Some example use cases:

Custom fonts

image
More examples at https://vt100.net/dec/vt320/fonts

Simple monochromatic images

image

CMatrix with Japanese characters

Source: https://github.com/jhamby/cmatrix
image

Game sprites

image

Proposed technical implementation details (optional)

The screenshots above were taken from a POC I've been working on for conhost. In the current implemenation, when you've designated a DRCS character set, those characters get mapped to values in the Unicode PUA area. Then when the renderer encounters values in that range, it uses a BitBlt to render the glyph in place of the usual PolyTextOut calls.

The quality isn't fantastic - I'm just using StretchBlt to resize the provided glyphs to match the current font size. And the performance can seem a bit sluggish on apps like CMatrix when writing a lot of content to the screen. Nevertheless, I think it works reasonably well, and I'm sure someone smarter than me will have suggestions for how it could be improved.

I'm still a long way from producing a PR, but I wanted to raise the issue now to see how much interest there was in the idea before spending too much time on it. Initially it would be conhost-only - I'm not sure about the conpty feasibility without #1173.

Originally created by @j4james on GitHub (Feb 14, 2021). # Description of the new feature/enhancement Starting with the VT220 terminal, it was possible for apps to define their own "soft fonts", also known as dynamically replaceable character sets (DRCS). You would download the font to the terminal with a `DECDLD` escape sequence, and assign it a character set ID that could then be designated via the usual `SCS` escape sequences. Some example use cases: <details> <summary>Custom fonts</summary> ![image](https://user-images.githubusercontent.com/4181424/107891068-41dd8e00-6f14-11eb-8d4c-37894548e8a4.png) More examples at https://vt100.net/dec/vt320/fonts </details> <details> <summary>Simple monochromatic images</summary> ![image](https://user-images.githubusercontent.com/4181424/107891089-6a658800-6f14-11eb-82b5-7ba8492f0094.png) </details> <details> <summary>CMatrix with Japanese characters</summary> Source: https://github.com/jhamby/cmatrix ![image](https://user-images.githubusercontent.com/4181424/107891093-705b6900-6f14-11eb-92c1-3f52e2b15469.png) </details> <details> <summary>Game sprites</summary> ![image](https://user-images.githubusercontent.com/4181424/107891102-77827700-6f14-11eb-8115-9df758990442.png) </details> # Proposed technical implementation details (optional) The screenshots above were taken from a POC I've been working on for conhost. In the current implemenation, when you've designated a DRCS character set, those characters get mapped to values in the Unicode PUA area. Then when the renderer encounters values in that range, it uses a `BitBlt` to render the glyph in place of the usual `PolyTextOut` calls. The quality isn't fantastic - I'm just using `StretchBlt` to resize the provided glyphs to match the current font size. And the performance can seem a bit sluggish on apps like CMatrix when writing a lot of content to the screen. Nevertheless, I think it works reasonably well, and I'm sure someone smarter than me will have suggestions for how it could be improved. I'm still a long way from producing a PR, but I wanted to raise the issue now to see how much interest there was in the idea before spending too much time on it. Initially it would be conhost-only - I'm not sure about the conpty feasibility without #1173.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12582