Merge pull request #821 from attisvalentin/fix/rescan-and-load-fonts

M4: fonts installed while the app runs: text.rescanFonts, text.loadFont, text.refit
This commit is contained in:
BFlat
2026-10-20 03:04:29 +07:00
committed by GitHub
11 changed files with 360 additions and 15 deletions
+6 -1
View File
@@ -234,7 +234,12 @@ Or in a project's `.mcp.json`:
`text.setVariations {variations, replace?}` merges instead. `text.fonts {family, style?, axes: true}`
lists a font's axes and named instances (named instances are also valid `fontStyle` values).
`text.missingFonts` lists the families the document names that aren't installed
(`{families: [{family, layers}]}`); their text draws in a fallback font.
(`{families: [{family, layers}]}`); their text draws in a fallback font. Fonts are indexed once
per process: after installing one, `text.rescanFonts` picks it up (`{added: [families]}`), and
`text.loadFont {path | data (base64)}` adds a font file without installing it (`{families}`).
Text boxes keep the size they were measured at: both refit the open document's auto-sizing text
in the new families (`refitted: [ids]`), and `text.refit {ids?}` does it for any text, e.g. a
file saved while its fonts were missing.
OpenType features: `features {"liga": false, "tnum": true}`.
Decorations: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationThickness` and
`textDecorationOffset` (`auto`, px, or `"10%"` of the font size; the offset runs from the baseline