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
feat(typography): enforce role→locked-size order, warn on template px drift
hugohe3126cd75474f7
diff --git a/skills/ppt-master/references/executor-base.md b/skills/ppt-master/references/executor-base.mdindex 9a79852b..c15e049f 100644--- a/skills/ppt-master/references/executor-base.md+++ b/skills/ppt-master/references/executor-base.md@@ -41,7 +41,17 @@ 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`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.)+**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.++**Typography execution order (mandatory):**++1. Build a per-page text inventory from `design_spec.md §IX` + the current `notes/<NN>_*.md`.+2. Classify each text item before drawing. **Structural roles** (`title`, `subtitle` / `lead`, `body`, `annotation`, `footnote` / `page_number`) must map to their declared `spec_lock.typography` slot. A **one-off feature element** (a single hero number, an isolated emphasis label) may take an in-ramp intermediate value — the ramp is anchored on `body`, not a closed menu — but a feature size that **recurs** must be promoted to a declared slot. The failure mode this guards against is structural text silently inheriting the template's compact px, not legitimate feature sizing.+3. Copy the role's locked px value into `font-size` verbatim. Do this before placing the text; never start from a template `font-size` and then "adjust".+4. Layout from those locked sizes: compute line-height, wrapped line count, child `y` / `dy`, card padding, card height, column gaps, and available image/chart area from the chosen px values.+5. Only after this reflow may you inspect fit. If fit fails, move / resize containers or simplify local geometry first; do not reduce the role size merely because the inherited template slot was smaller.++**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. A `font-size` change is a layout change: revise line-height and every downstream vertical coordinate that depends on it. For wrapped text, allocate at least the wrapped line count × line-height plus top / bottom padding; fixed `y` stacks copied from a smaller template are invalid once the locked role size is applied. 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 consumptiondiff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.pyindex 53b68466..8771ba2a 100644--- a/skills/ppt-master/scripts/svg_quality_checker.py+++ b/skills/ppt-master/scripts/svg_quality_checker.py@@ -16,7 +16,7 @@ import jsonimport htmlfrom pathlib import Pathfrom typing import List, Dict, Tuple-from collections import defaultdict+from collections import Counter, defaultdictfrom xml.etree import ElementTree as ETtry:@@ -833,8 +833,10 @@ class SVGQualityChecker:else RAMP_MAX_RATIO)size_drifts = set()+ used_sizes = []for m in re.finditer(r'font-size\s*=\s*["\']([^"\']+)["\']', content):val = self._normalize_size(m.group(1))+ used_sizes.append(val)if not allowed_sizes or val in allowed_sizes:continue# Intermediate values are allowed when they sit inside the ramp@@ -848,6 +850,10 @@ class SVGQualityChecker:passsize_drifts.add(val)+ template_size_drift = self._detect_template_size_drift(+ used_sizes, allowed_sizes, body_px+ )+# Record in run-wide aggregationfname = svg_path.namefor v in color_drifts:@@ -870,6 +876,72 @@ class SVGQualityChecker:f"spec_lock drift: {', '.join(parts)} not in spec_lock.md ""(see drift summary for details)")+ if template_size_drift:+ result['warnings'].append(template_size_drift)++ def _detect_template_size_drift(self, used_sizes, allowed_sizes, body_px):+ """Warn when template-like small sizes bypass the locked type ramp.++ The normal drift check deliberately permits in-ramp feature sizes, so+ it should not hard-fail valid hero numbers or one-off labels. This+ warning targets the common executor failure mode: copying a template's+ compact 12/15/16px text stack instead of mapping content roles to+ spec_lock typography, then reflowing from those locked px values.+ """+ if not allowed_sizes or not body_px or body_px <= 0:+ return None++ try:+ declared_min = min(float(v) for v in allowed_sizes)+ except ValueError:+ declared_min = None++ # Stay narrow on purpose: real decks carry legitimate undeclared+ # sub-body sizes (intermediate levels, labels, emphasis) just below the+ # locked body, so "any size < body" floods the warning and destroys its+ # credibility. Only flag values that read as genuine template leftovers+ # — at or below `body * 0.75`, or below the smallest declared slot. This+ # under-warns (a stray 15/16 against a body of 18 can slip through) in+ # exchange for not crying wolf on valid intermediate type.+ template_like_limit = body_px * 0.75+ template_like_sub_body = []+ for raw in used_sizes:+ if raw in allowed_sizes:+ continue+ try:+ size = float(raw)+ except (TypeError, ValueError):+ continue+ below_declared_floor = declared_min is not None and size < declared_min+ if size <= template_like_limit or below_declared_floor:+ template_like_sub_body.append(raw)++ if not template_like_sub_body:+ return None++ counts = Counter(template_like_sub_body)+ distinct = sorted(counts, key=lambda v: float(v))+ repeated_total = sum(counts.values())++ below_declared_floor = []+ if declared_min is not None:+ below_declared_floor = [v for v in distinct if float(v) < declared_min]++ if len(distinct) < 2 and repeated_total < 4 and not below_declared_floor:+ return None++ sample = ', '.join(+ f"{v}x{counts[v]}" if counts[v] > 1 else v+ for v in distinct[:5]+ )+ more = len(distinct) - 5+ suffix = f" (+{more} more)" if more > 0 else ""+ return (+ "possible template font-size drift: undeclared sub-body size(s) "+ f"{sample}{suffix}. Map each text item to a spec_lock typography "+ "role first, then reflow card height / y / dy / line-height from "+ "the locked px values."+ )def _find_image_sources_manifest(self, svg_path: Path) -> Path | None:"""Locate image_sources.json for a project SVG.