Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

refactor(typography): px-only unit system, recalibrated body baselines

hugohe3f509a88e0799
diff --git a/docs/faq.md b/docs/faq.md
index abacef88..6a1a6807 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -62,6 +62,22 @@ With `--no-merge`, every visual line becomes its own PowerPoint text frame. This
When you're chatting with the AI, you can also just ask for strict line fidelity on layout-sensitive pages — the AI will add `--no-merge` when re-exporting.
+## Q: Why are font sizes in px, not pt? Do they change on export?
+
+PPT Master works in **unitless px end-to-end** — the confirm page, `spec_lock.md`, and the SVG all carry px; there is no pt layer. The SVG canvas is literally 1280×720 px, so px is the real layout / execution unit, and keeping a single unit avoids the size drift you get when a value is "confirmed as 20pt" but written into the SVG as a different number.
+
+PowerPoint displays pt, so the **export** converts px → pt automatically (`pt = px × 0.75`, kept to one decimal). For example a `24px` body becomes `18pt`, a `42px` title becomes `31.5pt`. So a non-integer like `13.5pt` or `31.5pt` in PowerPoint is **expected and intentional**, not a bug — the size is whatever the px works out to, no longer forced onto whole or half-point values.
+
+The body baseline is a fixed value per **delivery purpose** (not a range):
+
+| Delivery purpose | Body px | ≈ exported pt |
+|---|---|---|
+| `text` (read-close: report / leave-behind) | 20px | 15pt |
+| `balanced` (default: roadshow / review) | 24px | 18pt |
+| `presentation` (projected / launch) | 32px | 24pt |
+
+Title, subtitle, footnote and the other roles derive from the body by ratio and snap to clean even px. You can override any role's px value on the confirm page.
+
## Q: How does PPT Master decide a deck's style?
Two independent choices, locked at confirmation `d`:
diff --git a/docs/zh/faq.md b/docs/zh/faq.md
index c9617220..efac2630 100644
--- a/docs/zh/faq.md
+++ b/docs/zh/faq.md
@@ -62,6 +62,22 @@ python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> --no-merge
跟 AI 对话时也可以直接说:"这个页面要严格保持逐行版式" —— AI 重新导出时会加上 `--no-merge`。
+## Q: 字号为什么用 px 不是 pt?导出后字号会变吗?
+
+PPT Master 内部**全程只用 px**(无单位像素)——确认页、`spec_lock.md`、SVG 都是 px,没有 pt 这一层。原因是 SVG 画布本身就是 1280×720 px,px 是真正的排版/执行单位;只用一个单位,能避免「确认时说 20pt、写进 SVG 又变成另一个数」这类单位混淆导致整套字号偏差。
+
+PowerPoint 最终显示的是 pt,所以**导出时**自动把 px 换成 pt(`pt = px × 0.75`,保留 1 位小数)。例如正文 `24px` 导出后是 `18pt`、标题 `42px` 是 `31.5pt`。所以你在 PowerPoint 里看到 `13.5pt`、`31.5pt` 这种非整数是**正常的、有意的**,不是 bug——字号算出来是多少就是多少,不再强行凑成整数或半磅。
+
+正文基准按**交付目的**固定取值(不是区间):
+
+| 交付目的 | 正文 px | ≈ 导出 pt |
+|---|---|---|
+| `text` 文字型(近读:报告 / 资料) | 20px | 15pt |
+| `balanced` 均衡(默认:路演 / 评审) | 24px | 18pt |
+| `presentation` 展示型(投影 / 发布) | 32px | 24pt |
+
+标题、副标题、脚注等其它角色按比例从正文派生,并取整洁偶数 px。你在确认页可以手动覆盖任何角色的 px 值。
+
## Q: PPT Master 怎么确定演示的风格?
在第 d 项确认时锁定两个独立维度:
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.md
index 53d6d7bd..07d630e1 100644
--- a/skills/ppt-master/SKILL.md
+++ b/skills/ppt-master/SKILL.md
@@ -332,7 +332,7 @@ Read references/strategist.md
| **1 — anchors** | canvas · audience + core message + `content_divergence` + `delivery_purpose` *(PPT only — omitted on non-PPT canvases)* (all §c key info) · `mode` + `visual_style` | the source + user intent |
| **2 — realization** (re-derived from Tier 1) | page count · color · typography (font + size) · icons · formula policy · image usage + strategy · generation mode · refine-spec toggle | the confirmed Tier 1 |
-> **Why two tiers.** Every realization field is anchored by the same few choices (`visual_style` anchors color / icon / typography / image; `delivery_purpose` drives the type band, page density, **and** the page-count recommendation). Confirming anchors first, then re-deriving, means Tier 2's candidates fit the user's *real* anchors instead of your originals — the coherence reconciliation below is done by construction on this path. Page count is a **derived** field (content volume × `delivery_purpose`), which is why it lives in Tier 2, not up front.
+> **Why two tiers.** Every realization field is anchored by the same few choices (`visual_style` anchors color / icon / typography / image; `delivery_purpose` sets the body size, page density, **and** the page-count recommendation). Confirming anchors first, then re-deriving, means Tier 2's candidates fit the user's *real* anchors instead of your originals — the coherence reconciliation below is done by construction on this path. Page count is a **derived** field (content volume × `delivery_purpose`), which is why it lives in Tier 2, not up front.
Steps:
@@ -344,12 +344,12 @@ Steps:
python3 ${SKILL_DIR}/scripts/confirm_ui/server.py <project_path> --daemon --wait
```
Page opens at `http://localhost:5050` — the **same port as the Step 6 live preview** (they never run at once: this page shuts down at the end of Step 4). If 5050 is held, the launcher **auto-advances** (5051, …) — read the actual URL from the launch log and report it. The page does **not** close after Tier 1: it shows a "deriving…" state and polls for Tier 2. **Launch or wait failure is non-fatal**: if it fails or times out (flask missing, port blocked, no GUI / remote / web host), do **NOT** troubleshoot — **on any non-zero exit, re-check `result.json` once** (a fresh `status: tier1-confirmed`) before dropping to the chat fallback. **On success (exit 0 with a tier-1 result), do not pause or report — go straight to step 3 in the same turn.**
-3. **Re-derive Tier 2 from the confirmed anchors, then write it — immediately, same turn (the page is polling for it).** Read the tier-1 `result.json` (`status: tier1-confirmed`). Using the user's **actual** confirmed anchors (not your originals), author the realization candidates and **overwrite** `recommendations.json` with `"tier": 2`: page count (content volume × `delivery_purpose`); color, typography, and generated-image style as **generative ≥3-candidate** fields (creative recommendations always offer real choice — same rule as h.5; fewer than 3 only on the honest-shortfall exception, with a stated reason; color: core `palette` with background/secondary_bg/primary/accent/secondary_accent/body_text; typography: CJK + Latin for `heading` and `body` with `css` preview stacks + `body_size` as the body baseline in **pt** for PPT / px for non-PPT, derived from the confirmed `delivery_purpose` band; images: `image_strategy.candidates` rendering × palette from h.5); enumerable `icons` / `formula_policy` / `generation_mode` (recommended `id`); `image_usage` (`ai` / `web` / `provided` / `placeholder` / `none`, or a custom prose plan when several sources mix — never bare `"custom"`; write `image_ai_path` only when the plan includes AI). The still-open page polls, renders Tier 2, and preserves the user's Tier 1 picks. Closed fields (`image_ai_path`, `formula_policy`, `generation_mode`, `refine_spec`) stay finite; open fields (`icons`, `image_usage`, typography custom text) show a Custom box.
+3. **Re-derive Tier 2 from the confirmed anchors, then write it — immediately, same turn (the page is polling for it).** Read the tier-1 `result.json` (`status: tier1-confirmed`). Using the user's **actual** confirmed anchors (not your originals), author the realization candidates and **overwrite** `recommendations.json` with `"tier": 2`: page count (content volume × `delivery_purpose`); color, typography, and generated-image style as **generative ≥3-candidate** fields (creative recommendations always offer real choice — same rule as h.5; fewer than 3 only on the honest-shortfall exception, with a stated reason; color: core `palette` with background/secondary_bg/primary/accent/secondary_accent/body_text; typography: CJK + Latin for `heading` and `body` with `css` preview stacks + `body_size` as the body baseline in **px** (every canvas) — **one fixed value per confirmed `delivery_purpose`** (`text` 20 / `balanced` 24 / `presentation` 32), not a range; images: `image_strategy.candidates` rendering × palette from h.5); enumerable `icons` / `formula_policy` / `generation_mode` (recommended `id`); `image_usage` (`ai` / `web` / `provided` / `placeholder` / `none`, or a custom prose plan when several sources mix — never bare `"custom"`; write `image_ai_path` only when the plan includes AI). The still-open page polls, renders Tier 2, and preserves the user's Tier 1 picks. Closed fields (`image_ai_path`, `formula_policy`, `generation_mode`, `refine_spec`) stay finite; open fields (`icons`, `image_usage`, typography custom text) show a Custom box.
4. **Wait for the final confirmation** — attach to the already-running page, do **not** relaunch (same 600000 ms budget):
```bash
python3 ${SKILL_DIR}/scripts/confirm_ui/server.py <project_path> --wait-only
```
- This is the ⛔ BLOCKING completion: returns when the page writes the final `result.json` (`status: confirmed`, `stage: final`, carrying all Tier 1 + Tier 2 fields). On a non-zero exit, re-check `result.json` once. **Typography normalization is mandatory before any spec writing**: for PPT canvases, confirmed `pt` values become unitless px (`px = pt × 4/3`) so `design_spec.md`, `spec_lock.md`, and SVG see px only; keep original pt only as provenance (`body_size_pt` / `sizes_pt`). `generation_mode: "split"` / `refine_spec: true` are explicit user choices.
+ This is the ⛔ BLOCKING completion: returns when the page writes the final `result.json` (`status: confirmed`, `stage: final`, carrying all Tier 1 + Tier 2 fields). On a non-zero exit, re-check `result.json` once. Confirmed sizes are **already px** (the system is px-only — no pt anywhere, no conversion): write `result.json` `typography.body_size` / `sizes` into `design_spec.md` / `spec_lock.md` / SVG verbatim. `generation_mode: "split"` / `refine_spec: true` are explicit user choices.
5. **Close the confirm page (Mandatory cleanup — every path).** Shut the server down before leaving Step 4 so it cannot keep holding port 5050 (which Step 6 live preview reuses):
```bash
python3 ${SKILL_DIR}/scripts/confirm_ui/server.py <project_path> --shutdown
diff --git a/skills/ppt-master/references/canvas-formats.md b/skills/ppt-master/references/canvas-formats.md
index 00113a4a..c5863f21 100644
--- a/skills/ppt-master/references/canvas-formats.md
+++ b/skills/ppt-master/references/canvas-formats.md
@@ -62,7 +62,7 @@ Content purpose?
| Story | — | Middle 1500px | Top safe zone 120px, bottom 180px |
| WeChat Article Header | Center/left-aligned 48-72px | — | Image on right or as background |
-> **Body font baseline scales with canvas and delivery purpose** — a PPT 16:9 baseline confirmed for read-close / business / projection cannot be carried onto tall canvases (Xiaohongshu / Story / A4). Pick the baseline from the confirmed canvas, not the recommended one; see the per-canvas anchors and PPT pt→px normalization in [`strategist.md`](strategist.md) §g "Font Size Ramp".
+> **Body font baseline scales with canvas and delivery purpose** — a PPT 16:9 baseline confirmed for read-close / business / projection cannot be carried onto tall canvases (Xiaohongshu / Story / A4). Pick the baseline from the confirmed canvas, not the recommended one; see the per-canvas px anchors in [`strategist.md`](strategist.md) §g "Font Size Ramp" (the system is px-only — all sizes are unitless px on every canvas).
## ViewBox Examples
diff --git a/skills/ppt-master/references/executor-base.md b/skills/ppt-master/references/executor-base.md
index 278f7481..9a79852b 100644
--- a/skills/ppt-master/references/executor-base.md
+++ b/skills/ppt-master/references/executor-base.md
@@ -41,7 +41,7 @@ Resolve the per-page template SVG via `spec_lock.md page_layouts` (authoritative
**Templates supply structure, not skin (non-mirror)**: a chart or layout template's gradients, drop-shadows, palette, **and font sizes** are placeholder. Inherit its geometry, label / legend placement, and series-encoding logic; re-skin every fill / stroke to the deck's `visual_style` + `spec_lock.colors` — flat styles strip the gradients and shadows, gradient / glass styles repaint their own. Forbidden — shipping a template's default `<linearGradient>` / `cardShadow` / Tailwind fills unchanged. Mirror templates are the exception: §1.1 preserves their visuals verbatim.
-**Font size is skin, not geometry (non-mirror).** A chart / layout template's hardcoded `font-size` values (often 11–16px, sized for the template's own dense placeholder text) are NOT inherited — classify each text into its `spec_lock.md` role and use that role's locked size, exactly as you re-skin color. **Structural roles (page title / body / subtitle / annotation / footnote) hold their one deck-wide size on every page** — the template's placeholder px never overrides it; same-role text drifting page to page is what makes a deck look unprofessional. **Geometry adapts to the type, never the reverse**: when the locked size is larger than the template's placeholder text, widen / heighten the card, open spacing, and recompute child `y` / `dy` to make room — do not shrink the font to fit the inherited container. The Executor renders the page it was given; page count and per-page density are the Strategist's call, fixed at confirmation — do **not** re-paginate, split the page, or drop authored content to cope with size here. Only when a single block still cannot fit after the geometry is fully reflowed may you shrink **that block** as a bounded last resort — and **only body text** is ever shrunk this way. Title, subtitle, annotation / caption, footnote and page number are **locked once set and never adjusted to fit** — their values hold across the whole deck. Step the overflowing body block's `font-size` down by `2.67`px (one 2pt step) at a time, and only if it still overflows step it down again, up to a cumulative floor of **`5.33`px (4pt) below the locked body size** (e.g. `26.67` → no smaller than `21.33`). This is a **local, single-block** reduction — the deck-wide locked body size is unchanged on every other block and page. (The Executor works in unitless px — spec_lock and SVG carry no `pt`; `2.67`px ≈ 2pt, `5.33`px ≈ 4pt.) If the block still overflows at the 4pt floor, surface a `warning:` rather than silently restructure the page. (Mirror templates are the exception: §1.1 preserves their sizes verbatim — there the source deck's typography *is* the spec.)
+**Font size is skin, not geometry (non-mirror).** A chart / layout template's hardcoded `font-size` values (often 11–16px, sized for the template's own dense placeholder text) are NOT inherited — classify each text into its `spec_lock.md` role and use that role's locked size, exactly as you re-skin color. **Structural roles (page title / body / subtitle / annotation / footnote) hold their one deck-wide size on every page** — the template's placeholder px never overrides it; same-role text drifting page to page is what makes a deck look unprofessional. **Geometry adapts to the type, never the reverse**: when the locked size is larger than the template's placeholder text, widen / heighten the card, open spacing, and recompute child `y` / `dy` to make room — do not shrink the font to fit the inherited container. The Executor renders the page it was given; page count and per-page density are the Strategist's call, fixed at confirmation — do **not** re-paginate, split the page, or drop authored content to cope with size here. Only when a single block still cannot fit after the geometry is fully reflowed may you shrink **that block** as a bounded last resort — and **only body text** is ever shrunk this way. Title, subtitle, annotation / caption, footnote and page number are **locked once set and never adjusted to fit** — their values hold across the whole deck. Step the overflowing body block's `font-size` down by `2`px at a time, and only if it still overflows step it down again, up to a cumulative floor of **`4`px below the locked body size** (e.g. `24` → no smaller than `20`). This is a **local, single-block** reduction — the deck-wide locked body size is unchanged on every other block and page. (The Executor works in **unitless px** throughout — spec_lock and SVG carry no `pt`.) If the block still overflows at the floor, surface a `warning:` rather than silently restructure the page. (Mirror templates are the exception: §1.1 preserves their sizes verbatim — there the source deck's typography *is* the spec.)
### 1.1 Mirror-mode templates — reference-style consumption
@@ -109,7 +109,8 @@ Before the first SVG page, output a confirmation listing: canvas dimensions, bod
- Icons MUST come from `icons.inventory`; library MUST equal `icons.library`
- Font family from `typography`: use role override (`title_family` / `body_family` / `emphasis_family` / `code_family`) if declared, else fall back to `font_family`
- Font sizes follow a **ramp anchored on `typography.body`**, not a closed menu. **Structural roles — page title, body, subtitle, annotation / caption, footnote / page number — render at one consistent size deck-wide, taken from their `spec_lock` slot; never re-pick a structural role's size page by page or carry a template's placeholder px.** This locks the **role**, not every glyph: a page may still carry deliberate typographic hierarchy — a lead-in sentence, an inline emphasis figure, a pull-quote, a kicker, a hero number — but each of those is its **own role / feature element** with its own size, **applied consistently deck-wide** (declare a recurring one as its own `spec_lock` slot). In-band intermediate sizes are for exactly these feature elements. What is banned is the *same* role drifting size to fit a container or by page whim — that scatter is what reads as unprofessional. Sizes outside every band require extending the lock first.
-- **Write `font-size` to at most 2 decimals** — prefer a whole number; keep the 2-decimal form only for a slot that carries it from `spec_lock` (e.g. `body: 26.67`). Never emit long tails like `20.8026`: the exporter snaps the final size to the nearest 0.5pt, so extra px precision is wasted noise.
+- **The page's core message is primary — render it ≥ `body`.** The one-idea / key-claim / key-takeaway line a page is built around is its most important text; map it to the locked `lead` or `subtitle` slot (≥ `body`), never to a sub-`body` size. Demoting it below body while data callouts or labels sit larger inverts the hierarchy — the failure this prevents. If no `lead` / `subtitle` slot is locked for a recurring core-message line, surface it (per below) instead of improvising a smaller one. A footnote / page number / source credit uses the locked `footnote` (or `annotation`) slot — never an invented sub-`annotation` size; and the body-shrink last resort (§1.0) bottoms out at `body − 4`px, a hard floor never crossed.
+- **Write the locked px verbatim; at most 2 decimals.** `font-size` MUST be the exact px from `spec_lock.typography` — if `body` is `24`, write `24`; never substitute a "rounder" or PowerPoint-familiar number (`20` / `18` / `36`). The system is px-only — there is no pt to convert, and a remembered pt-style value written as px renders the whole deck the wrong size. Prefer whole numbers (sizes are clean even px); keep a decimal only for a slot that genuinely carries one in `spec_lock`. Never emit long tails like `20.8026`: the exporter rounds the final size to 1 decimal pt, so extra px precision is wasted noise.
- Images MUST reference files listed under `images`; no invented filenames
- Formula PNGs are images with `Acquire Via: formula` / `Status: Rendered`; place them only from the listed file path and never recreate the formula as text.
diff --git a/skills/ppt-master/references/strategist.md b/skills/ppt-master/references/strategist.md
index f9840cd9..0cfd3529 100644
--- a/skills/ppt-master/references/strategist.md
+++ b/skills/ppt-master/references/strategist.md
@@ -31,7 +31,7 @@ As a top-tier AI presentation strategist, receive source documents, perform cont
| **1 — anchors** | `a` canvas · `c` key info — audience + `content_divergence` + **delivery purpose** *(PPT only)* (promoted out of `g`) · `d` mode + visual_style | confirmed first |
| **2 — realization** (re-derived from the user's *actual* Tier 1) | `b` page count · `e` color · `f` icon · `g` typography (font + size) · `h` image | derived from Tier 1 |
-The realization items are anchored by Tier 1 — `visual_style` governs `e` / `f` / `g` / `h` (§d Layer 2), and delivery purpose drives the §g type band, page density, **and** the `b` page-count recommendation. So author Tier 2 *after* Tier 1 is confirmed, against the user's real choices. **Page count is derived, not an anchor** — it follows content volume × delivery purpose, which is why it is Tier 2. The launch / re-derive / wait mechanics live in [SKILL.md Step 4](../SKILL.md); the item specs below keep their `a`–`h` letters.
+The realization items are anchored by Tier 1 — `visual_style` governs `e` / `f` / `g` / `h` (§d Layer 2), and delivery purpose sets the §g body size (one fixed value per purpose), page density, **and** the `b` page-count recommendation. So author Tier 2 *after* Tier 1 is confirmed, against the user's real choices. **Page count is derived, not an anchor** — it follows content volume × delivery purpose, which is why it is Tier 2. The launch / re-derive / wait mechanics live in [SKILL.md Step 4](../SKILL.md); the item specs below keep their `a`–`h` letters.
> **Execution discipline**: This is the last BLOCKING checkpoint in the pipeline. After confirmation, complete the Design Spec and proceed to image generation / SVG / post-processing without further pauses.
>
@@ -45,13 +45,13 @@ Recommend format based on scenario (see [`canvas-formats.md`](canvas-formats.md)
### b. Page Count Confirmation
-**Tier-2 (derived).** Page count is not an anchor — recommend it only after the Tier-1 delivery purpose is confirmed, since the same source yields a different count by purpose. Provide a specific page count recommendation based on source document content volume **and the confirmed delivery purpose** (文字型 packs denser → the same source fits in fewer pages; 展示型 is one-idea-per-page → the same source may need more) — see §6.1 Content Planning Strategy. The user's confirmed count still wins; delivery purpose governs density and per-page treatment within it.
+**Tier-2 (derived).** Page count is not an anchor — recommend it only after the Tier-1 delivery purpose is confirmed, since the same source yields a different count by purpose. Provide a specific page count recommendation based on source document content volume **and the confirmed delivery purpose** (`text` packs denser → the same source fits in fewer pages; `presentation` is one-idea-per-page → the same source may need more) — see §6.1 Content Planning Strategy. The user's confirmed count still wins; delivery purpose governs density and per-page treatment within it.
### c. Key Information Confirmation
Confirm target audience, usage occasion, and core message; provide initial assessment based on document nature.
-**Delivery purpose** (PPT only) is confirmed here, beside audience, as part of the key information — the deck's consumption mode: 文字型 (read-close) / 均衡 (business, default) / 展示型 (presentation). It is a Tier-1 anchor: it seeds the §g body-size band, the type character, page density, and the §b page-count recommendation (both re-derived in Tier 2). Recommend one (`recommend.delivery_purpose`, default `balanced`) and let the user confirm. The full size mapping and within-band density / style nudge live in §g and §6.1 — here it is surfaced as a key-information choice, not a separate typography step.
+**Delivery purpose** (PPT only) is confirmed here, beside audience, as part of the key information — the deck's consumption mode: `text` (read-close) / `balanced` (business, default) / `presentation`. It is a Tier-1 anchor: it sets the §g body size to one fixed value per purpose, plus the type character, page density, and the §b page-count recommendation (the size and page count re-derived in Tier 2). Recommend one (`recommend.delivery_purpose`, default `balanced`) and let the user confirm. The fixed body value per purpose lives in §g; the density / treatment side lives in §6.1 — here it is surfaced as a key-information choice, not a separate typography step.
**Material divergence** — a **free-text** intent the user states beside audience (same content-strategy cluster): in their own words, how closely the deck should follow the source vs how freely it may reshape it. This is the user's own call — a free prose field (`content_divergence`), **not** a fixed set of options and **not** something you recommend from analyzing the source. Surface the question (in the confirm UI it is a text box under audience; in chat, ask it plainly); leave it for the user to fill. Blank = a balanced default.
@@ -230,35 +230,39 @@ See [`../templates/icons/README.md`](../templates/icons/README.md) for the curre
> - **Calligraphic display** — 隶书 LiSu / 华文行楷 STXingkai / 华文新魏 STXinwei (closest safe substitute: `KaiTi` / `FangSong`); cover / section / hero titles only, never body
> - **Brand-specific** — McKinsey Bower, corporate VI typefaces
-#### Font Size Ramp (confirmation layer in pt → spec layer in px)
+#### Font Size Ramp (px throughout)
-> **Ramp, not a fixed menu.** All sizes derive from the `body` baseline as a ratio. `spec_lock.md typography` declares `body` plus the slots this deck uses (`title` / `subtitle` / `annotation` by default; add `cover_title` / `hero_number` / `subheading` / `lead` / `chart_annotation` as needed). **Structural roles (page title / body / subtitle / annotation / footnote) resolve to one size each and hold it deck-wide** — that consistency is what reads as professional. Picking an intermediate in-band size is for special / feature elements (hero number, display title, one-off emphasis); declare a recurring special size as its own slot so it stays consistent too.
+> **Ramp, not a fixed menu.** All sizes derive from the `body` baseline as a ratio. `spec_lock.md typography` declares `body` plus the slots this deck uses (`title` / `subtitle` / `annotation` by default; add `cover_title` / `hero_number` / `subheading` / `lead` / `footnote` / `chart_annotation` as the outline demands).
+>
+> **Mandatory — scan `§IX` before locking and declare a slot for every role that recurs across pages.** Do not ship only the four defaults when the outline plainly carries more. A report / `text`-mode deck almost always recurs a per-page **core-message / lead line** (the one-sentence key-claim / takeaway under the title) and recurring **page numbers / source credits / footnotes** — declare `lead` (in the 1.1–1.4× lead band, and **always ≥ `body`** — the core message is a primary line, never smaller than body) and `footnote` (keep it readable — **~16px for a standard body, not shrunk smaller**) for them. Leaving these undeclared forces the Executor to improvise an unlocked size, and a core line improvised *below* `body` (with data callouts sitting larger) is exactly the hierarchy inversion this prevents. Recurring chart / figure labels get `chart_annotation` likewise.
+>
+> **Structural roles (page title / body / subtitle / annotation / footnote) resolve to one size each and hold it deck-wide** — that consistency is what reads as professional. Picking an intermediate in-band size is for special / feature elements (hero number, display title, one-off emphasis); a recurring one is declared as its own slot so it stays consistent too.
-> **Unit boundary (HARD rule).** PPT canvases may use **pt only in the confirmation layer** (`recommendations.json`, the Confirm UI, or chat fallback). Before writing `design_spec.md`, normalize the confirmed font sizes to **unitless px** (`px = pt × 4/3`) and keep px as the only design/execution value in `design_spec.md`, `spec_lock.md`, and SVG. Keep original pt only as provenance (`body_size_pt` / `sizes_pt`) when useful. Non-PPT canvases use px everywhere. Never write `pt` / `px` / `em` units into `spec_lock.md` or SVG; those layers carry unitless px numbers only. Geometry — margins, gaps, card sizes — is px everywhere.
+> **Unit boundary (HARD rule).** The system is **px-only**. `recommendations.json`, the Confirm UI, `result.json`, `design_spec.md`, `spec_lock.md`, and SVG **all carry unitless px** — there is no pt layer anywhere, and no pt→px conversion step. pt exists only as the size PowerPoint happens to show *after export* (`px × 0.75`, rounded to 1 decimal); it is never an input, a confirmation value, or a provenance field (no `body_size_pt` / `sizes_pt`). Never write `pt` / `px` / `em` units; every layer carries bare px numbers. Geometry — margins, gaps, card sizes — is px too. (Beautify reads a source deck's pt at intake but converts to px **before** any recommendation — see [`beautify-pptx.md`](../workflows/beautify-pptx.md); pt never re-enters the contract.)
-**Baseline — pick by delivery purpose first, then density.** Delivery purpose is a **Tier-1 anchor confirmed in §c key information** (beside audience, not as a separate typography step — see §1 Two-tier confirmation); it is the primary driver because the same canvas reads very differently when read close vs. projected. It is a **deck-wide** axis — beyond the body baseline it also drives page density / count / rhythm; see §6.1 for that side. Here, with the purpose already confirmed, it sets the body baseline:
+**Baseline — one fixed value per delivery purpose, not a range.** Delivery purpose is a **Tier-1 anchor confirmed in §c key information** (beside audience, not as a separate typography step — see §1 Two-tier confirmation); it is the primary driver because the same canvas reads very differently when read close vs. projected. It is a **deck-wide** axis — beyond the body baseline it also drives page density / count / rhythm; see §6.1 for that side. Here, with the purpose confirmed, it sets the body baseline to a single value:
-| Delivery purpose (PPT 16:9) | Body (pt) | Default | Reads as |
-|---|---|---:|---|
-| 文字型 · read-close (report, data-dense brief, leave-behind file) | 14–18 | 16pt | screen / handout reading at arm's length |
-| 均衡 · business (presented **and** read; roadshow, review) — **default** | 18–22 | 20pt | mixed projection + reading |
-| 展示型 · presentation (projected, sparse; keynote, launch, classroom) | 22–28 | 24pt | room projection, glance from the back |
+| Delivery purpose (PPT 16:9) | Body (px) | Reads as |
+|---|---:|---|
+| `text` · read-close (report, data-dense brief, leave-behind file) | 20px | screen / handout reading at arm's length |
+| `balanced` · business (presented **and** read; roadshow, review) — **default** | 24px | mixed projection + reading |
+| `presentation` (projected, sparse; keynote, launch, classroom) | 32px | room projection, glance from the back |
-Within the chosen purpose band, **density** picks the point (chart-heavy / 6+ items → low end · medium → mid · sparse / poster / cover → high end), and **visual style** nudges it (technical / data toward low, corporate / instructional toward mid, editorial / narrative / showcase toward high).
+The body baseline is **purely a function of delivery purpose** — density and visual style do **not** nudge it within a range. Body size is the reading-distance proxy; density is orthogonal and shows in **how much text per page, page count, and `page_rhythm`** (§6.1), the *other* roles, and decoration — never in growing or shrinking the body baseline. One purpose → one body size, identical across the deck. (The user may still override the value in confirmation; absent an override, this fixed value is the recommendation.)
| Canvas | Height | Body baseline | Unit |
|---|---|---|---|
-| PPT 16:9 / 4:3 | 720 / 768 | 14–28 (by delivery purpose above) | **pt** |
+| PPT 16:9 / 4:3 | 720 / 768 | 20 / 24 / 32 (by delivery purpose) | **px** |
| Xiaohongshu | 1242×1660 | 40–55 | px |
| WeChat / IG 1:1 | 1080×1080 | 27–36 | px |
| Story / Portrait | 1080×1920 | 48–64 | px |
| A4 | 1240×1754 | 44–58 | px |
-> **PPT confirms in pt, specs carry px.** Only the PPT canvases (16:9 / 4:3) expose pt in the confirmation layer because they export to a real PowerPoint slide where pt is meaningful. Social / print canvases (Xiaohongshu / Story / A4, viewed close on phone or in print) have no PPT pt semantics, so author their body baseline directly in px and skip the conversion step.
+> **Every canvas authors px directly.** PPT and social / print alike — the body baseline is a px number (PPT by delivery purpose above; social / print by the per-canvas value). No pt confirmation, no conversion step on any canvas.
-> **Confirmed values win — never recompute over them.** The user's confirmed sizes are authoritative. **Confirm UI path**: take `result.json` `typography.body_size` / `sizes` (already px) **verbatim** — do **not** re-derive from the canvas even if the user changed it. The page deliberately does not auto-rescale font sizes when the canvas changes (it only updates the suggested-range hint), so `result.json` already reflects the user's intent; recomputing here would silently override their choice. **Chat-fallback path** (no `result.json`): size from the confirmed canvas + delivery purpose (convert via `pt_to_px.py` for PPT). The `body_size` in `recommendations.json` is only a stale hint once the canvas changes — use the confirmed value, not the recommendation.
+> **Confirmed values win — never recompute over them.** The user's confirmed sizes are authoritative. **Confirm UI path**: take `result.json` `typography.body_size` / `sizes` (already px) **verbatim** — do **not** re-derive from the canvas even if the user changed it. The page deliberately does not auto-rescale font sizes when the canvas changes (it only updates the recommended-value hint), so `result.json` already reflects the user's intent; recomputing here would silently override their choice. **Chat-fallback path** (no `result.json`): take the px body baseline for the confirmed canvas + delivery purpose directly from the table above (no conversion). The `body_size` in `recommendations.json` is only a stale hint once the canvas changes — use the confirmed value, not the recommendation.
-| Level | Ratio to body | 32px baseline (24pt UI) | 24px baseline (18pt UI) |
+| Level | Ratio to body | 32px baseline (`presentation`) | 24px baseline (`balanced`) |
|-------|---------------|---------------|---------------|
| Cover title (hero headline) | 2.5-5x | 80-160px | 60-120px |
| Chapter / section opener | 2-2.5x | 64-80px | 48-60px |
@@ -271,17 +275,11 @@ Within the chosen purpose band, **density** picks the point (chart-heavy / 6+ it
| Annotation / caption | 0.7-0.85x | 22-27px | 17-20px |
| Page number / footnote | 0.5-0.65x | 16-21px | 12-16px |
-> Two baseline columns are illustrative only — for any other normalized `body` px value (21.33 / 26.67 / 29.33 / 32 / ...), multiply the row's ratio. Structural roles (page title / body / subtitle / annotation / footnote) take their locked slot value and stay there on every page — not a per-page pick. In-band freedom without pre-declaring is for special / feature elements (hero number, display title, one-off emphasis); a recurring special size should be declared as its own slot. The subtitle / lead / subheading bands overlap on purpose — pick by role, not size, then hold each at one size deck-wide. Values outside **every** band require lock extension first.
+> Two baseline columns are illustrative only — for any other `body` px value (20 / 24 / 32 / ...), multiply the row's ratio. Structural roles (page title / body / subtitle / annotation / footnote) take their locked slot value and stay there on every page — not a per-page pick. In-band freedom without pre-declaring is for special / feature elements (hero number, display title, one-off emphasis); a recurring special size should be declared as its own slot. The subtitle / lead / subheading bands overlap on purpose — pick by role, not size, then hold each at one size deck-wide. Values outside **every** band require lock extension first.
-> **pt → px: where it happens (Mandatory).** PPT canvases confirm in pt; `design_spec.md` / `spec_lock.md` / SVG carry **unitless px only**. The conversion `px = pt × 4 ⁄ 3` happens **once**, by path. (At export the px is converted back with `× 0.75` and **snapped to the nearest 0.5pt** so PowerPoint always shows a clean integer-or-half-point size; a confirmed integer pt round-trips exactly — e.g. 20pt → 26.67px → 20.0pt.)
-> - **Confirm UI path** — already done at submit. `result.json` `typography.body_size` / `sizes` are **already px** (`body_size_pt` / `sizes_pt` are kept only as provenance). Use the px directly; do **not** re-convert.
-> - **Chat-fallback path** — no `result.json` exists, so you convert, via the deterministic helper (never mental math):
-> ```bash
-> python3 skills/ppt-master/scripts/pt_to_px.py <body_pt> [<title_pt> <subtitle_pt> <annotation_pt>] # e.g. 20 → 26.67
-> ```
-> Write its printed px into `design_spec.md §IV` + `spec_lock.md typography`. Honor any per-role size the user pinned as that slot's locked value; derive the rest from the ramp.
->
-> **Validation** — before leaving the Strategist: every font-size in `design_spec.md` / `spec_lock.md` is the **px** value (e.g. `26.67`), never the confirmed pt number (`20`) written raw. Copying a pt number in unconverted is the one silent error the unit guard cannot catch — `20` is a valid bare number that renders at 15pt. Convert (via the page or `pt_to_px.py`), don't copy.
+> **Round recommended sizes to clean even px — don't ship ratio leftovers.** The ratios are a guide; lock each role at a **clean even px**, not the raw product. For `body` 24px that means **title 42 · subtitle 32 · lead 30 · annotation 18 · footnote 16** — never `32.4` / `18.7` / odd tails, which read as unprofessional. Snap the ratio output to the nearest even px (…14, 16, 18, 20, 24, 28, 32, 36, 42, 48…), then lock that. (The Confirm UI already snaps its per-role suggestions this way; match it on the chat-fallback path.)
+
+> **px is literal — write the locked number verbatim (Mandatory).** `result.json` / `design_spec.md` / `spec_lock.md` / SVG all carry px as-is; there is no conversion anywhere. The size you confirm is the size you write. The Executor's `font-size` MUST be the **exact px from `spec_lock.typography`** — if `body` is `24`, write `24`; never a "rounder" or PowerPoint-familiar number (`20` / `18` / `36`). Writing a remembered pt-style value as px is the silent drift that renders a whole deck the wrong size (e.g. a `24`px body emitted as `20` ships ~17% small); the checker's spec-lock drift guard backstops it, but author it right. Per role: honor any size the user pinned as that slot's locked value; derive the rest from the ramp and snap to clean even px. (At export the px is turned back into pt by `× 0.75`, rounded to 1 decimal — that is the only place pt ever appears, and it is automatic.)
> **Hero in single-focus / breathing pages**: when one element *is* the entire page — a large number, a headline, a key phrase — it is the visual subject, not body content. Such heroes may borrow the cover-title band (2.5–5×); for greater emphasis, declare a hero slot in `spec_lock.md` (e.g., `hero_number` / `hero_headline`) — checker exempts declared slots with no fixed upper limit. The row above "Hero number (consulting KPIs) 1.5–2×" applies only to numeric KPIs in dashboard/data layouts, not to full-page focal elements.
@@ -764,15 +762,15 @@ Templates are starting points. The Strategist may adjust based on content and au
Content-outline and speaker-notes strategy follow the deck's locked **mode** — see [`modes/_index.md`](./modes/_index.md) and the locked mode's file. The guidance below applies within any mode:
-**Delivery purpose drives the whole plan, not just type size.** `result.json delivery_purpose` — 文字型 (read-close) / 均衡 (business, default) / 展示型 (presentation), confirmed as a Tier-1 anchor (§1) — is a **deck-wide consumption mode**. It seeds the normalized body baseline (§g) **and** governs how content is distributed:
+**Delivery purpose drives the whole plan, not just type size.** `result.json delivery_purpose` — `text` (read-close) / `balanced` (business, default) / `presentation`, confirmed as a Tier-1 anchor (§1) — is a **deck-wide consumption mode**. It seeds the body baseline (§g) **and** governs how content is distributed:
| Delivery purpose | Per-page density & treatment | §IX content per page | page_rhythm lean |
|---|---|---|---|
-| 文字型 · read-close | dense — pack more per page, fuller layouts | prose paragraphs, more blocks, tables / fine detail; complete sentences | leans `dense` |
-| 均衡 · business (default) | balanced | one primary + supporting points; moderate text | mixed |
-| 展示型 · presentation | sparse — one idea per page, generous whitespace | keywords / short phrases, a single core message, large visual; never paragraph dumps | leans `anchor` / `breathing` |
+| `text` · read-close | dense — pack more per page, fuller layouts | prose paragraphs, more blocks, tables / fine detail; complete sentences | leans `dense` |
+| `balanced` · business (default) | balanced | one primary + supporting points; moderate text | mixed |
+| `presentation` | sparse — one idea per page, generous whitespace | keywords / short phrases, a single core message, large visual; never paragraph dumps | leans `anchor` / `breathing` |
-This is what makes the axis meaningful: a 展示型 deck and a 文字型 deck built from the **same source** must differ in per-page text volume, layout density, and rhythm — **not only in font size**. Page count (item b) stays the user's call; delivery purpose governs the **density and treatment within it**, and informs the page-count recommendation when the user has not fixed one. Record the chosen purpose in `design_spec.md §I`. The `page_rhythm` leans are a bias, not a quota — the filler-page ban and "rhythm follows narrative" rule still hold. (Preservation paths — beautify / template-fill — keep source structure verbatim: honor purpose only in styling, never to re-paginate.)
+This is what makes the axis meaningful: a `presentation` deck and a `text` deck built from the **same source** must differ in per-page text volume, layout density, and rhythm — **not only in font size**. Page count (item b) stays the user's call; delivery purpose governs the **density and treatment within it**, and informs the page-count recommendation when the user has not fixed one. Record the chosen purpose in `design_spec.md §I`. The `page_rhythm` leans are a bias, not a quota — the filler-page ban and "rhythm follows narrative" rule still hold. (Preservation paths — beautify / template-fill — keep source structure verbatim: honor purpose only in styling, never to re-paginate.)
**Per-block expression**: phrase each §IX content block in the mode that fits it — prose, bullet, keyword, or any phrasing the content calls for — not a default bullet. Take the cue from the source's texture: a narrative source (article / transcript / talk) leans prose — resist compressing its argument pages into fragments; a data sheet leans bullet/keyword. Write the real sentence into §IX itself, not a skeleton point to expand later. One page mixes modes; let layout pull each (narrative → prose, structural/chart → bullets/keywords).
@@ -800,7 +798,7 @@ This is what makes the axis meaningful: a 展示型 deck and a 文字型 deck bu
3. Save to: `projects/<project_name>.../design_spec.md`
4. **Generate execution lock**: read `templates/spec_lock_reference.md` and produce `projects/<project_name>.../spec_lock.md` — a distilled, machine-readable short form of the color / typography / icon / image / **page_rhythm** / **page_layouts** / **page_charts** decisions above. This file is what the Executor re-reads before every page (see [executor-base.md](executor-base.md) §2.1). The values in `spec_lock.md` MUST exactly match the decisions recorded in `design_spec.md`; if they ever diverge, `spec_lock.md` wins and `design_spec.md` should be treated as historical narrative.
- **page_rhythm is mandatory**: Based on the page list in §IX Content Outline, assign each page one of `anchor` / `dense` / `breathing` (see `spec_lock_reference.md` for the full vocabulary). This is what breaks the uniform "every page is a card grid" feel — without it the Executor defaults all pages to `dense`.
- - **Rhythm follows narrative, not quota**: `breathing` pages mark natural pauses — chapter transitions, standalone emphasis (hero quote / big number), SCQA bridges. Dense decks may legitimately be all `dense`. **Do NOT invent filler pages** ("Thank you", empty dividers) to pad rhythm — every `breathing` page must say something independent. Delivery purpose biases the overall lean (展示型 toward more `anchor` / `breathing`, 文字型 toward `dense`; see §6.1) — a bias, never a quota.
+ - **Rhythm follows narrative, not quota**: `breathing` pages mark natural pauses — chapter transitions, standalone emphasis (hero quote / big number), SCQA bridges. Dense decks may legitimately be all `dense`. **Do NOT invent filler pages** ("Thank you", empty dividers) to pad rhythm — every `breathing` page must say something independent. Delivery purpose biases the overall lean (`presentation` toward more `anchor` / `breathing`, `text` toward `dense`; see §6.1) — a bias, never a quota.
- **Cover impact is mandatory**: Page `P01` is the deck's first visual contract, not a generic title slide. In `design_spec.md §IX`, add a `Cover impact` line for `P01` that names one concrete hook and one concrete composition strategy. Use the source's strongest available signal: a provocative core claim, object / scene metaphor, hero number, founder / product / audience moment, or a distilled conflict. Pair it with one concrete composition strategy — such as `full-bleed image + floating title`, `typographic poster`, `hero object`, `data hook`, `editorial scene`, `high-contrast abstract geometry`, or a fresh composition the deck's subject suggests (these are starting points, not the allowed set). If no external or AI image is available, still specify a native-SVG visual hook; do not fall back to "title + subtitle + decorative background". (Beautify / template-fill keep the source cover verbatim — this rule does not apply on those preservation paths.)
- **Cover rhythm lock**: `P01` remains `anchor` in `spec_lock.md page_rhythm`, but its §IX `Cover impact` must prevent content-page patterns. Do not plan multi-card grids, agenda-like bullets, or equal-weight columns on the cover unless a template explicitly requires that structure, or a preservation path (beautify / template-fill) is transcribing the source cover verbatim.
- **Closing impact (only when the deck closes)**: the deck's last page is its final visual contract — the strongest impression after the cover. When the deck genuinely lands on a conclusion / call-to-action / final-takeaway page, give it a `Closing impact` line in §IX: name the one thing the audience should leave with (a distilled takeaway, a forward call, a memorable restatement of the core claim) + one composition that delivers it — never a generic "Thank you" / contact-only slide or a centered-title reprise of the cover. **Do NOT invent a closing page to satisfy this** — the filler-page ban above still holds; apply it only to the page where the deck actually resolves. Same exemptions as the cover: skip on template / beautify / template-fill preservation paths.
diff --git a/skills/ppt-master/scripts/confirm_ui/static/app.js b/skills/ppt-master/scripts/confirm_ui/static/app.js
index 2f32306e..9c55713a 100644
--- a/skills/ppt-master/scripts/confirm_ui/static/app.js
+++ b/skills/ppt-master/scripts/confirm_ui/static/app.js
@@ -57,8 +57,8 @@
font_body_size: "Body baseline size",
font_body_size_hint: "All type sizes derive from this body baseline.",
body_size_hint_canvas: "This canvas suggests ~{lo}–{hi}px (scales with canvas height).",
- body_size_hint_pt: "PPT body is confirmed in pt — this purpose suggests ~{lo}–{hi}pt (default {def}pt). Saved as px after confirmation.",
- body_size_hint_oor: "(Current value is outside this range — it is not auto-converted across canvases; check it fits.)",
+ body_size_hint_purpose: "This delivery purpose recommends {def}px — one fixed size, not a range.",
+ body_size_hint_oor: "(Current value is outside the usual range for this canvas — check the unit is right and that it fits.)",
delivery_purpose: "Delivery purpose",
delivery_purpose_hint: "Read-close decks can run smaller; projected decks need larger type.",
size_override: "Per-role size override:",
@@ -137,8 +137,8 @@
font_body_size: "正文基准字号",
font_body_size_hint: "所有字号按这个正文基准推导。",
body_size_hint_canvas: "当前画布建议 ~{lo}–{hi}px(随画布高度缩放)。",
- body_size_hint_pt: "PPT 正文确认时用 pt — 该交付目的建议 ~{lo}–{hi}pt(默认 {def}pt),确认后保存为 px。",
- body_size_hint_oor: "(当前数值不在此区间——换画布不会自动换算,请确认是否合适。)",
+ body_size_hint_purpose: "该交付目的推荐 {def}px(单一固定值,非区间)。",
+ body_size_hint_oor: "(当前数值超出该画布的常用范围——请确认单位无误、是否合适。)",
delivery_purpose: "交付目的",
delivery_purpose_hint: "近读型可以小一点;投影型需要更大的字。",
size_override: "逐角色字号覆盖:",
@@ -558,9 +558,9 @@
sec.appendChild(subDiv);
// Delivery purpose (PPT only) lives in the §c key-information confirmation,
// beside audience — it is part of "who / how this deck is consumed". It is a
- // Tier-1 anchor: its value seeds the body-size band, type character, page
+ // Tier-1 anchor: its value sets the body size (one fixed value per purpose), page
// density, and the re-derived Tier-2 page-count recommendation. Non-PPT
- // canvases carry no PowerPoint pt semantics, so the axis does not apply.
+ // canvases scale the body by canvas height instead, so the axis does not apply.
if (isPptCanvas(STATE.canvas)) {
var purposeField = el("div", "subfield");
purposeField.appendChild(el("div", "subfield-label", t("delivery_purpose")));
@@ -616,11 +616,16 @@
// Per-role size slots the user can edit directly (parallel to color roles).
// Defaults derive from `body` via mid-band ramp ratios (strategist.md §g);
- // values follow body's unit (pt on PPT canvases, px otherwise).
+ // values are px (the system's only unit).
var SIZE_ROLES = ["title", "subtitle", "annotation"];
var SIZE_RATIO = { title: 1.75, subtitle: 1.35, annotation: 0.78 };
function deriveSize(role, bodyVal) {
- return Math.round((bodyVal || 0) * (SIZE_RATIO[role] || 1));
+ var raw = (bodyVal || 0) * (SIZE_RATIO[role] || 1);
+ // All px. On PPT, snap the recommended role size to a clean even number so
+ // the user sees conventional sizes (body 24 → title 42, subtitle 32), not
+ // ratio leftovers. Non-PPT keeps a plain integer — large px, snapping moot.
+ if (isPptCanvas(STATE.canvas)) return Math.round(raw / 2) * 2;
+ return Math.round(raw);
}
// Canvas height (viewBox user units) parsed from a catalog `dim` like
@@ -643,8 +648,8 @@
return isPpt ? { lo: 0.031, hi: 0.047 } : { lo: 0.025, hi: 0.033 };
}
- // PPT canvases (16:9 / 4:3) carry the pt design language + pt→px conversion;
- // social / print canvases have no PowerPoint pt semantics and stay in px.
+ // PPT canvases (16:9 / 4:3) take the fixed per-delivery-purpose body px;
+ // social / print canvases scale the body px by canvas height instead.
function isPptCanvas(canvasVal) {
var dim = null;
(CAT.canvas || []).forEach(function (o) { if (o.id === canvasVal) dim = o.dim; });
@@ -655,16 +660,18 @@
/1024\s*[×xX*]\s*768/.test(raw);
}
- // PPT confirmation pt band + default per delivery purpose (see strategist.md §g).
- // The confirmed pt is converted to px (×4/3) before any spec is written.
- function deliveryPtBand(purposeId) {
- if (purposeId === "text") return { lo: 14, hi: 18, def: 16 };
- if (purposeId === "presentation") return { lo: 22, hi: 28, def: 24 };
- return { lo: 18, hi: 22, def: 20 }; // balanced — the default
+ // Body baseline in **px** per delivery purpose (see strategist.md §g). The
+ // system is px-only — these are the SVG/execution px values, recalibrated for
+ // the 1280×720 PPT canvas. No pt layer, no conversion. `def` is the fixed
+ // recommendation; lo/hi are a sanity envelope for the out-of-range flag only.
+ function deliveryBodyPx(purposeId) {
+ if (purposeId === "text") return { lo: 18, hi: 21, def: 20 };
+ if (purposeId === "presentation") return { lo: 28, hi: 32, def: 32 };
+ return { lo: 22, hi: 25, def: 24 }; // balanced — the default
}
function defaultBodySizeForCanvas(canvasVal, purposeId) {
- if (isPptCanvas(canvasVal)) return deliveryPtBand(purposeId).def;
+ if (isPptCanvas(canvasVal)) return deliveryBodyPx(purposeId).def;
var h = canvasHeight(canvasVal);
if (!h) return 40;
var band = bodySizeRatioBand(canvasVal);
@@ -675,54 +682,28 @@
return Math.round(value * 100) / 100;
}
- function ptToPx(value) {
- return roundSize(value * 4 / 3);
- }
-
function normalizeTypographyForSubmit(payload) {
if (!payload.typography || typeof payload.typography !== "object") return;
var typ = payload.typography;
- var ppt = isPptCanvas(payload.canvas);
var body = parseFloat(typ.body_size);
if (!isFinite(body)) {
// Cleared / invalid body field — fall back so role sizes never submit
- // against an empty anchor, and (on PPT) so the pt→px branch still runs
- // instead of leaking pt-valued role sizes through as px.
+ // against an empty anchor.
body = defaultBodySizeForCanvas(payload.canvas, payload.delivery_purpose);
- typ.body_size = body;
- }
- if (ppt && isFinite(body)) {
- typ.body_size_pt = roundSize(body);
- typ.body_size = ptToPx(body);
- typ.body_size_unit = "px";
- typ.body_size_source_unit = "pt";
- if (typ.sizes && typeof typ.sizes === "object") {
- var sizesPt = {};
- var sizesPx = {};
- Object.keys(typ.sizes).forEach(function (role) {
- var raw = parseFloat(typ.sizes[role]);
- if (!isFinite(raw)) return;
- sizesPt[role] = roundSize(raw);
- sizesPx[role] = ptToPx(raw);
- });
- typ.sizes_pt = sizesPt;
- typ.sizes = sizesPx;
- }
- return;
- }
- if (isFinite(body)) {
- typ.body_size = roundSize(body);
- typ.body_size_unit = "px";
}
+ // px is the only unit — round and submit as-is. No pt conversion, no
+ // body_size_pt / sizes_pt provenance (the system never carries pt).
+ typ.body_size = roundSize(body);
+ typ.body_size_unit = "px";
if (typ.sizes && typeof typ.sizes === "object") {
Object.keys(typ.sizes).forEach(function (role) {
var raw = parseFloat(typ.sizes[role]);
if (isFinite(raw)) typ.sizes[role] = roundSize(raw);
});
}
- delete typ.body_size_pt;
- delete typ.sizes_pt;
- delete payload.delivery_purpose;
+ // delivery_purpose is PPT-only; drop it on non-PPT canvases where it has
+ // no meaning and was never shown.
+ if (!isPptCanvas(payload.canvas)) delete payload.delivery_purpose;
}
function renderColor(host) {
@@ -926,7 +907,7 @@
top.appendChild(el("span", "font-card-name", localized(c, "name") || (t("option_prefix") + " " + (idx + 1))));
var meta = t("font_heading") + " " + t("cjk") + ":" + (head.cjk || "—") + " / " + t("latin") + ":" + (head.latin || "—")
+ " · " + t("font_body") + " " + t("cjk") + ":" + (body.cjk || "—") + " / " + t("latin") + ":" + (body.latin || "—");
- if (c.body_size) meta += " · " + t("font_body_size") + ":" + c.body_size + (isPptCanvas(STATE.canvas) ? "pt" : "px");
+ if (c.body_size) meta += " · " + t("font_body_size") + ":" + c.body_size + "px";
top.appendChild(el("span", "font-card-meta", meta));
card.appendChild(top);
var hbox = el("div", "font-sample-heading-box"); fontSample(hbox, head, head.css); card.appendChild(hbox);
@@ -969,16 +950,16 @@
var sizeHint = el("div", "toggle-desc");
sizeRow.appendChild(sizeHint);
// Hint only — the user's value is never overwritten; downstream §g
- // re-derives if ignored. PPT canvases speak pt (range by delivery
- // purpose); non-PPT canvases speak px (≈% of canvas height).
+ // re-derives if ignored. PPT body is one fixed px value per delivery
+ // purpose (not a range); non-PPT canvases scale px to canvas height.
+ // Everything is px — lo/hi are only a sanity envelope for the OOR flag.
refreshBodySizeHint = function () {
var txt = t("font_body_size_hint");
var lo, hi;
if (isPptCanvas(STATE.canvas)) {
- var pb = deliveryPtBand(STATE.delivery_purpose);
+ var pb = deliveryBodyPx(STATE.delivery_purpose);
lo = pb.lo; hi = pb.hi;
- txt += " " + t("body_size_hint_pt")
- .replace("{lo}", pb.lo).replace("{hi}", pb.hi).replace("{def}", pb.def);
+ txt += " " + t("body_size_hint_purpose").replace("{def}", pb.def);
} else {
var h = canvasHeight(STATE.canvas);
var band = bodySizeRatioBand(STATE.canvas);
@@ -988,9 +969,9 @@
.replace("{lo}", lo).replace("{hi}", hi);
}
}
- // Flag (hint only — never auto-corrected) a value outside the range,
- // e.g. a pt number kept after switching to a px canvas, so a cross-unit
- // switch is visible instead of silently submitting a mis-unit size.
+ // Flag (hint only — never auto-corrected) a value far outside the
+ // canvas's usual px range, so an accidental extreme value is visible
+ // instead of silently submitting it.
var cur = parseFloat(STATE.typography && STATE.typography.body_size);
if (isFinite(cur) && isFinite(lo) && isFinite(hi) && (cur < lo || cur > hi)) {
txt += " " + t("body_size_hint_oor");
@@ -1008,7 +989,7 @@
// Per-role size override (parallel to color's per-role HEX override): the
// ramp derives title / subtitle / annotation from body, but the user may
- // set each explicitly. Values follow body's unit (pt on PPT, px else).
+ // set each explicitly. Values are px (the system's only unit).
var sizeOverride = el("div", "hex-override");
sizeOverride.appendChild(el("div", "subfield-label", t("size_override")));
var srow = el("div", "hex-row");
@@ -1040,7 +1021,7 @@
if (!STATE.typography) STATE.typography = { name: "", heading: {}, body: {} };
if (!STATE.typography.sizes) STATE.typography.sizes = {};
var bodyVal = parseFloat(STATE.typography.body_size) ||
- (isPptCanvas(STATE.canvas) ? deliveryPtBand(STATE.delivery_purpose).def : 40);
+ (isPptCanvas(STATE.canvas) ? deliveryBodyPx(STATE.delivery_purpose).def : 40);
SIZE_ROLES.forEach(function (role) {
var cur = STATE.typography.sizes[role];
var hasVal = cur !== undefined && cur !== null && cur !== "";
@@ -1116,10 +1097,9 @@
var acc = hexOr(pal.accent, pri);
var sacc = hexOr(pal.secondary_accent, acc);
var txt = hexOr(pal.body_text, "#1d2430");
- // body_size is pt on PPT canvases (×4/3 → px) and px elsewhere.
- var rawSize = parseFloat(typ.body_size) || (isPptCanvas(STATE.canvas) ? 20 : 18);
- var bodyPx = Math.max(12, Math.min(34,
- isPptCanvas(STATE.canvas) ? rawSize * 4 / 3 : rawSize));
+ // body_size is px everywhere — preview it directly, no conversion.
+ var rawSize = parseFloat(typ.body_size) || (isPptCanvas(STATE.canvas) ? 24 : 18);
+ var bodyPx = Math.max(12, Math.min(34, rawSize));
var headStack = previewFontStack(head.cjk, head.css);
var headLatStack = previewFontStack(head.latin, head.css);
var bodyStack = previewFontStack(body.cjk, body.css);
@@ -1320,7 +1300,7 @@
STATE.content_divergence = (REC.content_divergence && REC.content_divergence.value) || ""; // free text; blank = balanced default
STATE.mode = pick("mode", CAT.modes);
STATE.visual_style = pick("visual_style", CAT.visual_styles);
- // Delivery purpose drives the PPT confirmation pt baseline; default balanced
+ // Delivery purpose drives the PPT body px baseline; default balanced
// (not the catalog-first id) when the Strategist did not recommend one.
STATE.delivery_purpose = recId("delivery_purpose") || "balanced";
}
@@ -1357,7 +1337,7 @@
STATE.generation_mode = pick("generation_mode", CAT.generation_mode);
STATE.refine_spec = !!((REC.refine_spec && REC.refine_spec.value) || (REC.recommend && REC.recommend.refine_spec));
// Guarantee a body baseline even when a candidate omitted body_size, on
- // any canvas (PPT → pt default by purpose, non-PPT → px from canvas height),
+ // any canvas (PPT → px default by purpose, non-PPT → px from canvas height),
// so role sizes never derive from an empty anchor.
if (STATE.typography && !STATE.typography.body_size) {
STATE.typography.body_size = defaultBodySizeForCanvas(STATE.canvas, STATE.delivery_purpose);
diff --git a/skills/ppt-master/scripts/confirm_ui/static/catalogs.json b/skills/ppt-master/scripts/confirm_ui/static/catalogs.json
index 164f96c6..231a5ea8 100644
--- a/skills/ppt-master/scripts/confirm_ui/static/catalogs.json
+++ b/skills/ppt-master/scripts/confirm_ui/static/catalogs.json
@@ -455,24 +455,24 @@
"label": "text",
"label_zh": "文字型 · 近读",
"label_en": "text / read-close",
- "desc_zh": "当文件读、近距离看(报告、数据密集 brief、留底材料)。正文可小,14–18pt,默认 16pt。",
- "desc_en": "Read close as a file (report, data-dense brief, leave-behind). Body can run small, 14–18pt, default 16pt."
+ "desc_zh": "当文件读、近距离看(报告、数据密集 brief、留底材料)。正文 20px。",
+ "desc_en": "Read close as a file (report, data-dense brief, leave-behind). Body 20px."
},
{
"id": "balanced",
"label": "balanced",
"label_zh": "均衡 · 商务",
"label_en": "balanced / business",
- "desc_zh": "既投影也阅读(路演、业务评审)。默认档,18–22pt,默认 20pt。",
- "desc_en": "Both projected and read (roadshow, business review). The default tier, 18–22pt, default 20pt."
+ "desc_zh": "既投影也阅读(路演、业务评审)。默认档,正文 24px。",
+ "desc_en": "Both projected and read (roadshow, business review). The default tier, body 24px."
},
{
"id": "presentation",
"label": "presentation",
"label_zh": "展示型 · 演讲",
"label_en": "presentation / keynote",
- "desc_zh": "投影、远距离扫一眼、内容稀疏(keynote、发布、课堂)。22–28pt,默认 24pt。",
- "desc_en": "Projected, glanced from the back, sparse (keynote, launch, classroom). 22–28pt, default 24pt."
+ "desc_zh": "投影、远距离扫一眼、内容稀疏(keynote、发布、课堂)。正文 32px。",
+ "desc_en": "Projected, glanced from the back, sparse (keynote, launch, classroom). Body 32px."
}
]
}
diff --git a/skills/ppt-master/scripts/docs/confirm_ui.md b/skills/ppt-master/scripts/docs/confirm_ui.md
index 8cc63852..352aa41b 100644
--- a/skills/ppt-master/scripts/docs/confirm_ui.md
+++ b/skills/ppt-master/scripts/docs/confirm_ui.md
@@ -129,9 +129,9 @@ The AI launches Tier 1 (`--daemon --wait`), reads the tier-1 result, **re-derive
- For a custom image plan, the page treats "may include AI" as true only when the recommendation includes `recommend.image_ai_path` or `image_strategy.candidates`; a custom plan without those signals is handled as non-AI and omits AI controls / fields.
- **Color candidates carry the user-facing core `palette`**: `background`, `secondary_bg`, `primary`, `accent`, `secondary_accent`, and `body_text`. The page renders labelled swatches and offers per-role override inputs for precise single-role edits, plus a **Custom color card with a free-text box** (parallel to the custom typography box) — the user can describe the palette in words or paste HEX values instead of filling each role; this writes `color: { "name": "custom", "custom": "<text>" }` to `result.json` for the AI to interpret. Legacy `text` is accepted as an alias for `body_text`, but new files should write `body_text`. Strategist derives secondary text, borders, state colors, and visual-style neutral tiers later when writing `design_spec.md` / `spec_lock.md`; those are not user-facing confirmation choices.
- **Candidate display text may be bilingual**: color / typography candidates can provide `name_zh` / `name_en` and `note_zh` / `note_en`; the page falls back to legacy `name` / `note`.
-- **Typography candidates split CJK and Latin** for both `heading` and `body`; `css` is the fallback preview `font-family` stack. The page previews CJK sample text with `cjk + css` and Latin sample text with `latin + css`, so the two script choices are visible independently. Each candidate should also include `body_size` — the body baseline, **shown in pt for PPT canvases (16:9 / 4:3), in px for non-PPT canvases** (Xiaohongshu / Story / A4 have no PowerPoint pt semantics). For PPT, the page shows/edits pt; the initial value comes from the candidate's `body_size` (sized for the recommended delivery purpose: 文字型 ~16 · 均衡 ~20 · 展示型 ~24). On submit, the page normalizes PPT values to px before writing `result.json`: `typography.body_size` is px, `typography.body_size_pt` preserves the original pt for provenance. Chat fallback must produce the same normalized contract before `design_spec.md` / `spec_lock.md` are written. The page exposes `body_size` as an editable numeric field whose hint shows a canvas-appropriate range (PPT 14–28pt by delivery purpose, non-PPT ≈2.5–3.3% of height in px). **Inputs are independent — the hint updates with canvas / delivery purpose but never rewrites a value the user can see.** It also offers a custom typography text box so the user is not limited to the proposed candidates.
-- **Per-role size override** (parallel to color's per-role HEX override): besides `body_size`, the page exposes **independent** editable inputs for `title` / `subtitle` / `annotation`. Each role is pre-filled **once** with a starting value — the candidate's `typography.sizes[role]` if provided, otherwise a one-time ramp suggestion (`body × ` mid-band ratio) — and then holds its own value. **There is no cross-field cascade**: changing `body_size`, `delivery_purpose`, or canvas updates only the suggested-range hint, never the role values; a re-render preserves exactly what the user sees. The final values are written to `result.json` as `typography.sizes: { "title", "subtitle", "annotation" }` in px; for PPT canvases, `typography.sizes_pt` preserves the original pt values for provenance. Seeding `sizes` in a candidate is optional — omit it and each role gets its one-time ramp suggestion.
-- **`delivery_purpose`** (enumerable, PPT only) is the primary driver of the body baseline: `text` (文字型 · read-close), `balanced` (均衡 · business, the default), `presentation` (展示型 · presentation). It is surfaced in the **§c key-information area** (beside audience, Tier 1) as a consumption-mode choice; the Tier-2 typography section then reads the confirmed value for the recommended body pt and the suggested-range hint — the pick itself does not rewrite the body field (inputs are independent). `recommend.delivery_purpose` pre-selects one (default `balanced`); the user's pick writes back to `result.json.delivery_purpose` as a plain id. Strategist uses it to choose the normalized px body baseline and the within-band density/style nudge (see [strategist.md §g](../../references/strategist.md)). Non-PPT canvases omit it.
+- **Typography candidates split CJK and Latin** for both `heading` and `body`; `css` is the fallback preview `font-family` stack. The page previews CJK sample text with `cjk + css` and Latin sample text with `latin + css`, so the two script choices are visible independently. Each candidate should also include `body_size` — the body baseline in **px** (the system's only unit, every canvas). The initial value comes from the candidate's `body_size`, sized for the recommended delivery purpose: `text` ~20 · `balanced` ~24 · `presentation` ~32. On submit the page writes `typography.body_size` as px directly — no pt conversion, no `body_size_pt` provenance. The page exposes `body_size` as an editable numeric field whose hint shows the recommended size — **one fixed px per delivery purpose on PPT (`text` 20 · `balanced` 24 · `presentation` 32), not a range** (non-PPT ≈2.5–3.3% of height in px). The user may still edit it; an out-of-range flag only warns if the value strays far (e.g. a unit mistake). **Inputs are independent — the hint updates with canvas / delivery purpose but never rewrites a value the user can see.** It also offers a custom typography text box so the user is not limited to the proposed candidates.
+- **Per-role size override** (parallel to color's per-role HEX override): besides `body_size`, the page exposes **independent** editable inputs for `title` / `subtitle` / `annotation`. Each role is pre-filled **once** with a starting value — the candidate's `typography.sizes[role]` if provided, otherwise a one-time ramp suggestion (`body × ` mid-band ratio) — and then holds its own value. **There is no cross-field cascade**: changing `body_size`, `delivery_purpose`, or canvas updates only the recommended-value hint, never the role values; a re-render preserves exactly what the user sees. The final values are written to `result.json` as `typography.sizes: { "title", "subtitle", "annotation" }` in **px** — every canvas, no pt and no `sizes_pt` provenance. Seeding `sizes` in a candidate is optional — omit it and each role gets its one-time ramp suggestion.
+- **`delivery_purpose`** (enumerable, PPT only) is the primary driver of the body baseline: `text` (read-close), `balanced` (business, the default), `presentation`. It is surfaced in the **§c key-information area** (beside audience, Tier 1) as a consumption-mode choice; the Tier-2 typography section then reads the confirmed value for the recommended body px — the pick itself does not rewrite the body field (inputs are independent). `recommend.delivery_purpose` pre-selects one (default `balanced`); the user's pick writes back to `result.json.delivery_purpose` as a plain id. Strategist uses it to set the px body baseline — **one fixed px per purpose (`text` 20 · `balanced` 24 · `presentation` 32), not a range** (see [strategist.md §g](../../references/strategist.md)). Non-PPT canvases omit it.
- **Combined style preview** — a compact live "overall impression" strip sits just above the color section and is **sticky**: it pins under the topbar so it stays visible while the user scrolls through the color / icon / typography sections, keeping the picking controls and their combined effect on screen together. It applies the currently selected color palette **and** typography (heading sample in `primary` over `background`, body sample in `body_text`, an `accent` bar, a `secondary_bg` chip) and repaints on every color / HEX-override / font / `body_size` change. It does not replace the per-candidate swatches or font samples (those stay for picking); it is deliberately an abstract style chip, **not** a slide-layout preview — page layout preview remains the live-preview server's job (Step 6). No schema field; it derives entirely from the existing color + typography selections.
- **Generated image style candidates** live in `image_strategy.candidates` and are shown only when `image_usage` is `ai` or a custom image plan may include generated images. Each candidate records `rendering`, `palette`, and short `visual` / `color` / `mood` lines from Strategist h.5. The chosen value is written to `result.json.image_strategy`; it is omitted when generated images are not part of the plan.
- **`visual_style_spectrum`** (optional) lets the AI surface the deck's aesthetic as a **personality spectrum** instead of one badged style. Each entry is `{ "id", "tag_zh"/"tag_en", "note_zh"/"note_en" }` where `id` is a real `visual_styles` catalog id; the page badges those chips with their temperament `tag` (replacing the single ★) and appends the `note` (a real-world analogy) inline. The full grouped style list and Custom box stay visible below, and `recommend.visual_style` is still the pre-selected default (it should equal the spectrum's safe pick). Author **≥3** spanning safe / shifted / bold (mirrors h.5; honest-shortfall exception applies — fewer only when the constraints genuinely cannot yield 3). The user's pick still writes back to `result.json.visual_style` as a plain id; the spectrum is presentation-only. Omit the field to fall back to the single-recommendation badge.
@@ -151,7 +151,7 @@ The AI launches Tier 1 (`--daemon --wait`), reads the tier-1 result, **re-derive
"visual_style": "swiss-minimal",
"color": { "name": "...", "palette": { "background": "#...", "secondary_bg": "#...", "primary": "#...", "accent": "#...", "secondary_accent": "#...", "body_text": "#..." } },
"icons": "tabler-outline",
- "typography": { "name": "...", "heading": { "cjk": "...", "latin": "...", "css": "..." }, "body": { "cjk": "...", "latin": "...", "css": "..." }, "body_size": 26.67, "body_size_pt": 20, "body_size_unit": "px", "body_size_source_unit": "pt", "sizes": { "title": 46.67, "subtitle": 36, "annotation": 21.33 }, "sizes_pt": { "title": 35, "subtitle": 27, "annotation": 16 } },
+ "typography": { "name": "...", "heading": { "cjk": "...", "latin": "...", "css": "..." }, "body": { "cjk": "...", "latin": "...", "css": "..." }, "body_size": 24, "body_size_unit": "px", "sizes": { "title": 42, "subtitle": 32, "annotation": 18 } },
"delivery_purpose": "balanced",
"formula_policy": "mixed",
"image_usage": "web",
diff --git a/skills/ppt-master/scripts/pt_to_px.py b/skills/ppt-master/scripts/pt_to_px.py
deleted file mode 100644
index 319f01ff..00000000
--- a/skills/ppt-master/scripts/pt_to_px.py
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/env python3
-"""
-PPT Master - Point-to-Pixel Font Size Converter
-
-Deterministic pt <-> SVG-px font-size conversion, the single source of truth for
-the chat-fallback path of the Eight Confirmations (the Confirm UI does the same
-math in app.js at submit time). PPT canvases confirm font sizes in pt; the
-execution layer (design_spec.md / spec_lock.md / SVG) carries unitless px only.
-Convert here instead of mental arithmetic so the chat path matches the UI path.
-
- px = pt * 4 / 3 (the inverse of the exporter's px * 0.75; canvas 1280px -> 960pt slide)
-
-Rounding matches app.js `roundSize` (2 decimals, round-half-up), so a value
-confirmed in pt round-trips back to the same pt at export.
-
-Usage:
- python3 scripts/pt_to_px.py <pt> [<pt> ...]
- python3 scripts/pt_to_px.py --reverse <px> [<px> ...]
-
-Examples:
- python3 scripts/pt_to_px.py 20 # -> 26.67 (write into spec_lock body)
- python3 scripts/pt_to_px.py 20 36 27 15 # body title subtitle annotation -> 26.67 48 36 20
- python3 scripts/pt_to_px.py --reverse 26.67 # -> 20 (what PowerPoint will display)
-
-Dependencies:
- None (only uses standard library)
-
-See references/strategist.md §g (Font Size Ramp) for the pt/px unit boundary.
-"""
-
-import sys
-import math
-import argparse
-from typing import Optional
-
-PT_TO_PX = 4 / 3 # px = pt * 4/3
-PX_TO_PT = 0.75 # pt = px * 0.75 (mirrors svg_to_pptx FONT_PX_TO_HUNDREDTHS_PT)
-
-
-def _round_half_up(value: float, decimals: int = 2) -> float:
- """Round half-up to ``decimals`` places, matching app.js ``Math.round``."""
- factor = 10 ** decimals
- return math.floor(value * factor + 0.5) / factor
-
-
-def pt_to_px(pt: float) -> float:
- """Convert a pt font size to its unitless SVG px value."""
- return _round_half_up(pt * PT_TO_PX)
-
-
-def px_to_pt(px: float) -> float:
- """Convert an SVG px font size back to the pt PowerPoint will display."""
- return _round_half_up(px * PX_TO_PT)
-
-
-def _fmt(value: float) -> str:
- """Drop a trailing ``.0`` so integers print clean (32, not 32.0)."""
- return str(int(value)) if value == int(value) else f"{value:.2f}"
-
-
-def _parse_size(raw: str) -> float:
- """Accept a bare number or a value with a stray pt/px suffix."""
- return float(raw.strip().lower().removesuffix("pt").removesuffix("px").strip())
-
-
-def build_parser() -> argparse.ArgumentParser:
- parser = argparse.ArgumentParser(
- description="Convert pt font sizes to unitless SVG px (or back with --reverse).",
- formatter_class=argparse.RawDescriptionHelpFormatter,
- )
- parser.add_argument("sizes", nargs="+", help="One or more font sizes to convert.")
- parser.add_argument(
- "-r", "--reverse", action="store_true",
- help="Convert px -> pt instead of pt -> px (debug / verification).",
- )
- return parser
-
-
-def main(argv: Optional[list[str]] = None) -> int:
- parser = build_parser()
- args = parser.parse_args(argv)
- convert = px_to_pt if args.reverse else pt_to_px
- try:
- values = [convert(_parse_size(s)) for s in args.sizes]
- except ValueError:
- print("Error: every size must be a number (optionally suffixed pt/px).",
- file=sys.stderr)
- return 1
- print(" ".join(_fmt(v) for v in values))
- return 0
-
-
-if __name__ == "__main__":
- raise SystemExit(main())
diff --git a/skills/ppt-master/templates/design_spec_reference.md b/skills/ppt-master/templates/design_spec_reference.md
index 1d319943..a360fc3c 100644
--- a/skills/ppt-master/templates/design_spec_reference.md
+++ b/skills/ppt-master/templates/design_spec_reference.md
@@ -14,7 +14,7 @@
| **Design Style** | {design_style} |
| **Target Audience** | [Filled by Strategist] |
| **Use Case** | [Filled by Strategist] |
-| **Delivery Purpose** | [文字型 read-close / 均衡 business / 展示型 presentation — confirmed at item 7; a deck-wide consumption mode that drives per-page density, page-count recommendation, page_rhythm lean, and the normalized body baseline. See strategist.md §6.1.] |
+| **Delivery Purpose** | [`text` read-close / `balanced` business / `presentation` — confirmed at item 7; a deck-wide consumption mode that drives per-page density, page-count recommendation, page_rhythm lean, and the body baseline (px). See strategist.md §6.1.] |
| **Content Strategy** | [Material divergence — the user's free-text intent on how closely to follow the source vs how freely to reshape it (or "balanced default"); facts stay sourced however free. Confirmed at c; consumed when authoring §IX. Not in spec_lock.] |
| **Created Date** | {date_str} |
@@ -99,7 +99,7 @@
**Typography direction**: [Fill in one phrase, e.g., "modern CJK sans" / "academic serif" / "brand-specific: McKinsey Bower (requires font install)"]
-> Step 4 Confirm UI: present **≥3** typography candidates (creative recommendations always offer real choice — same rule as h.5; fewer only on the honest-shortfall exception, with a stated reason), each splitting CJK + Latin for `heading` and `body` (with `css` preview stacks) and declaring `body_size` as the user-facing body baseline (pt for PPT canvases, px for non-PPT), in `confirm_ui/recommendations.json`; the confirmed `result.json` normalizes the execution value to px before this spec is written. Schema: [`scripts/docs/confirm_ui.md`](../scripts/docs/confirm_ui.md).
+> Step 4 Confirm UI: present **≥3** typography candidates (creative recommendations always offer real choice — same rule as h.5; fewer only on the honest-shortfall exception, with a stated reason), each splitting CJK + Latin for `heading` and `body` (with `css` preview stacks) and declaring `body_size` as the body baseline in **px** (the system's only unit, every canvas), in `confirm_ui/recommendations.json`; the confirmed `result.json` carries px directly — no conversion. Schema: [`scripts/docs/confirm_ui.md`](../scripts/docs/confirm_ui.md).
Two views on the same font decisions — fill both, keep them consistent:
@@ -131,12 +131,12 @@ Two views on the same font decisions — fill both, keep them consistent:
### Font Size Hierarchy
> **Ramp discipline, not a fixed menu.** `body` is the single anchor; every other size is a ratio of it. Each row below gives the role's allowed ratio band. **Structural roles (page title / body / subtitle / annotation / footnote) resolve to one size each and stay that size deck-wide** — pick the value once, lock it, reuse it on every page; same-role drift is what makes a deck look unprofessional. The in-band freedom to use an intermediate value without pre-declaring is for **special / feature elements** (hero number, cover / section display headline, one-off emphasis); if such a size recurs, declare it as its own slot so it too stays consistent.
-> **Unit boundary (HARD rule).** Author this section in **unitless px**. PPT canvases may be confirmed in pt, but that conversion is already resolved before writing this spec (`px = pt × 4⁄3`); `design_spec.md`, `spec_lock.md`, and SVG carry px only. Never write `pt`, `px`, `em`, or any unit in `spec_lock.md` or SVG. Geometry (margins / gaps / card sizes) is px everywhere. Non-PPT canvases use px throughout.
-> **Baseline selection**: drive by **delivery purpose** first (read-close vs. presentation), then content density; visual style only nudges within the chosen band.
+> **Unit boundary (HARD rule).** Author this section in **unitless px** — the system's only unit, every canvas. There is no pt layer and no conversion: the confirmed value is already px. Never write `pt`, `px`, `em`, or any unit in `spec_lock.md` or SVG. Geometry (margins / gaps / card sizes) is px everywhere.
+> **Baseline selection**: **delivery purpose** sets the body baseline to **one fixed value** (not a range); content density and visual style drive page treatment / rhythm / the *other* roles, **not** the body size.
-**Baseline (unitless px)**: Body font size = [fill in]. For PPT 16:9, normalize from the confirmed delivery-purpose pt band: **文字型 / read-close** `14–18pt` → `18.67–24`, **均衡 / business** `18–22pt` → `24–29.33` (default `26.67`), **展示型 / presentation** `22–28pt` → `29.33–37.33`. Within the band, density picks the point (6+ items → low · sparse / cover → high) and visual style nudges (technical / data low · corporate / instructional mid · editorial / narrative / showcase high). The user may also pin individual role sizes (`title` / `subtitle` / `annotation`) directly in the Confirm UI — a confirmed per-role value (`result.json typography.sizes`) is already px and becomes the locked slot for that role; the rest derive from the ramp. For non-PPT canvases, author px from the confirmed canvas scale (see [strategist.md §g](../references/strategist.md) per-canvas table).
+**Baseline (unitless px)**: Body font size = [fill in]. For PPT 16:9, the confirmed delivery-purpose value is **one fixed px per purpose, not a range**: **`text` / read-close** `20`, **`balanced` / business** `24` (default), **`presentation`** `32`. The body baseline is purely a function of delivery purpose — density and visual style drive page treatment / rhythm / the other roles, never the body size. The user may also pin individual role sizes (`title` / `subtitle` / `annotation`) directly in the Confirm UI — a confirmed per-role value (`result.json typography.sizes`) is already px and becomes the locked slot for that role; the rest derive from the ramp. For non-PPT canvases, author px from the confirmed canvas scale (see [strategist.md §g](../references/strategist.md) per-canvas table).
-| Purpose | Ratio to body | Example @ body=32 (24pt UI) | Example @ body=24 (18pt UI) | Weight |
+| Purpose | Ratio to body | Example @ body=32 (`presentation`) | Example @ body=24 (`balanced`) | Weight |
| ------- | ------------- | --------------------------- | ------------------------- | ------ |
| Cover title (hero headline) | 2.5-5x | 80-160 | 60-120 | Bold / Heavy |
| Chapter / section opener | 2-2.5x | 64-80 | 48-60 | Bold |
@@ -150,7 +150,7 @@ Two views on the same font decisions — fill both, keep them consistent:
| Page number / footnote | 0.5-0.65x | 16-21 | 12-16 | Regular |
> **Subtitle / lead-in / subheading bands overlap by design** — choose among them by *role*, not size: `subtitle` sits under a title, `lead` is a lead-in / pull-quote in the body flow, `subheading` labels a block inside the content area. Each is its own slot, declared only when the deck uses it, and then held at one size deck-wide like any structural role. Font stays at the **family** level (no new typeface per role): `subheading` → heading / `title_family`, `lead` → `body_family` or `emphasis_family` — size + weight carry the hierarchy.
-> The two px columns are illustrations for common baselines. For any other `body` value, multiply by each row's ratio. When the confirmation came from PPT pt, you may record the provenance once (e.g. "confirmed as 20pt") in prose, but the size values in this section and in `spec_lock.md` stay normalized px. The checker (`svg_quality_checker._check_spec_lock_drift`) reads the live `body` (px) from `spec_lock.md` and applies the bands, so no code change is needed for a different baseline.
+> The two px columns are illustrations for common baselines. For any other `body` value, multiply by each row's ratio. All size values here and in `spec_lock.md` are px (no pt anywhere). The checker (`svg_quality_checker._check_spec_lock_drift`) reads the live `body` (px) from `spec_lock.md` and applies the bands, so no code change is needed for a different baseline.
> Sizes outside **every** band remain forbidden — surface the need and extend `spec_lock.md typography` (e.g., `cover_title: 96`) rather than invent a one-off value.
diff --git a/skills/ppt-master/templates/spec_lock_reference.md b/skills/ppt-master/templates/spec_lock_reference.md
index e02d3b37..4385e427 100644
--- a/skills/ppt-master/templates/spec_lock_reference.md
+++ b/skills/ppt-master/templates/spec_lock_reference.md
@@ -54,10 +54,11 @@
- body_family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif
- emphasis_family: Georgia, SimSun, serif
- code_family: Consolas, "Courier New", monospace
-- body: 26.67
-- title: 48
-- subtitle: 36
-- annotation: 20
+- body: 24
+- title: 42
+- subtitle: 32
+- annotation: 18
+- footnote: 16
> **All five family lines are listed explicitly** so Strategist considers every role — `code_family` and `emphasis_family` are easily forgotten. In a real `spec_lock.md`:
> - Keep any `*_family` whose role genuinely differs from `font_family`.
@@ -68,9 +69,9 @@
>
> **Source**: copy verbatim from the *Per-role font stacks* list in `design_spec.md §IV Font Plan`. Stack **order** encodes browser-rendering intent (Latin-led vs. CJK-led) that the breakdown table cannot — strings here must match character-for-character. See `design_spec.md §IV` for the explainer.
>
-> Sizes (`body` / `title` / etc.) are **unitless px numbers** — the execution unit and the same values recorded in `design_spec.md §IV`. PPT canvases may have been confirmed in pt, but that conversion is resolved before spec writing (`px = pt × 4⁄3`; e.g. body 20pt → `26.67`, title 36pt → `48`, subtitle 27pt → `36`, annotation 15pt → `20`). For non-PPT canvases there is no pt layer — the px is authored directly. Do not write `pt` / `px` / `em` or any unit, and **do not copy a confirmed pt number unconverted** (`20` would render as 15pt — the one error the unit guard cannot catch). `body` is the **required baseline anchor** — all other sizes derive as ratios of it (ramp table: `design_spec_reference.md §IV`).
+> Sizes (`body` / `title` / etc.) are **unitless px numbers** — the execution unit and the same values recorded in `design_spec.md §IV`. The system is px-only on every canvas: there is no pt layer and no conversion — the confirmed value is already px (e.g. `balanced` body `24`, title `42`, subtitle `32`, annotation `18`, footnote `16` — clean even px). Do not write `pt` / `px` / `em` or any unit. `body` is the **required baseline anchor** — all other sizes derive as clean-even ratios of it (ramp table: `design_spec_reference.md §IV`).
>
-> **Size slots are anchors, not a closed menu.** Common slots (`title` / `subtitle` / `annotation`) cover frequent cases. Add role-specific slots (e.g. `cover_title: 88`, `hero_number: 56`, `subheading: 32`, `lead: 32`, `chart_annotation: 18`) when needed — common for cover-heavy decks, consulting-style hero numbers, dense pages. `subheading` and `lead` sit between `subtitle` and `body`; their bands overlap `subtitle`, so pick by role, not size, and declare only the ones the deck uses. **Structural roles (title / body / subtitle / annotation / footnote) render at their locked size on every page — one role, one size, deck-wide.** Intermediate in-band sizes are for special / feature elements only (hero number, display title, one-off emphasis); declare a recurring one as its own slot so it stays consistent too.
+> **Size slots are anchors, not a closed menu.** Common slots (`title` / `subtitle` / `annotation`) cover frequent cases. Add role-specific slots (e.g. `cover_title: 88`, `hero_number: 56`, `subheading: 32`, `lead: 30`, `footnote: 16`, `chart_annotation: 16`) for the roles the deck actually uses — common for cover-heavy decks, consulting-style hero numbers, dense pages. **Mandatory — scan `§IX` and declare a slot for every role that recurs across pages, not just the four defaults.** A report / `text`-mode deck almost always recurs a per-page **core-message / lead line** and **page numbers / source credits / footnotes** → declare `lead` and `footnote` for them. `subheading` and `lead` sit between `subtitle` and `body` (their bands overlap `subtitle`) — pick by role, not size — and the core-message `lead` is a **primary** line, **always ≥ `body`**, never smaller. Leaving a recurring lead / footnote undeclared forces the Executor to improvise an unlocked size (and a core line improvised below `body` inverts the hierarchy). **Structural roles (title / body / subtitle / annotation / footnote) render at their locked size on every page — one role, one size, deck-wide.** Intermediate in-band sizes are for special / feature elements only (hero number, display title, one-off emphasis); declare a recurring one as its own slot so it stays consistent too.
>
> **⚠️ PPT-safe stack discipline (HARD rule).** PPTX stores one `typeface` per run with no runtime fallback. Every stack MUST end with a cross-platform pre-installed font: `"Microsoft YaHei", sans-serif` / `SimSun, serif` / `Arial, sans-serif` / `"Times New Roman", serif` / `Consolas, "Courier New", monospace`. Non-preinstalled fonts (Inter / Google Fonts / brand typefaces) may lead the stack only when the Design Spec notes the font-install or embedding requirement.
>
diff --git a/skills/ppt-master/workflows/beautify-pptx.md b/skills/ppt-master/workflows/beautify-pptx.md
index d63df2e9..13dbeb47 100644
--- a/skills/ppt-master/workflows/beautify-pptx.md
+++ b/skills/ppt-master/workflows/beautify-pptx.md
@@ -181,8 +181,8 @@ Write `<project_path>/confirm_ui/recommendations.json` and launch the same confi
{ "name_zh": "备选配色 A", "name_en": "Alternative palette A", "palette": { "background": "#...", "secondary_bg": "#...", "primary": "#...", "accent": "#...", "secondary_accent": "#...", "body_text": "#..." } }
] },
"typography": { "selected": 0, "candidates": [
- { "name_zh": "复刻源 PPT(推荐)", "name_en": "Source replica (recommended)", "heading": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body_size": <source observed size in pt = dominant observed.sizes_pt> },
- { "name_zh": "实际字体(observed)", "name_en": "Observed fonts", "heading": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body_size": <source observed size in pt> },
+ { "name_zh": "复刻源 PPT(推荐)", "name_en": "Source replica (recommended)", "heading": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body_size": <dominant observed.sizes_pt × 4/3, as px> },
+ { "name_zh": "实际字体(observed)", "name_en": "Observed fonts", "heading": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body_size": <dominant observed.sizes_pt × 4/3, as px> },
{ "name_zh": "备选字体 A", "name_en": "Alternative pairing A", "heading": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body_size": <canvas-appropriate baseline> }
] }
}
@@ -191,7 +191,7 @@ Write `<project_path>/confirm_ui/recommendations.json` and launch the same confi
- **Recommend keep, allow override**: pre-fill canvas / mode / visual style / icons / image strategy with the source-faithful default (canvas = Step 3 format, mode = `briefing`, image_usage = `provided` since pictures are reused). Enumerable fields already list every catalog option with the source-faithful one badged, so the user can switch. Beautify's only true non-choices are the frozen text and the strict 1:1 page count (changing those means routing to the main pipeline instead — see CLAUDE.md). The §c material-divergence field is therefore not surfaced here — beautify never reshapes content (text is verbatim).
- **Our recommendation is the pre-selected default = the source replica**: for color and typography, author **several candidates** like the from-scratch flow. The pre-selected default (`selected: 0`, the first card) is what beautify recommends — the candidate that **best replicates the source deck's style** (the truest reading of `theme` / `observed`). Replicate-by-default.
- **Judge the other alternatives exactly as the from-scratch flow does — fonts as much as colors**: don't invent a beautify-specific rule. Author each non-replica candidate with the **same content-driven judgment the Strategist uses when generating from scratch** (color §e, typography §g), applied to the material this project provides — the source document's content and subject, the company's own theme colors, and any brand signal. Pick the palette **and** the font pairing by what fits *this* deck's content; fonts are chosen by content fit, not just defaulted to a safe face. Reach **≥3 candidates total** (PPT-safe stacks; the same creative-choice rule used elsewhere) so a user who departs from the replica still lands on a considered, content-fitting direction — depart-by-choice.
-- **`body_size` is the load-bearing field, and the replica follows the source's own size**: seed the replica candidate's `body_size` (pt, because this is the confirmation layer for a PPT canvas) from the source's actual body size — take the dominant `observed.sizes_pt` value (the most frequent run-level size, the **body proxy**) without converting it. The confirm page writes normalized px to `result.json` (`body_size`) and keeps the original pt as `body_size_pt`; chat fallback must do the same normalization before `design_spec.md` / `spec_lock.md`. The "most frequent = body" read is a proxy, not a guarantee — `observed.sizes_pt` counts every explicit run size (titles, captions, footnotes, chart/label text included, no placeholder-type resolution), so a deck dense with small labels can let a caption size outrank true body; cross-check the proxy against the page's actual body blocks and the sanity range below before trusting it, and prefer the size the body paragraphs visibly render at over the raw mode when the two disagree. Fall back to `theme.sizes.body` (the declared placeholder size) when `observed.sizes_pt` is empty, and to a PPT delivery-purpose baseline (read-close 14–18pt / balanced 18–22pt / presentation 22–28pt) only when neither is present. Note `theme.sizes.body` is the master `bodyStyle` **level-1 declared default** — a coarse value that commonly **over-reads** the real body density (decks often render body at a deeper outline level or override it smaller), so when you land on this fallback treat it as an upper-ish guess and run it through the sanity check below, never as a precise body size. `theme.sizes.body_levels` and `layout_sizes_pt` are **reference context, not extra fallback tiers**: consult them to judge a saner body value when the deck is theme-driven (`observed` empty) — e.g. a deeper `body_levels` entry or a `layout_sizes_pt` hint may read truer than level-1 — but do not auto-seed from them; the seed chain stays `observed → theme.sizes.body → delivery-purpose baseline`, and a theme-driven deck whose body size genuinely can't be pinned cleanly is exactly the case the sanity check is for. The canvas hint stays a **sanity range**, not the seed: if the source's own size lands far outside it (a dense source doc reads tiny on a projection canvas), surface that to the user rather than silently snapping — the replica recommendation is the source's size, the user confirms or overrides. Non-replica alternatives may use the delivery-purpose baseline. This is what prevents the deck from exporting at an unintentionally small size while still honoring the source.
+- **`body_size` is the load-bearing field, and the replica follows the source's own size**: seed the replica candidate's `body_size` from the source's actual body size — take the dominant `observed.sizes_pt` value (the most frequent run-level size, the **body proxy**) and **convert it to px (`× 4/3`)** before seeding, since the system is px-only and the source measures in pt: a source 20pt body becomes `26.67`px, so the replica renders at the source's true size (seeding the bare `20` as px would shrink it ~25% — the pt-as-px trap). Whichever source value you land on below (observed mode, or `theme.sizes.body`) gets the same `× 4/3` conversion. The confirm page (and chat fallback) then writes that px to `result.json` (`body_size`) **directly — no further conversion, no `body_size_pt` provenance** (pt never enters the contract). The "most frequent = body" read is a proxy, not a guarantee — `observed.sizes_pt` counts every explicit run size (titles, captions, footnotes, chart/label text included, no placeholder-type resolution), so a deck dense with small labels can let a caption size outrank true body; cross-check the proxy against the page's actual body blocks and the sanity range below before trusting it, and prefer the size the body paragraphs visibly render at over the raw mode when the two disagree. Fall back to `theme.sizes.body` (the declared placeholder size) when `observed.sizes_pt` is empty, and to a PPT delivery-purpose baseline (`text` 20 / `balanced` 24 / `presentation` 32 px — one fixed value per purpose) only when neither is present. Note `theme.sizes.body` is the master `bodyStyle` **level-1 declared default** — a coarse value that commonly **over-reads** the real body density (decks often render body at a deeper outline level or override it smaller), so when you land on this fallback treat it as an upper-ish guess and run it through the sanity check below, never as a precise body size. `theme.sizes.body_levels` and `layout_sizes_pt` are **reference context, not extra fallback tiers**: consult them to judge a saner body value when the deck is theme-driven (`observed` empty) — e.g. a deeper `body_levels` entry or a `layout_sizes_pt` hint may read truer than level-1 — but do not auto-seed from them; the seed chain stays `observed → theme.sizes.body → delivery-purpose baseline`, and a theme-driven deck whose body size genuinely can't be pinned cleanly is exactly the case the sanity check is for. The canvas hint stays a **sanity range**, not the seed: if the source's own size lands far outside it (a dense source doc reads tiny on a projection canvas), surface that to the user rather than silently snapping — the replica recommendation is the source's size, the user confirms or overrides. Non-replica alternatives may use the delivery-purpose baseline. This is what prevents the deck from exporting at an unintentionally small size while still honoring the source.
```bash
python3 ${SKILL_DIR}/scripts/confirm_ui/server.py <project_path> --daemon --wait