Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VT] Add support for downloadable soft fonts #467

Open
WSLUser opened this issue Oct 19, 2021 · 4 comments
Open

[VT] Add support for downloadable soft fonts #467

WSLUser opened this issue Oct 19, 2021 · 4 comments
Labels
VT: Backend Virtual Terminal Backend (libterminal API) VT: rasterizer Rendering of the terminal into a pixmap using `terminal_renderer` library

Comments

@WSLUser
Copy link

WSLUser commented Oct 19, 2021

Abstract

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.

Motivation

Ability to download fonts such as from https://vt100.net/dec/vt320/fonts.

Specification

See microsoft/terminal#10011 and it's related issue microsoft/terminal#9164

@christianparpart
Copy link
Member

While that's a really great idea, I first have to finish my current work-in-progress PR. @j4james, what did you use to test'n'verify that your PR is correct? Or isn't it like 100% conform but a workable solution for modern times? When I'm going to do that I'd like NOT to diverge of what you have already implemented (ideally without being forced to log into Windows) :-)

@j4james
Copy link

j4james commented Oct 21, 2021

OK, this is kind of complicated. I collected fonts from all over the place, that were originally designed for different terminals. Each terminal uses a different cell size, so fonts typically only work on the system they were designed for. However, I wanted to be able to support all of them, so I try to detect the cell size they were originally targetting, and then scale up or down to match our native resolution.

In some cases this is reasonably straightforward, because the dimensions are defined in the DECDLD parameters (although the defined size isn't necessarily the target cell size). Other times they're just left as "default", and you've got to try and estimate the size from the sixel character data, and take into account things like whether it's full cell font, and the target screen size, etc. I don't know whether you want to go to that much effort though.

Anyway, if you want samples to test with, here are some of the places I got my fonts (you may need to lookup some of these on archive.org if the links are dead):

I don't think I got all of them to work perfectly though. In particular I remember some that were targetting printers which I wasn't even trying to detect, so they didn't come out quite right (still readable - just not fitting the text cell perfectly).

@j4james
Copy link

j4james commented Oct 21, 2021

This CMatrix fork is also a nice test case:
https://github.com/jhamby/cmatrix

@christianparpart
Copy link
Member

Nice. Thanks! :)

@christianparpart christianparpart added VT: Backend Virtual Terminal Backend (libterminal API) VT: rasterizer Rendering of the terminal into a pixmap using `terminal_renderer` library labels Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VT: Backend Virtual Terminal Backend (libterminal API) VT: rasterizer Rendering of the terminal into a pixmap using `terminal_renderer` library
Projects
None yet
Development

No branches or pull requests

3 participants