Skip to content
rafageist edited this page Dec 2, 2026 · 3 revisions

Glyphs

A Turbo Vision screen is a grid of cells. A character that some terminal or font draws two cells wide, or not at all, shifts the rest of its line and breaks the frames, on one platform and not on another. So a TurboFrame application's own strings keep to ASCII and CP437, the characters of Turbo Vision itself: ░▒▓█, the box-drawing lines, ►◄↑↓. Text that comes from elsewhere and is drawn as it is goes through screen_text. Data the user owns (file names, records) keeps its Unicode.

Use it for keeping your screens aligned in every terminal and font
Import from turboframe.text import CP437, check_glyphs, screen_text
Needs nothing beyond TurboFrame
Extend check_glyphs(source, skip=(...)) for files you allow more in

TurboFrame keeps to the same rule: DesktopApp draws Textual's scroll bars in whole cells, because their eighth-cell thumbs are not CP437 (see The Desktop), and the catalogue checks refuse a translation wider than one cell per character (see Translating Your Application).

turboframe.text:

  • CP437: the set.
  • screen_text(text): typography as ASCII (an ellipsis as three dots, a long dash as two hyphens, curly quotes as straight ones), and wide characters as ?.
  • check_glyphs(source, *, skip=()): every character outside ASCII and CP437 in the strings of the Python files under source, docstrings aside; skip names files to leave out. Your test asserts it is empty:
from pathlib import Path

from turboframe.text import check_glyphs


def test_only_ascii_and_cp437():
    assert check_glyphs(Path(__file__).parents[1] / "src" / "myapp") == []

It reports path:line 'c' U+XXXX for each one it finds.

API: turboframe.text.

Clone this wiki locally