Skip to content

fix(docx): resolve theme font references in styles and document defaults#316

Merged
developer0hye merged 1 commit into
mainfrom
fix/docx-theme-default-fonts
Jul 18, 2026
Merged

fix(docx): resolve theme font references in styles and document defaults#316
developer0hye merged 1 commit into
mainfrom
fix/docx-theme-default-fonts

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

Summary

  • rFonts theme slots (asciiTheme="minorHAnsi" etc.) were ignored: documents whose defaults or paragraph styles reference the theme font scheme fell back to Typst's Libertinus Serif
  • Parse the theme fontScheme's minor/major latin typefaces from word/theme/theme1.xml and resolve theme slots wherever no literal family is given — in document defaults and per paragraph style

Test plan

  • New test covering theme parsing and slot resolution (minor/major, literal-font passthrough) — TDD, red first
  • Full workspace suite passes; fmt --check clean; clippy -D warnings clean

Visual verification (public mce-wpg fixture, 150 DPI)

Before After
before after

pdffonts: before embeds LibertinusSerif-Regular; after embeds Calibri (the theme minor font), matching Word.

Related: #287

🤖 Generated with Claude Code

rFonts theme slots (asciiTheme="minorHAnsi" etc.) were ignored, so
documents whose defaults or paragraph styles reference the theme font
scheme fell back to Typst's Libertinus Serif instead of the theme's
latin typeface (normally Calibri). Parse the theme fontScheme's
minor/major latin typefaces from word/theme/theme1.xml and resolve
theme slots wherever no literal font family is given — document
defaults and paragraph styles alike.

Related: #287

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit b042c71 into main Jul 18, 2026
14 checks passed
@developer0hye
developer0hye deleted the fix/docx-theme-default-fonts branch July 18, 2026 09:29
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.

1 participant