a-Shell's font makes QR codes not usable (tried with copyparty)
a-Shell is great! 1000 thanks for all the effort you put into this! ❤️
Is there a possibility to switch to a different font in the shell? Either by user or by changing the default font of this project? Because the current font has problems displaying QR codes. I'm using https://github.com/9001/copyparty and have a lot of fun running it on iPhone (following this hint https://github.com/9001/copyparty/issues/328)
To let others in the room use my copypart instance running on my iPhone, I would like to scan them the QR code generated in the terminal when copyparty is launched... But I tried with some scanners - but due to line spacing the QR code is not working.... (see screenshot)
Hi, thanks for the kind words. I have to admit using copyparty is a new and original use of a-Shell, and I'm glad it works.
You can change the font with config -n, either config -n with nothing after to open a font picker that lets you chose the (fixed-witdth) fonts installed in the system, or config -n <fontName> if you have a specific font in mind (the latter lets you activate non-fixed-width fonts, which is not good for what you have in mind).
Fantastic! That config -n let me chose Courier New - Bold which displays QR code like so:
I scanned this QR code with other iPhone - now it worked!
I also installed few other monospaced fonts on iPhone (iFont is a very good app to do so!). I tried Anonymus Pro, IBM Plex Mono and Source Code Pro. But all had same or worse line spacing. So I settled with Couroier New Bold.
One follow-up question, as with all those fonts there is always a gap between lines. So I guess launching tools that use Terminal graphics / nCurses would all suffer from these line gaps... Is there - besides switching fonts - another way to reduce / configure line spacing?
That's a good question; when I call "curl -s wttr.in", the result is continuous, without gaps between lines. I'm using the font "SauceCodePro", but I cannot test with a QR-code. There is no way to change line spacing, that is done automatically by the text window.
I can chime in regarding the qr-code :>
if the screen is large enough, it draws the qr-code by toggling the background-color of each cell, which always works regardless of the terminal -- but the drawback is that each "pixel" in the qr-code will occupy two letters horizontally, so you run out of space pretty quickly.
so when there's not enough space, it uses the four characters ▄▀█ instead, which usually works well in terminals, but it seems that github is another good example of some places where it doesn't work:
▄█ ┃ ┌┐ ╔╗
▀█ ┃ └┘ ╚╝
in the good old days, all of those were guaranteed to be connected both horizontally and vertically, but not so much now...
but, since it's a matter of screen space, I took the liberty of making a small wrapper which turns down the fontsize sufficiently to make it work as intended -- or, at least, on the old hand-me-down iPhone SE I have available to test with :>