feat(ppt): per-run character formatting from StyleTextPropAtom#609
Open
andiwand wants to merge 1 commit into
Open
feat(ppt): per-run character formatting from StyleTextPropAtom#609andiwand wants to merge 1 commit into
andiwand wants to merge 1 commit into
Conversation
Parse the StyleTextPropAtom ([MS-PPT] 2.9.44) that follows each text atom — in the drawing's ClientTextbox as well as the outline (SlideListWithText) — and split slide text into styled spans carrying bold, italic, underline, font size, font name (FontCollection) and explicit sRGB colors. Replaces the flat 11pt placeholder; unformatted text defaults to 18pt, approximating the unread master text styles. Paragraph-level runs are skipped field-by-field via their PFMasks; paragraphs store their first run's style so empty paragraphs keep their height. Scheme-indexed colors and master-inherited formatting remain open (documented in AGENTS.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R9Z3kyUaHNkJacAEggevHH
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-run character formatting to the legacy
.pptdecoder: bold, italic, underline, font size, font name, and font color, replacing the flatfont_size = 11ptplaceholder.How
TextCharsAtom/TextBytesAtom) is now kept raw until theStyleTextPropAtom([MS-PPT] 2.9.44) that most closely follows it — in the drawing'sClientTextboxand in the outline (SlideListWithText) alike. Its character runs (counts in UTF-16 units, also covering the implicit final paragraph mark) split the text into styled spans; the tree becomesframe → paragraph → span → text.PFMasks(including the variable-sizetabStops).FontCollection(RT_Environment→FontEntityAtom, indexed byrecInstance), interned in the registry.ColorIndexStructs: explicit sRGB values (index0xFE) are used; scheme indexes are left unset (they need the slide's color scheme — documented as open work along with master-inherited formatting viaTxMasterStyleAtom; unformatted text defaults to 18pt as an approximation).Validation
On the
style-various-1.pptfixture the titles now render as 44pt Arial with explicit black, and slide 7's link text renders underlined blue 32pt:Tests
OldMs.ppt_parse_style_text_prop_atom— inline bytes: PF-run skipping incl. mask-dependent fields, CFStyle bold/italic, fontRef/size, sRGB color.OldMs.ppt_style_various— extended with style assertions against the real fixture (44pt Arial black title; underlined blue 32pt link).OldMs.*and pptHtmlOutputTestspass.Note: reference HTML
Rendered
.pptHTML changes (styled spans instead of flat 11pt); the ppt reference outputs undertest/data/reference-output/odr-public/output/ppt/need regenerating for thecompare-htmlCI step (flagged separately, same as #606/#608).https://claude.ai/code/session_01R9Z3kyUaHNkJacAEggevHH