Set font
set_fontRestyle text by setting font-family, size, and weight. Each property is validated, and glyph coverage is checked to prevent missing characters.
Instructions
Set font-family / font-size / font-weight on one or more text objects.
When to use: restyling text typography. To change the words use replace_text; for non-font
fill/stroke use set_fill / set_stroke.
Key params: provide any of family, size, weight (at least one required); each is validated
and written to every target's inline style.
Return shape: SetFontResult — all EditResult fields (operation_id, snapshot_id,
changed, before/after preview; the edit lands on the working copy only, reversible) PLUS glyph
coverage: coverage_ok is False when a target now names a family that cannot render
its text, and font_coverage lists per object the uncovered_chars (read from the font's OWN
cmap, never fontconfig substitution) and a suggested_family that covers them — so a
non-covering font choice is checkable at apply time instead of silently shipping tofu.
Example: set_font(doc_id, ["title"], family="Inter", size="24px")
Render and look before you trust this edit: render with render_preview (or live_render_view)
and inspect the result before relying on it; restore_snapshot reverts it if it is wrong.
Risk class: medium (reversible style edit on the working copy; original untouched).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | ||
| doc_id | Yes | ||
| family | No | ||
| weight | No | ||
| object_ids | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| changed | Yes | ||
| summary | No | ||
| coverage_ok | No | ||
| snapshot_id | Yes | ||
| operation_id | Yes | ||
| font_coverage | No | ||
| preview_after | No | ||
| preview_before | No |