-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Description
The PPTX parser ignores the spc attribute on <a:rPr> (run properties), which controls character/letter spacing. This causes text to render with incorrect spacing, particularly noticeable on CJK text and headings with wide tracking.
Root Cause
In crates/office2pdf/src/parser/pptx.rs, extract_rpr_attributes() (line ~2348) only handles: b, i, u, strike, sz. The spc attribute is never read. Searching for "spc" in the parser yields zero matches.
Additionally, the TextStyle struct in crates/office2pdf/src/ir/elements.rs has no field for letter/character spacing.
PPTX XML structure:
<a:rPr lang="en-US" sz="4800" spc="300">
...
</a:rPr>
<a:t>SOME HEADING TEXT</a:t>Here spc="300" means 300 hundredths of a point = 3pt letter spacing.
Expected
Text rendered with 3pt spacing between characters (wider, more airy).
Actual
Text rendered with default (0) letter spacing — characters appear closer together than intended.
Fix Required
- Add
letter_spacing: Option<f64>toTextStylestruct - Parse
spcattribute inextract_rpr_attributes():spc / 100.0to get points - Emit
tracking: Xptin Typst codegen'swrite_text_params()