Skip to content

Improve cosmetics on Linux vconsole #5011

@jsatchell

Description

@jsatchell

Textual works, but doesn't look good on the Linux virtual console environment.
I am about to deploy an in company solution that uses textual on read-only Linux ISOs, where the textual app is launched as the default shell. It all works, but the box drawing looks poor, and you can see the problem by running any textual demo in the console environment. All the graphical elements that should have edges have rows of diamonds (or whatever the missing glyph is shown as for that font). The available colors are limited, and the scroll bars have no contrast, but that could presumably be fixed with some CSS.

Ironically, if you provoke a traceback, the box drawing in the traceback looks great.

The Linux console has some limitations, inherited from VGA hardware text mode. There are at most 256 glyphs, or 512 if you give up bright colors. A standard install ships with about 120 font files, which differ in both glyph shape and size, and the mapping of character index to glyph shape, to cover a range of languages. I have looked at quite a lot of the Latin ones, and all the ones I checked have the basic, single-line box drawing characters and some shading chars, round 0xB0 to 0xB5 and 0xC0 to 0xC6.

There are supposedly some psfu fonts, which do some extended Unicode mapping to the limited set of available glyphs, and these might include some or all of the Unicode box drawing area round 2500 that Textual uses. None of my installs have psfu files, but I could chase that if it one that works was known.

I don't want to solutioneer, but I can see two options.

  • Either, a better font is found (or made).
  • Or, an alternate box drawing mode that uses the existing single line glyphs. Ideally, this would auto-detect, but if we had to pass a parameter in, perhaps to the app object, that would be fine. Looking at the source code, I think changes could be largely localised to the box drawing module.

Happy to help, but I don't want to start changing things on a clone in a way you would never accept.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions