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

feat(svg-to-pptx): inherit project theme fonts

hugohe3ee9e8378bc5e
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.md
index cbc0ac71..9f028785 100644
--- a/skills/ppt-master/SKILL.md
+++ b/skills/ppt-master/SKILL.md
@@ -700,9 +700,13 @@ python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path>
> PowerPoint new-slide picker only offers layouts that belong to the deck, and
> converts `pageNumber` / `slideNumber` chrome whose text exactly equals the
> slide's display number into an auto-updating PowerPoint slide-number field
-> (other numbering schemes keep their literal text). Add
+> (other numbering schemes keep their literal text). For projects with a
+> `spec_lock.md` typography contract, baseline also installs `title_family` as
+> the PowerPoint theme major font and `body_family` / `font_family` as the minor
+> font; matching SVG runs use theme tokens so later theme edits can cascade
+> without changing initial rendering. Add
> `--pptx-structure flat` only for debugging/comparison when all generated
-> backgrounds and chrome must remain slide-local.
+> backgrounds and chrome must remain slide-local and fonts must stay concrete.
> **Preserved source-template export** — a reusable template package created
> from a structured PPTX may ship `native_structure.json` plus
diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.md
index 834d9270..5d7023d4 100644
--- a/skills/ppt-master/references/shared-standards.md
+++ b/skills/ppt-master/references/shared-standards.md
@@ -925,6 +925,31 @@ steal plot area in PPT. Add `show_legend: true` only when the legend is needed;
**Forbidden — native marker transforms**: Do not rotate, skew, or matrix-transform native table/chart marker groups. Translate / scale is accepted; complex transforms fail export because PowerPoint native table/chart frames do not preserve arbitrary SVG transforms.
+### Theme Font Inheritance (Baseline and Template Export)
+
+New projects derive PowerPoint theme fonts from `spec_lock.md` typography when
+native export uses `baseline` or `template` structure mode:
+
+- `title_family` (falling back to `font_family`) becomes the theme major font.
+- `body_family` (falling back to `font_family`) becomes the theme minor font.
+- SVG text whose resolved exported face matches either locked family emits
+ DrawingML `+mj-*` / `+mn-*` tokens instead of a fixed typeface.
+- When major and minor resolve to the same face, ordinary slide-local text uses
+ the minor role; semantic `title` placeholders are forced to major, while
+ body/footer/slide-number placeholders are forced to minor.
+- Local emphasis, code, brand, or other families that do not match the locked
+ title/body faces remain concrete per-run fonts and do not change with the
+ theme.
+
+This substitution is package-only: the SVG stays the live-preview truth, and
+the installed theme resolves the tokens to the same concrete fonts on initial
+open. Changing the PowerPoint theme later can therefore update matching text
+without changing the SVG geometry or the first export's visual design.
+
+`preserve` mode never rewrites source theme fonts, and `flat` remains the
+diagnostic slide-local/fixed-font comparison path. A project without a usable
+`spec_lock.md` typography section keeps the legacy concrete-font behavior.
+
### Explicit PPTX Master / Layout / Placeholder Metadata (Template Export)
**Trigger**: Set `spec_lock.md` `pptx_structure.mode` to `template`, or pass
diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.md
index d4e101ce..d25e6f12 100644
--- a/skills/ppt-master/scripts/docs/svg-pipeline.md
+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md
@@ -63,6 +63,7 @@ Behavior:
- For PPTX template-import workspaces, use `-s svg-flat` when you need a visual round-trip check. The layered `svg/` tree is the machine-readable template source and intentionally does not inline inherited master / layout decoration into each slide.
- Native mode is strict about unsupported visual SVG elements: if a visual element cannot be represented or safely preserved, export fails with the SVG file, element tag, and position instead of silently dropping content.
- Omitting `--pptx-structure` reads `spec_lock.md` `pptx_structure.mode`, then falls back to `baseline`; an explicit CLI value overrides the lock. Template mode builds reusable PowerPoint layouts only from explicit SVG metadata: root `data-pptx-layout`, direct-child `data-pptx-layer="master|layout"`, optional `data-pptx-layer="slide"` on a full-canvas solid background, and direct-child `data-pptx-placeholder`. It validates the per-page `pptx_layouts` lock plus cross-slide structure consistency and never infers layouts from visual similarity. Direct full-canvas solid rects compile to Master/Layout/Slide `p:bg` by scope; an unmarked one is a Slide override. Chart/table placeholders also require `--native-objects`. Full contract: [`shared-standards.md`](../../references/shared-standards.md#explicit-pptx-master--layout--placeholder-metadata-template-export).
+- Baseline/template native export reads `spec_lock.md` typography into the PowerPoint theme: `title_family` becomes the major font and `body_family` / `font_family` becomes the minor font. Matching SVG text emits `+mj-*` / `+mn-*` tokens, while unrelated emphasis/code/brand families stay concrete. Preserve mode keeps the imported source theme; flat mode keeps fixed-font diagnostic output.
- Preserve mode requires both a Strategist-confirmed `template_adherence: strict` and a `create-template` native pair (`native_structure.json` + `source_template.pptx`) declared in `spec_lock.md`. It verifies the source digest, binds each generated page to an imported layout part, retains the source master/layout/theme roster, removes preview-only inherited SVG layers, and restores source placeholder type/index identities. The SVG root still declares `data-pptx-layout`; repeated semantic placeholders may disambiguate with `data-pptx-placeholder-idx`. `template_adherence: adaptive` keeps export on baseline even when the pair is present.
- Native output uses content-hash media filenames, so identical images are reused and different images cannot overwrite each other by sharing a basename.
- `[Content_Types].xml` is generated from the actual media extensions written into the PPTX. Unknown media extensions fail unless Python's `mimetypes` can identify them.
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/context.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/context.py
index 72024d1f..79379282 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/context.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/context.py
@@ -3,10 +3,13 @@
from __future__ import annotations
from pathlib import Path
-from typing import Any
+from typing import TYPE_CHECKING, Any
from xml.etree import ElementTree as ET
from dataclasses import dataclass, field
+if TYPE_CHECKING:
+ from .theme_fonts import ThemeFontSpec
+
AffineMatrix = tuple[float, float, float, float, float, float]
IDENTITY_MATRIX: AffineMatrix = (1.0, 0.0, 0.0, 1.0, 0.0, 0.0)
@@ -67,6 +70,9 @@ class ConvertContext:
# Optional per-element conversion diagnostics. Shared by child contexts so
# callers can inspect native / skipped / unsupported decisions per slide.
trace_events: list[dict[str, Any]] | None = None
+ # Optional project theme contract. Matching SVG title/body families emit
+ # DrawingML +mj/+mn tokens instead of fixed typeface names.
+ theme_font_spec: ThemeFontSpec | None = None
def next_id(self) -> int:
"""Allocate the next shape ID."""
@@ -178,6 +184,7 @@ class ConvertContext:
image_scale=self.image_scale,
image_quality=self.image_quality,
trace_events=self.trace_events,
+ theme_font_spec=self.theme_font_spec,
)
def sync_from_child(self, child_ctx: ConvertContext) -> None:
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.py
index eb5c1f5b..654b6fb5 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.py
@@ -11,6 +11,7 @@ from xml.etree import ElementTree as ET
from resource_paths import icon_search_dirs_for_svg
from .context import ConvertContext, ShapeResult
+from .theme_fonts import ThemeFontSpec
from .utils import (
SVG_NS, EMU_PER_PX,
_extract_inheritable_styles, _f, _get_attr, parse_transform_matrix, resolve_url_id,
@@ -575,6 +576,7 @@ def convert_svg_to_slide_shapes(
image_scale: float = 2.0,
image_quality: int = 85,
native_objects: bool = False,
+ theme_font_spec: ThemeFontSpec | None = None,
trace_out: list[dict[str, Any]] | None = None,
) -> tuple[
str,
@@ -602,6 +604,8 @@ def convert_svg_to_slide_shapes(
image_quality: JPEG quality used for opaque optimized rasters.
native_objects: Convert explicit ``data-pptx-native`` table/chart
markers to native PowerPoint objects. Default off.
+ theme_font_spec: Optional major/minor theme-font contract. Matching SVG
+ families emit DrawingML theme tokens instead of fixed typefaces.
trace_out: Optional list populated with one per-slide trace dictionary.
Returns:
@@ -679,6 +683,7 @@ def convert_svg_to_slide_shapes(
image_quality=image_quality,
native_objects_enabled=native_objects,
trace_events=trace_events,
+ theme_font_spec=theme_font_spec,
)
shapes: list[str] = []
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/elements.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/elements.py
index 04409699..131478ad 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/elements.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/elements.py
@@ -14,6 +14,7 @@ from xml.etree import ElementTree as ET
from resource_paths import resolve_external_image_reference
from .context import ConvertContext, ShapeResult
+from .theme_fonts import theme_font_tokens
from .utils import (
SVG_NS, XLINK_NS, ANGLE_UNIT, FONT_PX_TO_HUNDREDTHS_PT, DASH_PRESETS,
px_to_emu, _f, _get_attr, parse_svg_length,
@@ -1449,7 +1450,10 @@ def _build_run_xml(
spc_attr = _letter_spacing_to_drawingml_spc(letter_spacing_px)
fonts = parse_font_family(ff) if ff else default_fonts
- run_fonts = resolve_text_run_fonts(text, fonts)
+ run_fonts = theme_font_tokens(
+ fonts,
+ ctx.theme_font_spec if ctx is not None else None,
+ ) or resolve_text_run_fonts(text, fonts)
lang = detect_text_lang(text)
fill_xml = _build_text_fill_xml(fill, fill_raw, opacity, ctx)
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/theme_fonts.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/theme_fonts.py
new file mode 100644
index 00000000..0280990b
--- /dev/null
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/theme_fonts.py
@@ -0,0 +1,153 @@
+"""Theme-font contracts shared by SVG conversion and PPTX package assembly."""
+
+from __future__ import annotations
+
+import re
+from dataclasses import dataclass
+from pathlib import Path
+from xml.etree import ElementTree as ET
+
+from .utils import parse_font_family
+
+
+DML_NS = "http://schemas.openxmlformats.org/drawingml/2006/main"
+_LOCK_ROW_RE = re.compile(r"^-\s+([A-Za-z0-9_]+)\s*:\s*(.+?)\s*$")
+_CJK_THEME_SCRIPTS = frozenset({"Hans", "Hant", "Jpan", "Hang"})
+
+
+class ThemeFontError(RuntimeError):
+ """Raised when a project theme-font contract cannot be loaded or applied."""
+
+
+@dataclass(frozen=True)
+class ThemeFontFace:
+ """Concrete Latin, East Asian, and complex-script theme faces."""
+
+ latin: str
+ ea: str
+ cs: str
+
+ def matches(self, fonts: dict[str, str]) -> bool:
+ """Return whether resolved SVG fonts represent this theme face."""
+ return fonts.get("latin") == self.latin and fonts.get("ea") == self.ea
+
+
+@dataclass(frozen=True)
+class ThemeFontSpec:
+ """Major/minor theme fonts derived from one project's typography lock."""
+
+ major: ThemeFontFace
+ minor: ThemeFontFace
+ major_family: str
+ minor_family: str
+
+
+def _font_face(font_family: str) -> ThemeFontFace:
+ fonts = parse_font_family(font_family)
+ return ThemeFontFace(
+ latin=fonts["latin"],
+ ea=fonts["ea"],
+ cs=fonts["latin"],
+ )
+
+
+def _typography_rows(lock_path: Path) -> dict[str, str]:
+ rows: dict[str, str] = {}
+ current_section: str | None = None
+ try:
+ lines = lock_path.read_text(encoding="utf-8").splitlines()
+ except OSError as exc:
+ raise ThemeFontError(f"Cannot read {lock_path}: {exc}") from exc
+
+ for raw_line in lines:
+ line = raw_line.strip()
+ if line.startswith("## "):
+ current_section = line[3:].strip()
+ continue
+ if current_section != "typography":
+ continue
+ match = _LOCK_ROW_RE.fullmatch(line)
+ if match:
+ rows[match.group(1)] = match.group(2)
+ return rows
+
+
+def load_theme_font_spec(project_path: Path) -> ThemeFontSpec | None:
+ """Load major/minor theme fonts from ``spec_lock.md`` typography rows."""
+ lock_path = project_path / "spec_lock.md"
+ if not lock_path.is_file():
+ return None
+ rows = _typography_rows(lock_path)
+ default_family = rows.get("font_family")
+ major_family = rows.get("title_family") or default_family
+ minor_family = rows.get("body_family") or default_family
+ if not major_family or not minor_family:
+ return None
+ return ThemeFontSpec(
+ major=_font_face(major_family),
+ minor=_font_face(minor_family),
+ major_family=major_family,
+ minor_family=minor_family,
+ )
+
+
+def theme_font_tokens(
+ fonts: dict[str, str],
+ spec: ThemeFontSpec | None,
+) -> dict[str, str] | None:
+ """Return DrawingML major/minor tokens for a locked SVG font face."""
+ if spec is None:
+ return None
+ major_match = spec.major.matches(fonts)
+ minor_match = spec.minor.matches(fonts)
+ if major_match and not minor_match:
+ prefix = "+mj"
+ elif minor_match:
+ # When title/body use the same family, minor is the least surprising
+ # default for ordinary text boxes. Template assembly forces semantic
+ # title placeholders to the major role after SVG conversion.
+ prefix = "+mn"
+ else:
+ return None
+ return {
+ "latin": f"{prefix}-lt",
+ "ea": f"{prefix}-ea",
+ "cs": f"{prefix}-cs",
+ }
+
+
+def _patch_font_collection(collection: ET.Element, face: ThemeFontFace) -> None:
+ for tag, value in (("latin", face.latin), ("ea", face.ea), ("cs", face.cs)):
+ elem = collection.find(f"{{{DML_NS}}}{tag}")
+ if elem is None:
+ elem = ET.SubElement(collection, f"{{{DML_NS}}}{tag}")
+ elem.set("typeface", value)
+ for supplemental in collection.findall(f"{{{DML_NS}}}font"):
+ if supplemental.get("script") in _CJK_THEME_SCRIPTS:
+ supplemental.set("typeface", face.ea)
+
+
+def apply_theme_font_spec(extract_dir: Path, spec: ThemeFontSpec) -> None:
+ """Install locked major/minor fonts into every existing PPTX theme part."""
+ theme_dir = extract_dir / "ppt" / "theme"
+ theme_paths = sorted(theme_dir.glob("theme*.xml"))
+ if not theme_paths:
+ raise ThemeFontError(f"PPTX package has no theme part under {theme_dir}")
+
+ ET.register_namespace("a", DML_NS)
+ for theme_path in theme_paths:
+ try:
+ tree = ET.parse(theme_path)
+ except (OSError, ET.ParseError) as exc:
+ raise ThemeFontError(f"Cannot parse {theme_path}: {exc}") from exc
+ font_scheme = tree.getroot().find(f".//{{{DML_NS}}}fontScheme")
+ if font_scheme is None:
+ raise ThemeFontError(f"Theme has no fontScheme: {theme_path}")
+ major = font_scheme.find(f"{{{DML_NS}}}majorFont")
+ minor = font_scheme.find(f"{{{DML_NS}}}minorFont")
+ if major is None or minor is None:
+ raise ThemeFontError(f"Theme has no major/minor font collection: {theme_path}")
+ font_scheme.set("name", "PPT Master")
+ _patch_font_collection(major, spec.major)
+ _patch_font_collection(minor, spec.minor)
+ tree.write(theme_path, encoding="utf-8", xml_declaration=True)
diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.py
index fc23297a..9a18e123 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.py
@@ -27,6 +27,10 @@ from pptx import Presentation
from pptx.util import Emu
from ..drawingml.converter import convert_svg_to_slide_shapes
+from ..drawingml.theme_fonts import (
+ ThemeFontSpec,
+ apply_theme_font_spec,
+)
from ..drawingml.utils import EMU_PER_PX
from .dimensions import (
CANVAS_FORMATS,
@@ -1357,10 +1361,33 @@ def _set_body_placeholder_no_bullets(
paragraph_props.insert(insert_at, ET.Element(f"{{{DML_NS}}}buNone"))
+def _set_placeholder_theme_font_role(
+ shape: ET.Element,
+ item: TemplateElementSpec,
+ theme_font_spec: ThemeFontSpec | None,
+) -> None:
+ """Force semantic text placeholders onto the correct theme font role."""
+ if theme_font_spec is None:
+ return
+ if item.placeholder == "title":
+ prefix = "+mj"
+ elif item.placeholder in {"body", "footer", "slide-number"}:
+ prefix = "+mn"
+ else:
+ return
+ for props_tag in ("rPr", "defRPr", "endParaRPr"):
+ for props in shape.iter(f"{{{DML_NS}}}{props_tag}"):
+ for font_tag, suffix in (("latin", "lt"), ("ea", "ea"), ("cs", "cs")):
+ font = props.find(f"{{{DML_NS}}}{font_tag}")
+ if font is not None:
+ font.set("typeface", f"{prefix}-{suffix}")
+
+
def _layout_placeholder_shape(
source_shape: ET.Element,
item: TemplateElementSpec,
placeholder_idx: int,
+ theme_font_spec: ThemeFontSpec | None = None,
) -> ET.Element:
"""Build one reusable p:sp placeholder from a prototype slide object."""
placeholder_type = _TEMPLATE_PLACEHOLDER_TYPES.get(item.placeholder or "")
@@ -1401,6 +1428,7 @@ def _layout_placeholder_shape(
_replace_shape_xfrm(sp_pr, bounds)
shape.append(sp_pr)
shape.append(_placeholder_text_body(source_shape, item))
+ _set_placeholder_theme_font_role(shape, item, theme_font_spec)
return shape
@@ -1409,6 +1437,7 @@ def _patch_slide_placeholder(
item: TemplateElementSpec,
placeholder_idx: int | None,
placeholder_type: str | None = None,
+ theme_font_spec: ThemeFontSpec | None = None,
) -> None:
resolved_type = placeholder_type or _TEMPLATE_PLACEHOLDER_TYPES.get(
item.placeholder or ""
@@ -1437,6 +1466,7 @@ def _patch_slide_placeholder(
f"Placeholder {item.element_id!r} has no non-visual properties"
)
_set_body_placeholder_no_bullets(shape, item)
+ _set_placeholder_theme_font_role(shape, item, theme_font_spec)
for existing in list(nv_pr):
if existing.tag == f"{{{PML_NS}}}ph":
nv_pr.remove(existing)
@@ -1489,6 +1519,7 @@ def _apply_template_structure(
structure: PptxStructureContext,
specs: list[TemplateSlideSpec],
conversion_traces: list[dict[str, Any]] | None,
+ theme_font_spec: ThemeFontSpec | None,
*,
verbose: bool = False,
) -> None:
@@ -1579,6 +1610,7 @@ def _apply_template_structure(
prototype_shape,
item,
assigned_idx,
+ theme_font_spec,
)
_append_shape_to_part(layout_path, layout_placeholder)
for state in layout_states:
@@ -1588,7 +1620,12 @@ def _apply_template_structure(
f"{state.spec.svg_path.name}: placeholder {item.element_id!r} "
"did not produce a shape"
)
- _patch_slide_placeholder(shape, item, assigned_idx)
+ _patch_slide_placeholder(
+ shape,
+ item,
+ assigned_idx,
+ theme_font_spec=theme_font_spec,
+ )
if item.placeholder != "title":
assigned_placeholder_indices.add(assigned_idx)
placeholder_idx = max(placeholder_idx, assigned_idx + 1)
@@ -2829,6 +2866,7 @@ def create_pptx_with_native_svg(
doc_metadata: dict[str, Any] | None = None,
pptx_structure: str = "baseline",
native_structure_contract: NativeStructureContract | None = None,
+ theme_font_spec: ThemeFontSpec | None = None,
) -> bool:
"""Create a PPTX file with native SVG.
@@ -2872,6 +2910,8 @@ def create_pptx_with_native_svg(
``flat`` keeps generated structure slide-local.
native_structure_contract: Validated source package contract for
``preserve`` mode.
+ theme_font_spec: Locked project major/minor fonts for baseline/template
+ theme inheritance. Preserve and flat modes ignore this value.
Returns:
Whether all slides were successfully created.
@@ -3015,6 +3055,13 @@ def create_pptx_with_native_svg(
zf.extractall(extract_dir)
if use_native_shapes and pptx_structure == "preserve":
_clear_preserved_slide_collections(extract_dir)
+ active_theme_font_spec = (
+ theme_font_spec
+ if use_native_shapes and pptx_structure in {"baseline", "template"}
+ else None
+ )
+ if active_theme_font_spec is not None:
+ apply_theme_font_spec(extract_dir, active_theme_font_spec)
structure = _read_slide_layout_targets(extract_dir, len(svg_files))
media_dir = extract_dir / 'ppt' / 'media'
@@ -3078,6 +3125,7 @@ def create_pptx_with_native_svg(
image_scale=image_scale,
image_quality=image_quality,
native_objects=native_objects,
+ theme_font_spec=active_theme_font_spec,
trace_out=conversion_trace
if conversion_trace is not None
else structure_trace,
@@ -3445,6 +3493,7 @@ def create_pptx_with_native_svg(
structure,
template_specs,
conversion_trace if conversion_trace is not None else structure_trace,
+ active_theme_font_spec,
verbose=verbose,
)
_prune_unused_slide_layouts(
diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
index 8e570f10..b01521eb 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
@@ -29,6 +29,7 @@ if __package__ in {None, ''}:
from .dimensions import CANVAS_FORMATS, get_project_info, get_viewbox_dimensions
from .discovery import find_svg_files, find_notes_files
from .builder import create_pptx_with_native_svg
+from ..drawingml.theme_fonts import ThemeFontError, load_theme_font_spec
from .narration import NARRATION_EXTENSIONS, find_narration_files, probe_audio_duration
from .slide_xml import TRANSITIONS
from .template_structure import (
@@ -361,6 +362,13 @@ Recorded narration:
except TemplateStructureError as exc:
print(f"Error: {exc}", file=sys.stderr)
return 1
+ theme_font_spec = None
+ if pptx_structure in {'baseline', 'template'}:
+ try:
+ theme_font_spec = load_theme_font_spec(project_path)
+ except ThemeFontError as exc:
+ print(f"Error: {exc}", file=sys.stderr)
+ return 1
if args.image_max_dimension < 1:
print("Error: --image-max-dimension must be >= 1", file=sys.stderr)
return 1
@@ -743,6 +751,7 @@ Recorded narration:
native_objects=args.native_objects,
pptx_structure=pptx_structure,
native_structure_contract=native_structure_contract,
+ theme_font_spec=theme_font_spec,
)
success = True
diff --git a/skills/ppt-master/templates/spec_lock_reference.md b/skills/ppt-master/templates/spec_lock_reference.md
index c9b71d8f..b88d4ac2 100644
--- a/skills/ppt-master/templates/spec_lock_reference.md
+++ b/skills/ppt-master/templates/spec_lock_reference.md
@@ -73,7 +73,7 @@
>
> **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 concrete exported Latin / EA typefaces per run with no runtime fallback. Every stack's exported Latin / EA typefaces MUST resolve to cross-platform pre-installed fonts: `"Microsoft YaHei"` / `SimSun` / `Arial` / `"Times New Roman"` / `Consolas`. Stacks that export non-preinstalled typefaces (Inter / Google Fonts / brand typefaces) may be used only when the Design Spec notes the font-install or embedding requirement.
+> **⚠️ PPT-safe stack discipline (HARD rule).** Native `baseline` / `template` export maps `title_family` to the PowerPoint theme major font and `body_family` (or `font_family`) to the theme minor font. Runs whose resolved face matches either role use `+mj-*` / `+mn-*` theme tokens; other role families remain concrete per-run typefaces. Every exported Latin / EA face MUST therefore resolve to cross-platform pre-installed fonts: `"Microsoft YaHei"` / `SimSun` / `Arial` / `"Times New Roman"` / `Consolas`. Stacks that resolve to non-preinstalled typefaces (Inter / Google Fonts / brand typefaces) may be used only when the Design Spec notes the font-install or embedding requirement. `preserve` keeps the source template theme; `flat` keeps concrete fonts for diagnostics.
>
> **Stack length discipline.** 3-4 fonts per stack is the sweet spot. Converter only writes the **first** Latin and **first** CJK font into PPTX — everything after is silently dropped. macOS-only families (`Songti SC`, `Menlo`, `Monaco`, `Helvetica`) are auto-mapped to Windows equivalents via `FONT_FALLBACK_WIN` (see `scripts/svg_to_pptx/drawingml/utils.py`); stacking both is redundant. Lead with Windows-preinstalled fonts (`Microsoft YaHei` / `SimSun` / `Arial` / `Georgia` / `Consolas`); keep at most **one** macOS-exclusive family (typically `"PingFang SC"`) as a browser-preview nicety.