Skip to content

API turboframe.text

rafageist edited this page Dec 4, 2026 · 4 revisions

turboframe.text

Source: turboframe/text.py. Generated from the code of TurboFrame 0.3.0 by tools/wiki_api.py.

What a Turbo Vision screen can draw: ASCII and Turbo Vision's own characters (CP437).

A Turbo Vision screen is a grid of cells. A character some terminal or font draws two cells wide, or not at all, shifts its line and breaks the frames, on one platform and not on another. An application's own strings keep to ASCII and CP437 (its test calls check_glyphs on its sources); text that comes from elsewhere and must be drawn as it is shown goes through screen_text. Data the user owns (file names, records) keeps its Unicode.

Contents

CP437, check_glyphs, drawn_strings, screen_text

CP437

frozenset (160 entries)

check_glyphs

def check_glyphs(source: Path, *, skip: tuple[str, ...] = ()) -> list[str]

Every character outside ASCII and CP437 in the strings of the *.py files under source (skip: file names left out, such as a translation table), as path:line 'c' U+XXXX. A test asserts it is empty.

drawn_strings

def drawn_strings(tree: ast.AST)

The string constants of a module, but not its docstrings.

screen_text

def screen_text(text: str) -> str

text safe for the grid: typography as ASCII, wide characters as ?.

Clone this wiki locally