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

Steve D'Aprano steve+python at pearwood.info
Sun Mar 26 13:43:28 EDT 2017


On Mon, 27 Mar 2017 02:37 am, Chris Angelico wrote:

> 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.

You are absolutely correct in theory, but in practice the availability of
glyphs in most fonts is only a tiny proportion of the Unicode range. And
even when the glyphs are available, the quality often varies: for example,
in all of the monospaced fonts I've looked at, the superscripts ¹²³ are a
different size to ⁴⁵⁶⁷⁸⁹⁰, both vertically and horizontally. And I've come
across a few fonts where the box drawing characters don't all line up.

Don't misunderstand me: Unicode is a HUGE improvement over the Bad Old Days
of dozens of incompatible character sets. But let's not pretend that it
makes it *easy*.



[...]
>> 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. 

That's not quite right. Unicode includes 137000 or so Private Use
Characters, which anyone can define for their own purposes, "by private
agreement". There's an unofficial registry of such private use characters
here:

http://www.evertype.com/standards/csur/

More info here:

https://en.wikipedia.org/wiki/Private_Use_Areas



> 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.

Assuming you have a text widget which is capable of displaying LTR and RTL
text, and support for all the glyphs you need.




-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.



More information about the Python-list mailing list