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: reject series-level line_style, accept Cambria Math, keep JSON CDATA through compaction

hugohe34a7512ececdb
diff --git a/skills/ppt-master/references/native-formula.md b/skills/ppt-master/references/native-formula.md
index f75616b6..89bdeec1 100644
--- a/skills/ppt-master/references/native-formula.md
+++ b/skills/ppt-master/references/native-formula.md
@@ -67,4 +67,4 @@ Formula handling is not a user-confirmed policy, image resource, manifest, or `s
**Hard rule — repair LaTeX upstream**: unsupported source or an invalid marker blocks the page. Rewrite within the profile without changing the planned mathematics, or return it to the content owner. Never substitute a PNG, flatten structural math into ordinary text, hand-write OMML, or leave raw LaTeX visible.
-**Validation**: the early/final SVG checker validates every marker, compiles its LaTeX, and applies the shared native-height envelope to page/module text bounds; native export repeats validation and uses that envelope for the generated text frame. Output is standard editable Office Math for PowerPoint 2010+; WPS, Keynote, and LibreOffice receive no embedded fallback and are outside the rendering/editability contract.
+**Validation**: planned LaTeX can be compile-checked before authoring ([`svg-pipeline.md`](../scripts/docs/svg-pipeline.md) § svg_to_pptx); the early/final SVG checker validates every marker, compiles its LaTeX, and applies the shared native-height envelope to page/module text bounds; native export repeats validation and uses that envelope for the generated text frame. Output is standard editable Office Math for PowerPoint 2010+; WPS, Keynote, and LibreOffice receive no embedded fallback and are outside the rendering/editability contract.
diff --git a/skills/ppt-master/references/plan-core.md b/skills/ppt-master/references/plan-core.md
index 4513f6ad..168555c9 100644
--- a/skills/ppt-master/references/plan-core.md
+++ b/skills/ppt-master/references/plan-core.md
@@ -163,7 +163,7 @@ python3 skills/ppt-master/scripts/visualization_recall.py validate \
**Family selection**: user/template typography is authoritative. Delivery target: an explicit user/template target first, otherwise Windows Microsoft PowerPoint (owner: [`shared-standards-core.md`](./shared-standards-core.md) §4.1) — the authoring host's installed fonts never select a face; name concrete faces installed or approved on that target; at most four families; a brand/web face leads only after user-confirmed installation, otherwise export a safe face and keep it as a Design Spec reference (fonts are not embedded; CSS tails are preview aids, not PowerPoint fallbacks). Avoid near-equivalent splits (YaHei↔PingFang, SimSun↔Songti, Arial↔Helvetica↔Segoe UI, Times↔Times New Roman). Fonts in one deck form contrast (different family, weight, or proportion) or concord (one family throughout); across the direction set include both a concord and a contrast pairing unless the user or template fixes the stack, and never default to title = body without a reason.
-**Reference — PPT-safe faces (recall, not a whitelist; one concrete named face per script — a stack carries at most one Latin face and one CJK face and never a fallback list of alternatives, because export takes the first named face of each script)**: CJK sans `Microsoft YaHei` / `SimHei`, CJK serif `SimSun` / `FangSong` / `KaiTi` (their macOS counterparts `PingFang SC` / `Heiti SC` / `Songti SC` are preview aliases, never the named face), Traditional Chinese sans `Microsoft JhengHei`, serif `PMingLiU` / `DFKai-SB`, Japanese sans `Yu Gothic` / `Meiryo`, serif `Yu Mincho`, Korean sans `Malgun Gothic`, serif `Batang` (text on another locale's CJK face takes that locale's glyph forms), Arabic `Segoe UI` / `Tahoma` / `Times New Roman` (one face carries both the Latin and Arabic text), Latin sans `Arial` / `Calibri` / `Segoe UI` / `Verdana` / `Trebuchet MS`, Latin serif `Times New Roman` / `Georgia` / `Cambria` / `Palatino` / `Garamond` (`Georgia` sets old-style figures whose digits sit at different heights — a hero-number or data role needs lining figures: `Times New Roman`, `Cambria`, or any listed sans or mono), mono `Consolas` / `Courier New`, display `Impact` / `Arial Black`. Let the locked style's character pick the axis and lead the title — `Microsoft YaHei` / `Arial` are the neutral members, never the automatic lead; a neutral sans title where the style asks for character is the failure to avoid. Non-pre-installed directions — retro/pixel Press Start 2P / VT323, rounded Nunito / Quicksand / OPPO Sans (safe substitute `Trebuchet MS` / `Verdana`), modern web Inter / HarmonyOS Sans / Source Han, calligraphic 隶书 / 华文行楷 / 华文新魏 (safe substitute `KaiTi` / `FangSong`, titles only), brand faces — need target installation or stay Design Spec references.
+**Reference — PPT-safe faces (recall, not a whitelist; one concrete named face per script — a stack carries at most one Latin face and one CJK face and never a fallback list of alternatives, because export takes the first named face of each script)**: CJK sans `Microsoft YaHei` / `SimHei`, CJK serif `SimSun` / `FangSong` / `KaiTi` (their macOS counterparts `PingFang SC` / `Heiti SC` / `Songti SC` are preview aliases, never the named face), Traditional Chinese sans `Microsoft JhengHei`, serif `PMingLiU` / `DFKai-SB`, Japanese sans `Yu Gothic` / `Meiryo`, serif `Yu Mincho`, Korean sans `Malgun Gothic`, serif `Batang` (text on another locale's CJK face takes that locale's glyph forms), Arabic `Segoe UI` / `Tahoma` / `Times New Roman` (one face carries both the Latin and Arabic text), Latin sans `Arial` / `Calibri` / `Segoe UI` / `Verdana` / `Trebuchet MS`, Latin serif `Times New Roman` / `Georgia` / `Cambria` / `Palatino` / `Garamond` (`Georgia` sets old-style figures whose digits sit at different heights — a hero-number or data role needs lining figures: `Times New Roman`, `Cambria`, or any listed sans or mono), mono `Consolas` / `Courier New`, math `Cambria Math` (formula preview runs only), display `Impact` / `Arial Black`. Let the locked style's character pick the axis and lead the title — `Microsoft YaHei` / `Arial` are the neutral members, never the automatic lead; a neutral sans title where the style asks for character is the failure to avoid. Non-pre-installed directions — retro/pixel Press Start 2P / VT323, rounded Nunito / Quicksand / OPPO Sans (safe substitute `Trebuchet MS` / `Verdana`), modern web Inter / HarmonyOS Sans / Source Han, calligraphic 隶书 / 华文行楷 / 华文新魏 (safe substitute `KaiTi` / `FangSong`, titles only), brand faces — need target installation or stay Design Spec references.
**Role extension after confirmation**: while composing the roster, add a lowercase snake_case role with an exact stack only for a recurring role that materially needs a different family (`annotation`, `footer`, `footnote`, `data`, `emphasis`, `quote`, `code`), coherent with the confirmed heading/body system and locked style; one-off garnish stays omitted and Default names any added role in one compact `Role rationale` line in §IV.
diff --git a/skills/ppt-master/scripts/compact_svg_styles.py b/skills/ppt-master/scripts/compact_svg_styles.py
index cd0fd18c..e6bc5424 100644
--- a/skills/ppt-master/scripts/compact_svg_styles.py
+++ b/skills/ppt-master/scripts/compact_svg_styles.py
@@ -515,11 +515,48 @@ def _compact_svg_bytes(
encoding="utf-8",
xml_declaration=original.lstrip().startswith(b"<?xml"),
)
+ if b"<![CDATA[" in original:
+ payload = _restore_json_cdata(payload)
if not payload.endswith(b"\n"):
payload += b"\n"
return payload, stats
+_JSON_METADATA_RE = re.compile(
+ rb'(<metadata\b[^>]*\btype="application/json"[^>]*>)(.*?)(</metadata>)',
+ re.DOTALL,
+)
+_XML_ENTITY_UNESCAPES = (
+ (b"&lt;", b"<"),
+ (b"&gt;", b">"),
+ (b"&quot;", b'"'),
+ (b"&apos;", b"'"),
+ (b"&amp;", b"&"),
+)
+
+
+def _restore_json_cdata(payload: bytes) -> bytes:
+ """Re-wrap serialized JSON metadata in CDATA.
+
+ ElementTree drops CDATA sections on parse and escapes ``<``/``&`` on
+ write; the native payload examples are authored as CDATA, so a compacted
+ file keeps that form for grep-style readers.
+ """
+
+ def _wrap(match: re.Match[bytes]) -> bytes:
+ body = match.group(2)
+ if body.lstrip().startswith(b"<![CDATA["):
+ return match.group(0)
+ text = body
+ for entity, literal in _XML_ENTITY_UNESCAPES:
+ text = text.replace(entity, literal)
+ if b"]]>" in text:
+ return match.group(0)
+ return match.group(1) + b"<![CDATA[" + text + b"]]>" + match.group(3)
+
+ return _JSON_METADATA_RE.sub(_wrap, payload)
+
+
def _write_atomic(path: Path, payload: bytes) -> None:
mode = stat.S_IMODE(path.stat().st_mode)
with tempfile.NamedTemporaryFile(
diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.md
index a074e644..b81192d4 100644
--- a/skills/ppt-master/scripts/docs/svg-pipeline.md
+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md
@@ -765,7 +765,13 @@ stores delimiter-free LaTeX in the JSON metadata of
`<tspan data-pptx-inline-formula="...">preview</tspan>` inside ordinary text
exports `m:oMath` in the same DrawingML paragraph as its surrounding runs; it
inherits computed size and visible solid fill, then uses the project text
-language and Cambria Math.
+language and Cambria Math. LaTeX can be compile-checked before any SVG is
+written, so an unsupported command is caught at planning time:
+
+```bash
+python3 -c "import sys; sys.path.insert(0, 'skills/ppt-master/scripts'); from svg_to_pptx.native_objects.formula_compiler import compile_latex_to_omml as c; c(sys.argv[1])" '\frac{a}{b} \int_0^T e^{-i\omega t}\, dt'
+```
+
Matrices, multiline derivations, and other high-structure expressions remain
blocks. Formula replacement is always active, independent of
`--native-charts-and-tables`: export replaces only the registered SVG preview
diff --git a/skills/ppt-master/scripts/pptx_shapes/data/presetShapeSemantics.json b/skills/ppt-master/scripts/pptx_shapes/data/presetShapeSemantics.json
index 3e9bd10e..b117895c 100644
--- a/skills/ppt-master/scripts/pptx_shapes/data/presetShapeSemantics.json
+++ b/skills/ppt-master/scripts/pptx_shapes/data/presetShapeSemantics.json
@@ -1173,10 +1173,10 @@
"Use the cloud variant only for thought, uncertainty, or a literal cloud context."
],
"presets": {
- "wedgeRectCallout": {"intent": "Rectangular annotation body with a pointed wedge to the target."},
- "wedgeRoundRectCallout": {"intent": "Rounded rectangular annotation body with a pointed wedge."},
- "wedgeEllipseCallout": {"intent": "Oval speech-like annotation body with a pointed wedge."},
- "cloudCallout": {"intent": "Cloud-shaped thought callout with a dotted tail."}
+ "wedgeRectCallout": {"intent": "Rectangular annotation body with a pointed wedge to the target.", "adjustment_notes": "adj1 / adj2 place the wedge tip relative to the shape centre, in 1/100000 of width / height: negative = left / above, positive = right / below; the defaults point down-left."},
+ "wedgeRoundRectCallout": {"intent": "Rounded rectangular annotation body with a pointed wedge.", "adjustment_notes": "adj1 / adj2 place the wedge tip relative to the shape centre, in 1/100000 of width / height: negative = left / above, positive = right / below; the defaults point down-left."},
+ "wedgeEllipseCallout": {"intent": "Oval speech-like annotation body with a pointed wedge.", "adjustment_notes": "adj1 / adj2 place the wedge tip relative to the shape centre, in 1/100000 of width / height: negative = left / above, positive = right / below; the defaults point down-left."},
+ "cloudCallout": {"intent": "Cloud-shaped thought callout with a dotted tail.", "adjustment_notes": "adj1 / adj2 place the tail bubble relative to the shape centre, in 1/100000 of width / height: negative = left / above, positive = right / below; the defaults point down-left."}
}
},
{
diff --git a/skills/ppt-master/scripts/pptx_shapes/semantics.py b/skills/ppt-master/scripts/pptx_shapes/semantics.py
index a941005f..e7043a5e 100644
--- a/skills/ppt-master/scripts/pptx_shapes/semantics.py
+++ b/skills/ppt-master/scripts/pptx_shapes/semantics.py
@@ -342,6 +342,7 @@ class PresetShapeSemantics:
"literal_only",
"recommended_for",
"avoid_for",
+ "adjustment_notes",
},
)
normalized_details: dict[str, object] = {
@@ -386,6 +387,11 @@ class PresetShapeSemantics:
details[field],
f"{preset_label}.{field}",
)
+ if "adjustment_notes" in details:
+ normalized_details["adjustment_notes"] = _require_string(
+ details["adjustment_notes"],
+ f"{preset_label}.adjustment_notes",
+ )
normalized_presets[preset_name] = normalized_details
recommended_for = _require_string_list(
group.get("recommended_for"),
diff --git a/skills/ppt-master/scripts/preset_shape_svg.py b/skills/ppt-master/scripts/preset_shape_svg.py
index c1410652..ae345a08 100644
--- a/skills/ppt-master/scripts/preset_shape_svg.py
+++ b/skills/ppt-master/scripts/preset_shape_svg.py
@@ -306,6 +306,11 @@ def main(argv: Sequence[str] | None = None) -> int:
"scope": semantics["scope"],
"literal_only": semantics["literal_only"],
"adjustments": adjustments,
+ **(
+ {"adjustment_notes": semantics["adjustment_notes"]}
+ if "adjustment_notes" in semantics
+ else {}
+ ),
"connector_preset": connector_preset,
"path_count": path_count,
"connection_site_count": connection_site_count,
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py
index 9f8db3db..30aae0ff 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py
@@ -177,7 +177,7 @@ PPT_SAFE_FONTS = frozenset({
'malgun gothic', 'gulim', 'dotum', 'batang',
'arial', 'arial black', 'calibri', 'segoe ui', 'verdana',
'helvetica', 'helvetica neue', 'tahoma', 'trebuchet ms',
- 'times new roman', 'times', 'georgia', 'cambria', 'palatino',
+ 'times new roman', 'times', 'georgia', 'cambria', 'cambria math', 'palatino',
'garamond', 'book antiqua',
'consolas', 'courier new', 'menlo', 'monaco',
'impact',
diff --git a/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_data.py b/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_data.py
index 894df889..5add193c 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_data.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_data.py
@@ -891,6 +891,14 @@ def _category_series(
for idx, item in enumerate(raw_series, start=1):
if not isinstance(item, dict):
raise RuntimeError("Native PPTX chart series entries must be objects")
+ if (
+ _first_present(item.get("line_style"), item.get("lineStyle")) is not None
+ and not (item.get("type") or item.get("chart_type"))
+ ):
+ raise RuntimeError(
+ "Native PPTX chart series[].line_style is not a series option; "
+ "set line_style on the chart root (combo: on the plot or typed series)"
+ )
values = [
_chart_point_value(value)
for value in _chart_list(item.get("values", []), "series[].values")
diff --git a/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_style.py b/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_style.py
index 4209c851..116a360e 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_style.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_style.py
@@ -843,8 +843,9 @@ def _native_chart_line_marker_warnings(
if not has_markers:
warnings.append(
f"Native PPTX line chart fallback draws {len(dots)} point marker(s) "
- "but the payload has none; set line_style \"lineMarker\" (marker_size in px) "
- "for every point, or series point_colors with a colour per marked point "
+ "but the payload has none; set chart-root line_style \"lineMarker\" "
+ "(combo: per plot; marker_size in px) for every point, or series "
+ "point_colors with a colour per marked point "
"and null elsewhere"
)
series_count = (
diff --git a/skills/ppt-master/scripts/tests/test_dogfood_fourier_fixes.py b/skills/ppt-master/scripts/tests/test_dogfood_fourier_fixes.py
new file mode 100644
index 00000000..4349dd57
--- /dev/null
+++ b/skills/ppt-master/scripts/tests/test_dogfood_fourier_fixes.py
@@ -0,0 +1,85 @@
+"""Regressions from the Fourier-transform formula deck dogfood (2026-09-12)."""
+
+from __future__ import annotations
+
+import sys
+import tempfile
+import unittest
+from pathlib import Path
+
+SCRIPTS_DIR = Path(__file__).resolve().parents[1]
+if str(SCRIPTS_DIR) not in sys.path:
+ sys.path.insert(0, str(SCRIPTS_DIR))
+
+import compact_svg_styles # noqa: E402
+import text_measure # noqa: E402
+from svg_to_pptx.drawingml.utils import unsafe_exported_font_faces # noqa: E402
+from svg_to_pptx.native_objects.chart_data import _chart_data # noqa: E402
+
+
+def _line_payload(**series_extra: object) -> dict[str, object]:
+ return {
+ "type": "line",
+ "categories": ["a", "b", "c"],
+ "series": [{"name": "s", "values": [1, 2, 3], **series_extra}],
+ }
+
+
+class SeriesLineStyleTests(unittest.TestCase):
+ def test_series_level_line_style_is_rejected_with_pointer(self) -> None:
+ with self.assertRaises(RuntimeError) as ctx:
+ _chart_data(_line_payload(line_style="lineMarker"))
+ self.assertIn("series[].line_style", str(ctx.exception))
+ self.assertIn("chart root", str(ctx.exception))
+
+ def test_root_line_style_still_accepted(self) -> None:
+ payload = _line_payload()
+ payload["line_style"] = "lineMarker"
+ self.assertEqual(_chart_data(payload)["line_style"], "lineMarker")
+
+ def test_typed_combo_series_keep_line_style(self) -> None:
+ payload = {
+ "type": "combo",
+ "categories": ["a", "b"],
+ "series": [
+ {"type": "column", "name": "c", "values": [1, 2]},
+ {"type": "line", "name": "l", "values": [2, 3], "line_style": "lineMarker"},
+ ],
+ }
+ plots = _chart_data(payload)["plots"]
+ self.assertEqual(plots[1]["line_style"], "lineMarker")
+
+
+class CambriaMathTests(unittest.TestCase):
+ def test_formula_face_is_not_flagged(self) -> None:
+ self.assertEqual(unsafe_exported_font_faces("Cambria Math"), {})
+
+
+class OutlineSplitTests(unittest.TestCase):
+ def test_ascii_semicolon_before_cjk_splits_blocks(self) -> None:
+ parts = text_measure._split_joined_blocks("A · B;C · 含 4 个导频;子载波间隔 · D")
+ self.assertEqual(parts, ["A", "B;C", "含 4 个导频", "子载波间隔", "D"])
+
+
+class CompactCdataTests(unittest.TestCase):
+ SVG = (
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">'
+ '<g id="f" data-pptx-replace-with="formula">'
+ '<metadata type="application/json"><![CDATA[{"latex": "a < b & c"}]]></metadata>'
+ '<text x="1" y="2" style="fill:#000000;font-size:12px">a</text>'
+ '<text x="1" y="20" style="fill:#000000;font-size:12px">b</text>'
+ "</g></svg>\n"
+ )
+
+ def test_json_metadata_keeps_cdata_after_compaction(self) -> None:
+ with tempfile.TemporaryDirectory() as tmp:
+ path = Path(tmp) / "t.svg"
+ path.write_text(self.SVG, encoding="utf-8")
+ payload, stats = compact_svg_styles._compact_svg_bytes(path)
+ self.assertGreater(stats.changed_declarations, 0)
+ self.assertIn(b'<![CDATA[{"latex": "a < b & c"}]]>', payload)
+ self.assertNotIn(b"&lt;", payload)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/skills/ppt-master/scripts/text_measure.py b/skills/ppt-master/scripts/text_measure.py
index 6cd000b3..a19a2f1d 100644
--- a/skills/ppt-master/scripts/text_measure.py
+++ b/skills/ppt-master/scripts/text_measure.py
@@ -397,7 +397,7 @@ def _clean_planned_line(raw: str) -> str:
return ' '.join(text.split())
-_JOINED_BLOCK_SEPARATOR_RE = re.compile(r'\s+[·•|/]\s+|;|;\s')
+_JOINED_BLOCK_SEPARATOR_RE = re.compile(r'\s+[·•|/]\s+|;|;(?=\s|[^\x00-\x7f])')
def _split_joined_blocks(text: str) -> list[str]: