You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set console font automatically when selecting language (#4356)
* Set console font automatically when selecting language
Add console_font field to languages.json and Language dataclass.
When a language is activated, setfont is called automatically,
falling back to default8x16 on error or for languages without
a custom font. Also activate translation when loading language
from config file.
* Support FONT environment variable for console font override
When FONT env var is set, use it as the console font instead of the language-specific font mapping from languages.json. The font is applied at startup and preserved across language switches.
On exit (success or failure), restore the console font to default8x16.
* CI checks fix
* Try to restore original console font with setfont -O
* Fix for pylint
* Restore console font before Textual exits application mode
Move font set/restore into Textual lifecycle to prevent color
artifacts from 256/512 glyph transitions. Apply FONT env var
and language font in on_mount, restore in _on_exit_app.
Skip font change when loading language from config (set_font=False)
to defer it until TUI starts.
* Fall back to language font mapping when FONT env var is invalid
Add _using_env_font flag to skip mapping only when FONT was
successfully applied. Show info message after TUI exits if FONT
could not be set.
* Use tempfile for console font backup files
* Fix linter errors: use mkstemp, close fds, add @OverRide
* Fix ruff formatting
* Move font state from module singleton into TranslationHandler
* Refactor font handling per review feedback
* Make font methods members of TranslationHandler, skip on non-ISO
* ci: trigger tests
* Move running_from_iso import to module level
No circular dep, simpler than per-method local imports.
* Add explicit ISO guard to restore_console_font
Matches the existing guards in _set_font and save_console_font.
Behaviour was already safe implicitly via _font_backup=None, but
the explicit check makes intent obvious at the call site.
* Skip apply_console_font off-ISO
* Use list form for setfont SysCommand calls
0 commit comments