Skip to content

XLSX: use a metric-compatible sans-serif fallback for unavailable fonts #329

Description

@developer0hye

Summary

When an XLSX cell requests an unavailable sans-serif font, office2pdf can render it with a serif fallback. In the contributor acceptance fixture, the bold Carlito header text is sans-serif in Excel but serif in the office2pdf PDF.

Reproduction

Convert tests/fixtures/xlsx/pr_186_contributor_acceptance.xlsx on a system without Carlito installed and compare page 1 with a native Microsoft Excel PDF export.

Expected

An unavailable spreadsheet sans-serif font uses a metric-compatible sans-serif fallback, preserving the workbook's font class and layout as closely as possible.

Actual

The header uses a serif fallback, changing glyph shape and metrics.

Visual comparison

Ground truth is on the left; office2pdf output at filing time is on the right. Both pages were rendered with pdftoppm at 150 DPI.

GT and office2pdf output

Related to #186 and #327.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions