Summary
headerFooter/oddHeader and oddFooter strings carry inline formatting codes. &"<font>,<style>"
selects the face and style for the runs that follow it, and there is a separate &<n> size code.
office2pdf renders header and footer text in the fallback serif at the document default size
instead, so the family and the size are both wrong on every printed page.
Measured
headerFooterTest.xlsx sets &L&"Calibri,Regular"&K000000top left and five more slots
(left/centre/right of both header and footer).
|
GT (Excel) |
office2pdf |
| family |
Calibri |
LibertinusSerif-Regular |
| size |
12pt |
11pt |
| slots affected |
6 of 6 |
6 of 6 |
The serif-vs-sans difference is plainly visible at 150 DPI, and it appears on every page of
any workbook that sets a header or footer.
Worth noting alongside it: the same GT PDF renders its cell text in a substituted Malgun
Gothic while the header/footer text is real Calibri 12 — so the 12pt figure above is Excel's
own header font size, not an artifact of the substitution.
Reproduction
cargo run -p office2pdf-cli -- tests/fixtures/xlsx/poi/headerFooterTest.xlsx -o out.pdf
mutool draw -F stext -o - out.pdf 1 | grep -i 'font name' # LibertinusSerif 11, Excel uses Calibri 12
Expected
&"<font>,<style>" selects the named family and style for the following runs, &<n> sets
their size, and a slot with no explicit codes uses Excel's default header/footer font
(Calibri 12 in this file's theme) rather than the document body fallback.
Actual
Both codes are ignored; every slot renders LibertinusSerif-Regular at 11pt.
Related: #233, #578
Found in the 2026-07-29 full-corpus visual audit at c1adfbd (native Office GT, 150 DPI, mutool-trace geometry).
Visual comparison
| Compare |
 |
GT left, office2pdf right, 150 DPI, same page.
Summary
headerFooter/oddHeaderandoddFooterstrings carry inline formatting codes.&"<font>,<style>"selects the face and style for the runs that follow it, and there is a separate
&<n>size code.office2pdf renders header and footer text in the fallback serif at the document default size
instead, so the family and the size are both wrong on every printed page.
Measured
headerFooterTest.xlsxsets&L&"Calibri,Regular"&K000000top leftand five more slots(left/centre/right of both header and footer).
The serif-vs-sans difference is plainly visible at 150 DPI, and it appears on every page of
any workbook that sets a header or footer.
Worth noting alongside it: the same GT PDF renders its cell text in a substituted Malgun
Gothic while the header/footer text is real Calibri 12 — so the 12pt figure above is Excel's
own header font size, not an artifact of the substitution.
Reproduction
Expected
&"<font>,<style>"selects the named family and style for the following runs,&<n>setstheir size, and a slot with no explicit codes uses Excel's default header/footer font
(Calibri 12 in this file's theme) rather than the document body fallback.
Actual
Both codes are ignored; every slot renders LibertinusSerif-Regular at 11pt.
Related: #233, #578
Found in the 2026-07-29 full-corpus visual audit at c1adfbd (native Office GT, 150 DPI, mutool-trace geometry).
Visual comparison
GT left, office2pdf right, 150 DPI, same page.