Skip to content

fix(pptx): prefer Office Calibri for missing theme fonts - #2042

Merged
developer0hye merged 3 commits into
mainfrom
fix/issue-2038-theme-font
Oct 7, 2026
Merged

developer0hye merged 3 commits into
mainfrom
fix/issue-2038-theme-font

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

Summary

PPTX documents can name a missing theme face such as Expert Sans Regular; the current fallback selects Helvetica for this deck, while native PowerPoint uses Calibri. Add Calibri to the sans-serif fallback candidates so Office font-source ranking can select the installed Office face and align page 1 text metrics with PowerPoint. This resolves #2038; the separate page 2 hanging-indent defect found in the full-deck audit remains tracked in #2041.

Related issue

Related: #2038

Testing

  • cargo test --locked -p office2pdf --lib render::font_subst::tests — 123 tests passed.
  • cargo fmt --all -- --check and git diff --check — passed.
  • python3 scripts/compare_layout.py ... --audit --fine-shift 0.5 — page 1 passes; page 2 findings are classified below and tracked in PPTX: table-cell hanging indent is ignored #2041 and Tracker: sub-materiality visual deviations (revisit in bulk) #1874.
  • python3 scripts/compare_render.py ... --cluster-report ... --cluster-dispositions ... --strict-clusters — page 1 passes with no material clusters; page 2's 16 clusters are all explicitly assigned to PPTX: table-cell hanging indent is ignored #2041.
  • python3 scripts/compare_text_layer.py ... — normalized content is identical and has no codepoint-class delta.
  • The full cargo test --locked --workspace --profile ci run was attempted but could not link after the local volume ran out of space; no local full-suite pass is claimed. CI will run the full suite.

Visual impact

  • No rendered PDF change
  • Rendered PDF change or visual evidence added
  • Reason: The fallback face changes page 1 glyph shape and width to match native PowerPoint.

Visual audit

  • Issue: PPTX: theme-font fallback differs from native PowerPoint #2038
  • Fixture: tests/fixtures/pptx/oxp_PB001-Input1.pptx
  • Page(s): 1-2
  • Renderer and DPI: Native PowerPoint PDF and office2pdf PDFs rendered with pdftoppm at 150 DPI
  • Evidence mode: fix
  • Layout audit report: assets/bugfixes/issue-2038/layout-audit.json
  • Render cluster reports: assets/bugfixes/issue-2038/render-clusters-page-1.json, assets/bugfixes/issue-2038/render-clusters-page-2.json
  • Reference exporter differences: None
  • Fine-detail threshold: 0.5pt
  • Layout audit page count: Pass
  • Layout audit text flow: Pass
  • Layout audit visible fills: Pass
  • Layout audit rectangle geometry: Tracker: sub-materiality visual deviations (revisit in bulk) #1874
  • Layout audit large shifts: PPTX: table-cell hanging indent is ignored #2041
  • Layout audit fine shifts: PPTX: table-cell hanging indent is ignored #2041
  • New follow-up issues found in this audit: PPTX: table-cell hanging indent is ignored #2041
  • Model vision findings: I inspected both full-page GT and output renders, the 5% pixel-difference pages, and the matched text and cluster crops. On page 1, the Calibri fallback now matches the native title and body letterforms; the worst baseline residual fell from about 1.076 pt before the change to 0.091 pt after it. The photo and cyan frame align, and the remaining dispersed photo-resampling and glyph-edge specks do not form material clusters. On page 2, the four subordinate contents labels are visibly 18 pt to the right while leader dots, connector guides, and page numbers stay aligned; the four thin section rules extend about 0.25 pt on each side. Crops show no other material changes in text, fills, font emphasis, clipping, or rotation.
  • GT: assets/bugfixes/issue-2038/gt.jpg
  • Before: assets/bugfixes/issue-2038/before.jpg
  • After: assets/bugfixes/issue-2038/after.jpg
  • Native: None
  • Compare: None

Visual comparison

GT Before After
GT Before After

Required inspection

  • Rendered all evidence at 150 DPI or higher
  • Stored progressive JPEG quality 86 assets with metadata stripped
  • Used Codex/Claude vision to inspect the full GT/output pages, diff, and matched crops
  • Inspected matched region crops at full resolution
  • Ran compare_layout.py --audit --fine-shift PT and dispositioned every fine/large text-instance shift, rectangle geometry deviation, painted-text visibility mismatch, and visible-fill occlusion
  • Ran compare_render.py --cluster-report PATH --strict-clusters and dispositioned every material 5% fuzz diff cluster by explicit ID
  • Inventoried hairlines and border dash styles
  • Inventoried font weight, italic, and underline emphasis

Deviation audit

Check Result
Page count/order Matches GT: both exports have two pages in the same order.
Element presence Matches GT: text, photos, rules, connector guides, leader dots, and page numbers remain present.
Position/size Remaining: #2041 four contents labels are 18 pt right; #1874 four section rules are 0.50003 pt wider.
Rotation/flip No deviation observed.
Fill Matches GT: fills and photo color match; dispersed photo-edge pixels are resampling.
Stroke/border Remaining: #1874 four section rules are 0.50003 pt wider; connector guides and cyan frame align.
Shape outline geometry Matches GT: the cyan frame and other outlines retain their geometry.
Text content Matches GT: normalized text is identical (430 characters) with no codepoint-class delta.
Font family/weight/style Fixed: missing theme sans faces can now fall back to installed Office Calibri; visible emphasis matches.
Text color Matches GT: text colors match on both pages.
Alignment Remaining: #2041 four subordinate contents labels are 18 pt right while their guides remain in place.
Line/paragraph spacing Matches GT: baseline residuals are at most 0.12 pt, with no wraps or reflow.
Clipping/overflow No deviation observed.

Checklist

  • Any submitted sample files or attachments satisfy the submission policy, or none are submitted.
  • Commits include a Signed-off-by line
  • PR scope contains one root cause
  • Remaining converter or harness deviations each reference an open issue

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit 13d62a0 into main Oct 7, 2026
26 checks passed
@developer0hye
developer0hye deleted the fix/issue-2038-theme-font branch October 7, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PPTX: theme-font fallback differs from native PowerPoint

1 participant