Replies: 1 comment 2 replies
-
I've used pyfiglet for this kind of thing, which was fairly easy to integrate with Rich and also Textual (https://github.com/willmcgugan/textual/blob/main/imgs/textual.png). I'm not sure if this belongs in Rich itself, as I don't think there will be that many people who want to use it. But it could be an external package. I could make an exception for those htop digits which loop temptingly easy to integrate. I've noticed the double sized characters in the spec, but left them out since they aren't well supported. I am tempted, but I'm not keen to have to design graceful fallbacks for them. I could still be persuaded. Let's see what others think. I'm especially interested in an apps which do this kind of thing well. |
Beta Was this translation helpful? Give feedback.
-
Larger type using block or line drawing characters can provide some richer UI experiences and help make elements stand out. Unicode provides both a full set of line drawing characters and 2x2 and 2x3 mosaics (as well as a wide assortment of other semigraphic blocks) and even 7-segment digits that fit in a character cell. Some terminal programs (all VTE and QtTermWidget ones) render those symbols even if no font in the system defines them.
These tricks are used to great effect by programs such as htop (https://github.com/htop-dev/htop/blob/39db3eb6f7a5d892d6343d5b3d574cf34ab150ee/Meter.c#L367-L371) and libraries like urwid (https://github.com/urwid/urwid/blob/bd573439ab5776c3511d7b82d98d00a50c9e1273/urwid/font.py#L190-L451). Some terminals (Apple's Terminal and xterm) can also support DEC's old double width and height (which are line-based and not cell-based attributes).
There are some complications however - these larger composite glyphs are more than one cell high and 2 or more cells wide. Does anyone (besides me) want this feature?
Beta Was this translation helpful? Give feedback.
All reactions