Skip to content

PPTX: SmartArt text sits in the drawing's own text box (dsp:txXfrm) - #676

Closed
NikitkaRa wants to merge 1 commit into
storytold:mainfrom
NikitkaRa:smartart-text-xfrm
Closed

NikitkaRa wants to merge 1 commit into
storytold:mainfrom
NikitkaRa:smartart-text-xfrm

Conversation

@NikitkaRa

@NikitkaRa NikitkaRa commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

SmartArt's pre-drawn shapes can place their text in a box apart from the outline (dsp:txXfrm), with its own turn added to the shape's. We ignored it, so Venn labels sat in the circles' middles (under the neighbouring circle) and a hexagon turned 90° had its text turned too (or upside down).
Now such a shape reads as the outline without text, followed by a bare rectangle holding the text at the text box, turned by shape rot + text-box rot. Shapes whose text box equals their outline are untouched.
Test: smartart_text_boxes_split_off_with_their_own_turn. Checked by eye against LibreOffice with Apache POI's smartart-simple.pptx and smartart-rotated-text.pptx (now match). cargo xtask ci green.

Overlap: #242 (open, currently conflicting) also reads dsp:txXfrm, laying SmartArt text on its text rectangle in the text layout. This PR does it at import by splitting the text into its own rectangle (also handling the text box's own rotation). Pick one; if #242 lands, close this.

@echelon

echelon commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thank you for this, @NikitkaRa! The same fix has now landed on main through #242, so this PR is superseded and we'll close it. If you spot anything #242 misses that your version handled, please say so here or open a follow-up — we'd welcome it.

If you haven't already, come join us on Discord: https://discord.gg/artcraft

@echelon echelon closed this Oct 14, 2026
anishguduru pushed a commit to anishguduru/deckcraft that referenced this pull request Oct 16, 2026
… (winit#4650) (storytold#676)

winit 0.30.13 reports insertText as Ime::Commit only while marked text is
left, and after any commit it swallows the next key. Real paths where that
loses text:

- input methods that end a composition with unmarkText, then insertText
  (rust-windowing/winit#3925): the committed text was dropped;
- Apple Korean 2-Set, for the key typed after a syllable: on 한 then 5 it
  calls setMarkedText("한"), insertText("한"), setMarkedText(""),
  insertText("5"), so the 5 (or ;, or any key that ends the syllable) was
  dropped;
- a commit made outside a key press (a candidate clicked with the mouse,
  dictation): no key follows to reset the state, so the next key (for
  example Backspace) was swallowed.

vendor/winit now commits when a composition was started (pending_commit,
set in setMarkedText, cleared by the commit and when IME is disallowed);
other insertText calls still reach the app as KeyboardInput. A commit
outside keyDown clears the marked text and returns to the ground state.
validAttributesForMarkedText lists the underline and marked-clause
attributes, which some input methods need before they compose.

This is rust-windowing/winit#4650, the 0.30 backport of #4651 (merged on
winit master), plus the part of #4748 that fixes #4651's out-of-key-press
case (#4748's other parts are not included). One correction: upstream
spells the underline attribute "NSUnderlineStyle", but AppKit's
NSUnderlineStyleAttributeName is "NSUnderline" (printed on macOS 14), so
the AppKit value is used.

Checked with the real input methods on macOS 14.7.1 (a scratch winit app fed
key events through AppKit): with the patch 한+5 and 한+; commit the 5 and ;,
unmarkText-then-insertText commits, and Backspace after a commit outside a
key press is delivered; ABC typing, held keys, Japanese (日本, あ), Cangjie
(日) and Korean composition give the same events as before. A test fails if
a re-vendored winit loses the patch.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants