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_quality_checker): pattern fill PPTX safety net

hugohe3fd648184bb3a
diff --git a/docs/roadmap.md b/docs/roadmap.md
index 73ef6a4c..544db129 100644
--- a/docs/roadmap.md
+++ b/docs/roadmap.md
@@ -38,6 +38,7 @@ The past two months' structural capability growth. Single flags / incremental po
- **AI image: Type concept boundary clarification** — Type is now narrowed to "the internal geometric skeleton of a local infographic block" (11 real skeletons); the four pseudo-types (hero / background / portrait / typography) fold back into `page_role: hero_page` plus four composition primitives (single-subject / portrait / typographic / atmospheric); hero_page text layering rule (visual keywords embedded, editable text via SVG overlay)
- **Brutalist AI newspaper example deck shipped** ([`examples/ppt169_brutalist_ai_newspaper_2026/`](../examples/ppt169_brutalist_ai_newspaper_2026/)) — first of the three P0 capability-backing demos: wall-to-wall small type + irregular columns + halftone monochrome + single-spot red + real native shapes; 10-page editorial annual report stressing text-position precision and cross-page consistency
- **Kubernetes Blueprint example deck shipped** ([`examples/ppt169_kubernetes_blueprint_2026/`](../examples/ppt169_kubernetes_blueprint_2026/)) — second of the three P0 capability-backing demos: isometric technical-drawing aesthetic + blueprint cyan/amber palette + hand-authored SVG geometry (no raster images) + custom drawing-in animation; 10-page Kubernetes architecture walkthrough stressing geometric shape generalization and chart-structure extensibility
+- **Pattern fill PPTX safety net** — `svg_quality_checker.py` now warns on `<pattern>` without `data-pptx-pattern` (silent fallback to `ltUpDiag`) and errors on values outside OOXML `ST_PresetPatternVal` (schema-failed PPTX that won't open); `shared-standards.md §7` documents the closed preset enum and the required `<rect fill="<bg>"/>` child convention
---
diff --git a/docs/zh/roadmap.md b/docs/zh/roadmap.md
index 416e0d03..fb5c9ad5 100644
--- a/docs/zh/roadmap.md
+++ b/docs/zh/roadmap.md
@@ -38,6 +38,7 @@
- **AI 图 Type 概念边界澄清** — Type 收窄回「local 信息图的内部几何骨架」(11 个真骨架);原 4 个伪 type (hero/background/portrait/typography) 折回 `page_role: hero_page` + 4 条构图通则(single-subject / portrait / typographic / atmospheric);hero_page 文字分层规则(关键视觉词 embedded、可改文字走 SVG)
- **Brutalist AI 报章示例 deck 交付**([`examples/ppt169_brutalist_ai_newspaper_2026/`](../../examples/ppt169_brutalist_ai_newspaper_2026/)) — P0 三档第一档落地:满版小字 + 不规则栏宽 + halftone 黑白图 + 单点红 + 真原生 shape,10 页编辑部年报实压「文字位置精度 + 跨页一致性」
- **Kubernetes Blueprint 示例 deck 交付**([`examples/ppt169_kubernetes_blueprint_2026/`](../../examples/ppt169_kubernetes_blueprint_2026/)) — P0 三档第二档落地:等距工程图美学 + 蓝图青/琥珀色板 + 全手写 SVG 几何(无 raster 图)+ 自定义"逐笔绘制"动画,10 页 Kubernetes 架构走读实压「几何形状泛化 + chart 结构扩展性」
+- **Pattern 填充 PPTX 安全网** — `svg_quality_checker.py` 现在对未标 `data-pptx-pattern` 的 `<pattern>` 元素发 warning(会静默回退 `ltUpDiag` 斜纹)、对超出 OOXML `ST_PresetPatternVal` 枚举的值发 error(schema 校验失败 PPT 无法打开);`shared-standards.md §7` 落地了完整 preset 清单和 `<rect fill="<bg>"/>` 子元素约定
---
diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.md
index 7846d7da..4c4ee952 100644
--- a/skills/ppt-master/references/shared-standards.md
+++ b/skills/ppt-master/references/shared-standards.md
@@ -39,6 +39,8 @@ One offending character invalidates the file and aborts export. Numeric refs (`&
>
> **`clipPath` on `<image>` is conditionally allowed** — see §1.2 for constraints. The converter maps qualifying clip shapes to native DrawingML picture geometry (`<a:prstGeom>` or `<a:custGeom>`).
>
+> **`<pattern>` fills are conditionally allowed** — see §7 *Pattern Fill* for the required `data-pptx-pattern` annotation and the closed OOXML preset enum. Hand-drawn pattern geometry is NOT honored; the converter emits the named PPTX preset only. Missing or invalid preset values produce diagonal stripes (warning) or schema-failed PPTX (error).
+>
> **Replacing `<mask>` effects** — DrawingML has no per-pixel alpha. Route by effect:
> - Image gradient overlay (vignette/fade/tint) → stacked `<rect>` with `<linearGradient>`/`<radialGradient>` (§6 Image Overlay)
> - Non-rectangular image crop (circle/rounded/hexagon) → `clipPath` on `<image>` (§1.2)
@@ -647,6 +649,43 @@ Gradients defined in `<defs>` and referenced via `fill="url(#id)"` convert to na
<circle cx="640" cy="360" r="300" fill="url(#spotBg)"/>
```
+### Pattern Fill — `<pattern>` with PPTX preset annotation
+
+`<pattern>` fills convert to native PPTX `<a:pattFill prst="...">` — but only PPTX's built-in preset patterns are reachable. The converter does **not** render hand-drawn `<path>` geometry inside the pattern; instead it reads two annotations off the `<pattern>` element and emits the matching DrawingML preset.
+
+**Required annotations**:
+
+| Attribute | Purpose | Without it |
+|---|---|---|
+| `data-pptx-pattern="<preset>"` | Names the PPTX preset (one of the enum below) | Falls back to `ltUpDiag` — diagonal stripes, not your geometry |
+| Child `<rect fill="<bg-hex>"/>` | Background color of the pattern tile | `bg` falls back to `#FFFFFF`, painting over the page background |
+
+The child `<path>`'s `stroke` becomes the foreground color (the pattern's line color).
+
+```xml
+<defs>
+ <pattern id="bpGrid" x="0" y="0" width="40" height="40"
+ patternUnits="userSpaceOnUse" data-pptx-pattern="lgGrid">
+ <rect width="40" height="40" fill="#0E2A47"/>
+ <path d="M 40 0 L 0 0 0 40" fill="none" stroke="#2D4A6B" stroke-width="0.6"/>
+ </pattern>
+</defs>
+<rect width="1280" height="720" fill="url(#bpGrid)"/>
+```
+
+**Valid `data-pptx-pattern` values** (OOXML `ST_PresetPatternVal` — closed enum, anything outside makes PowerPoint open with "needs to be repaired"):
+
+| Category | Values |
+|---|---|
+| Grids | `smGrid` · `lgGrid` · `dotGrid` *(no `ltGrid` — common typo)* |
+| Diagonal lines | `ltUpDiag` · `ltDnDiag` · `dkUpDiag` · `dkDnDiag` · `wdUpDiag` · `wdDnDiag` · `dashUpDiag` · `dashDnDiag` · `diagCross` |
+| Horizontal / vertical lines | `horz` · `vert` · `ltHorz` · `ltVert` · `dkHorz` · `dkVert` · `narHorz` · `narVert` · `dashHorz` · `dashVert` · `cross` |
+| Percent fills | `pct5` · `pct10` · `pct20` · `pct25` · `pct30` · `pct40` · `pct50` · `pct60` · `pct70` · `pct75` · `pct80` · `pct90` |
+| Checks & confetti | `smCheck` · `lgCheck` · `smConfetti` · `lgConfetti` |
+| Decorative | `horzBrick` · `diagBrick` · `weave` · `plaid` · `trellis` · `zigZag` · `wave` · `sphere` · `divot` · `shingle` · `solidDmnd` · `openDmnd` · `dotDmnd` |
+
+> `svg_quality_checker.py` warns on missing `data-pptx-pattern` and errors on values outside the enum. Catch these pre-export — PowerPoint's repair dialog hides which pattern broke.
+
### transform: rotate — Element Rotation
Rotation converts to native PPTX `<a:xfrm rot="...">`. Supported on all element types: `rect`, `circle`, `ellipse`, `line`, `path`, `polygon`, `polyline`, `image`, and `text`.
diff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.py
index 29ce981b..ddf56fe8 100644
--- a/skills/ppt-master/scripts/svg_quality_checker.py
+++ b/skills/ppt-master/scripts/svg_quality_checker.py
@@ -271,6 +271,9 @@ class SVGQualityChecker:
# 7. Check object-level animation anchor quality.
self._check_animation_group_ids(content, result)
+ # 7b. Check <pattern> elements declare a PPTX preset.
+ self._check_pattern_fills(content, result)
+
# 8. Check spec_lock drift (colors / font-family / font-size).
# Templates do not ship a spec_lock.md, so skip in template
# mode to avoid noise.
@@ -616,6 +619,68 @@ class SVGQualityChecker:
"object-level animation config cannot reference it"
)
+ # OOXML ST_PresetPatternVal enum — anything outside this set produces a
+ # PPTX schema violation ("PowerPoint found a problem with the content").
+ _OOXML_PATTERN_PRESETS = frozenset({
+ 'pct5', 'pct10', 'pct20', 'pct25', 'pct30', 'pct40', 'pct50', 'pct60',
+ 'pct70', 'pct75', 'pct80', 'pct90',
+ 'horz', 'vert', 'ltHorz', 'ltVert', 'dkHorz', 'dkVert',
+ 'narHorz', 'narVert', 'dashHorz', 'dashVert',
+ 'cross', 'dnDiag', 'upDiag', 'ltDnDiag', 'ltUpDiag', 'dkDnDiag',
+ 'dkUpDiag', 'wdDnDiag', 'wdUpDiag',
+ 'dashDnDiag', 'dashUpDiag', 'diagCross',
+ 'smCheck', 'lgCheck', 'smGrid', 'lgGrid', 'dotGrid', 'smConfetti',
+ 'lgConfetti', 'horzBrick', 'diagBrick', 'solidDmnd', 'openDmnd',
+ 'dotDmnd', 'plaid', 'sphere', 'weave', 'wave', 'trellis', 'zigZag',
+ 'divot', 'shingle',
+ })
+
+ def _check_pattern_fills(self, content: str, result: Dict):
+ """Audit <pattern> defs that drive PPTX <a:pattFill> output.
+
+ svg_to_pptx maps <pattern fill> to native <a:pattFill prst="...">. The
+ preset name comes from `data-pptx-pattern` (e.g. `lgGrid` / `smGrid` /
+ `dkUpDiag`). Two failure modes worth catching pre-export:
+
+ 1. Missing annotation → converter silently falls back to `ltUpDiag`
+ (diagonal stripes) and picks `bg = #FFFFFF` when the pattern has
+ no child <rect>, turning a hand-authored grid into white-on-stripes
+ in PPTX.
+ 2. Invalid preset name → PPTX schema rejects the file; PowerPoint
+ opens it with "needs to be repaired". OOXML
+ `ST_PresetPatternVal` is a closed enum — only the names in
+ `_OOXML_PATTERN_PRESETS` are legal. Inventing `ltGrid` (no such
+ value) is the canonical mistake; the only grids are `smGrid` /
+ `lgGrid` / `dotGrid`.
+ """
+ try:
+ root = ET.fromstring(content)
+ except ET.ParseError:
+ return
+
+ for pattern in root.iter(f'{{{SVG_NS}}}pattern'):
+ pat_id = pattern.get('id', '<unnamed>')
+ prst = pattern.get('data-pptx-pattern')
+ if not prst:
+ result['warnings'].append(
+ f"<pattern id=\"{pat_id}\"> has no data-pptx-pattern attribute — "
+ "PPTX export will fall back to `ltUpDiag` (diagonal stripes), "
+ "not your custom geometry. Add data-pptx-pattern=\"lgGrid\" / "
+ "\"smGrid\" / etc. plus a <rect fill=\"<bg>\"/> child so the "
+ "preset and bg color match your design."
+ )
+ continue
+ if prst not in self._OOXML_PATTERN_PRESETS:
+ result['errors'].append(
+ f"<pattern id=\"{pat_id}\"> uses data-pptx-pattern=\"{prst}\" "
+ "which is not in OOXML ST_PresetPatternVal — exported PPTX "
+ "will fail schema validation ('needs to be repaired'). "
+ "Use one of: smGrid / lgGrid / dotGrid (grids), "
+ "ltUpDiag / dkUpDiag / cross / diagCross / weave / plaid / "
+ "horzBrick (others); full enum in svg_quality_checker.py "
+ "_OOXML_PATTERN_PRESETS."
+ )
+
def _get_spec_lock(self, svg_path: Path):
"""Locate and parse spec_lock.md near the SVG. Returns dict or None.