Commit Graph
106 Commits
Author SHA1 Message Date
David MannandClaude Opus 5.5 1929e79ebb Merge storytold main into next (20 Nov, second sync)
Merges main at 8f92ed1334 (#2550 and the rest of main since the 20 Nov sync).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 16:38:55 +01:00
FredApps 2e45aeeee5 Merge pull request #2192 from Morzilla/docx-grid-from-cells
craft-docx: a table without w:tblGrid takes its grid from its cells, as Word rebuilds it
2026-11-20 13:33:59 +07:00
FredApps d042b09745 Merge pull request #2510 from OPUZZLES/opuzzles/docx-picture-soft-edge-roundtrip
DOCX: preserve imported picture soft edges
2026-11-20 13:09:33 +07:00
FredApps 9867c5ac13 Merge pull request #2347 from OPUZZLES/opuzzles/docx-screentips
craft-docx: preserve bounded hyperlink ScreenTips
2026-11-20 12:54:14 +07:00
FredApps e956256f1d Merge pull request #2349 from OPUZZLES/opuzzles/docx-mail-merge
Preserve external DOCX mail-merge source relationships
2026-11-20 12:51:44 +07:00
FredApps 796d915ba9 Merge pull request #2445 from MMexicann/patch-4
DOCX: save the current zoom when merging retained settings
2026-11-20 12:47:19 +07:00
FredApps 5a913a42ab Merge pull request #2449 from mmazzieri/fix/vml-allowincell
craft-docx: a VML shape in a body table cell keeps Layout in table cell off
2026-11-20 12:21:02 +07:00
Rees 8eae257cf3 DOCX #2532: preserve imported picture soft edges 2026-11-20 05:59:01 +01:00
keithcsqueensu 4e5f883c93 Merge storytold/craft-libs main into math-ports 2026-11-20 00:40:38 +00:00
mmazzieri abaccb0d38 craft-docx: a VML shape in a body table cell keeps Layout in table cell off
`o:allowincell="f"` on a VML shape anchored in a body table cell now sets
`Float::outside_cell`, as `layoutInCell="0"` already does for DrawingML.
Word places such a shape outside its cell, and the cell's text does not wrap
around it. Without the attribute, or with it on, the shape stays in its cell.
The writer already saved `o:allowincell` from `outside_cell`, so the setting
now survives open and save.
2026-11-19 22:33:53 +01:00
Mex b8af9ef92a DOCX: cover zoom changes with retained settings 2026-11-19 22:31:18 +01:00
Mex 14718ae0c1 DOCX: save the current zoom when merging settings 2026-11-19 22:31:00 +01:00
FredApps 39de15147c Consolidate related office tests 2026-11-19 13:05:56 +01:00
Daniele Mori 347dccfa11 craft-docx: a cut-off span gives an unsized kept column only its share (test) 2026-11-19 10:55:38 +01:00
Daniele Mori b0ce7bcc8f craft-docx: gridless tables keep an empty grid's inch, the narrowest column before spans, and cut spans' rest
Review fixes: a file with an empty w:tblGrid keeps the inch per column it had; a cell narrower
than the narrowest column counts as that column before a span shares out what it lacks, so the
span keeps its width; a span cut off at the last column the reader keeps sizes its kept columns
by their share and gives the rest to no other column.
2026-11-19 10:55:38 +01:00
Daniele Mori befa8fd583 craft-docx: a table without w:tblGrid takes its grid from its cells, as Word rebuilds it
Template libraries write tables with no w:tblGrid. The reader gave every column an inch, so such a
table came out at the wrong width whatever its cells asked for. Word rebuilds the grid from the
cells on opening: each column as wide as the widest w:tcW among the cells that occupy it alone, a
spanning cell's width shared among the columns no cell sizes, what it still lacks going to its
last column, an inch for a column nothing sizes, never narrower than 26 twips. The rules were
measured on the grids Word saves for synthetic tables. A row after w:gridBefore starts at its
own column.

Moved from storytold/wordcraft#1630, whose reader half had no file left there after #6603.
2026-11-19 10:55:38 +01:00
Rees aa89df6814 Preserve external DOCX mail-merge source relationships 2026-11-19 09:21:13 +01:00
Rees a2df846270 craft-docx: preserve bounded hyperlink ScreenTips 2026-11-19 09:09:49 +01:00
aiongg e8e713ee26 Merge storytold main into next (18 Nov sync)
Merges main at 3b8e426a26.

- crates/ui: main's e-sign dialog (crates/ui/src/esign) moves to craft-cloud-ui beside the
  share dialog, behind craft-cloud-ui's esign feature; craft-ui forwards `esign` and
  re-exports the module.
- crates/proof: main's can_suggest_cased goes to affix/check.rs and its tests to
  affix/tests.rs (next split affix.rs); French wiring in lib.rs.
- crates/svg: main's validated resolver and raster validation stay under tree-render, which
  now also enables gif and image-webp; the shared image-codec helpers are gated on tree.
- craft-ai-agents: main's rev (craft-ai-integrations main), one entry.
- crates/craft: facade dependencies, features and re-exports for main's new crates.
2026-11-18 23:07:38 +00:00
Kevin Joseph 041bafa259 craft-docx: keep a table style's w:tblInd on read and save (#2196)
* craft-docx: keep a table style's w:tblInd on read and save

A table style's own indent was dropped on read, so it was gone on save.
pandoc's Table style sets it to 0, and Word for Mac places a table whose
style chain sets no indent about 5.4 pt further right than one set to 0.

craft-wordmodel gains TableStyleParts::indent, merged through basedOn.
The reader takes a dxa indent (nil is 0; pct and auto set none) and the
writer emits it in schema order, 0 included.

Part of storytold/wordcraft#5767.

* craft-docx: a table style's w:tblInd without w:w is 0

CT_TblWidth's w:w defaults to 0, so the style resets a based-on style's
indent instead of inheriting it. The test helper now fails when a saved
style is missing rather than matching an empty string.

* craft-docx: the tblInd override test checks the base sets an indent

Without it the test would pass if the reader dropped the base style's
indent, since there would be nothing to override.
2026-11-18 15:35:42 -05:00
Kevin Joseph 0c3793eadd craft-docx: theme font slots survive a save (#2197)
* craft-docx: theme font slots survive a save

w:rFonts' w:eastAsiaTheme and w:cstheme slots are kept on read and written
back. Word picks the East Asian and complex-script fonts through them, so
dropping them changed which font Word used for East Asian punctuation and
its line breaks. The Latin slots (w:asciiTheme, w:hAnsiTheme) are kept when
the run's font came from them and written back only while they still name
that font in the document's theme, so a font chosen later is not hidden.

craft-wordmodel: a one-byte ThemeFont and CharProps font_ascii_theme,
font_hansi_theme, font_ea_theme and font_cs_theme. Overlaying a named font
without its slot clears the slot; minus keeps a slot whose font stays.

Ported from storytold/wordcraft#5772.

* craft-docx: keep the theme's East Asian and script fonts; exact slot replacement

The saved theme wrote empty a:ea and a:cs faces and no per-script fonts, so
a kept w:eastAsiaTheme or w:cstheme slot named no font in Word. The reader
now keeps the theme's ea, cs and a:font script entries (THEME_FONTS) and
the writer puts them back.

craft-wordmodel: a named font replaces both Latin slots with its own, so a
patch with one slot no longer leaves the other stale. minus keeps a font
equal to the base's when its slots differ, so a font that clears the
base's slots still clears them when overlaid. latin_slot compares the
theme face without cloning it.

* craft-docx: theme fonts keep faces and scripts apart; limit only usable scripts

THEME_FONTS lines now say whether they hold a default face (a:ea, a:cs) or a
per-script font, so an a:font script="cs" is no longer written back as the
a:cs face. The 256-entry limit applies to usable per-script fonts only, so
empty default faces no longer push the last one out.

A test pins down Latin slots that name different faces: the model has one
Latin font, so only the slot that still names it is written.

* craft-docx: a long theme script id never pushes out one font resolution uses

The kept per-script fonts count script ids of 8 characters or fewer (the
ones font resolution takes) and longer ones (language tags such as
zh-Hant-TW) apart, 256 each, so a long one can't use up the place of a
mapping resolution keeps.

* craft-docx: THEME_FONTS names both per-script caps
2026-11-18 15:35:36 -05:00
Kevin JosephandNghiathan13 6242f65262 craft-docx: a table border without w:sz is width 0, and ODT and RTF keep it (#2203)
* craft-docx: a DOCX border without w:sz is an eighth of a point

* craft-docx: a table border without w:sz is width 0, and ODT and RTF keep it

A table, cell or table-style border without w:sz gives the same output in
Word as w:sz="0" and takes no room; read as half a point, rows below a
pandoc table's header rule moved down half a point. PropCtx::table_borders
now reads it as 0, as PropCtx::borders does since #1488.

ODT and RTF have no border that is drawn and takes no room, so a drawn
width-0 cell side is written at Border::THINNEST instead of being dropped.
Where two ODT cells share an edge, a line with a width wins over a width-0
one, whichever cell states it.

Table half of storytold/wordcraft#5764.

---------

Co-authored-by: Nghiathan13 <201675788+Nghiathan13@users.noreply.github.com>
2026-11-18 15:35:29 -05:00
ARCandARC 1846851756 fix(docx): a VML shape whose v:stroke is off or fully transparent has no outline (#2226)
The VML reader took a shape's outline from its stroked and strokecolor
attributes only, so a v:stroke child with on="f" or opacity="0" was
ignored and the shape got a black 0.75 pt outline. Google Docs writes
its horizontal rules this way (a 0.05 pt v:rect with a transparent
stroke): Word shows nothing, and after a save every rule became a
visible line.

Each stroke property (on, color, opacity, endcap) now resolves as Word
does: the shape's own v:stroke, then the shape's attribute (stroked,
strokecolor), then the same two on its shapetype. A fully transparent
line is kept as a shape without an outline, and freeforms take the
resolved opacity, inherited ones included. Opacity is read in all three
forms a file can use (0, 0% and 65536ths such as 0f).

Moved from storytold/wordcraft#3829, where it was reviewed, now that
the DOCX reader lives here.

Co-authored-by: ARC <261443955+arc-uri-el@users.noreply.github.com>
2026-11-18 15:35:22 -05:00
ARCandARC da69193a2f fix(docx): write and read a turned object's effect extent as Word does (#2227)
From 45° up to 135° and from 225° up to 315°, Word measures the room a
turned object's rotated bounds take against its frame with width and
height exchanged, so a quarter turn records no effect extent. craft-docx
measured it against the unturned frame, so saving a picture turned 90°
wrote half the difference between its sides as negative top and bottom
extents, which Word draws as a crop, and the text after it moves up.
Reading had the same mismatch the other way: a picture Word turned 60°
gained phantom effects room above and below.

Float::effect_spin_pad gives the overhang in Word's measure, choosing the
frame from the angle as it is saved (60000ths of a degree), so an angle
such as 44.999996° is measured as the 45° it is written as. The docx
reader and both writers use it; a bare turn (Float::is_bare_turn) still
records none, and layout keeps spin_pad and line_pad.

The test reads and saves a 254 x 337 pt picture with the extents Word
for Microsoft 365 (build 16.0.20527) writes at 60° and 90° and on both
sides of each boundary (44/45, 134/135, 224/225, 314/315), and reads the
saved file back. Two existing tests asserted the old values and now use
Word's.

Moved from storytold/wordcraft#3828, where it was reviewed, now that the
DOCX reader and writer live here.

Co-authored-by: ARC <261443955+arc-uri-el@users.noreply.github.com>
2026-11-18 15:35:16 -05:00
Dylan M. Taylor e646d9307e fix(docx): charge rejected nested roots against shared element budget 2026-11-18 01:15:42 -05:00
Bra1nZ 9ab8aac5ca craft-docx: a package-wide XML element budget bounds hostile files' tree memory 2026-11-17 17:41:20 +03:00
aiongg ac3dfd1f53 Merge storytold main into next (17 Nov sync)
storytold main 83cb1133dd (291 commits) into the integration head bab1a99b85; 47 conflicted files.

- Domain test files (metafile, prepress, pdf plates, settings store, heif, media-testkit, atomic): tests next cut stay cut; tests new on main are kept, as trials where the crate's test target runs trials.
- atomic: main's group-bits test and Faulty::set_group go to src/tests.rs. audio: main's GSM and SBC oracles join tests/main.rs. cms constructors, pdf knockout_backdrop and testing_pdf join their crates' one test binary; timeline's preflight tests become src/preflight_tests.rs trials.
- update: main's changes to detect, install (linux, macos) and the tests land in next's split modules. The app's own offer is inspected on a thread of its own, picked up by tick's polling; settle_for_tests settles offers too. Later on a ready update drops the close it asked for. updater_pin_tests.rs stays deleted; its new pin test is in tests/it/update.rs.
- craft-color: main added a different crate at crates/color (the colour tags of compositor and display frames); it is next's craft-color module `tags`, re-exported at the root.
- Old crates/ui (combo, docking, testing, README) and keymap's ui/view.rs stay deleted; main's new crates/ui/src/testing files are dropped with them.
- New crates in the craft facade: ai, control, dds, frame, ipc, media-source, palette, press-print, score, ssip. testkit and xtask are listed outside it.
- Cargo.lock: the union of both locks, resolved by cargo metadata. Workflow: main's nextest Windows leg, with next's --keep-going clippy.
2026-11-17 12:44:52 +00:00
Dylan M. Taylor 8672aff3d8 Merge pull request #1991 from storytold/fix/plot-range-contains
unbreak the Workspace gate: the xlsx fixture Result and the docx range-contains lint
2026-11-17 03:17:42 -05:00
FredApps cc22854ea4 Preserve ODF lookahead and stacking normalization together 2026-11-17 04:59:07 +01:00
FredApps 0dbd888f3c Integrate page background preservation with stacking normalization 2026-11-17 04:12:46 +01:00
Dylan M. Taylor b4d17d3943 docx: preserve horizontal axis-title rotation guard semantics 2026-11-16 22:03:46 -05:00
Dylan M. Taylor 1901b2fac6 docx: satisfy clippy's range-contains lint in the chart title guard
main's gate fails here for every pull request: `!(r < 1.0 || r > 359.0)` is
exactly what `manual_range_contains` rejects. Express the same range as
`(1.0..=359.0).contains(&r)`.
2026-11-16 21:54:47 -05:00
midasmatterhorn 93598bc018 craft-docx: documentProtection without w:enforcement is enforced, as in Word, and survives a save (#1750) 2026-11-16 21:31:25 -05:00
Hamza Naveed 76fc04feee craft-docx: relate the bibliography store from the main part, not the package (#1835) 2026-11-16 21:30:40 -05:00
Joseph Anglada b1d3abc55e DOCX: the parts of a package that cannot be read are listed on the document (#1902) 2026-11-16 21:30:17 -05:00
Joseph Anglada 38e5614b9c SmartArt: an item's opacity is read, written and drawn (#1906) 2026-11-16 21:30:04 -05:00
keithcsqueensu 738bf6fafe docx: write a font table naming the fonts a document uses (#1948) 2026-11-16 21:29:43 -05:00
FredApps 1612dd35b9 Integrate current drawing readers and preserve retained OLE stacking 2026-11-17 03:11:41 +01:00
Dylan M. Taylor 4992583846 Merge pull request #1898 from StDenis1980/tinta/upstream-application-name
docx: set_application_name for apps that embed the writer
2026-11-16 19:16:04 -05:00
Dylan M. Taylor 68cc642520 Merge pull request #1791 from vangel76/feat/6820-chartex-placeholder
Office 2016 charts with a text-only fallback keep their size instead of collapsing the pages
2026-11-16 16:12:25 -05:00
Dylan M. Taylor 09cae32c45 Merge pull request #1776 from vangel76/fix/gutter-at-top
The "gutter at top" page setting in Word files is now read and saved
2026-11-16 16:11:33 -05:00
Dylan M. Taylor 443a2b05ff docx: preserve partial table margins in current and tracked properties (#1924) 2026-11-16 15:51:23 -05:00
FredApps c2068fc90b fix(import): normalize maximum drawing stacking orders without replay 2026-11-16 18:54:38 +01:00
FredApps d60d1b0a45 Merge pull request #1868 from tsw2k/fix/docx-frame-shape
craft-docx: a frame preset shape is a border with a hole
2026-11-16 16:24:26 +01:00
FredApps dd3015c678 wordmodel: keep the kashida length of a justified paragraph (#1875)
* wordmodel: keep the kashida length of a justified paragraph

ST_Jc lowKashida, mediumKashida and highKashida were all read as
Align::Justify, so the length was lost. ParaProps and ResolvedPara now
keep it; a direct both/justify cancels an inherited length. The DOCX
reader and writer round-trip the three values.

* docx: keep a style's kashida length when writing justify

w:jc encodes alignment and kashida together. A paragraph or style
with Align::Justify and kashida unset still inherits a length from
the style chain; writing "both" would read back as Some(Kashida::None)
and cancel it. Use the resolved length in that case.
2026-11-16 10:23:22 -05:00
FredApps 8ee8316213 Merge pull request #1652 from D13GOOOO/docx-locked-canvas
craft-docx: read a DrawingML locked canvas as a group of its members (wordcraft#5060)
2026-11-16 16:12:08 +01:00
FredApps c5f217e765 craft-docx: a shape's VML fallback takes its anchor's relativeHeight
Main's VML fallback (#1864) read the writer's z counter after the anchor was written. That counter now only counts objects without a stored order, so a stored order's fallback got the wrong z-index. The anchor's relativeHeight is now kept in anchor_z for the fallback, and the wps_fallback tests expect the written relativeHeight (one less than Float::z).
2026-11-16 16:10:03 +01:00
FredApps bb965ed3c9 Merge remote-tracking branch 'origin/main' into t1729 2026-11-16 16:09:39 +01:00
aiongg 2df33d2f01 Merge remote-tracking branch 'upstream/main' into sync/main-1116
# Conflicts:
#	Cargo.lock
#	crates/audio/src/lib.rs
#	crates/exr/src/decode.rs
#	crates/font-catalog/src/lib.rs
#	crates/ps/src/lib.rs
#	crates/svg/Cargo.toml
#	crates/text/Cargo.toml
#	crates/text/src/lib.rs
#	crates/video/Cargo.toml
#	crates/video/src/lib.rs
2026-11-16 14:23:07 +00:00
StDenis1980andClaude Opus 5.5 0b0e5accd5 docx: set_application_name for apps that embed the writer
An app that ships the writer under its own name names itself in docProps/app.xml
(<Application>); "WordCraft" until set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:37:37 +01:00