Text-mode apps (Was :Who are the "spacists"?)

Chris Angelico rosuav at gmail.com
Sun Mar 26 11:37:11 EDT 2017


On Mon, Mar 27, 2017 at 2:17 AM, Mikhail V <mikhailwas at gmail.com> wrote:
>>> Why? IIRC I can do good pseudographics on linux only with extended
>>> unicode character sets, so yes it is possible, is that what you mean?
>>
>> No.  The same ASCII character set that was available in DOS is
>> available in Linux without unicode.
>
> Ok, now I have read that one can change the encoding in the terminal
> to get same table drawing characters (if one does not want to use
> unicode).

Just use Unicode. Everything else, these days, is a subset of Unicode
anyway. Unless you're stuck on the default Windows shell/terminal, you
should be able to use UTF-8 everywhere and have the entire Unicode
range available. For example, the IBM OEM box-drawing characters are
available in Code Page 437... or as Unicode code points in the U+25xx
range.

> But such a question: can one do it programmaticaly?

Set everything to UTF-8 and you don't have to.

> And more important: can one use binary (bitmap) fonts in default modern
> linux console? If yes, can one patch them with custom tiles at
> the application start?

If you really need something completely custom, it's not text any
more. For example, suppose you redefine all the character images, and
then someone copies and pastes into a web browser - can they search
the web for the characters you're displaying, and will they mean the
same things? If you've redefined images arbitrarily, they won't.

More likely, you don't truly need something custom - what you need is
a different subset of characters (maybe you need to mix Latin, Greek,
and Hebrew letters, in order to show interlinear translation of the
Bible). Instead of messing around with character sets, you can just
use Unicode and have all of them available.

> In DOS, (I don't remember if in all versions or only some)
> one could do all this and this opens very rich possibilities for
> approximating of objects with tiles. The only limitations
> that one uses 255 tiles, but even this enables to build
> whole 'worlds' and state of the art apps. So I would call this
> pseudographics and not few sticks and corner tiles
> (which I cannot even define and upload easily).

Yeah; if my memory serves me, this was an IBM BIOS feature, so all
versions of DOS would be equally able to do it. But it's basically a
form of tile graphics, not text. Given how easily graphical programs
can be built these days, I would strongly recommend that, rather than
abusing pseudo-text as pseudo-graphics. Pick up Tk or GTK or wxWindows
or something, or build your app to run in a web browser, or something
like that.

If what you're doing really is text, just with custom images, you MAY
be able to ask your users to install a TTF or something. But I
wouldn't use a program that demands that I reconfigure my terminal.

ChrisA



More information about the Python-list mailing list