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

fix(confirm-ui): preview CJK and Latin fonts independently in typography cards

hugohe39a6c5e9b9ef8
diff --git a/skills/ppt-master/scripts/confirm_ui/static/app.js b/skills/ppt-master/scripts/confirm_ui/static/app.js
index b6c2157b..995bb378 100644
--- a/skills/ppt-master/scripts/confirm_ui/static/app.js
+++ b/skills/ppt-master/scripts/confirm_ui/static/app.js
@@ -606,11 +606,22 @@
host.appendChild(sec);
}
+ function previewFontStack(primary, fallback) {
+ if (!primary) return fallback || "";
+ if (!fallback) return primary;
+ return primary + ", " + fallback;
+ }
+
function fontSample(box, slot, css) {
var line = el("div", "font-sample-line");
var cjk = el("span", "fs-cjk", slot.sample_cjk || t("sample_cjk"));
var lat = el("span", "fs-latin", slot.sample_latin || t("sample_latin"));
- if (css) { cjk.style.fontFamily = css; lat.style.fontFamily = css; }
+ var cjkStack = previewFontStack(slot.cjk, css);
+ var latinStack = previewFontStack(slot.latin, css);
+ if (cjkStack) cjk.style.fontFamily = cjkStack;
+ if (latinStack) lat.style.fontFamily = latinStack;
+ if (cjkStack) cjk.title = cjkStack;
+ if (latinStack) lat.title = latinStack;
line.appendChild(cjk); line.appendChild(lat); box.appendChild(line);
}
diff --git a/skills/ppt-master/scripts/docs/confirm_ui.md b/skills/ppt-master/scripts/docs/confirm_ui.md
index 0831fc70..caae38ec 100644
--- a/skills/ppt-master/scripts/docs/confirm_ui.md
+++ b/skills/ppt-master/scripts/docs/confirm_ui.md
@@ -106,7 +106,7 @@ Both files live under `<project_path>/confirm_ui/`.
- 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. 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 preview `font-family` stack. Each candidate should also include `body_size` (the body baseline in px; common values are 18 and 24, but any reasonable integer is valid). The page exposes `body_size` as an editable numeric field, and also offers a custom typography text box so the user is not limited to the proposed candidates.
+- **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; common values are 18 and 24, but any reasonable integer is valid). The page exposes `body_size` as an editable numeric field, and also offers a custom typography text box so the user is not limited to the proposed candidates.
- **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.
- `recommend.generation_mode` and `refine_spec` mirror the two mandatory notes in SKILL.md Step 4. Confirmed `generation_mode: "split"` / `refine_spec: true` are explicit user choices, equivalent to opting in through chat.
- `lang` is a soft default; an explicit user language choice in the page (persisted to `localStorage`) wins.