Skip to content

WordArt text effects and transforms, and shape connectors (#416) - #481

Merged
echelon merged 4 commits into
storytold:mainfrom
vangel76:feat/416-wordart-connectors
Oct 11, 2026
Merged

echelon merged 4 commits into
storytold:mainfrom
vangel76:feat/416-wordart-connectors

Conversation

@vangel76

Copy link
Copy Markdown
Contributor

What

WordArt

  • Run-level text effects ([MS-DOCX] w14:textFill, w14:textOutline, w14:shadow, w14:glow, w14:reflection): solid / linear-gradient / no fill, outline colour and width, shadow, glow, fading reflection. Model (wordcraft_doc::wordart), DOCX read/write, drawn from glyph outlines as paint layers in the rasteriser and the PDF (invisible glyphs keep the PDF text extractable).
  • Transform warps (a:prstTxWarp + a:avLst adjust values in wps:bodyPr): all 41 presets round-trip; arch up/down, circle, wave, slant up/down, inflate/deflate, chevron up/down and triangle up/down are drawn bent (glyph outlines flattened and mapped through the preset geometry); others draw flat. Unknown presets are dropped, adjust values capped.
  • insert.wordArt now makes a floating, fill-less text box in one of our own styles (theme colours, generic names), optionally bent; format.textEffects (Home › Text Effects), wordArt.style, wordArt.textFill, wordArt.textOutline, wordArt.transform (Shape Format › WordArt Styles). With a shape selected or the caret in a text box, effects apply to the whole box's text.
  • UI: style gallery (Insert › WordArt, Home › Text Effects, Shape Format › WordArt Styles), Text Fill / Text Outline / Text Effects (Shadow, Glow, Reflection, Transform) menus; Transform previews are drawn from the warp geometry itself; new icons drawn in code.

Connectors

  • Straight, elbow and curved connectors (straightConnector1, bentConnector2–5, curvedConnector2–5 read; 3-segment forms written), arrowheads (a:headEnd/a:tailEnd), glued ends (wps:cNvCnPr a:stCxn/a:endCxn → shape drawing id + site). Glued-to shapes keep their docPr/cNvPr ids; other shapes' ids are dropped on read so existing round trips are unchanged.
  • Connection sites: rectangle-like shapes 4 side midpoints, ellipse 8, triangle 6.
  • shape.connect glues an end to a shape (by position, nearest site or given site) or drags it to a page point (snaps to a site within 12 pt, else stays free). After object edits (arrange.*, shape.*, picture.*, insert.shape), glued floating connectors in the body re-route from the layout (and connectors inside groups in the group's space), in the same undo step.
  • Insert › Shapes lists the connectors; dragging a selected connector's end handle onto a shape glues it (sites shown while dragging).

Clean room: ECMA-376 / [MS-DOCX] only; styles, colours and icons are our own.

How tested

  • docx roundtrip: every char prop incl. full text effects; warp + glued connectors + arrowheads + unglued id dropped; hostile XML (unknown warp, huge site index, glue to a missing id).
  • layout: arch baselines lie on one ellipse over the top; flat/unknown warps; hostile adjust values stay in the frame.
  • doc: hostile effect values capped; group connectors follow their shapes, missing ids/sites ignored.
  • engine: nudging/resizing a glued shape re-routes the connector (one undo); dragging an end snaps/frees/refuses bad sites; WordArt insert → Draw::Art, PDF export, capped/invalid params. hostile_params_never_panic green.
  • cargo clippy -D warnings on touched crates, cargo xtask layers, cargo xtask wasm, cargo xtask parity (402/434 → 407/439), UI tests (i18n coverage in all 9 catalogs).
  • Looked at it headlessly with ui_shot: bent/glowing/gradient/reflected WordArt over body text, elbow and curved connectors following a moved ellipse, the Transform previews and the style gallery.

Fixes #416

Not done

  • WordArt 3-D (w14:scene3d/w14:props3d), bevel; text effects on PDF are vector layers (blurs approximated by bands, as for shapes).
  • Warped text is edited/selected in its unbent layout (highlights don't follow the warp); the text is stretched over the box like WordArt, the box isn't auto-fitted to the text afterwards.
  • Elbow connectors always route out-across-in horizontally (no vertical exits, no avoiding shapes); bentConnector2/4/5 and curvedConnector2/4/5 adjust values aren't kept.
  • Connectors re-route on the same page only, for floating body connectors; text edits that reflow paragraph-anchored shapes don't re-route until the next object edit. Copying a glued shape duplicates its id (the first copy wins).
  • Shape effects (shadow/glow) aren't drawn on connectors.

🤖 Generated with Claude Code

vangel76 and others added 3 commits October 11, 2026 22:11
)

- Model: WordArt text effects on runs (fill solid/gradient/none, outline,
  shadow, glow, reflection), text warps on shapes (all DrawingML presets
  kept, adjust values capped), connector kinds (straight, elbow, curved)
  with glued ends, arrowheads and drawing ids (ShapeExtra).
- DOCX: w14:textFill/textOutline/shadow/glow/reflection in w:rPr,
  a:prstTxWarp in wps:bodyPr, wps:cNvCnPr a:stCxn/a:endCxn,
  a:headEnd/a:tailEnd; glued-to shapes keep their docPr ids.
- Layout/render/PDF: text with effects drawn from glyph outlines as paint
  layers (gradients, shadow/glow bands, faded reflection); warped text
  boxes bent along arch up/down, circle, wave, slant, inflate/deflate,
  chevron and triangle; connectors and arrowheads drawn as paths.
- Engine: insert.wordArt makes a floating WordArt text box with our own
  styles; format.textEffects, wordArt.style/textFill/textOutline/transform,
  shape.connect; glued connectors re-route after object edits.
- UI: WordArt style gallery (Insert, Home › Text Effects, Shape Format ›
  WordArt Styles), Text Fill/Outline/Effects menus, Transform previews
  drawn from the warp geometry, connectors in Insert › Shapes, drag a
  connector end onto a shape to glue it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vangel76
vangel76 force-pushed the feat/416-wordart-connectors branch from 41840bc to 28c28fa Compare October 11, 2026 20:14
# Conflicts:
#	ROADMAP.md
#	crates/doc/src/lib.rs
#	crates/docx/src/read/story.rs
#	crates/engine/src/cmd/mod.rs
#	crates/ui-egui/src/i18n/es.tsv
#	crates/ui-egui/src/i18n/et.tsv
#	crates/ui-egui/src/i18n/ja.tsv
#	crates/ui-egui/src/i18n/pt-br.tsv
#	crates/ui-egui/src/i18n/ru.tsv
#	crates/ui-egui/src/i18n/sr-latn.tsv
#	crates/ui-egui/src/i18n/sr.tsv
#	crates/ui-egui/src/i18n/tr.tsv
#	crates/ui-egui/src/i18n/uk.tsv
#	crates/ui-egui/src/i18n/zh-hans.tsv
#	crates/ui-egui/src/i18n/zh-hant.tsv
#	docs/file-format-parity.md
#	docs/gaps.md
#	docs/parity-checklist.md
#	docs/target-app-parity.md
@echelon
echelon merged commit 2ffba93 into storytold:main Oct 11, 2026
2 checks passed
@echelon

echelon commented Oct 11, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution, @vangel76! This is now merged into main. If you haven't already, please come join us on Discord: https://discord.gg/artcraft

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.

Parity: Insert › WordArt and shape connectors

2 participants