feat(xls): cell font and fill formatting from Font/XF/Palette records#606
Open
andiwand wants to merge 3 commits into
Open
feat(xls): cell font and fill formatting from Font/XF/Palette records#606andiwand wants to merge 3 commits into
andiwand wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 971dd7d08f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
This was referenced Jul 16, 2026
Parse the Font (0x0031), XF (0x00E0) and Palette (0x0092) records in the globals substream, keep each cell's ixfe, and resolve every XF into a per-cell TextStyle (name, size, weight, italic, underline, strike, color) plus a TableCellStyle fill. Replaces the flat 11pt placeholder style. Covers the FontIndex 4 gap ([MS-XLS] 2.5.129), the Icv color table with custom-palette override ([MS-XLS] 2.5.161), and approximates non-solid fill patterns by their foreground color. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R9Z3kyUaHNkJacAEggevHH
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AEvWWwe1EyeWH7ANHoAvPH
andiwand
force-pushed
the
feat/xls-cell-formatting
branch
from
July 19, 2026 08:38
f7b0441 to
c0a60e4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code
Adds per-cell character formatting to the legacy
.xlsdecoder: font name, size, bold, italic, underline, strikethrough, font color, and cell fill (background) color, replacing the flatfont_size = 11ptplaceholder.How
Font(0x0031),XF(0x00E0) andPalette(0x0092) records; every cell record'sixfe(previously read and discarded) is kept on itsSheetCell.CellStyle(TextStylefrom the font +TableCellStylefill), stored in the registry indexed byixfe. Adapters only look up:text_style/paragraph_text_stylevia thesheet_cellancestor,sheet_cell_stylefor the fill. No renderer changes needed.FontIndex4 does not exist (ifnt< 4 zero-based, > 4 one-based, [MS-XLS] 2.5.129);Icvcolor table with built-ins, custom-palette override and default palette ([MS-XLS] 2.5.161); automatic/system colors left unset;dyHeight == 0leaves the size unset instead of emitting invisible 0pt text; non-solid fill patterns approximated by their foreground color.Tests
OldMs.xls_cell_styles— synthetic inline-byte workbook: font resolution incl. the index-4 gap, all style flags, default palette, automatic color, solid fill, unstyled empty positions.OldMs.xls_palette_record—Paletterecord overriding the default palette.OldMs.*and xlsHtmlOutputTestspass.Note: reference HTML
The rendered spreadsheet HTML changes (real fonts instead of 11pt), e.g. the bold header row of
file_example_XLS_10.xls:The 6 xls reference outputs under
test/data/reference-output/odr-public/output/xls/need regenerating for thecompare-htmlCI step (needs a push to the reference repo — flagged separately).