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(checker): align font guidance with PPT-safe discipline

hugohe35b8596365261
diff --git a/skills/ppt-master/references/executor-base.md b/skills/ppt-master/references/executor-base.md
index d8004b06..d92f2349 100644
--- a/skills/ppt-master/references/executor-base.md
+++ b/skills/ppt-master/references/executor-base.md
@@ -205,14 +205,11 @@ Handle images based on their status in the Design Specification's "Image Resourc
## 7. Font Usage
-Apply corresponding fonts for different text roles based on the font plan in the Design Specification & Content Outline:
-
-| Role | Chinese Recommended | English Recommended |
-|------|--------------------|--------------------|
-| Title font | Microsoft YaHei / KaiTi / SimHei | Arial / Georgia |
-| Body font | Microsoft YaHei / SimSun | Calibri / Times |
-| Emphasis font | SimHei | Arial Black / Consolas |
-| Annotation font | Microsoft YaHei / SimSun | Arial / Times |
+Font family per role is governed by `spec_lock.md typography` — that file is the source of truth. Read `font_family` as the default, plus any `*_family` override (`title_family` / `body_family` / `emphasis_family` / `code_family` / etc.); roles without an explicit override fall back to `font_family`.
+
+If `spec_lock.md` is absent for any reason, consult the seed combinations and PPT-safe discipline in [`strategist.md`](strategist.md) §g "Typography Plan Confirmation" rather than inventing a stack.
+
+**Hard rule — never violate**: every `font-family` stack emitted into SVG MUST end with a cross-platform pre-installed family (Microsoft YaHei / SimHei / SimSun / Arial / Calibri / Segoe UI / Times New Roman / Georgia / Consolas / Courier New / Impact / Arial Black). PPTX stores a single `typeface` per run with no runtime fallback — a missing font silently degrades to Calibri on the viewer's machine.
---
diff --git a/skills/ppt-master/scripts/error_helper.py b/skills/ppt-master/scripts/error_helper.py
index fe5eb66f..424c8dee 100644
--- a/skills/ppt-master/scripts/error_helper.py
+++ b/skills/ppt-master/scripts/error_helper.py
@@ -252,8 +252,8 @@ class ErrorHelper:
'message': 'Forbidden web font (@font-face) detected',
'solutions': [
'Remove @font-face declarations',
- 'Use the system font stack',
- 'font-family: system-ui, -apple-system, sans-serif'
+ 'End every font-family stack with a PPT-safe pre-installed family',
+ 'Example: font-family: "Microsoft YaHei", Arial, sans-serif'
],
'severity': 'error'
},
@@ -276,12 +276,13 @@ class ErrorHelper:
'severity': 'error'
},
'invalid_font': {
- 'message': 'Non-standard font used',
+ 'message': 'Font stack does not end on a PPT-safe family',
'solutions': [
- 'Use the system UI font stack',
- 'font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',
- 'Avoid using specific font names (e.g. Arial, Helvetica)',
- 'Ensure cross-platform compatibility'
+ 'End the stack with a cross-platform pre-installed family',
+ 'CJK: "Microsoft YaHei", sans-serif | SimSun, serif',
+ 'Latin: Arial, sans-serif | "Times New Roman", serif',
+ 'Mono: Consolas, "Courier New", monospace',
+ 'See strategist.md §g for the full PPT-safe discipline'
],
'severity': 'warning'
}
diff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.py
index bb667ce6..99d6c085 100644
--- a/skills/ppt-master/scripts/svg_quality_checker.py
+++ b/skills/ppt-master/scripts/svg_quality_checker.py
@@ -262,27 +262,51 @@ class SVGQualityChecker:
result['errors'].append("Detected forbidden <image opacity> (use overlay mask approach)")
def _check_fonts(self, content: str, result: Dict):
- """Check font usage"""
- # Find font-family declarations
+ """Check font usage.
+
+ PPTX stores a single `typeface` per run with no runtime fallback, so every
+ stack must END with a cross-platform pre-installed family. See
+ strategist.md §g "PPT-safe font discipline".
+ """
font_matches = re.findall(
r'font-family[:\s]*["\']([^"\']+)["\']', content, re.IGNORECASE)
- if font_matches:
- result['info']['fonts'] = list(set(font_matches))
-
- # Check if system UI font stack is used
- recommended_fonts = [
- 'system-ui', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI']
+ if not font_matches:
+ return
- for font_family in font_matches:
- has_recommended = any(
- rec in font_family for rec in recommended_fonts)
+ result['info']['fonts'] = list(set(font_matches))
+
+ # Pre-installed on Windows + macOS out of the box (plus their direct
+ # FONT_FALLBACK_WIN mappings). A stack whose last concrete family is in
+ # this set survives the PPTX round-trip on any viewer machine.
+ ppt_safe_tail = {
+ 'microsoft yahei', 'simhei', 'simsun', 'kaiti', 'fangsong',
+ 'pingfang sc', 'heiti sc', 'songti sc', 'stsong',
+ 'arial', 'arial black', 'calibri', 'segoe ui', 'verdana',
+ 'helvetica', 'helvetica neue', 'tahoma', 'trebuchet ms',
+ 'times new roman', 'times', 'georgia', 'cambria', 'palatino',
+ 'consolas', 'courier new', 'menlo', 'monaco',
+ 'impact',
+ }
- if not has_recommended:
- result['warnings'].append(
- f"Recommend using system UI font stack, current: {font_family}"
- )
- break # Only warn once
+ for font_family in font_matches:
+ # Drop the generic CSS fallback (sans-serif / serif / monospace)
+ # and inspect the last concrete family.
+ parts = [p.strip().strip('"').strip("'").lower()
+ for p in font_family.split(',')]
+ parts = [p for p in parts
+ if p and p not in ('sans-serif', 'serif', 'monospace',
+ 'cursive', 'fantasy', 'system-ui')]
+ if not parts:
+ continue
+ tail = parts[-1]
+ if tail not in ppt_safe_tail:
+ result['warnings'].append(
+ f"Font stack does not end on a PPT-safe family "
+ f"(expected e.g. Microsoft YaHei / SimSun / Arial / "
+ f"Times New Roman / Consolas): {font_family}"
+ )
+ break
def _check_dimensions(self, content: str, result: Dict):
"""Check width/height consistency with viewBox"""
@@ -638,7 +662,7 @@ class SVGQualityChecker:
print(f"\n[TIP] Common fixes:")
print(f" 1. viewBox issues: Ensure consistency with canvas format (see references/canvas-formats.md)")
print(f" 2. foreignObject: Use <text> + <tspan> for manual line breaks")
- print(f" 3. Font issues: Use system UI font stack")
+ print(f" 3. Font issues: end every font-family stack with a PPT-safe family (e.g. Microsoft YaHei / Arial / Consolas)")
def _print_drift_summary(self):
"""Print spec_lock drift aggregation if any was observed.