Awesome! I recently spent a while making an animated ASCII globe in Python, rendering a map with Cartopy and Matplotlib and then converting the pixel array to ASCII characters. It was not elegant. Perhaps I'll switch to this.
Ah, I thought your original comment was referring to using the corresponding letters for the Braille (semantically), but now I guess you're probably unable to see it because your terminal doesn't have the Braille fonts (or doesn't have UTF-8 support?). I guess it would be possible to hack the code (it's just JS running under Node) to change the output character set; the challenge (as usual with ASCII) is to pick a character set that looks good.
But honestly, it's not as if using 7-bit ASCII will make it any more "readable"; more compatible, possibly, but the use of Braille subpixels definitely makes the map look visually nicer.
That's a strange request, along the lines of wanting to know what your mp3s spell if you just converted the encoded data into whatever characters the drama happens to encode.
Ah, well, your original comment was a little unclear there, so apologies for the confusion.
Unfortunately most of the characters won’t map onto any Latin letter. Typical English Braille only uses the top 6 dots - but as a display character, this program uses all 8 dots. I’m not even sure which Braille dialects use all eight dots. As another commenter hinted at, it’s a bit strange to ask what the semantic meaning of graphical display characters are - a bit like reading out the characters in a binary file which happen to correspond to ASCII values. (Like, what might happen if you open a binary file in a text editor).
It's too bad that text labels don't show up correctly (because they're rendered to pixels like the map), but otherwise, wow that's impressive. It works like a charm on XTerm on Mac. (It doesn't work with Terminal.app, but that's because Terminal doesn't support 24-bit colour commands IIRC, so I am not surprised).
The current version seems to have trouble with text direction when rendering RTL scripts; if you look at the Wikipedia homepage, the links for the Arabic and Hebrew Wikipedias appear with the names of the languages written LTR rather than RTL. Maybe a different Unicode rendering method would also help address this problem.
Considering that terminals can display images just fine you'll have a hard time convincing Unicode that you need arbitrary pixel sets because somehow images are plain text (emoji had prior usage in plain text and they have a lot more semantic meaning per character than just some pixels).
I made something like this in the past for viewing QGIS projects in the console. Mainly just as a bit of fun on the train: https://github.com/NathanW2/ascii_qgis
25 comments
[ 2.5 ms ] story [ 36.7 ms ] threadhttps://gist.github.com/rgov/97f57e58fcfc999a26501f91392606b...
But honestly, it's not as if using 7-bit ASCII will make it any more "readable"; more compatible, possibly, but the use of Braille subpixels definitely makes the map look visually nicer.
It was. You're overthinking this. I want to see what the braille reads like.
Unfortunately most of the characters won’t map onto any Latin letter. Typical English Braille only uses the top 6 dots - but as a display character, this program uses all 8 dots. I’m not even sure which Braille dialects use all eight dots. As another commenter hinted at, it’s a bit strange to ask what the semantic meaning of graphical display characters are - a bit like reading out the characters in a binary file which happen to correspond to ASCII values. (Like, what might happen if you open a binary file in a text editor).
I'm aware of two dialects, Gardner-Salinas [1] and Kantenji [2]. And they are different in to which direction 6-dot brailles are extended.
[1] https://en.wikipedia.org/wiki/Gardner%E2%80%93Salinas_braill...
[2] https://en.wikipedia.org/wiki/Braille_kanji
I created a Python library for the Braille graphics part: https://github.com/dheera/python-termgraphics
Or we just leave that to enterprising conspiracy theorists, as a new kind of "backwards masking".
----
Also, I wonder if terminal lovers should maybe lobby for a set of Unicode symbols with more ‘pixels’ than the Braille 2×8.
https://www.youtube.com/watch?v=5Aw83c6q7dE
Never really had a good use case for it but was good fun.