https://gitlab.synchro.net/main/sbbs/-/commit/fe8b2f6258f746aafb9e0a57
Added Files:
src/syncterm/scripts/auto/connected/font_pick.wren
Modified Files:
src/syncterm/scripts/auto/connected/keys_default.wren online_menu.wren src/syncterm/scripts/syncterm.wren ui_list.wren src/syncterm/term.c term.h wren_bind.c wren_bind_conn.c wren_bind_conn.h wren_bind_fs.c wren_bind_fs.h wren_bind_screen.c wren_bind_screen.h
Log Message:
SyncTERM: move font_control to Wren
Replace the C-side font_control() uifc dialog with a Wren FontApp
class. The picker uses ListView over Font.name(0..count-1), with
Insert keying into Host.pickFile + Font.load(file). Hook.onKey
for Alt-F lives in keys_default.wren; online_menu's "Font Setup"
entry now calls FontApp.run() instead of Host.fontControl().
Two new foreigns:
- CTerm.altFont / CTerm.altFont=(slot) — getter/setter for
cterm->altfont[0]. Setter calls ciolib_setfont(slot, false, 1)
and updates the cache.
- Font.load(file) — takes a File foreign (not a path string) and
extracts the path internally via the new wren_file_path() helper
in wren_bind_fs. Keeping bare paths out of Wren preserves the
consent-token model: only paths the user explicitly approved
through a picker can be opened.
Two pre-existing bugs surfaced by this work, fixed in passing:
- ListView.preferredHeight returned the unbounded item count, so a
pane with fitContent() over the 100+ populated font slots
overflowed the screen. Cap it at screen height minus a chrome
budget (ListView already scrolls).
- ListView.handleKey_ didn't guard `cp` before `cp >= 0x20`, so any
extended key with null codepoint (Insert, function keys, arrows)
that fell through the explicit handlers crashed with
"Null does not implement '>=(_)'".
Deletes ~75 lines: font_control() in term.c, the Alt-F switch case
in doterm(), fn_Host_fontControl() shim, Host.fontControl()
declaration.
Co-Authored-By: Claude Opus 4.7 (1M context) <
noreply@anthropic.com>
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net