Skip to content

fix(export): improve numeral rendering in exported documents#552

Merged
murongg merged 2 commits into
mainfrom
fix/issue-551-pdf-lining-figures
Jul 17, 2026
Merged

fix(export): improve numeral rendering in exported documents#552
murongg merged 2 commits into
mainfrom
fix/issue-551-pdf-lining-figures

Conversation

@murongg

@murongg murongg commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Render exported document digits with lining figures so serif numerals share a consistent height.
  • Prefer a CJK-capable serif family for Simplified Chinese exports so Han text and numerals use compatible glyph metrics.
  • Add regression coverage for both export style rules.

Why

PDF exports use browser-generated HTML. The previous font stack rendered Latin numerals with ui-serif or Georgia while Chinese text fell back to a separate CJK font, leaving mixed-script text visually inconsistent even after enabling lining figures.

Validation

  • pnpm --filter @markra/app test — 122 test files and 1832 tests passed.
  • pnpm --filter @markra/app build — TypeScript build check passed.
  • Generated an A4 PDF with headless Chrome and rendered it with pdftoppm; verified consistent date numerals and mixed Han/numeral text with no clipping or layout regression.

Risk

Low. This is export-only CSS. Simplified Chinese exports now use the first available CJK serif family for Latin text and numerals as well as Han text; other language exports and the Pandoc path are unchanged.

Closes #551

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markra-web Ready Ready Preview, Comment Jul 17, 2026 12:12pm

@murongg murongg changed the title fix(export): use lining figures in exported documents fix(export): improve numeral rendering in exported documents Jul 17, 2026
@murongg
murongg merged commit 711f2dd into main Jul 17, 2026
21 checks passed
@murongg
murongg deleted the fix/issue-551-pdf-lining-figures branch July 17, 2026 12:28
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.

[Editor]: 导出为PDF后显示的数字字体不美观

1 participant