Repository navigation
SmartArt: text is laid out on its text rectangle (dsp:txXfrm), not in columns - #242
Merged
Merged
Conversation
This was referenced Oct 13, 2026
… columns A SmartArt drawing shape keeps its text rectangle in dsp:txXfrm, apart from the shape's own box. The importer ignored it and laid the text out in the shape itself. In list layouts the shape is a tall, narrow box turned by 90 degrees, so the text came out as narrow vertical columns, in the editor and in the exported PPTX. The text rectangle uses the shape's coordinate space and is turned by the shape's rotation plus its own: - When it is the shape's text area shrunk by some margin, with the same orientation, the shape keeps its text and the margin is added to its insets. - Otherwise (a rectangle reaching outside the shape, or turned against it) the text moves to a new shape without fill or outline, placed on the rectangle right above its shape in the diagram's group. Both export as plain DrawingML (positive insets, an ordinary rotated shape), which other readers lay out the same way. Test: a SmartArt drawing built in the test, with a text rectangle wider than its shape, a turned shape with upright text, and a rectangle inside its shape; the laid-out text box is checked on import and after a PPTX round trip.
- file-format-parity.md: SmartArt row notes the text rectangle; status line and history. - ROADMAP.md: progress log line. No checklist row changes score (Insert SmartArt stays P), and the gaps.md SmartArt entry (pre-drawn shapes only) still holds.
pierrevbc
force-pushed
the
smartart-txxfrm
branch
from
October 13, 2026 10:13
c9787c8 to
daf612b
Compare
Member
|
Thank you for this contribution, @pierrevbc! It has landed on If you haven't already, please come join us on Discord: https://discord.gg/artcraft |
anishguduru
pushed a commit
to anishguduru/deckcraft
that referenced
this pull request
Oct 16, 2026
…age coordinates (storytold#129) (storytold#242) doc_info (and the MCP document-info resource built on it) serialised annotation and link rectangles straight from the PDF /Rect, in user space, while every other tool reports and accepts rectangles with the origin at the top-left of the displayed page. Feeding a doc_info rect to link_edit therefore moved the link, and on rotated pages the two conventions disagreed in more than a y flip. Convert both through the page's user_to_view, the same conversion comment_list and link_list use, so the three agree. Pages that an annotation cannot be matched to keep the raw rect. Co-authored-by: wstock <1394687+wstock@users.noreply.github.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.
Problem
In SmartArt imported from PPTX, the text of a pre-drawn shape is laid out inside the shape's own
box. SmartArt drawings give each shape a separate text rectangle,
dsp:txXfrm, which DeckCraftdoes not read. In list layouts the shape is a tall, narrow rounded rectangle turned by 90°, with a
text rectangle turned back by -90°: the text should run in wide horizontal lines, but it comes out
as narrow vertical columns of a few words each. The exported PPTX keeps the columns, since the
SmartArt is written back as a group of shapes.
Reproduce on
main(0.6.0) with a public file, not for committing:2017/OWASP Top 10-2017 (en).pptxfrom OWASP/Top10 (commit3a31f35), slides 20 ("What's Nextfor Organizations") and 21 ("What's Next for Application Managers").
deckcraft-cli render "OWASP Top 10-2017 (en).pptx" --slide 19 --scale 1 out.png(the CLIindex starts at 0).
deckcraft-cli convert … out.pptx, in DeckCraft and in LibreOffice.The simple SmartArt of apache/poi (
test-data/slideshow/SmartArt.pptx) renders fine: its textrectangles match its shapes.
Cause:
smartart()incrates/pptx/src/read/shapes.rsreads the drawing part's shapes throughsp_tree, and nothing readsdsp:txXfrm. In the OWASP drawing, a row's shape is<a:xfrm rot="5400000">withcx="855279" cy="5430307"(narrow, turned), and its text rectangleis
<dsp:txXfrm rot="-5400000">withcx="5346805" cy="771777"around the same centre (wide,upright on the slide).
What changes
Two commits: the fix, and the progress docs.
Only the SmartArt import changes (
crates/pptx/src/read/shapes.rs,smartart()and three newfunctions). After the drawing's shapes are read, each
dsp:spwith adsp:txXfrmgets its textplaced on that rectangle, read in the shape's coordinate space and turned by the shape's rotation
plus its own:
shape keeps its text and the margin between the two is added to its insets, so they stay
positive.
to a new shape with no fill, outline or effects, placed on the rectangle, right after its shape
in the diagram's group. It keeps the shape's style font reference (text colour) and hyperlinks.
Both export as plain DrawingML: positive insets, or an ordinary rotated shape. No negative insets
and no
bodyPr rot, which readers handle unevenly. The text area of the shape is computed the waythe renderer does (
preset::build(..).text_rect; the full box for custom geometry).Progress docs: the SmartArt row of
docs/file-format-parity.md(status line, history) and aROADMAP.mdprogress log line. The checklist row "Insert SmartArt" stays P and thegaps.mdentry"SmartArt is pre-drawn shapes only" still holds, so neither changes.
How it was tested
cargo xtask cipasses on this branch (fmt, clippy-D warnings, workspace tests, layers,assets, wasm32 check).
tests/smartart.rs::smartart_text_follows_tx_xfrmbuilds the SmartArt in code: a new presentationexported, plus a diagram frame, data part and drawing part written by the test (no file made by
another application). Three shapes: a text rectangle three times wider than its shape, a shape
turned by 90° whose text rectangle is turned back, and a rectangle inside its shape. Through
render::place_slide, the test checks the slide-space box the text is laid out in, that thebaseline is horizontal and that each text fits on one line, after import and again after a PPTX
export and re-import. It also checks the group structure (the inside case keeps its text in the
roundRect; moved text has no fill or outline). Without the fix it fails: the text is laid out inthe 72 × 144 pt shape instead of the 216 × 72 pt rectangle.
Checked by hand (files not committed):
and of its PPTX export; LibreOffice renders the export like the original.
after: only these two slides change.
(AGENTS.md §2).
Known limits
docs/gaps.md, "SmartArt is pre-drawn shapesonly").
diagram group moves both.
Related PRs
crates/pptx/src/read/shapes.rs(media options); no textual conflict.ROADMAP.mdanddocs/file-format-parity.md(status line, progress log) conflict with otherPRs that update them (Add Ukrainian interface translation and language selection #34, i18n: add Russian, Spanish, French, Portuguese and German interfaces #110, feat(theme): add System appearance across DeckCraft controls #134, Notes: speaker notes show their formatting and keep it when edited #168, Export: animated GIF of the deck (Export… dialog, CLI, MCP) (#171) #177, Charts: GridCraft spreadsheet data editor and live editing for the first 5 chart types #195, Animation effects: follow the system's reduced-motion setting #196, i18n: add Polish (pl) interface #199); the resolution is to keep
both lines.