Fix #36: the font menus list the installed fonts, with a search field

Type > Font, the Character, Properties and Glyphs panels and Find Font list
every installed font by default, as the reference app does, instead of the
four bundled families. The family dropdowns get a search field that filters
the list as you type (Enter picks the first match) and open on the current
font. Show System Fonts, which no longer means anything, becomes Refresh Font
List (text.rescanFonts): it picks up fonts installed since the app started and
redraws type set in them without editing the document. text.fontList lets MCP
agents list the families and a family's styles.

Root cause: the font lists came from FontDb::families(), which only held the
bundled fonts until something scanned the system fonts (fixed with #130). The
Type > Font menu, rebuilt every frame, now builds its items once per font
change, and renderers lay type out again when the fonts change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-06 00:49:22 +07:00
co-authored by Claude Opus 5.5
parent 49e8413ebe
commit f12428264c
16 changed files with 380 additions and 48 deletions
+16
View File
@@ -1713,3 +1713,19 @@ tone (mono, or CMYK screens multiplied over each other), clipped to the art's ou
```json
{"name":"run_command","arguments":{"command":"object.vectorHalftone","params":{"shape":"circle","frequency":25,"angle":45,"mode":"cmyk"}}}
```
## Fonts
Type can use the bundled fonts, fonts added to the session and the fonts installed on the system (none on the web).
The installed fonts are cataloged once per session (in the background when the app starts, else on the first lookup
by family name), so opening, placing, pasting and importing files find them whatever ran before. `text.fontList`
lists every family available, the installed ones included; with `family` it gives that family's styles (upright
by weight, then italics) and fails when the family isn't available. `text.rescanFonts` (Character panel menu ›
Refresh Font List) scans the font folders again, for fonts installed or removed since the app started: type set in a
font that became available redraws in it, without editing the document.
```json
{"name":"run_command","arguments":{"command":"text.fontList","params":{}}}
{"name":"run_command","arguments":{"command":"text.fontList","params":{"family":"Source Serif 4"}}}
{"name":"run_command","arguments":{"command":"text.rescanFonts","params":{}}}
```