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(text-layout): preserve breaks across font-size changes
hugohe30f649cb87ad0
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.mdindex 7625b8fa..442c04b0 100644--- a/skills/ppt-master/SKILL.md+++ b/skills/ppt-master/SKILL.md@@ -783,7 +783,8 @@ python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path>> `<a:p>`, improving body-text editing and resize/reflow behavior. Add `--no-merge`> only when the user explicitly asks for strict line-layout fidelity or when a> layout-tight page must keep every dy-stacked line as its own text frame. The-> merge detector is conservative; mixed-layout text falls back to per-line frames.+> merge detector is conservative: adjacent lines with different effective font+> sizes retain a paragraph break, and mixed-layout text falls back to per-line frames.> A multiline> text carrier inside a slot must remain one native text frame; do not combine> it with `--no-merge`. Strict-line text stays Slide-local rather than claimingdiff --git a/skills/ppt-master/references/executor-base.md b/skills/ppt-master/references/executor-base.mdindex 3fd50e10..c81c4180 100644--- a/skills/ppt-master/references/executor-base.md+++ b/skills/ppt-master/references/executor-base.md@@ -144,7 +144,7 @@ Before the first SVG page, output a confirmation listing: canvas dimensions, bod**Per-block expression**: render each `design_spec.md §IX Content` block in its written texture — a full-sentence block as wrapped prose, a fragment/label block as bullets/keywords. **Never split a full-sentence block into a bullet list** — splitting loses the information that the block was continuous reasoning, not a set of parallel points; not because a bullet lays out easier, and not because an inherited template slot is shaped as a list. If a block carries no clear texture, infer the mode from its wording and the page layout.-- **Prose render recipe**: one `<text>` per paragraph; wrap lines with sibling `<tspan>` where the first line uses `dy="0"` and every subsequent line repeats the parent `<text>`'s **exact `x`** and the **same positive relative `dy`** (the line-height). Equal relative `dy` + matching `x` is what merges the lines into one editable PowerPoint text frame; a growing/cumulative `dy`, an irregular gap, or a mismatched `x` (e.g. `x="0"` under `<text x="60">`) splits them into separate single-line boxes. Set the line-height `dy` from the font size × a line-height factor. **Default — line-height by density (may override per content fit)**: ~1.4–1.5× for dense / small-body blocks (CLReq comfortable minimum), 1.6–2.0× for large-type, sparse, or `breathing` blocks. Fit about width ÷ font-size CJK glyphs per line (Latin fits roughly twice that); the last line runs short. Use the body ramp size, not a new one.+- **Prose render recipe**: one `<text>` per paragraph; wrap lines with sibling `<tspan>` where the first line uses `dy="0"` and every subsequent line repeats the parent `<text>`'s **exact `x`** and the **same positive relative `dy`** (the line-height). Equal relative `dy` + matching `x` + the same effective `font-size` lets lines flow inside one PowerPoint paragraph; a font-size change preserves a new paragraph inside the same text frame, while a growing/cumulative `dy`, an irregular gap, or a mismatched `x` (e.g. `x="0"` under `<text x="60">`) may split them into separate single-line boxes. Set the line-height `dy` from the font size × a line-height factor. **Default — line-height by density (may override per content fit)**: ~1.4–1.5× for dense / small-body blocks (CLReq comfortable minimum), 1.6–2.0× for large-type, sparse, or `breathing` blocks. Fit about width ÷ font-size CJK glyphs per line (Latin fits roughly twice that); the last line runs short. Use the body ramp size, not a new one.- **Template precedence**: when an inherited template slot is a bullet list but the §IX block is prose, the prose wins — widen or reflow the container to hold the paragraph, or drop that card; do not pour the sentence back into the list slot.- **Mode precedence**: the locked mode shapes voice / register, not §IX's authored titles or page order. When a `§IX` title is a user-authored topic label, keep it — do not upgrade it to an assertion just because the mode (e.g. `pyramid`) favors them; mode title-tendencies apply only to AI-drafted titles.diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.mdindex 2f395d45..3bb33135 100644--- a/skills/ppt-master/references/shared-standards.md+++ b/skills/ppt-master/references/shared-standards.md@@ -434,7 +434,7 @@ These forms are needed only when the stated PPT behavior matters:| Desired behavior | Required form ||---|---|-| One editable PPT text frame with mixed inline formatting | Put the logical line in one `<text>` with non-positional `<tspan>` children. A `<tspan>` with `x`/`y`/`dy` starts a new positioned line; evenly `dy`-stacked lines that repeat the parent `<text>`'s `x` merge into one frame as multiple paragraphs, while an irregular gap or a mismatched `x` flattens to separate frames. Separate `<text>` elements stay valid when separate frames are intended. |+| One editable PPT text frame with mixed inline formatting | Put the logical line in one `<text>` with non-positional `<tspan>` children. A `<tspan>` with `x`/`y`/`dy` starts a new positioned line. Evenly `dy`-stacked lines that repeat the parent `<text>`'s `x` stay in one frame: equal effective `font-size` may flow in the current paragraph, while a font-size change, list marker, or accepted larger gap starts a new paragraph. An unmergeable gap or mismatched `x` flattens to separate frames. Separate `<text>` elements stay valid when separate frames are intended. || Stable object grouping or object-level animation anchor | Wrap the intended object in `<g id="...">`. Content grouping is **mandatory** per §4.3 — a top-level `<g id>` is also the animation anchor; it is not an optional convenience. || Native PowerPoint background promotion | Use a direct, full-canvas, solid `<rect>` without transform, filter, clip, rounding, or visible stroke. Other SVG backgrounds remain ordinary slide shapes. Template routes add the ownership metadata in §7. || Reusable free-design PowerPoint Layout | Strategist declares the Master roster and complete page-to-Layout map before drawing. Executor writes the root identities, atomic fixed layers, and grouped slots while authoring each page. Export compiles only those declarations. |diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.mdindex 14815cab..2e16210a 100644--- a/skills/ppt-master/scripts/docs/svg-pipeline.md+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md@@ -88,7 +88,7 @@ Behavior:- `finalize_svg.py` always creates `svg_final/` before export. This directory is the self-contained SVG visual preview; it is not packaged as a second PPTX.- Explicit `-o/--output` changes the native PPTX destination and skips `backup/`.- Paragraph merging is enabled by default and trades some SVG line-layout fidelity for PowerPoint editability:- - Default: mergeable paragraph blocks (same x, dy clustered around one base line-height, optional larger gap for paragraph breaks) collapse into one editable text frame with multiple `<a:p>` and precise `<a:lnSpc>` / `<a:spcBef>`. Resizing the box reflows text inside it.+ - Default: mergeable paragraph blocks (same x, dy clustered around one base line-height) collapse into one editable text frame. Equal effective font sizes may join as flowing prose; a font-size change, list marker, or accepted larger gap starts a new `<a:p>` with precise `<a:lnSpc>` / `<a:spcBef>`. Resizing the box reflows text inside it without erasing those paragraph boundaries.- With `--no-merge`: every dy-stacked `<tspan>` becomes its own text frame — exact SVG line layout is preserved but a 12-line paragraph is 12 separate textboxes- Side effect: PowerPoint may wrap merged paragraphs to a different line count than the SVG source. Long body text (abstracts, multi-paragraph sections, reference lists) usually benefits from the default; pages with tight typographic alignment (covers, charts, tables) usually want `--no-merge`- Mergeable detection is conservative: only fires when the children form a clean paragraph block; mixed-layout `<text>` falls through to the default per-line pathdiff --git a/skills/ppt-master/scripts/svg_finalize/flatten_tspan.py b/skills/ppt-master/scripts/svg_finalize/flatten_tspan.pyindex 1a09efc1..bfad80b4 100644--- a/skills/ppt-master/scripts/svg_finalize/flatten_tspan.py+++ b/skills/ppt-master/scripts/svg_finalize/flatten_tspan.py@@ -260,6 +260,18 @@ def _get_font_size_px(elem: ET.Element) -> float | None:return parse_first_number(style_size)+def _effective_line_font_size_px(+ text_el: ET.Element,+ line_group: list[ET.Element],+) -> float:+ """Return the positioned line starter's effective font size."""+ line_size = _get_font_size_px(line_group[0])+ if line_size is not None:+ return line_size+ parent_size = _get_font_size_px(text_el)+ return parent_size if parent_size is not None else 16.0++def _classify_paragraph_block(text_el: ET.Element,is_svg_tag,@@ -292,6 +304,7 @@ def _classify_paragraph_block(is treated as a section break and rejected.- Every line-break tspan that sets x repeats the parent <text>'s x.- No nested tspan inside any line carries x/y/dy.+ - Adjacent lines with different effective font sizes start new paragraphs."""base_x = parse_first_number(get_attr(text_el, "x"))child_view = _build_paragraph_child_view(text_el, is_svg_tag)@@ -358,6 +371,10 @@ def _classify_paragraph_block(extras: list[float] = [0.0] # first line never has space-beforesoft_breaks: list[bool] = [False] # first line starts a paragraph+ line_font_sizes = [+ _effective_line_font_size_px(text_el, group)+ for group in line_groups+ ]for idx, d in enumerate(dy_values[1:], start=1):if d + DY_TOLERANCE_PX < base:return None # below base — line overlap, not a paragraph@@ -368,11 +385,12 @@ def _classify_paragraph_block(extra = 0.0# dy at the base line-height = soft break (SVG was simulating wrap);# dy strictly greater than base = hard paragraph break. List markers- # also start a fresh paragraph so bullet/ordered items do not merge- # into the previous item when exported to PowerPoint.+ # and font-size changes also start a fresh paragraph so semantically+ # distinct visual lines do not merge into one PowerPoint line.is_soft = (abs(extra) <= DY_TOLERANCE_PXand not _starts_with_list_marker(line_groups[idx])+ and abs(line_font_sizes[idx] - line_font_sizes[idx - 1]) <= 1e-6)extras.append(0.0 if is_soft else extra)soft_breaks.append(is_soft)