fontlabapp.fontui.teaching_text.feature
feature
What: Edit a local OpenType feature-code draft with syntax colour.
How: Mark keywords, quoted strings and comments. Keep all edits in the text editor. Colour gives lexical guidance; it does not compile the feature code.
Why: Experimental code needs a separate workspace before use in a font.
Usage: Edit text or Load a UTF-8 file. Insert Names adds current-font glyph names as a comment. Copy or Export New transfers the draft for further use.
Benefit: Prepare feature code beside the font without changing its features.
Setup: FontLab 9, Python 3.11, Fly and fontlabapp. Panels stay open beside the font. Export uses a new absolute path and never overwrites an existing file.
Idea from the Qt/PyQt examples (Riverbank Computing, Nokia, 2010-2013). Independent rewrite. Apache-2.0.
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
TITLE |
attribute | ||
build |
function | (parent: Any=None) -> Any |
Build the original controls as a hidden child for an owned lab tab. (shared captured text) |
capture_names |
function | () -> tuple[str, ...] |
Read the current font's glyph names. |
check_text |
function | (text: str) -> str |
Reject character classes that can change in a Qt plain-text document. (shared captured text) |
export_new |
function | (filename: str, text: str) -> None |
Export UTF-8 to a new absolute path. (shared captured text) |
feature_spans |
function | (text: str) -> list[tuple[int, int, str]] |
Tokenize one line; comments and quoted strings shield embedded keywords. |
main |
function | () -> None |
Open through Fly. |
read_editor_exact |
function | (editor: Any, gui: Any) -> str |
Check an export in a detached editor so draft text and Undo stay intact. (shared captured text) |
set_plain_exact |
function | (editor: Any, text: str) -> None |
Set checked text and verify the result. (shared captured text) |
show |
function | (qt: Any, parent: Any, *, embedded: bool=False) -> Any |
Build one modeless tool; retain every exact connection until safe close. |