diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2c4b8cb1a4..f92b4ccfed 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,11 +7,30 @@ updates: interval: "daily" time: "06:00" timezone: "America/New_York" - # Consolidate updates into a single PR rather than one PR per crate + # Minor and patch updates share one PR. A breaking bump gets its own PR so one API change + # doesn't hold the safe updates back (#2973). For cargo, Dependabot counts a 0.y bump of a + # 0.x crate as major, as Cargo does. A dependency goes to the first group it matches, so the + # crate families that must move together come before the catch-all. groups: + egui: + patterns: + - "egui" + - "egui_*" + - "eframe" + - "winit" + fonts: + patterns: + - "skrifa" + - "harfrust" + hayro: + patterns: + - "hayro-*" cargo-dependencies: patterns: - "*" + update-types: + - "minor" + - "patch" commit-message: prefix: "chore(deps)" diff --git a/.github/workflows/house-rules.yml b/.github/workflows/house-rules.yml new file mode 100644 index 0000000000..de64ad3ee4 --- /dev/null +++ b/.github/workflows/house-rules.yml @@ -0,0 +1,28 @@ +name: House rules + +on: + push: + branches: [main] + paths: + - AGENTS.md + - CLAUDE.md + - .github/workflows/house-rules.yml + pull_request: + paths: + - AGENTS.md + - CLAUDE.md + - .github/workflows/house-rules.yml + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: house-rules-${{ github.ref }} + cancel-in-progress: true + +jobs: + house-rules: + uses: storytold/craft-common-actions/.github/workflows/house-rules.yml@main + with: + rust: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0959ec140..89d3b647b1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,14 @@ concurrency: cancel-in-progress: false jobs: + # Regenerates contributors/contributors.json for the release commit; every build bundles it. + credits: + permissions: + contents: read + pull-requests: read + uses: storytold/craft-common-actions/.github/workflows/refresh-contributors.yml@main release: + needs: credits # Only this job publishes the GitHub release, so only it gets write access. permissions: contents: write @@ -31,6 +38,7 @@ jobs: craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83 web-craft-fonts: true version: ${{ inputs.version }} + contributors-artifact: ${{ needs.credits.outputs.artifact-name }} secrets: APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} @@ -46,3 +54,4 @@ jobs: AZURE_SIGNING_ENDPOINT: ${{ secrets.AZURE_SIGNING_ENDPOINT }} AZURE_SIGNING_ACCOUNT: ${{ secrets.AZURE_SIGNING_ACCOUNT }} AZURE_CERT_PROFILE: ${{ secrets.AZURE_CERT_PROFILE }} + LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }} diff --git a/AGENTS.md b/AGENTS.md index 04fb60a525..702f630871 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,10 +1,62 @@ + +## House rules + +These apply in every Craft repository. A later rule may be stricter, not weaker. The source is `standards/house-rules-core.md` in `storytold/craft-contrib`. Propose changes there, not in a copy. + +1. **A person is accountable.** Whoever runs an agent answers for what it opens and for its review comments. +2. **Check, then claim.** Before writing code, read the issue comments, search pull requests for `#N` and the keywords, and check recent commits on `main`. Comment on the issue first. Release a claim you will not finish. +3. **Verify, don't guess.** Open a definition before using it. Confirm the cause in the code, even when someone names a location. +4. **Keep fixes narrow and tested.** Fix what the issue describes, where the bug is. Add a test that fails without the fix. +5. **Review the diff before opening a pull request.** Identifiers exist as used, the test fails without the fix, nothing unrelated changed, and the description is true. +6. **Look for a better pull request.** If another fixes the same thing, close yours when it is better or equal, and say why. +7. **Report only what ran.** Say what you tested and what you could not run. Without a local build or test, say so and rely on CI before marking ready. +8. **`main` changes through a pull request.** Do not push to it. Branch protection enforces this. There is no exception. +9. **Stop and ask only about** licensing outside the allowlist, publishing, releases, a new remote, secrets, spending money, destructive git, and anything else hard to undo. Otherwise keep working. `plan/` is a gitignored notebook, not rules. Without it, do not ask for it and do not stop. +10. **Keep secrets and personal details out** of the repository, logs and requests. +11. **CI stays shared.** Workflows call `storytold/craft-common-actions`. Do not change CI in a feature or fix pull request. If CI cannot cover a change, open an issue there. +12. **Guards say why.** A check that looks removable says what it prevents. Read that before changing it. +13. **Instructions must be readable by everyone.** No notes about one machine, and no links to files a reader cannot open. `craftrules` is retired. Do not link to it. +14. **Keep pull requests moving.** Concurrent pull requests are fine; unanswered actionable feedback is not. Respond in 7 days, a reminder at 14, closure eligible at 30, from when an actionable request waits on the author. Suggestions and unconfirmed bot findings do not start the clock. A fix, explanation or agreed plan resets it; unrelated activity does not. Waiting on a reviewer or maintainer pauses it and does not count against the author. A maintainer decides closure; it is never automatic. Reuse search results, do not poll, and stop at a rate limit. +15. **No agent attribution.** A pull request does not say an agent wrote it. A repository rule may not require that. + + +## Rust Craft repositories + +These apply to native Craft apps and to shared Rust libraries. Select them by repository type. A repository that merely contains some Rust does not take this block. Rules later in a repository's file may be stricter, but not weaker. The source is `standards/house-rules-rust.md` in [storytold/craft-contrib](https://github.com/storytold/craft-contrib). + +1. **Never crash.** Non-test code does not panic and has no `unsafe`, except where the repository file names an exception. Return errors, treat input as hostile, and bound recursion and allocations. New production crate roots copy the `deny` attribute from an existing crate: `clippy::unwrap_used`, `clippy::expect_used`, `clippy::panic`, `clippy::unimplemented`, `clippy::todo`, `clippy::unreachable`. Every crash fix comes with a test that panicked before the fix. +2. **Clean room.** Learn from observed behaviour and public specifications. Do not copy another product's code, assets, strings or artwork. Check a dependency's licence before adding it. +3. **Assets and fonts.** Every asset is original or suitably licensed, and is recorded in `ATTRIBUTION.md` in the same change. Font files live in [storytold/craft-fonts](https://github.com/storytold/craft-fonts), not in the app repository. +4. **Rust only for native Craft apps.** No handwritten JavaScript or TypeScript, and no Tauri, Electron or webview shell, in those apps. Shared tooling follows its documented technical scope and maintainer-approved exceptions. Craft PR Review's existing Tauri and TypeScript UI is one such exception. It does not relax this rule for native apps. Preserve any existing web build. +5. **Time goes through `chrono`.** Do not hand-roll calendar conversion. For dates beyond what `chrono` can represent, follow [standards/time.md](https://github.com/storytold/craft-contrib/blob/main/standards/time.md). +6. **Contributor credits.** Add or edit only your own person's entry in `contributors/people.toml`, and only after asking them. Never guess a name or hand-edit `contributors.json`. + +## Licence allowlist + +Dependencies and assets use SPDX identifiers. An expression is allowed when every identifier is in this list. A repository may name a shorter list. It may not add an identifier here by editing its own copy of these rules. + +- `ISC` +- `MIT` +- `BSD-2-Clause` +- `BSD-3-Clause` +- `Apache-2.0` +- `OFL-1.1` +- `Ubuntu-font-1.0` +- `Bitstream-Vera` +- `CC0-1.0` +- `CC-BY-4.0` +- `CC-BY-SA-4.0` +- `LicenseRef-Public-Domain` + +`LicenseRef-Storyteller-Trademark` is not in this list. It covers Storyteller brand marks only, where a repository already says so. + + # WordCraft — instructions for agents WordCraft is a clean-room, open-source, Rust-native word processor targeting Microsoft Word parity — and going further on speed, openness and agent control. It runs natively on macOS, Windows, Linux and BSD, and on the web via WASM. Siblings with the same conventions: `../photocraft` (Photoshop), `../vectorcraft` (Illustrator), `../filmcraft` (Premiere), `../lightcraft` (Lightroom), `../pdfcraft` (Acrobat), `../effectcraft` (After Effects), `../designcraft` (InDesign). ## Start every session here -1. Read `plan/STATUS.md` (current milestone, next task), then the task in `plan/execution-plan.md` and the relevant `plan/architecture.md` section. `plan/` is gitignored (local only); if it's missing, start from `ROADMAP.md`, `docs/gaps.md` and `docs/roadmap.md` (Current focus). -2. Follow the autonomous operation protocol (`plan/execution-plan.md` §5). Don't stop to ask unless a decision is genuinely the owner's (licensing, publishing, pushing to new remotes, secrets). +Read [`ROADMAP.md`](ROADMAP.md), [`docs/gaps.md`](docs/gaps.md) and [`docs/roadmap.md`](docs/roadmap.md). `plan/` is an optional gitignored notebook. Do not ask for it and do not stop when it is absent. ## Never crash People trust WordCraft with their writing; a crash loses their work. **This outranks feature work**: never ship a feature through a panic path, and fix a crash before building on top of it. @@ -28,7 +80,7 @@ People trust WordCraft with their writing; a crash loses their work. **This outr - Never read, disassemble or copy anything inside the Word bundle (file names/listings only). Never commit files produced by Word. Never copy Microsoft wording beyond feature names. - File formats come from public specs: ECMA-376 / ISO 29500 (OOXML), the published RTF spec, OASIS ODF 1.3. Never copy GPL/LGPL/AGPL code (LibreOffice, AbiWord, pandoc…). -## Architecture (see `plan/architecture.md`) +## Architecture | Layer | Crate | Job | |---|---|---| | L0 | `geom` | units, rects, measurement parsing | @@ -44,7 +96,6 @@ People trust WordCraft with their writing; a crash loses their work. **This outr - **Everything is a command.** User-visible behaviour = a `CommandSpec` in `crates/engine/src/cmd/*.rs` (id, label, ribbon location, shortcut, params doc, `enabled`, `run`) + tests. UI-only commands (`ui.*`) live in `crates/ui-egui/src/lib.rs`. The ribbon, shortcuts, command search, CLI, control channel and MCP all dispatch by id. Programmatic calls never open dialogs. - **Parity is measured:** `crates/engine/src/catalog.rs` lists Word's ribbon/menu features with command ids. `cargo xtask parity` writes `docs/parity-checklist.md`; a test enforces a floor that only rises. Implement missing ids to raise it. - **Layering** is enforced by `cargo xtask layers`. Nothing below L6 depends on egui/eframe/winit/rfd. The UI is thin and reads `Session` state; colours come from `theme::Tokens`. -- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math). A crate owns only its output format string. The one exception is range extension: past the years chrono can represent, shift the date by whole 400-year Gregorian cycles (146,097 days, after which the calendar repeats), let chrono compute the month and day, and add the cycles back to the year (splitting seconds into hours, minutes and seconds is plain arithmetic). - **Rust only** (no handwritten JS/TS). **Never break wasm** (`cargo xtask wasm`). ## Quality gates @@ -85,3 +136,5 @@ Progress docs: `ROADMAP.md` (stage, headline numbers, progress log), `docs/targe - Workflows in `.github/workflows/` call the shared workflows in [`storytold/craft-common-actions`](https://github.com/storytold/craft-common-actions) at `@main`, with their inputs and secrets. No other jobs: if no shared workflow does what's needed, it doesn't go here. - Don't add or change CI in a feature or fix PR. If the existing workflows can't build or test a change, link an existing craft-common-actions issue or PR, or open a new issue, or a PR only for a small fix that is safe for every app and does not increase CI time. - Some workflow files here still run their own jobs. Don't add to them. Moving a job into craft-common-actions is its own task, never part of another PR, and the job stays here until a shared workflow runs it. + +New workspace crates include `workspace = true` under `[lints]` in `Cargo.toml`. Production crate roots declare the crate-level lint attributes before modules; crate-level `//!` documentation may precede them. diff --git a/CLAUDE.md b/CLAUDE.md index c3d28358b1..43c994c2d3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,71 +1 @@ -# WordCraft — instructions for agents - -WordCraft is a clean-room, open-source, Rust-native word processor targeting Microsoft Word parity — and going further on speed, openness and agent control. It runs natively on macOS, Windows, Linux and BSD, and on the web via WASM. Siblings with the same conventions: `../photocraft` (Photoshop), `../vectorcraft` (Illustrator), `../filmcraft` (Premiere), `../lightcraft` (Lightroom), `../pdfcraft` (Acrobat), `../effectcraft` (After Effects), `../designcraft` (InDesign). - -## Start every session here -1. Read `plan/STATUS.md` (current milestone, next task), then the task in `plan/execution-plan.md` and the relevant `plan/architecture.md` section. `plan/` is gitignored (local only); if it's missing, start from `ROADMAP.md`, `docs/gaps.md` and `docs/roadmap.md` (Current focus). -2. Follow the autonomous operation protocol (`plan/execution-plan.md` §5). Don't stop to ask unless a decision is genuinely the owner's (licensing, publishing, pushing to new remotes, secrets). - -## Never crash -People trust WordCraft with their writing; a crash loses their work. **This outranks feature work**: never ship a feature through a panic path, and fix a crash before building on top of it. -- **No panics in non-test code:** no `unwrap()`, `expect()`, `panic!`, `unreachable!`, `todo!`, `unimplemented!`; no `unsafe` (`unsafe_code = "forbid"`). -- **Errors are `Result`** through the crate's error type and `?`. An unfinished feature returns an error or is disabled; it never panics. -- **Input-derived numbers are hostile** (files, commands, MCP/control params): `get()` instead of `[i]`, slice strings only at char boundaries, checked/saturating arithmetic, clamp sizes, cap allocations, bound recursion. -- **Last-resort guard:** `Session::run` turns an escaped panic into an error and restores the document. It's a safety net, not a licence. -- **Prove it:** every crash fix lands with a regression test. `crates/engine/src/tests.rs::hostile_params_never_panic` runs every command with junk params — keep it green. -- Production crate roots carry `#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]`; new crates start with it and add `[lints]` with `workspace = true` to their `Cargo.toml`. Tests may `unwrap` (`clippy.toml`). - -## Assets: absolutely no Microsoft (or Adobe/Avid/Autodesk) iconography or images -**This rule is non-negotiable.** Breaking it is the worst mistake you can make in this repo. -- Never copy, trace, screenshot-crop or recreate icons, images, templates, themes, clip art, fonts, cursors, sounds or any other asset from Microsoft Word/Office or any Microsoft, Adobe, Avid or Autodesk product. Not even "temporarily". -- Every asset must be **original** (drawn in code — prefer this: `crates/ui-egui/src/icons.rs`), **public domain / CC0**, **OSI open source**, or **Creative Commons that allows redistribution**, or licensed open source by a contributor who made it. -- **Every asset file has a row in [`ATTRIBUTION.md`](ATTRIBUTION.md)** (author, source, licence). `cargo xtask assets` (part of `cargo xtask ci`) fails otherwise. Add the row in the same commit as the file. -- Fonts: new font files go to [`storytold/craft-fonts`](https://github.com/storytold/craft-fonts), never this repo; it's an optional build input (`CRAFT_FONTS_DIR`). Spelling word lists and hyphenation patterns live in [`storytold/craft-i18n`](https://github.com/storytold/craft-i18n) `language-data/`, never this repo; they are embedded from `CRAFT_I18N_DIR` (pinned by `craft-i18n.rev`, which CI checks out). Without it the app builds, but English spelling falls back to an installed Hunspell English or the built-in Moby word list (with no American/British variant table) and pattern hyphenation is off (Bulgarian, Turkish and Russian still hyphenate by rule), so proofing tests need it. Documents asking for proprietary fonts (Calibri, Aptos, Cambria…) are rendered with installed system fonts or metric-compatible open substitutes (`crates/fonts/src/word.rs`) — never bundle proprietary fonts. -- Templates, sample documents and themes are our own text and colours (`crates/engine/src/sample.rs`, `cmd/design.rs`). Demo images are public domain, with sources recorded. - -## Clean room -- Microsoft Word is installed on the dev machine and may be **observed** black-box: run it, use its UI with synthetic documents, take screenshots **of its window only** (by window id — the machine runs other work; never capture the whole desktop) stored only under `plan/word/screenshots/` (gitignored, never committed). -- Never read, disassemble or copy anything inside the Word bundle (file names/listings only). Never commit files produced by Word. Never copy Microsoft wording beyond feature names. -- File formats come from public specs: ECMA-376 / ISO 29500 (OOXML), the published RTF spec, OASIS ODF 1.3. Never copy GPL/LGPL/AGPL code (LibreOffice, AbiWord, pandoc…). - -## Architecture (see `plan/architecture.md`) -| Layer | Crate | Job | -|---|---|---| -| L0 | `geom` | units, rects, measurement parsing | -| L1 | `doc`, `fonts` | document model + edit primitives; font DB, shaping, Word font substitution | -| L2 | `layout`, `docx`, `formats` | line breaking, pagination, tables, headers/footers, hit testing; OOXML I/O; TXT/MD/HTML/RTF/ODT | -| L3 | `render`, `pdf` | vello_cpu rasteriser; krilla PDF | -| L4 | `engine` | Session, undo, **command registry**, Word feature catalog, samples, I/O dispatch | -| L5 | `mcp` | MCP server (headless or bridged to the app) | -| L6 | `ui-egui` | Word-style egui front end (swappable) | -| apps | `apps/wordcraft`, `apps/wordcraft-cli`, `apps/wordcraft-web` | binaries | -| external | `craft-proof` (craft-libs, used as `wordcraft-proof`, sits at L1) | proofing: spelling, grammar, hyphenation; its word lists and patterns are craft-i18n's `language-data/` (`CRAFT_I18N_DIR`) | - -- **Everything is a command.** User-visible behaviour = a `CommandSpec` in `crates/engine/src/cmd/*.rs` (id, label, ribbon location, shortcut, params doc, `enabled`, `run`) + tests. UI-only commands (`ui.*`) live in `crates/ui-egui/src/lib.rs`. The ribbon, shortcuts, command search, CLI, control channel and MCP all dispatch by id. Programmatic calls never open dialogs. -- **Parity is measured:** `crates/engine/src/catalog.rs` lists Word's ribbon/menu features with command ids. `cargo xtask parity` writes `docs/parity-checklist.md`; a test enforces a floor that only rises. Implement missing ids to raise it. -- **Layering** is enforced by `cargo xtask layers`. Nothing below L6 depends on egui/eframe/winit/rfd. The UI is thin and reads `Session` state; colours come from `theme::Tokens`. -- **Rust only** (no handwritten JS/TS). **Never break wasm** (`cargo xtask wasm`). - -## Quality gates -Before every commit: `cargo xtask ci` (fmt, clippy -D warnings, tests, assets, layers, wasm). Commit after every arc of work that builds, with a task id in the message (`M2.1: line spacing dialog`). - -## Typing behaves like Word -Typing, Enter, Backspace, Tab, lists, AutoCorrect and AutoFormat follow Word's observed behaviour in [`docs/typing-parity.md`](docs/typing-parity.md), pinned by `crates/engine/src/tests/typing.rs` (keys go through the same commands as the keyboard). Change behaviour, doc and tests together; a typing fix lands with a test there. Compare headlessly (`ui_shot`); don't drive GUIs with keystrokes on the shared machine. - -## Running and looking at the app -- `cargo run --release -p wordcraft -- --sample --control 7981` (sample document + control channel). -- Drive it with JSON lines on `127.0.0.1:7981`, each with the window's key from `~/.config/wordcraft/control-key.local-7981` (macOS: `~/Library/Application Support/WordCraft/`), e.g. `{"id":1,"key":"…","method":"engine.execute","params":{"command":"text.insert","params":{"text":"Hello"}}}` then `{"id":2,"key":"…","method":"ui.screenshot","params":{"path":"/tmp/shot.png"}}`. Methods: `crates/ui-egui/src/control.rs`; docs: `docs/control-protocol.md` (Keys). -- **Headless window screenshots** (no focus stealing, works with a locked screen): `cargo run --release -p wordcraft-ui-egui --example ui_shot -- script.jsonl` (see the example's header). -- **For UI work, look at the result** (screenshot, read the PNG) and compare with Word side by side. -- CLI: `wordcraft-cli convert in.docx out.pdf`, `wordcraft-cli run --template sample --cmd 'select.text={"text":"Studio"}' --cmd format.bold --save out.docx`, `wordcraft-cli commands`, `wordcraft-cli parity`. -- MCP: `wordcraft-cli mcp` (headless) or `wordcraft-cli mcp --connect 127.0.0.1:7981` (drives the running app). See `docs/mcp.md`. -- Shell gotcha: `mv`/`cp` may be aliased interactive — use `/bin/mv -f` / `/bin/cp -f`. -- Parallel agents: separate `CARGO_TARGET_DIR` per agent; edit only the crates you own; delete your target dir when done (disk). - -## Roadmap -Progress docs: `ROADMAP.md` (stage, headline numbers, progress log), `docs/target-app-parity.md` (the assessment), `docs/gaps.md` (ranked work list), `docs/roadmap.md` (milestones, Current focus), `docs/architecture.md`, and the parity checklists `docs/file-format-parity.md`, `docs/layout-parity.md`, `docs/typing-parity.md`, `docs/ui-parity.md`, `docs/hardware-parity.md`, `docs/localization-parity.md`. When work lands, update the gap, the parity doc and the progress log, and bump each touched doc's status line and revision history. - -## CI workflows -- Workflows in `.github/workflows/` call the shared workflows in [`storytold/craft-common-actions`](https://github.com/storytold/craft-common-actions) at `@main`, with their inputs and secrets. No other jobs: if no shared workflow does what's needed, it doesn't go here. -- Don't add or change CI in a feature or fix PR. If the existing workflows can't build or test a change, link an existing craft-common-actions issue or PR, or open a new issue, or a PR only for a small fix that is safe for every app and does not increase CI time. -- Some workflow files here still run their own jobs. Don't add to them. Moving a job into craft-common-actions is its own task, never part of another PR, and the job stays here until a shared workflow runs it. +@AGENTS.md diff --git a/Cargo.lock b/Cargo.lock index bfe2a15e2e..811ba2040b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1081,7 +1081,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0" +source = "git+https://github.com/storytold/craft-libs?rev=1b34eba41e62138fc2438d2734523b302840b45d#1b34eba41e62138fc2438d2734523b302840b45d" dependencies = [ "krilla", "thiserror 2.0.21", @@ -1090,9 +1090,10 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0" +source = "git+https://github.com/storytold/craft-libs?rev=a3e0b5a9440d18f19422a9dca13516747b7d3181#a3e0b5a9440d18f19422a9dca13516747b7d3181" dependencies = [ "craft-winprint-gdi", + "log", "miniz_oxide 0.9.1", "roxmltree", "tempfile", @@ -1103,7 +1104,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=47c9f62530db72bc5c3831c86653b47b20c640be#47c9f62530db72bc5c3831c86653b47b20c640be" +source = "git+https://github.com/storytold/craft-libs?rev=01315d9c92b5b0e69082d35ca56099461a1efd45#01315d9c92b5b0e69082d35ca56099461a1efd45" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1134,7 +1135,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c5a1cbfb5f9049f9270955caffb5bee5997aebf7#c5a1cbfb5f9049f9270955caffb5bee5997aebf7" +source = "git+https://github.com/storytold/craft-libs?rev=1b34eba41e62138fc2438d2734523b302840b45d#1b34eba41e62138fc2438d2734523b302840b45d" dependencies = [ "chrono", "dunce", @@ -1157,6 +1158,26 @@ dependencies = [ "zip 9.1.0", ] +[[package]] +name = "craft-web-api" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=fd5e2feff6ea25bed371a99cc732b3968d621505#fd5e2feff6ea25bed371a99cc732b3968d621505" +dependencies = [ + "js-sys", + "serde_json", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "craft-web-host" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=fd5e2feff6ea25bed371a99cc732b3968d621505#fd5e2feff6ea25bed371a99cc732b3968d621505" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "craft-window" version = "0.1.0" @@ -1520,6 +1541,19 @@ dependencies = [ "winit", ] +[[package]] +name = "egui_extras" +version = "0.37.0" +source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +dependencies = [ + "ahash", + "egui", + "enum-map", + "itertools", + "log", + "profiling", +] + [[package]] name = "egui_glow" version = "0.37.0" @@ -1587,6 +1621,26 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" +[[package]] +name = "enum-map" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4532960034c15ba2f55e9eee631040ecc473c32e6c4b200828c759840f13a06" +dependencies = [ + "enum-map-derive", +] + +[[package]] +name = "enum-map-derive" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7127272f64b3e098f7d81f350d672081b879bff896d219c42370dc858b1af9ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + [[package]] name = "enumflags2" version = "0.7.12" @@ -2927,7 +2981,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0" +source = "git+https://github.com/storytold/craft-libs?rev=1b34eba41e62138fc2438d2734523b302840b45d#1b34eba41e62138fc2438d2734523b302840b45d" dependencies = [ "base64 0.22.1", "bumpalo", @@ -6752,7 +6806,7 @@ dependencies = [ [[package]] name = "wordcraft" -version = "0.15.0" +version = "0.15.1" dependencies = [ "arboard", "chrono", @@ -6772,7 +6826,9 @@ dependencies = [ "open", "pollster 1.0.1", "rfd", + "serde", "serde_json", + "tempfile", "windows", "winit", "winresource", @@ -6782,29 +6838,33 @@ dependencies = [ "wordcraft-engine", "wordcraft-fonts", "wordcraft-ui-egui", + "x11rb", "zbus", ] [[package]] name = "wordcraft-cli" -version = "0.15.0" +version = "0.15.1" dependencies = [ + "image", "serde_json", "sys-locale", "wordcraft-doc", "wordcraft-engine", + "wordcraft-fonts", "wordcraft-mcp", "wordcraft-render", "wordcraft-zotero", + "zip 3.0.0", ] [[package]] name = "wordcraft-control-key" -version = "0.15.0" +version = "0.15.1" [[package]] name = "wordcraft-doc" -version = "0.15.0" +version = "0.15.1" dependencies = [ "base64 0.23.1", "log", @@ -6818,7 +6878,7 @@ dependencies = [ [[package]] name = "wordcraft-docbin" -version = "0.15.0" +version = "0.15.1" dependencies = [ "cfb", "chrono", @@ -6835,7 +6895,7 @@ dependencies = [ [[package]] name = "wordcraft-docx" -version = "0.15.0" +version = "0.15.1" dependencies = [ "aes", "base64 0.23.1", @@ -6847,6 +6907,7 @@ dependencies = [ "log", "proptest", "quick-xml 0.41.0", + "serde_json", "sha1 0.11.0", "sha2 0.11.1", "thiserror 2.0.21", @@ -6859,7 +6920,7 @@ dependencies = [ [[package]] name = "wordcraft-engine" -version = "0.15.0" +version = "0.15.1" dependencies = [ "cfb", "chrono", @@ -6892,7 +6953,7 @@ dependencies = [ [[package]] name = "wordcraft-fonts" -version = "0.15.0" +version = "0.15.1" dependencies = [ "brotli-decompressor", "harfrust 0.13.3", @@ -6906,26 +6967,34 @@ dependencies = [ [[package]] name = "wordcraft-formats" -version = "0.15.0" +version = "0.15.1" dependencies = [ + "aes", + "base64 0.23.1", "cfb", "chardetng", "chrono", "encoding_rs", + "getrandom 0.3.4", + "hmac", "image", "js-sys", "log", + "miniz_oxide 0.9.1", "proptest", "quick-xml 0.41.0", + "sha1 0.11.0", + "sha2 0.11.1", "wordcraft-doc", "wordcraft-geom", "wordcraft-metafile", + "zeroize", "zip 3.0.0", ] [[package]] name = "wordcraft-geom" -version = "0.15.0" +version = "0.15.1" dependencies = [ "image", "serde", @@ -6933,7 +7002,7 @@ dependencies = [ [[package]] name = "wordcraft-layout" -version = "0.15.0" +version = "0.15.1" dependencies = [ "craft-proof", "image", @@ -6953,7 +7022,7 @@ dependencies = [ [[package]] name = "wordcraft-mcp" -version = "0.15.0" +version = "0.15.1" dependencies = [ "log", "serde_json", @@ -6965,7 +7034,7 @@ dependencies = [ [[package]] name = "wordcraft-metafile" -version = "0.15.0" +version = "0.15.1" dependencies = [ "kurbo", "thiserror 2.0.21", @@ -6973,7 +7042,7 @@ dependencies = [ [[package]] name = "wordcraft-pdf" -version = "0.15.0" +version = "0.15.1" dependencies = [ "chrono", "craft-pdf", @@ -6994,7 +7063,7 @@ dependencies = [ [[package]] name = "wordcraft-render" -version = "0.15.0" +version = "0.15.1" dependencies = [ "image", "log", @@ -7008,8 +7077,9 @@ dependencies = [ [[package]] name = "wordcraft-ui-egui" -version = "0.15.0" +version = "0.15.1" dependencies = [ + "accesskit_consumer", "cfb", "chrono", "craft-i18n", @@ -7017,6 +7087,7 @@ dependencies = [ "craft-update", "craft-window", "egui", + "egui_extras", "egui_kittest", "image", "js-sys", @@ -7039,8 +7110,10 @@ dependencies = [ [[package]] name = "wordcraft-web" -version = "0.15.0" +version = "0.15.1" dependencies = [ + "craft-web-api", + "craft-web-host", "eframe", "egui", "js-sys", @@ -7058,7 +7131,7 @@ dependencies = [ [[package]] name = "wordcraft-zotero" -version = "0.15.0" +version = "0.15.1" dependencies = [ "log", "proptest", @@ -7221,7 +7294,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee" [[package]] name = "xtask" -version = "0.15.0" +version = "0.15.1" dependencies = [ "serde_json", ] @@ -7492,7 +7565,6 @@ dependencies = [ "nix", "typed-path", "windows-sys 0.61.2", - "zopfli", ] [[package]] @@ -7580,11 +7652,6 @@ name = "egui_demo_lib" version = "0.37.0" source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" -[[patch.unused]] -name = "egui_extras" -version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" - [[patch.unused]] name = "egui_inspection" version = "0.37.0" diff --git a/Cargo.toml b/Cargo.toml index 02b68895b4..993a15f583 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["crates/*", "apps/*", "xtask"] default-members = ["crates/*", "apps/wordcraft", "apps/wordcraft-cli", "xtask"] [workspace.package] -version = "0.15.0" +version = "0.15.1" edition = "2024" license = "MIT OR Apache-2.0" rust-version = "1.95" @@ -24,10 +24,11 @@ wordcraft-pdf = { path = "crates/pdf" } # Proofing is craft-libs' craft-proof (it was crates/proof); its Language data is craft-i18n's # language-data/, embedded from CRAFT_I18N_DIR (craft-i18n.rev). The package keeps the # `wordcraft-proof` name here so `wordcraft_proof::` paths are unchanged. -# craft-proof is storytold/craft-libs main at the merge of #497 (flag-based compounding), which -# also has #496 (review follow-ups, en-AU) and the merged #482–#490/#495 stack; the font store's +# craft-proof is storytold/craft-libs main at the merge of #590 (ca-ES-valencia reads the ca-valencia +# pack), after #589 (French elision suggestions first) and #497 (flag-based compounding), which also +# has #496 (review follow-ups, en-AU) and the merged #482–#490/#495 stack; the font store's # `language-pack` kind is #486 (CP4.1). -wordcraft-proof = { package = "craft-proof", git = "https://github.com/storytold/craft-libs", rev = "47c9f62530db72bc5c3831c86653b47b20c640be", version = "=0.1.0" } +wordcraft-proof = { package = "craft-proof", git = "https://github.com/storytold/craft-libs", rev = "01315d9c92b5b0e69082d35ca56099461a1efd45", version = "=0.1.0" } craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "762a06a4c6b48b522b7d4de84a87917ef90265e6", version = "=0.1.0" } craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "762a06a4c6b48b522b7d4de84a87917ef90265e6", version = "=0.1.0" } wordcraft-engine = { path = "crates/engine" } @@ -66,9 +67,9 @@ wuff = "0.2.9" brotli-decompressor = "5" vello_cpu = "0.2" image = { version = "0.25", default-features = false, features = ["png", "jpeg", "webp", "gif", "bmp", "tiff"] } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0", version = "=0.1.0", default-features = false, features = ["write"] } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "1b34eba41e62138fc2438d2734523b302840b45d", version = "=0.1.0", default-features = false, features = ["write"] } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "c5a1cbfb5f9049f9270955caffb5bee5997aebf7", features = ["egui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "1b34eba41e62138fc2438d2734523b302840b45d", features = ["egui"] } quick-xml = "0.41" zip = { version = "3", default-features = false, features = ["deflate"] } # zlib streams (compressed metafile pictures in `.doc` drawings); already in the lock as a dependency of other crates. @@ -91,6 +92,8 @@ zeroize = "1" # dependency of other crates. libc = "0.2" +# time + # ui egui = "0.37" egui_extras = { version = "0.37", default-features = false } @@ -131,7 +134,7 @@ debug = 0 # Required by craft-pdf: the backend rejects writers that failed during unwinding. [patch.crates-io] -krilla = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "1b34eba41e62138fc2438d2734523b302840b45d" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } diff --git a/GLOSSARY.md b/GLOSSARY.md new file mode 100644 index 0000000000..9d1ec531ed --- /dev/null +++ b/GLOSSARY.md @@ -0,0 +1,68 @@ +# WordCraft + +A clean-room, Rust-native word processor. These are the words its interface, docs and code use for +the same things. + +## Languages and proofing + +**Interface language**: +The language of WordCraft's own menus, buttons and messages. +_Avoid_: Display language, UI locale + +**Proofing language**: +The language a piece of text is marked as, which decides how its spelling, grammar and hyphenation +are checked. A language is told apart from another by its tag (language, script, region, variant), +never by the name a list shows for it. +_Avoid_: Text language, editing language, document language + +**Language pack**: +A downloadable bundle of a language's spelling dictionary and hyphenation patterns. +_Avoid_: Dictionary download, language data (that is the embedded data) + +**Language list**: +The proofing languages offered in Set Proofing Language, Review › Language and the status bar's +menu: the languages WordCraft names, plus those of every installed (and, in Set Proofing Language, +every available) Language pack, each once. +_Avoid_: Language menu (that is only one of the places it is shown) + +**Your languages**: +The proofing languages Options › Language lists: each English variant in use (the default proofing +language and any in the open document), every language with an installed +Language pack, and every proofing language used in the open document. +_Avoid_: Authoring languages, preferred languages + +**Default proofing language**: +The proofing language new blank documents get, set with Set as default; without one, the interface +language. +_Avoid_: Preferred language + +**Proofing status**: +Where a language's proofing comes from: built in, an installed Language pack, your own dictionary, +a system dictionary, available to install, or not available. + +**Custom dictionary**: +The words you added with Add to Dictionary, accepted in every language. +_Avoid_: User dictionary (in the interface) + +**Dictionaries folder**: +A folder of Hunspell dictionaries you supply, used before the system's (an installed Language pack +comes after it). +_Avoid_: Custom dictionaries + +## Export + +**Strict export**: +An export that writes nothing, and reports why, when a character or picture the output is meant +to show would be missing from it. Text the output doesn't show (hidden text, deletions without +markup) isn't checked. +_Avoid_: Safe mode, validated export + +**Missing glyph**: +A character the output draws that no face in the font fallback chain can draw, so it would appear +as an empty box. +_Avoid_: Tofu, box, notdef character + +**Missing picture**: +A picture the document refers to that the output cannot include: its part is absent, its data +cannot be decoded, its format is unsupported, or it is linked from outside the file. +_Avoid_: Broken image, dropped image diff --git a/README.md b/README.md index 1b1bcc2ede..66a7b7776a 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,7 @@ Command line: ```sh wordcraft-cli convert report.docx report.pdf # docx, pdf, odt, rtf, html, md, tex, txt, png +wordcraft-cli convert report.docx report.pdf --strict # exit 3, no file, if a character or picture would be left out wordcraft-cli text report.docx # plain text wordcraft-cli inspect report.docx # structure as JSON wordcraft-cli run --template sample \ @@ -164,6 +165,40 @@ wordcraft-cli run --template sample \ wordcraft-cli run --script job.json # the same from a file: commands, then save to docx and pdf ``` +`convert --strict` (a `.pdf` or `.png` output only) and `render --strict` (a PNG of one page) refuse a silently incomplete render: they exit 3 +and write nothing if the output would draw a character no font has (an empty box) or leave out a +picture. Exit codes are 0 (written), 1 (unreadable input, usage error, or `--strict` with another +output type, checked before the input is read) and 3 (strict refusal). On exit 3, stderr has one +`wordcraft-cli: strict: …` line per kind, then one JSON line: + +```sh +wordcraft-cli convert in.docx out.pdf --strict +# wordcraft-cli: strict: 1 character cannot be drawn: U+2D30 (×3) +# wordcraft-cli: strict: 1 picture(s) left out: word/media/image2.bin (header2.xml): unsupported format +# {"schema":1,"strict":"failed","missing_glyphs":[{"cp":"U+2D30","count":3}],"missing_pictures":[{"part":"word/media/image2.bin","source_part":"word/header2.xml","reason":"unsupported_format"}],"truncated":false,"total_missing_glyphs":1,"total_missing_pictures":1,"glyphs_truncated":false,"pictures_truncated":false} +``` + +The JSON line (schema 1, also what `file.strictReport` returns) has `schema`, `strict` +(`"passed"` or `"failed"`), `missing_glyphs` (entries `{"cp", "count"}`, sorted by code point), +`missing_pictures` (entries `{"part", "source_part", "reason"}`: the picture's part or target, the +story part it sits in such as `word/header2.xml`, and a reason code; `source_part` is also +`background` (the page picture), `body`, `header`, `footer`, `footnote`, `endnote`, `comment` or +`text box` where the part name is not known (a document not opened from a DOCX), or a chunk path such as +`word/afchunk1.docx > word/header1.xml` for a picture inside an embedded DOCX chunk), `truncated`, the two totals +`total_missing_glyphs` and `total_missing_pictures`, and `glyphs_truncated` and +`pictures_truncated` for each list. The reason codes are `missing_part`, `external_target`, +`link_only`, `undecodable` and `unsupported_format`; the stderr lines use plain words for them. When a list is cut, the stderr line gives the total +(`300 characters cannot be drawn (first 256 listed)`). +Each list stops at 256 entries separately; `truncated` is true when either was cut, and the totals +count every distinct character and picture found, those past the cap included. Only characters the output draws count (not hidden text, or deleted text +without `--markup`), and a character a fallback font draws is fine. Text inside a WMF or EMF picture counts too, shaped in the font the picture names with no fallback. A Private Use Area character +fails only if no installed font maps it. The result depends on the fonts installed on the host +(see #5624 for a fixed font set). An external picture target is never fetched: it is reported, not +loaded. Pictures dropped when a DOCX is opened (a missing part, an external target, or a `link only` picture with no embedded copy) are reported for DOCX input only. They have no page, so a PNG of any page is also refused for a missing or external picture anywhere in the document, unused headers included. `render --strict` checks only the page it +writes (`--page`; `--scale` doesn't matter), prints nothing on stdout when it refuses, and reports the +same way. The engine takes `strict: true` on `file.save`, `file.saveAs`, `file.exportPdf` and +`file.exportPng`, and `file.strictReport {markup?, page?}` returns the report without writing. + Web: `cd apps/wordcraft-web && trunk serve`, then open . ## For agents: CLI and MCP @@ -299,10 +334,21 @@ adapter. The log file records the choice (lines starting with RISC-V (riscv64): `wordcraft--linux-riscv64.tar.gz`, a tarball cross-compiled for glibc 2.39+ (Ubuntu 24.04, Debian 13 and newer). +**Read Aloud** (Review › Read Aloud) speaks through a speech program installed on the system: it +tries `espeak-ng`, then `espeak`, and when neither is installed it talks to Speech Dispatcher. +The `.rpm` package recommends `espeak-ng`; the `.deb` recommends `espeak-ng` or +`speech-dispatcher`, so the package manager installs one of the two by default. With the +AppImage or the tarball, install one yourself if neither is there (`sudo apt install espeak-ng`, +`sudo dnf install espeak-ng`, `sudo pacman -S espeak-ng`). The Flatpak doesn't speak yet: it has +no audio access and doesn't include `espeak-ng`, `espeak` or Speech Dispatcher. + **Wayland:** on a Wayland desktop the app runs through XWayland when it is available, because winit (the windowing library) supports dragging files into the window only on X11. To use the native Wayland backend instead (for example for sharper text with fractional scaling, at the cost -of file drag-and-drop), start it with `WORDCRAFT_WAYLAND=1`: +of file drag-and-drop), choose **File › Options › Advanced › Linux display server › Wayland**; it +applies the next time WordCraft starts, and **X11 (XWayland)** or **Automatic** switches back. The +`WORDCRAFT_WAYLAND` environment variable overrides the setting: `1` for native Wayland, `0` for +XWayland: ```sh WORDCRAFT_WAYLAND=1 wordcraft diff --git a/ROADMAP.md b/ROADMAP.md index e44ae6ceac..510812884a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,12 +1,22 @@ # WordCraft roadmap +> **Last reviewed:** 2026-10-31 · **Last updated:** 2026-10-31 · **Change:** minor (#3398: persistent screen paper colors; parity estimates unchanged); previously minor (#3693: additional Delete Previous Sentence command and shortcut; Word-parity estimates unchanged) +> **CLI path update:** 2026-11-04 · Options before a non-Unicode input filename no longer make the CLI reject that filename; text option values still require Unicode; `run --file` and `run --script` retain native paths. No ranked gap or readiness estimate changes. +> **Floating anchor row segments:** 2026-11-07 · A floating anchor after a manual page/column break counts visible content on the far side of the same wrapped row. Marker-only cover anchors retain their previous-page rule. Synthetic picture spacing, placement and history controls; no new native Word measurement. Readiness estimates unchanged. + > **Highlight update:** 2026-10-25 · Highlight shortcut toggles the last chosen colour off when the whole selection has it; explicit colour commands remain setters (#4085). Readiness estimates unchanged. **Stage: alpha** · next: beta, ~15 points (60% → 75% ready for real work) and ~150–230 h away -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-03 · **Change:** trivial (progress log: unclosed Markdown inline comments don't rescan the paragraph); previously trivial (progress log: Replace and Remove Table of Contents with Word's title above a section break, #4041); previously trivial (progress log: a password-protected file named on the command line asks for its password after the startup document is replaced, #5299); previously trivial (progress log: language-packs-2 published and pinned, 75 Language packs); previously trivial (progress log: language-packs-1 published and pinned, CP4.4); previously trivial (progress log: Language packs, CP4);; previously trivial (DOCX table rows and cells inside selected alternate-content branches survive open and repeated saves (#5219); broader corpus qualification and readiness estimates unchanged); previously trivial (progress log: a list inside a Markdown block quote stays quoted); previously trivial (progress log: arrowheads keep their kind, width and length and are drawn at Word's sizes); previously trivial (progress log: the line between columns for selected text, #5178); previously trivial (progress log: .doc standard font, #5066); previously trivial (progress log: a table row doesn't split off a picture that doesn't fit, #4272); previously trivial (progress log: a middle or bottom cell of a row split across pages lines up on the first page); previously trivial (progress log: tab leader dots spaced and placed as in Word); previously trivial (progress log: a list level above counts its first number at the first deeper item); previously trivial (progress log: paragraph side borders lie outside the text, #5036); previously trivial (progress log: a paragraph naming an undefined style is formatted as Normal, #5077); previously trivial (progress log: TOC page numbers as PAGEREF fields, #5097); previously trivial (progress log: Backstage keytips, #4960); previously trivial (Progress log: only the printer's PDF leaves out links; Save these pages as PDF keeps them, #4734); previously trivial (progress log: Chinese and Japanese text counts a word per character, #4547; previously trivial: aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (progress log: corporate authors in bibliographies, #4848); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (progress log: Table Properties follows the selection, #4857); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion walks reference offsets and formatting runs together, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (progress log: RTF pictures stored as Windows or Enhanced Metafiles are imported, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (progress log: Insert › Shapes icon grid, #4349); previously trivial (progress log: AutoCorrect Options with no document open, #4585); previously trivial (progress log: window fallback geometry and equation symbol tooltips); previously trivial (progress log: window titles omit NUL characters, #3634); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (progress log: Custom document properties dialog, #2982; previously trivial: progress log: View › New Window; previously trivial: progress log: interface translations come from storytold/craft-i18n through the `craft-i18n` crate; previously trivial: progress log: disabled-control reasons translated in every interface language, #2678; previously trivial: progress log: mail merge record navigation and record ranges for printing, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: group connector rerouting preserves rotated and flipped free or unresolved endpoints under nonuniform group scaling; readiness estimates unchanged; previously trivial: progress log: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: progress log: a relationship the markup names without the prefix is read as it wrote, and an ordinary `id` names no part; previously trivial: progress log: a document with many relationships opens in the time its part takes, and an id the text only mentions is not a reference, #3411; previously trivial: progress log: read only and comments-only protection grey out edits; previously trivial: progress log: an empty paragraph with a hidden mark shows nothing, not even its list number, #3982; previously trivial: progress log: "NaN" in the Font dialog's Size box no longer closes the app, #3663; previously trivial: progress log: a table cell span from a `.json` file no longer overflows, #3637; previously trivial: progress log: a click in the footer while editing the header moves there; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Slovenian interface catalog, 2,614 entries; previously trivial: Insert Table of Figures dialog for any caption label, #3013; previously trivial: progress log: Home › Underline drop-down, #2738; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: progress log: the scrollbar page tip stays on one line, #3341; previously trivial: progress log: forms protection greys out the control buttons; previously trivial: progress log: a document with many content controls saves in the time the controls take, #13; previously trivial: progress log: Word signature lines kept on save; previously trivial: a Thai run with Latin finds one installed font covering it all on Linux too, #1549; previously trivial: progress log: closing the header returns to the body selection, #3331; previously trivial: progress log: saving to a NAS share mounted by GVFS, #3003; previously trivial: progress log: a picture dragged near the bottom of a page lands there, #3169; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: progress log: inline pictures drag to an insertion cursor and stay inline, #2233, #2234; previously trivial: progress log: a text file saved over itself closes without asking, #2376; previously trivial: progress log: a text frame in the paragraph defaults frames nothing, #2360; previously trivial: fixed font inputs in four layout controls; previously trivial: typing no longer starts render threads on every repaint, #3027; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: progress log: banded rows shade as in Word, #3415; previously trivial: progress log: the table handles show while the caret is in the table, #2428; previously trivial: progress log: a click below a floating table reaches the text after it, #2038; previously trivial: progress log: Delete on selected table cells leaves one empty paragraph in each, #2802; previously trivial: progress log: lam-alef in exported PDFs extracts whole with fonts that draw it as two glyphs, #2310; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: progress log: a text box that keeps the keyboard no longer resets the input method every frame, #2986; previously trivial: progress log: recovery copies and .json files store pictures as base64, #586 follow-up; previously trivial: progress log: legacy menu keys, #1697; previously trivial: progress log: shape gradients and transparency, #1500; previously trivial: progress log: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: progress log: text above a float's anchor wraps around it, #2048; previously trivial: progress log: File › Recover follows the app theme, #3243; previously trivial: progress log: formatting toolbar with the text context menu, #2959; previously trivial: progress log: caret inside ligatures, #1974; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: progress log: a header-cell picture watermark sits behind the text, #1775; previously trivial: symbols keep their font when the text font changes, #2036; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: Add Font imports every selected font file, #1789); previously trivial (RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: Read Aloud speaks each sentence in its own language, #1843; previously trivial: hint-reliant CJK outlines; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: progress log: Turkish case mapping in AutoCorrect, #1923; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: progress log: Hebrew field results and smart quotes, #1670; previously trivial: Backspace removes a selected table, rows or columns, #1844; previously trivial: progress log: mixed Hebrew/Latin text keeps its order in Word, #1543; previously trivial: progress log: web typing in non-Latin text no longer repeats, #1480; previously trivial: progress log: font family caches bounded and math font lookups follow font changes, #1354; previously trivial: `-->` AutoCorrect replacement, #2223; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: progress log: Columns on selected text, #2024; previously trivial: progress log: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: progress log: Indonesian proofing, #498; previously trivial: progress log: DOCX glossary documents (building blocks); previously trivial: progress log: Read Mode keeps the keyboard and shows whole, unobscured columns, #1772); previously trivial: progress log: font list entries of tall-ascent fonts no longer cut off, #2570); previously trivial: progress log: Split Cells and Convert Text to Table dialogs follow the Word check, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout fills the window width, #1876; previously trivial: progress log: Different First Page headers reachable from page 1, #2826; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: progress log: web preferences kept between visits, #2132; previously trivial: progress log: undrawable private-use list bullets show the level's default bullet, #1683; previously trivial: progress log: `w:eastAsianLayout` kept on save; previously trivial: table style editor formats every part, #714); previously trivial: VML freeforms read and kept on save; previously trivial: progress log: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: progress log: grouped `flowChartOr` shapes draw their circle and crossing spokes; previously trivial: progress log: copies keep their formatting in other programs, #1523; previously trivial: progress log: privacy options on save, #1062; previously trivial: progress log: equation pictures in theme colours on Windows, #1002; previously trivial: symbol fonts, #776; previously trivial: the save prompt answers from the keyboard, #861; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw tab ink, #307, and Draw Table and Eraser, #303, landed: catalog 402/434; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; progress docs restructured) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-29 · **Change:** trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (English dialects in proofing, #1281; previously trivial: triple borders draw three lines, #1740; previously trivial: progress log: double-clicking a later page's footer no longer scrolls up, #2103; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: progress log: pasted blockquotes are indented paragraphs, #1270; previously trivial: progress log: print-area strings translated in every catalog; previously trivial: progress log: comments readable in the dark theme, #2045; previously trivial: progress log: ODT sections, #1379; previously trivial: progress log: table deletes, Change Case and Unlink Fields respect Track Changes and locked content controls, #1329; previously trivial: progress log: rounded rectangle corners, #1476; previously trivial: progress log: Save As type list, #1399; previously trivial: progress log: privacy options on save, #1062; previously trivial: progress log: equation pictures in theme colours on Windows, #1002; previously trivial: symbol fonts, #776; previously trivial: the save prompt answers from the keyboard, #861; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw tab ink, #307, and Draw Table and Eraser, #303, landed: catalog 402/434; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; progress docs restructured) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-03 · **Change:** trivial (progress log: a long comment's card and balloon stop at ten lines, #3382); previously trivial (progress log: a pasted text box story is charged for the formatting it copies); previously trivial (progress log: a .doc table row keeps one override per cell); previously trivial (progress log: a .doc file's sections find their paragraphs by index); previously minor (Arabic interface language with mirrored UI, #1195); previously trivial (progress log: Replace and Remove Table of Contents with Word's title above a section break, #4041); previously trivial (progress log: a password-protected file named on the command line asks for its password after the startup document is replaced, #5299); previously trivial (progress log: language-packs-2 published and pinned, 75 Language packs); previously trivial (progress log: language-packs-1 published and pinned, CP4.4); previously trivial (progress log: Language packs, CP4);; previously trivial (DOCX table rows and cells inside selected alternate-content branches survive open and repeated saves (#5219); broader corpus qualification and readiness estimates unchanged); previously trivial (progress log: a list inside a Markdown block quote stays quoted); previously trivial (progress log: arrowheads keep their kind, width and length and are drawn at Word's sizes); previously trivial (progress log: the line between columns for selected text, #5178); previously trivial (progress log: .doc standard font, #5066); previously trivial (progress log: a table row doesn't split off a picture that doesn't fit, #4272); previously trivial (progress log: a middle or bottom cell of a row split across pages lines up on the first page); previously trivial (progress log: tab leader dots spaced and placed as in Word); previously trivial (progress log: a list level above counts its first number at the first deeper item); previously trivial (progress log: paragraph side borders lie outside the text, #5036); previously trivial (progress log: a paragraph naming an undefined style is formatted as Normal, #5077); previously trivial (progress log: TOC page numbers as PAGEREF fields, #5097); previously trivial (progress log: Backstage keytips, #4960); previously trivial (Progress log: only the printer's PDF leaves out links; Save these pages as PDF keeps them, #4734); previously trivial (progress log: Chinese and Japanese text counts a word per character, #4547; previously trivial: aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (progress log: corporate authors in bibliographies, #4848); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (progress log: Table Properties follows the selection, #4857); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion walks reference offsets and formatting runs together, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (progress log: RTF pictures stored as Windows or Enhanced Metafiles are imported, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (progress log: Insert › Shapes icon grid, #4349); previously trivial (progress log: AutoCorrect Options with no document open, #4585); previously trivial (progress log: window fallback geometry and equation symbol tooltips); previously trivial (progress log: window titles omit NUL characters, #3634); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (progress log: Custom document properties dialog, #2982; previously trivial: progress log: View › New Window; previously trivial: progress log: interface translations come from storytold/craft-i18n through the `craft-i18n` crate; previously trivial: progress log: disabled-control reasons translated in every interface language, #2678; previously trivial: progress log: mail merge record navigation and record ranges for printing, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: group connector rerouting preserves rotated and flipped free or unresolved endpoints under nonuniform group scaling; readiness estimates unchanged; previously trivial: progress log: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: progress log: a relationship the markup names without the prefix is read as it wrote, and an ordinary `id` names no part; previously trivial: progress log: a document with many relationships opens in the time its part takes, and an id the text only mentions is not a reference, #3411; previously trivial: progress log: read only and comments-only protection grey out edits; previously trivial: progress log: an empty paragraph with a hidden mark shows nothing, not even its list number, #3982; previously trivial: progress log: "NaN" in the Font dialog's Size box no longer closes the app, #3663; previously trivial: progress log: a table cell span from a `.json` file no longer overflows, #3637; previously trivial: progress log: a click in the footer while editing the header moves there; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Slovenian interface catalog, 2,614 entries; previously trivial: Insert Table of Figures dialog for any caption label, #3013; previously trivial: progress log: Home › Underline drop-down, #2738; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: progress log: the scrollbar page tip stays on one line, #3341; previously trivial: progress log: forms protection greys out the control buttons; previously trivial: progress log: a document with many content controls saves in the time the controls take, #13; previously trivial: progress log: Word signature lines kept on save; previously trivial: a Thai run with Latin finds one installed font covering it all on Linux too, #1549; previously trivial: progress log: closing the header returns to the body selection, #3331; previously trivial: progress log: saving to a NAS share mounted by GVFS, #3003; previously trivial: progress log: a picture dragged near the bottom of a page lands there, #3169; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: progress log: inline pictures drag to an insertion cursor and stay inline, #2233, #2234; previously trivial: progress log: a text file saved over itself closes without asking, #2376; previously trivial: progress log: a text frame in the paragraph defaults frames nothing, #2360; previously trivial: fixed font inputs in four layout controls; previously trivial: typing no longer starts render threads on every repaint, #3027; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: progress log: banded rows shade as in Word, #3415; previously trivial: progress log: the table handles show while the caret is in the table, #2428; previously trivial: progress log: a click below a floating table reaches the text after it, #2038; previously trivial: progress log: Delete on selected table cells leaves one empty paragraph in each, #2802; previously trivial: progress log: lam-alef in exported PDFs extracts whole with fonts that draw it as two glyphs, #2310; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: progress log: a text box that keeps the keyboard no longer resets the input method every frame, #2986; previously trivial: progress log: recovery copies and .json files store pictures as base64, #586 follow-up; previously trivial: progress log: legacy menu keys, #1697; previously trivial: progress log: shape gradients and transparency, #1500; previously trivial: progress log: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: progress log: text above a float's anchor wraps around it, #2048; previously trivial: progress log: File › Recover follows the app theme, #3243; previously trivial: progress log: formatting toolbar with the text context menu, #2959; previously trivial: progress log: caret inside ligatures, #1974; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: progress log: a header-cell picture watermark sits behind the text, #1775; previously trivial: symbols keep their font when the text font changes, #2036; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: Add Font imports every selected font file, #1789); previously trivial (RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: Read Aloud speaks each sentence in its own language, #1843; previously trivial: hint-reliant CJK outlines; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: progress log: Turkish case mapping in AutoCorrect, #1923; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: progress log: Hebrew field results and smart quotes, #1670; previously trivial: Backspace removes a selected table, rows or columns, #1844; previously trivial: progress log: mixed Hebrew/Latin text keeps its order in Word, #1543; previously trivial: progress log: web typing in non-Latin text no longer repeats, #1480; previously trivial: progress log: font family caches bounded and math font lookups follow font changes, #1354; previously trivial: `-->` AutoCorrect replacement, #2223; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: progress log: Columns on selected text, #2024; previously trivial: progress log: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: progress log: Indonesian proofing, #498; previously trivial: progress log: DOCX glossary documents (building blocks); previously trivial: progress log: Read Mode keeps the keyboard and shows whole, unobscured columns, #1772); previously trivial: progress log: font list entries of tall-ascent fonts no longer cut off, #2570); previously trivial: progress log: Split Cells and Convert Text to Table dialogs follow the Word check, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout fills the window width, #1876; previously trivial: progress log: Different First Page headers reachable from page 1, #2826; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: progress log: web preferences kept between visits, #2132; previously trivial: progress log: undrawable private-use list bullets show the level's default bullet, #1683; previously trivial: progress log: `w:eastAsianLayout` kept on save; previously trivial: table style editor formats every part, #714); previously trivial: VML freeforms read and kept on save; previously trivial: progress log: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: progress log: grouped `flowChartOr` shapes draw their circle and crossing spokes; previously trivial: progress log: copies keep their formatting in other programs, #1523; previously trivial: progress log: privacy options on save, #1062; previously trivial: progress log: equation pictures in theme colours on Windows, #1002; previously trivial: symbol fonts, #776; previously trivial: the save prompt answers from the keyboard, #861; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw tab ink, #307, and Draw Table and Eraser, #303, landed: catalog 402/434; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; progress docs restructured) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-29 · **Change:** trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (English dialects in proofing, #1281; previously trivial: triple borders draw three lines, #1740; previously trivial: progress log: double-clicking a later page's footer no longer scrolls up, #2103; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: progress log: pasted blockquotes are indented paragraphs, #1270; previously trivial: progress log: print-area strings translated in every catalog; previously trivial: progress log: comments readable in the dark theme, #2045; previously trivial: progress log: ODT sections, #1379; previously trivial: progress log: table deletes, Change Case and Unlink Fields respect Track Changes and locked content controls, #1329; previously trivial: progress log: rounded rectangle corners, #1476; previously trivial: progress log: Save As type list, #1399; previously trivial: progress log: privacy options on save, #1062; previously trivial: progress log: equation pictures in theme colours on Windows, #1002; previously trivial: symbol fonts, #776; previously trivial: the save prompt answers from the keyboard, #861; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw tab ink, #307, and Draw Table and Eraser, #303, landed: catalog 402/434; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; progress docs restructured) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-08 · **Change:** trivial (progress log: the window moves by its title bar behind a modal dialog, #5124); previously trivial (progress log: `convert --strict` and `render --strict` refuse a silently incomplete PDF or PNG (#6005, #6008)); ; trivial (progress log: ODT columns stating only their shares); previously trivial (progress log: ODT font size for every script); previously trivial (progress log: ODT text turning off what its style turns on); previously trivial (progress log: edited ODT paragraphs keep custom styles with an outline level); previously trivial (progress log: ODT pictures keep the size their file gives); previously trivial (progress log: ODT frames keep the page they are anchored to); previously trivial (pointer zoom stretches page rasters until it stops); previously trivial (dark-theme interface text on Linux no longer looks semi-bold); previously trivial (Control/MCP #2596 review: partial-write outcomes, path-bearing image exports, accept-thread startup cleanup and malformed UTF-8 handling); previously trivial (progress log: a turned inline picture whose file keeps no room for the turn keeps its line to its frame); previously trivial (progress log: the Arabic interface's Styles gallery reads from the right (#5566)); previously trivial (progress log: ODT pictures offered in several formats); previously trivial (progress log: ODT heading text of another size); previously trivial (Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged; previously trivial: progress log: Custom document properties dialog, #2982; previously trivial: progress log: View › New Window; previously trivial: progress log: interface translations come from storytold/craft-i18n through the `craft-i18n` crate; previously trivial: progress log: disabled-control reasons translated in every interface language, #2678; previously trivial: progress log: mail merge record navigation and record ranges for printing, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: group connector rerouting preserves rotated and flipped free or unresolved endpoints under nonuniform group scaling; readiness estimates unchanged; previously trivial: progress log: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: progress log: a relationship the markup names without the prefix is read as it wrote, and an ordinary `id` names no part; previously trivial: progress log: a document with many relationships opens in the time its part takes, and an id the text only mentions is not a reference, #3411; previously trivial: progress log: read only and comments-only protection grey out edits; previously trivial: progress log: an empty paragraph with a hidden mark shows nothing, not even its list number, #3982; previously trivial: progress log: "NaN" in the Font dialog's Size box no longer closes the app, #3663; previously trivial: progress log: a table cell span from a `.json` file no longer overflows, #3637; previously trivial: progress log: a click in the footer while editing the header moves there; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Slovenian interface catalog, 2,614 entries; previously trivial: Insert Table of Figures dialog for any caption label, #3013; previously trivial: progress log: Home › Underline drop-down, #2738; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: progress log: the scrollbar page tip stays on one line, #3341; previously trivial: progress log: forms protection greys out the control buttons; previously trivial: progress log: a document with many content controls saves in the time the controls take, #13; previously trivial: progress log: Word signature lines kept on save; previously trivial: a Thai run with Latin finds one installed font covering it all on Linux too, #1549; previously trivial: progress log: closing the header returns to the body selection, #3331; previously trivial: progress log: saving to a NAS share mounted by GVFS, #3003; previously trivial: progress log: a picture dragged near the bottom of a page lands there, #3169; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: progress log: inline pictures drag to an insertion cursor and stay inline, #2233, #2234; previously trivial: progress log: a text file saved over itself closes without asking, #2376; previously trivial: progress log: a text frame in the paragraph defaults frames nothing, #2360; previously trivial: fixed font inputs in four layout controls; previously trivial: typing no longer starts render threads on every repaint, #3027; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: progress log: banded rows shade as in Word, #3415; previously trivial: progress log: the table handles show while the caret is in the table, #2428; previously trivial: progress log: a click below a floating table reaches the text after it, #2038; previously trivial: progress log: Delete on selected table cells leaves one empty paragraph in each, #2802; previously trivial: progress log: lam-alef in exported PDFs extracts whole with fonts that draw it as two glyphs, #2310; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial (progress log: a shape dropped just after a page break inside a paragraph stays on the new page, #4262); previously trivial (progress log: a float anchored on a later page of a long paragraph is drawn there, #4250); previously minor (progress log: `file.closeDocument` over the control channel and MCP bridge is refused while the document it names has unsaved changes; previously trivial (progress log: ODT element audit, ODT checked against 220 files from other applications, ODT display styles); previously trivial (progress log: Shape Format › Size in the interface unit, #4196); previously trivial (progress log: typed n-ary operators such as ∫ and ∑ wait for their limits, observed in Word for Windows on #4938 (#4917)); previously trivial (progress log: a paragraph naming an undefined style is formatted as Normal, #5077); previously trivial (progress log: justified and distributed lines keep the width of the spaces before their first character); previously trivial (print helpers erase loaded plaintext inputs before driver work, #5710); previously trivial (Windows print submissions use isolated helpers so a cancelled driver cannot block a retry, #5710); previously trivial (print cancellation remains available without a document; sending-boundary limitation clarified, #5710); previously trivial (progress log: a print job waiting on its driver can be cancelled, and quitting doesn't wait for it, #5710); previously trivial (progress log: the Print panel's printer list no longer waits on printer drivers, #5710); previously trivial (Page drawing indexes text-box warp lookups per paragraph (#3614)); previously trivial (built-in citation source lookups, #4888; current-main progress records retained); previously trivial (progress log: Times and Courier take their Windows counterparts' line spacing; previously trivial (progress log: the status bar's count can be words, characters or characters without spaces, #2797); previously trivial (Linux display server setting in File › Options › Advanced, #2184); previously trivial (progress log: Linux Read Aloud through Speech Dispatcher, #4576); previously trivial (progress log: a click just outside a floating table by turned cell text, #4181; previously minor: progress log: Spanish proofing, #3360, #3553; previously trivial: progress log: Insert › Table's grid previews the hovered table on the page, #3931; previously trivial (progress log: MHT quoted MIME parameters); previously trivial (progress log: CLI convert format options); previously trivial (MATH construction reuse, #3630); previously trivial (DOCX `w:adjustRightInd` is preserved through style resolution and ordered DOCX saves); previously trivial (per-page ink object lookups, #3614); previously trivial (progress log: ODT display settings removed); previously trivial (progress log: dialogs are modal except the five Word keeps modeless, and a press beside one shakes it, #3859); previously trivial (progress log: picture brightness, contrast and transparency, ODT element audit, ODT checked against 220 files from other applications, ODT display styles); previously trivial (progress log: the dialogs of the mirrored Arabic interface read right to left: label-and-field rows, tables (list columns, the Models table), tile galleries and the Add/Remove arrows follow the reading direction, through one `rtl::Table` helper that draws exactly as before in English; no ranked gap closed, readiness estimates unchanged); previously trivial (progress log: fonts that aren't installed are flagged in the font box and status bar); previously trivial (progress log: ODT sections inside text boxes); previously trivial (progress log: ODT definitions sharing a name, sections around tables, stacking order); previously trivial (progress log: ODT forms and indexes written as read); previously trivial (progress log: ODT table styles saved, WordCraft-origin documents checked in LibreOffice); previously trivial (progress log: ODT interpretation profile); previously trivial (progress log: ODT controls, custom shapes, in-line placement); previously trivial (progress log: ODT charts kept, frame outlines, header height); previously trivial (progress log: ODT header rows); previously trivial (progress log: ODT layout setting, padding, columns); previously trivial (progress log: ODT tables, header spacing, picture paragraphs); previously trivial (progress log: ODT round trips keep their page count); previously trivial (progress log: emphasis marks, SET fields, ODT page backgrounds and tables); previously trivial (progress log: ODT checked against LibreOffice's templates); previously trivial (progress log: ODT at ~90%); previously trivial (progress log: ODT read and written nearly whole); previously trivial (progress log: ODT text boxes); previously trivial (progress log: ODT layout settings); previously trivial (progress log: ODT character styles); previously trivial (progress log: ODT custom styles); previously trivial (progress log: ODT equations saved); previously trivial (progress log: ODT floating pictures); previously trivial (progress log: ODT paragraph borders); previously trivial (progress log: ODT heading numbering); previously trivial (progress log: ODT table borders); previously trivial (progress log: ODT heading styles); previously trivial (progress log: ODT tab stops); previously trivial (progress log: ODT character formatting); previously trivial (progress log: ODT lists); previously trivial (progress log: ODT comments); previously trivial (progress log: ODT footnotes and endnotes); previously trivial (progress log: ODT headers, footers and fields); previously trivial (progress log: ODT paragraph spacing); previously trivial (progress log: Options › Language redesign, CP4.3); previously trivial (progress log: the missing-pack bar on a fresh install, the caret's typing language, and the spelling menu heading in the interface language, CP4.3); previously trivial (progress log: Language pack languages in every language list, CP4.3); previously trivial (progress log: craft-proof pin, French elision and Valencian, CP4.3); previously trivial (progress log: a long comment's card and balloon stop at ten lines, #3382); previously trivial (progress log: a pasted text box story is charged for the formatting it copies); previously trivial (progress log: a .doc table row keeps one override per cell); previously trivial (progress log: a .doc file's sections find their paragraphs by index); previously minor (Arabic interface language with mirrored UI, #1195); previously trivial (progress log: Replace and Remove Table of Contents with Word's title above a section break, #4041); previously trivial (progress log: a password-protected file named on the command line asks for its password after the startup document is replaced, #5299); previously trivial (progress log: language-packs-2 published and pinned, 75 Language packs); previously trivial (progress log: language-packs-1 published and pinned, CP4.4); previously trivial (progress log: Language packs, CP4);; previously trivial (DOCX table rows and cells inside selected alternate-content branches survive open and repeated saves (#5219); broader corpus qualification and readiness estimates unchanged); previously trivial (progress log: a list inside a Markdown block quote stays quoted); previously trivial (progress log: arrowheads keep their kind, width and length and are drawn at Word's sizes); previously trivial (progress log: the line between columns for selected text, #5178); previously trivial (progress log: .doc standard font, #5066); previously trivial (progress log: a table row doesn't split off a picture that doesn't fit, #4272); previously trivial (progress log: a middle or bottom cell of a row split across pages lines up on the first page); previously trivial (progress log: tab leader dots spaced and placed as in Word); previously trivial (progress log: a list level above counts its first number at the first deeper item); previously trivial (progress log: paragraph side borders lie outside the text, #5036); previously trivial (progress log: TOC page numbers as PAGEREF fields, #5097); previously trivial (progress log: Backstage keytips, #4960); previously trivial (Progress log: only the printer's PDF leaves out links; Save these pages as PDF keeps them, #4734); previously trivial (progress log: Chinese and Japanese text counts a word per character, #4547; previously trivial: aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (progress log: corporate authors in bibliographies, #4848); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (progress log: Table Properties follows the selection, #4857); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion walks reference offsets and formatting runs together, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (progress log: RTF pictures stored as Windows or Enhanced Metafiles are imported, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (progress log: Insert › Shapes icon grid, #4349); previously trivial (progress log: AutoCorrect Options with no document open, #4585); previously trivial (progress log: window fallback geometry and equation symbol tooltips); previously trivial (progress log: window titles omit NUL characters, #3634); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (progress log: Custom document properties dialog, #2982; previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: progress log: a text box that keeps the keyboard no longer resets the input method every frame, #2986; previously trivial: progress log: recovery copies and .json files store pictures as base64, #586 follow-up; previously trivial: progress log: legacy menu keys, #1697; previously trivial: progress log: shape gradients and transparency, #1500; previously trivial: progress log: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: progress log: text above a float's anchor wraps around it, #2048; previously trivial: progress log: File › Recover follows the app theme, #3243; previously trivial: progress log: formatting toolbar with the text context menu, #2959; previously trivial: progress log: caret inside ligatures, #1974; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: progress log: a header-cell picture watermark sits behind the text, #1775; previously trivial: symbols keep their font when the text font changes, #2036; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: Add Font imports every selected font file, #1789); previously trivial (RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: Read Aloud speaks each sentence in its own language, #1843; previously trivial: hint-reliant CJK outlines; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: progress log: Turkish case mapping in AutoCorrect, #1923; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: progress log: Hebrew field results and smart quotes, #1670; previously trivial: Backspace removes a selected table, rows or columns, #1844; previously trivial: progress log: mixed Hebrew/Latin text keeps its order in Word, #1543; previously trivial: progress log: web typing in non-Latin text no longer repeats, #1480; previously trivial: progress log: font family caches bounded and math font lookups follow font changes, #1354; previously trivial: `-->` AutoCorrect replacement, #2223; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: progress log: Columns on selected text, #2024; previously trivial: progress log: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: progress log: Indonesian proofing, #498; previously trivial: progress log: DOCX glossary documents (building blocks); previously trivial: progress log: Read Mode keeps the keyboard and shows whole, unobscured columns, #1772); previously trivial: progress log: font list entries of tall-ascent fonts no longer cut off, #2570); previously trivial: progress log: Split Cells and Convert Text to Table dialogs follow the Word check, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout fills the window width, #1876; previously trivial: progress log: Different First Page headers reachable from page 1, #2826; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: progress log: web preferences kept between visits, #2132; previously trivial: progress log: undrawable private-use list bullets show the level's default bullet, #1683; previously trivial: progress log: `w:eastAsianLayout` kept on save; previously trivial: table style editor formats every part, #714); previously trivial: VML freeforms read and kept on save; previously trivial: progress log: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: progress log: grouped `flowChartOr` shapes draw their circle and crossing spokes; previously trivial: progress log: copies keep their formatting in other programs, #1523; previously trivial: progress log: privacy options on save, #1062; previously trivial: progress log: equation pictures in theme colours on Windows, #1002; previously trivial: symbol fonts, #776; previously trivial: the save prompt answers from the keyboard, #861; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw tab ink, #307, and Draw Table and Eraser, #303, landed: catalog 402/434; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; progress docs restructured); previously trivial (progress log: ODT documents keep their language); previously trivial (progress log: ODT table and row backgrounds) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> +> **Recipient CSV update:** 2026-10-27 · Complete quoted header records choose the delimiter (#4249); detection and regressions follow the current mailings module split. Recipient limits and readiness estimates are unchanged. +> +> **Headered CSV prefix update:** 2026-10-31 · Unquoted whitespace-only prefix lines are skipped before choosing recipient headers (#4249); quoted whitespace headers, headerless records, the shared CSV reader and recipient limits remain unchanged. + +> **Page Setup update:** 2026-11-07 · Page Setup number boxes keep long input inside the field, including accepted margin values after focus leaves (#5650); accepted ranges and readiness estimates are unchanged. > **Printing update:** 2026-10-12 · direct desktop printing through craft-print; details below. +> **Legacy form update:** 2026-10-22 · trivial: numeric XML references decode in field names and labels; readiness estimates unchanged. WordCraft aims for complete parity with Microsoft Word, then goes further on speed, openness and agent control. This page is the summary; the assessment is @@ -110,7 +120,7 @@ Weights and evidence per area: [docs/target-app-parity.md](docs/target-app-parit | Spanish | es | partial | ~95% | | Hindi | hi | none | 0% | | Arabic | ar | partial (catalog + mirrored UI; no kashida; no proofing; native review open) | ~95% | -| French | fr | partial (interface complete, native-speaker reviewed; no proofing) | 100% (2,615 entries) | +| French | fr | partial (interface complete, native-speaker reviewed; spelling from the French Language pack, no grammar marks) | 100% (2,615 entries) | | Portuguese | pt-br (pt-PT none) | partial | ~95% | | Indonesian | id | none | 0% | | Japanese | ja | partial | ~95% | @@ -141,14 +151,136 @@ Ranked, to beta (detail and remaining milestones in [docs/roadmap.md](docs/roadm ## Progress log - 2026-11-03: Security: Markdown import looks for the end of an inline ``. diff --git a/crates/formats/src/mht.rs b/crates/formats/src/mht.rs index c21c98d9aa..3ab3d91e36 100644 --- a/crates/formats/src/mht.rs +++ b/crates/formats/src/mht.rs @@ -213,10 +213,32 @@ fn header<'a>(h: &'a [(String, String)], name: &str) -> Option<&'a str> { /// A `; name=value` parameter of a header value (quotes removed), name case-insensitive. fn param<'a>(value: &'a str, name: &str) -> Option<&'a str> { - value.split(';').skip(1).find_map(|p| { - let (k, v) = p.split_once('=')?; - k.trim().eq_ignore_ascii_case(name).then(|| v.trim().trim_matches('"')) - }) + // Split outside quoted strings and comments (RFC 2045 §5.1, RFC 822 §3.3). + let mut quoted = false; + let mut escaped = false; + let mut comment_depth = 0usize; + value + .split(|c| { + if escaped { + escaped = false; + } else if (quoted || comment_depth > 0) && c == '\\' { + escaped = true; + } else if !quoted && c == '(' { + comment_depth = comment_depth.saturating_add(1); + } else if comment_depth > 0 { + if c == ')' { + comment_depth -= 1; + } + } else if c == '"' { + quoted = !quoted; + } + c == ';' && !quoted && comment_depth == 0 + }) + .skip(1) + .find_map(|p| { + let (k, v) = p.split_once('=')?; + k.trim().eq_ignore_ascii_case(name).then(|| v.trim().trim_matches('"')) + }) } /// Gather the leaf parts of a (possibly multipart) entity. @@ -400,6 +422,26 @@ mod tests { } } + #[test] + fn quoted_parameters_do_not_supply_a_false_boundary() { + for name in [r#"name="notes; boundary=wrong""#, r#"name="notes\"; boundary=wrong""#, r#"name="notes (10\" screen; boundary=wrong""#] { + let page = "Content-Type: text/html\r\n\r\n

Kept content

"; + let message = message(page).replace("multipart/related; boundary=", &format!("multipart/related; {name}; boundary=")); + let doc = import(message.as_bytes()); + assert_eq!(doc.plain_text(wordcraft_doc::StoryRef::Body).trim(), "Kept content", "{name}"); + } + } + + #[test] + fn quotes_in_comments_do_not_hide_the_boundary() { + for comment in [r#"(10" screen)"#, r#"(outer (10" screen); boundary=wrong)"#, r#"(10\)" screen; boundary=wrong)"#] { + let page = "Content-Type: text/html\r\n\r\n

Kept content

"; + let message = message(page).replace("multipart/related; boundary=", &format!("multipart/related {comment}; boundary=")); + let doc = import(message.as_bytes()); + assert_eq!(doc.plain_text(wordcraft_doc::StoryRef::Body).trim(), "Kept content", "{comment}"); + } + } + #[test] fn the_part_charset_decides_the_text() { let page = "Content-Type: text/html; charset=windows-1250\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n

=E8lanak

"; diff --git a/crates/formats/src/model.rs b/crates/formats/src/model.rs index 75e7d0d5e2..5ae9584ec2 100644 --- a/crates/formats/src/model.rs +++ b/crates/formats/src/model.rs @@ -16,16 +16,22 @@ use wordcraft_doc::{Align, Block, Blocks, Document, Paragraph, Revision, Revisio mod color; mod from_doc; mod media; +pub mod odf_object; mod to_doc; mod types; pub use color::parse_color; -pub use from_doc::{ListCounter, flow_paras, from_doc, from_doc_tracked, is_mono, para_kind}; +pub use from_doc::{ + ListCounter, flow_paras, from_doc, from_doc_tracked, from_doc_with, is_custom_char_style, is_custom_style, is_mono, para_kind, part_flow, + tabs_from_indent, +}; pub use media::{base64_decode, base64_encode, data_uri, decode_bounded, image_px, make_img, mime_of, percent_decode, sized_img, sniff_image}; pub use to_doc::{char_props, part_blocks, to_doc, to_doc_in}; pub use types::{ - CODE_STYLE, Cell, FBlock, FTable, Flow, Fmt, FmtChange, Img, Inline, Kind, ListInfo, MAX_DEPTH, MAX_FONT_NAME, MAX_LINK, MONO_FONT, Meta, Para, - RUBY_BASE_SIZE, RevMark, Spacing, clean_text, equations_as_text, kept_font, kept_link, ruby_as_text, ruby_object, + Affix, BoxLook, CODE_STYLE, Cell, CellPic, Chain, Chart, Conn, FBlock, FComment, FTable, Flow, FlowOpts, Fmt, FmtChange, Group, Img, Inline, + Kind, Label, ListInfo, MAX_DEPTH, MAX_FONT_NAME, MAX_GROUP_DEPTH, MAX_LINK, MONO_FONT, Member, Meta, OdfObject, Para, RUBY_BASE_SIZE, RevMark, + Spacing, TableExtra, clean_text, equations_as_text, flatten_tables, kept_font, kept_link, ranged_anchors, ruby_as_text, ruby_object, + shows_nothing, }; pub(crate) use types::{Dropped, begin_import, dropped}; @@ -40,6 +46,43 @@ thread_local! { mod tests { use super::*; + /// ASK and SET show nothing (layout shows no result for them): no text export writes the + /// result they hold, from the document or from a flow with fields; ODT keeps it. + #[test] + fn ask_and_set_fields_export_no_text() { + let mut doc = wordcraft_doc::Document::from_text("Before after"); + if let Ok(p) = doc.para_mut(wordcraft_doc::StoryRef::Body, &wordcraft_doc::Path::top(0)) { + for instr in ["SET name other", "ASK other \"Prompt\""] { + let field = wordcraft_doc::para::InlineObject::Field { + instr: instr.into(), + result: "SECRETVALUE".into(), + locked: false, + dirty: false, + code: false, + form: String::new(), + }; + p.insert_object(7, field, &Default::default()).unwrap(); + } + } + for (name, out) in [ + ("markdown", crate::markdown::export(&doc)), + ("html", crate::html::export(&doc)), + ("latex", crate::latex::export(&doc)), + ("rtf", crate::rtf::export(&doc)), + ] { + assert!(out.contains("Before"), "{name}: {out}"); + assert!(!out.contains("SECRETVALUE"), "{name}: {out}"); + } + let flow = from_doc_with(&doc, FlowOpts { fields: true, ..Default::default() }); + assert!(!crate::html::export_flow(&flow, "en").contains("SECRETVALUE")); + // The flow keeps the result for ODT. + let kept = flow + .blocks + .iter() + .any(|b| matches!(b, FBlock::Para(p) if p.inlines.iter().any(|i| matches!(i, Inline::Field { result, .. } if result == "SECRETVALUE")))); + assert!(kept); + } + #[test] fn percent_decode_requires_hex_digits() { assert_eq!(percent_decode("%+A"), b"%+A".to_vec()); @@ -52,8 +95,14 @@ mod tests { fn insert_covered_is_bounded_on_hostile_rowspan() { // Many rows each carrying the maximum rowspan would be O(rows × rowspan) covered cells; // the work cap must keep insertion bounded (and quick) instead of exhausting memory. - let mut t = - FTable { rows: (0..20_000).map(|_| vec![Cell { rowspan: 1000, ..Default::default() }]).collect(), widths: Vec::new(), borderless: false }; + let mut t = FTable { + rows: (0..20_000).map(|_| vec![Cell { rowspan: 1000, ..Default::default() }]).collect(), + widths: Vec::new(), + borderless: false, + extra: None, + kept: None, + wrap: None, + }; t.insert_covered(); assert!(t.rows.iter().all(|r| r.len() <= 64), "a row grew past the column cap"); } @@ -74,13 +123,15 @@ mod tests { assert_eq!(parse_color("#f00"), Some(Rgb(255, 0, 0))); assert_eq!(parse_color("#f00f"), Some(Rgb(255, 0, 0))); assert_eq!(parse_color("#0080FF"), Some(Rgb(0, 128, 255))); - assert_eq!(parse_color("#0080ff80"), Some(Rgb(0, 128, 255))); + assert_eq!(parse_color("#0080FFff"), Some(Rgb(0, 128, 255))); + // A colour with alpha is composited over the white page it lands on (#0080ff at 50%). + assert_eq!(parse_color("#0080ff80"), Some(Rgb(127, 191, 255))); assert_eq!(parse_color("rgb(1, 2, 3)"), Some(Rgb(1, 2, 3))); assert_eq!(parse_color("rgb(1 2 3)"), Some(Rgb(1, 2, 3))); - assert_eq!(parse_color("rgb(1 2 3 / 50%)"), Some(Rgb(1, 2, 3))); + assert_eq!(parse_color("rgb(1 2 3 / 50%)"), Some(Rgb(128, 129, 129))); assert_eq!(parse_color("hsl(0, 100%, 50%)"), Some(Rgb(255, 0, 0))); assert_eq!(parse_color("hsl(120deg 100% 50%)"), Some(Rgb(0, 255, 0))); - assert_eq!(parse_color("hsla(240, 100%, 50%, 0.8)"), Some(Rgb(0, 0, 255))); + assert_eq!(parse_color("hsla(240, 100%, 50%, 0.8)"), Some(Rgb(51, 51, 255))); assert_eq!(parse_color("navy"), Some(Rgb(0, 0, 128))); assert_eq!(parse_color("#zz"), None); assert_eq!(parse_color("rgb(1)"), None); @@ -89,12 +140,12 @@ mod tests { #[test] fn list_labels() { let mut c = ListCounter::default(); - let o = |level| ListInfo { ordered: true, level, start: 1 }; + let o = |level| ListInfo { ordered: true, level, start: 1, ..Default::default() }; assert_eq!(c.label(o(0)), "1."); assert_eq!(c.label(o(1)), "a."); assert_eq!(c.label(o(1)), "b."); assert_eq!(c.label(o(0)), "2."); - assert_eq!(c.label(ListInfo { ordered: false, level: 0, start: 1 }), "•"); + assert_eq!(c.label(ListInfo { ordered: false, level: 0, start: 1, ..Default::default() }), "•"); } #[test] @@ -103,6 +154,9 @@ mod tests { rows: vec![vec![Cell { rowspan: 2, ..Default::default() }, Cell::default()], vec![Cell::default()]], widths: vec![], borderless: false, + extra: None, + kept: None, + wrap: None, }; t.insert_covered(); assert_eq!(t.rows[1].len(), 2); diff --git a/crates/formats/src/model/color.rs b/crates/formats/src/model/color.rs index 48a83b5c4f..a80fdf60a7 100644 --- a/crates/formats/src/model/color.rs +++ b/crates/formats/src/model/color.rs @@ -34,24 +34,59 @@ fn hsl_to_rgb(h: f64, s: f64, l: f64) -> Rgb { Rgb(r, g, b) } +/// Composite `rgb` over the white page a paste lands on, at CSS alpha `a` (0..1): `rgba(0, 0, 0, +/// 0.45)` reads like the rgb(140, 140, 140) it looks like on the site, instead of solid black. +fn over_white(r: u8, g: u8, b: u8, a: f32) -> Rgb { + let mix = |c: u8| (c as f32 * a + 255.0 * (1.0 - a)).round().clamp(0.0, 255.0) as u8; + Rgb(mix(r), mix(g), mix(b)) +} + +/// The alpha of a CSS colour's `/ alpha` or 4th-value part, where present: 1.0 (opaque) otherwise. +fn css_alpha(after: Option<&str>) -> f32 { + let Some(a) = after else { return 1.0 }; + let a = a.trim(); + // CSS Colour 4's `none` is a missing component, and a missing alpha is transparent. + if a.eq_ignore_ascii_case("none") { + return 0.0; + } + // A value that is not a finite number (`nan`, `inf`) is no alpha at all: clamp would keep + // NaN, and `over_white` would turn the colour black. + let parse = |t: &str| t.parse::().ok().filter(|f| f.is_finite()); + if let Some(p) = a.strip_suffix('%') { + return parse(p.trim()).map(|f| f.clamp(0.0, 100.0) / 100.0).unwrap_or(1.0); + } + parse(a).map(|f| f.clamp(0.0, 1.0)).unwrap_or(1.0) +} + /// Parse a CSS / HTML colour: `#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`, `rgb(...)`, `hsl(...)` or a basic name. +/// A colour with alpha is composited over white: the model keeps opaque colours, and a paste lands +/// on a white page. pub fn parse_color(s: &str) -> Option { let s = s.trim().to_ascii_lowercase(); if let Some(h) = s.strip_prefix('#') { if (h.len() == 3 || h.len() == 4) && h.is_ascii() { let d = |i: usize| h.get(i..i + 1).and_then(|x| u8::from_str_radix(x, 16).ok()).map(|v| v * 17); - return Some(Rgb(d(0)?, d(1)?, d(2)?)); + let (r, g, b) = (d(0)?, d(1)?, d(2)?); + // A 4th digit is the alpha, composited over the page like `rgba(...)`'s is. + let a = if h.len() == 4 { d(3)? as f32 / 255.0 } else { 1.0 }; + return Some(over_white(r, g, b, a)); } if h.len() == 8 && h.bytes().all(|b| b.is_ascii_hexdigit()) { let p = |i: usize| h.get(i..i + 2).and_then(|x| u8::from_str_radix(x, 16).ok()); - return Some(Rgb(p(0)?, p(2)?, p(4)?)); + return Some(over_white(p(0)?, p(2)?, p(4)?, p(6)? as f32 / 255.0)); } return Rgb::parse(h); } if let Some(inner) = s.strip_prefix("rgb(").or_else(|| s.strip_prefix("rgba(")) { let inner = inner.trim_end_matches(')').trim(); - let before_slash = inner.split('/').next().unwrap_or(inner); - let parts: Vec<&str> = if before_slash.contains(',') { before_slash.split(',').collect() } else { before_slash.split_whitespace().collect() }; + let (rgb_part, alpha_part) = inner.split_once('/').map_or((inner, None), |(a, b)| (a, Some(b))); + // Legacy comma syntax carries the alpha as a 4th value (`rgba(0, 0, 0, 0.45)`). + let parts: Vec<&str> = if rgb_part.contains(',') { rgb_part.split(',').collect() } else { rgb_part.split_whitespace().collect() }; + let alpha = match alpha_part { + Some(a) => css_alpha(Some(a)), + None if parts.len() >= 4 => css_alpha(Some(parts[3])), + _ => 1.0, + }; let v: Vec = parts .iter() .take(3) @@ -65,14 +100,19 @@ pub fn parse_color(s: &str) -> Option { }) .collect(); if let [r, g, b] = v[..] { - return Some(Rgb(r, g, b)); + return Some(over_white(r, g, b, alpha)); } return None; } if let Some(inner) = s.strip_prefix("hsl(").or_else(|| s.strip_prefix("hsla(")) { let inner = inner.trim_end_matches(')').trim(); - let before_slash = inner.split('/').next().unwrap_or(inner); - let parts: Vec<&str> = if before_slash.contains(',') { before_slash.split(',').collect() } else { before_slash.split_whitespace().collect() }; + let (hsl_part, alpha_part) = inner.split_once('/').map_or((inner, None), |(a, b)| (a, Some(b))); + let parts: Vec<&str> = if hsl_part.contains(',') { hsl_part.split(',').collect() } else { hsl_part.split_whitespace().collect() }; + let alpha = match alpha_part { + Some(a) => css_alpha(Some(a)), + None if parts.len() >= 4 => css_alpha(Some(parts[3])), + _ => 1.0, + }; if parts.len() < 3 { return None; } @@ -96,7 +136,8 @@ pub fn parse_color(s: &str) -> Option { }; let s = parse_pct(parts[1])?; let l = parse_pct(parts[2])?; - return Some(hsl_to_rgb(h, s, l)); + let Rgb(r, g, b) = hsl_to_rgb(h, s, l); + return Some(over_white(r, g, b, alpha)); } Some(match s.as_str() { "black" => Rgb(0, 0, 0), @@ -127,6 +168,29 @@ mod tests { #[test] fn eight_digit_hex_rejects_signs() { assert_eq!(parse_color("#+1+2+3+4"), None); - assert_eq!(parse_color("#11223344"), Some(Rgb(0x11, 0x22, 0x33))); + // #11223344 is alpha 0x44 over white. + assert_eq!(parse_color("#11223344"), Some(Rgb(192, 196, 201))); + } + + #[test] + fn colors_with_alpha_composite_over_white() { + // The secondary text colour of dark-theme sites: solid black would read as the site's + // own emphasis, white is invisible on the page; the composite is what the eye saw. + assert_eq!(parse_color("rgba(0, 0, 0, 0.45)"), Some(Rgb(140, 140, 140))); + assert_eq!(parse_color("rgb(0 0 0 / 0.45)"), Some(Rgb(140, 140, 140))); + assert_eq!(parse_color("rgba(0, 0, 0, 0)"), Some(Rgb(255, 255, 255))); + assert_eq!(parse_color("rgba(255, 0, 0, 1)"), Some(Rgb(255, 0, 0))); + assert_eq!(parse_color("rgba(255, 0, 0, 45%)"), Some(Rgb(255, 140, 140))); + assert_eq!(parse_color("hsla(120, 100%, 50%, 0.5)"), Some(Rgb(128, 255, 128))); + // A 4-digit hex's last digit is the alpha, too: #0008 is black at 8/15 over white. + assert_eq!(parse_color("#0008"), Some(Rgb(119, 119, 119))); + // `none` is a missing alpha, and a missing alpha is transparent, not the opaque default + // an omitted alpha takes. + assert_eq!(parse_color("rgb(0 0 0 / none)"), Some(Rgb(255, 255, 255))); + assert_eq!(parse_color("rgb(0 0 0)"), Some(Rgb(0, 0, 0))); + // An alpha that is not a finite number is no alpha: the colour stays opaque, not black. + assert_eq!(parse_color("rgba(0, 0, 0, nan)"), Some(Rgb(0, 0, 0))); + assert_eq!(parse_color("rgba(0, 0, 0, inf)"), Some(Rgb(0, 0, 0))); + assert_eq!(parse_color("rgba(0, 0, 0, nan%)"), Some(Rgb(0, 0, 0))); } } diff --git a/crates/formats/src/model/from_doc.rs b/crates/formats/src/model/from_doc.rs index 0f77785f14..ae925ac1c2 100644 --- a/crates/formats/src/model/from_doc.rs +++ b/crates/formats/src/model/from_doc.rs @@ -1,4 +1,7 @@ -use super::types::{Cell, FBlock, FTable, Flow, Fmt, FmtChange, Img, Inline, Kind, ListInfo, MAX_DEPTH, Meta, Para, RevMark, Spacing}; +use super::types::{ + BoxLook, Cell, FBlock, FComment, FTable, Flow, FlowOpts, Fmt, FmtChange, Img, Inline, Kind, ListInfo, MAX_DEPTH, MAX_GROUP_DEPTH, Member, Meta, + Para, RevMark, Spacing, +}; use super::{ Arc, Block, Blocks, CharProps, Document, InlineObject, NumFormat, OBJ, PAGE_BREAK, ParaProps, Paragraph, StyleKind, Table, TextColor, Underline, VMerge, VertAlign, @@ -68,9 +71,152 @@ fn fmt_of(doc: &Document, cp: &CharProps, in_code: bool) -> Fmt { ins: None, del: None, fmt_change: None, + extra: None, } } +/// The flow formatting of a run with properties `props`: with `opts.chars`, its extra formatting, +/// its custom character style by name (only its direct formatting then its own) and a +/// monospaced font by its name. +fn run_fmt(doc: &Document, para_style: Option<&str>, props: &CharProps, in_code: bool, opts: FlowOpts) -> Fmt { + let mut f = fmt_of(doc, props, in_code); + if !opts.chars { + return f; + } + let custom = props.style.as_deref().filter(|id| is_custom_char_style(doc, id)); + let direct; + let props_now = match custom { + Some(_) => { + direct = CharProps { style: None, ..props.clone() }; + f = fmt_of(doc, &direct, in_code); + &direct + } + None => props, + }; + let e = effective(doc, props_now); + f.extra = extra_of(&e); + // Kerning on or off where it differs from the document's default. + let kerns = |k: Option| k.is_some_and(|k| k.is_finite() && k > 0.0); + let (kern, default) = (kerns(e.kern.or(doc.styles.default_chr.kern)), kerns(doc.styles.default_chr.kern)); + if kern != default { + f.extra.get_or_insert_with(Default::default).kern = Some(if kern { 1.0 } else { 0.0 }); + } + if let Some(id) = custom { + f.extra.get_or_insert_with(Default::default).style = Some(id.to_string()); + } + // A size stated without a complex-script size leaves the complex size to what is above it + // (a style's, or this size where none says one): said where it isn't this size, since a + // writer that gives every script the one size would otherwise change it. + let sized = props.size.is_some() || custom.is_some_and(|id| doc.styles.chain(id).iter().any(|s| s.chr.size.is_some())); + if props.size_cs.is_none() && sized && f.extra.as_ref().is_none_or(|x| x.size_cs.is_none()) { + let cs = doc.styles.resolve_char(para_style, props).size_cs; + if f.size != Some(cs) { + f.extra.get_or_insert_with(Default::default).size_cs = Some(cs); + } + } + if f.code { + f.code = false; + f.font = e.shown_font().map(Arc::from); + } + f +} + +/// The formatting in `e` (effective character properties) that only [`Fmt::extra`] holds; +/// `None` when it sets none of it. +fn extra_of(e: &CharProps) -> Option> { + let set = |v: Option| v.filter(|b| *b); + let x = CharProps { + // What it turns off, over what the style of its paragraph or span turns on, too. + bold: e.bold.filter(|b| !*b), + italic: e.italic.filter(|b| !*b), + strike: e.strike.filter(|b| !*b), + underline: e.underline.filter(|u| *u != Underline::Single), + underline_color: e.underline_color, + double_strike: set(e.double_strike), + caps: e.caps, + small_caps: e.small_caps, + hidden: set(e.hidden), + spacing: e.spacing.filter(|v| *v != 0.0 && v.is_finite()), + scale: e.scale.filter(|v| *v != 100.0 && v.is_finite()), + emphasis: e.emphasis.filter(|m| *m != wordcraft_doc::props::EmphasisMark::None), + position: e.position.filter(|v| *v != 0.0 && v.is_finite()), + outline: set(e.outline), + shadow: set(e.shadow), + emboss: set(e.emboss), + engrave: set(e.engrave), + border: e.border.filter(|b| b.is_visible()), + lang: e.lang.clone().filter(|l| !l.is_empty()), + font_cs: e.font_cs.clone().filter(|f| !f.is_empty()), + font_ea: e.font_ea.clone().filter(|f| !f.is_empty()), + size_cs: e.size_cs.filter(|s| s.is_finite()), + bold_cs: e.bold_cs, + italic_cs: e.italic_cs, + lang_bidi: e.lang_bidi.clone().filter(|l| !l.is_empty()), + lang_ea: e.lang_ea.clone().filter(|l| !l.is_empty()), + ..Default::default() + }; + (x != CharProps::default()).then(|| Box::new(x)) +} + +/// Whether character style `id` of `doc` is one of its own rather than one WordCraft gives links, +/// note and comment marks or placeholders. +pub fn is_custom_char_style(doc: &Document, id: &str) -> bool { + let builtin = + ["DefaultParagraphFont", "Hyperlink", "FollowedHyperlink", "FootnoteReference", "EndnoteReference", "CommentReference", "PlaceholderText"]; + !builtin.contains(&id) && doc.styles.get(id).is_some_and(|s| s.kind == wordcraft_doc::styles::StyleKind::Character) +} + +/// Whether paragraph style `id` of `doc` is one of its own rather than one the flow model's +/// paragraph kinds, lists and notes stand for (Normal, the headings, Title, Quote, Code, List +/// Paragraph, the note texts). +pub fn is_custom_style(doc: &Document, id: &str) -> bool { + // The styles the kinds stand for, and the names formats write fixed styles under. + let kinds = + ["Normal", "Title", "Quote", super::types::CODE_STYLE, "FootnoteText", "EndnoteText", "Standard", "Footnote", "Endnote", "Quotations"]; + let heading = id.strip_prefix("Heading").is_some_and(|n| n.len() == 1 && n.chars().all(|c| c.is_ascii_digit())); + !heading && !kinds.contains(&id) && doc.styles.get(id).is_some_and(|s| s.kind == wordcraft_doc::styles::StyleKind::Paragraph) +} + +/// Whether `doc`'s tab stops are measured from each paragraph's indent (an ODF document whose +/// file says so): [`Para::extra`]'s tab stops then are too. +pub fn tabs_from_indent(doc: &Document) -> bool { + doc.settings.odf.is_some_and(|o| o.tabs_from_indent) +} + +/// The paragraph formatting only [`Para::extra`] holds that `p` sets itself; `None` when none. +fn para_extra(doc: &Document, p: &wordcraft_doc::props::ParaProps) -> Option> { + let tabs = p.tabs.clone().filter(|t| !t.is_empty()).map(|mut tabs| { + // Measured from the paragraph's indent where the document measures them so (ODT). + if tabs_from_indent(doc) { + let indent = doc.styles.resolve_para(p).indent_left; + for t in &mut tabs { + t.pos = (t.pos - indent).clamp(-1584.0, 1584.0); + } + } + tabs + }); + let style = p.style.clone().filter(|id| is_custom_style(doc, id)); + // Its own, else its custom style's: the kind doesn't say (it stops at Heading 6, and is the + // heading style's where the style is based on one). + let outline_level = p.outline_level.or_else(|| style.as_ref().and_then(|_| doc.styles.resolve_para(p).outline_level)); + let x = wordcraft_doc::props::ParaProps { + tabs, + shading: p.shading, + style, + contextual_spacing: p.contextual_spacing, + bidi: p.bidi.filter(|b| *b), + drop_cap: p.drop_cap.filter(|l| *l > 1), + drop_cap_distance: p.drop_cap_distance.filter(|_| p.drop_cap.is_some_and(|l| l > 1)), + keep_lines: p.keep_lines.filter(|k| *k), + outline_level, + widow_control: p.widow_control.filter(|w| !*w), + // Hyphenated (the document hyphenates and the paragraph doesn't opt out): `Some(false)`. + suppress_hyphens: (doc.settings.auto_hyphenation && p.suppress_hyphens != Some(true)).then_some(false), + ..Default::default() + }; + (x != wordcraft_doc::props::ParaProps::default()).then(|| Box::new(x)) +} + /// Revision `i` as a flow mark (unknown author and date when there is none). fn rev_mark(doc: &Document, i: u32) -> RevMark { doc.revisions.get(i as usize).map(|r| RevMark { author: r.author.clone(), date: r.date.clone(), id: Some(i) }).unwrap_or_default() @@ -92,7 +238,13 @@ pub fn para_kind(doc: &Document, p: &Paragraph) -> (Kind, Option) { fn props_kind(doc: &Document, props: &ParaProps, blank: bool) -> (Kind, Option) { let rp = doc.styles.resolve_para(props); let style = props.style.as_deref().unwrap_or("Normal"); - let kind = if let Some(l) = rp.outline_level { + // A heading's kind is its style's (Heading 2 looks as Heading 2 whatever its outline level, + // which the paragraph may set apart); else its outline level's. + let style_level = + doc.styles.chain(style).iter().find_map(|s| s.id.strip_prefix("Heading").and_then(|n| n.parse::().ok()).filter(|n| (1..=9).contains(n))); + let kind = if let Some(l) = style_level.filter(|_| rp.outline_level.is_some()) { + Kind::Heading(l.min(6)) + } else if let Some(l) = rp.outline_level { Kind::Heading((l + 1).min(6)) } else if doc.styles.chain(style).iter().any(|s| s.id == "Title") { Kind::Title @@ -107,7 +259,13 @@ fn props_kind(doc: &Document, props: &ParaProps, blank: bool) -> (Kind, Option String { } } +/// The flow inlines for a note reference, comment mark or field `o` of `doc`, when `opts` asks +/// for them; `None` for other objects. `f` is the formatting of the run `o` is in. +fn rich_inlines(doc: &Document, o: &InlineObject, f: &Fmt, opts: FlowOpts) -> Option> { + Some(match o { + InlineObject::NoteRef { kind, id, custom } if opts.notes => { + // The note's content without its own mark (a note holds no notes). + let story = doc.parts.get(id).map(|part| &part.blocks); + let mut blocks = story.map(|b| flow_blocks(doc, b, 0, FlowOpts { notes: false, ..opts })).unwrap_or_default(); + // The space after the mark is the mark's (see `to_doc`'s `note`); a tab or more + // spaces there are the note's own. + if let Some(FBlock::Para(first)) = blocks.first_mut() { + let k = first.inlines.iter().take_while(|i| matches!(i, Inline::Text(t, _) if t.is_empty())).count(); + first.inlines.drain(..k); + if let Some(Inline::Text(t, _)) = first.inlines.first_mut() + && t.starts_with(' ') + { + t.remove(0); + } + } + let endnote = *kind == wordcraft_doc::para::NoteKind::Endnote; + vec![Inline::Note { endnote, custom: custom.clone(), blocks, fmt: f.clone() }] + } + // The comment, then the replies in its thread (replies to replies too, each answering the + // comment that starts the thread), which have no place of their own. + InlineObject::CommentStart { id } if opts.comments => { + let Some(c) = doc.comments.get(id) else { return Some(Vec::new()) }; + let mut out = vec![Inline::Comment { id: *id, comment: Box::new(flow_comment(doc, c, None, opts)) }]; + let mut thread = std::collections::BTreeSet::from([*id]); + let mut k = 0; + while let Some(Inline::Comment { id: at, .. }) = out.get(k) { + let at = *at; + k += 1; + for (rid, r) in doc.comments.iter().filter(|(_, r)| r.parent == Some(at)) { + if thread.insert(*rid) { + out.push(Inline::Comment { id: *rid, comment: Box::new(flow_comment(doc, r, Some(*id), opts)) }); + } + } + } + out + } + InlineObject::CommentEnd { id } if opts.comments => { + if doc.comments.contains_key(id) { + vec![Inline::CommentEnd(*id)] + } else { + Vec::new() + } + } + // A text box's content, without notes, comments or boxes of its own. + // A drawing shape, text box or group (pictures have their own place below). + InlineObject::Shape { .. } | InlineObject::Group { .. } if opts.boxes => vec![drawing_inline(doc, o, opts, 0, (1.0, 1.0))?], + InlineObject::FieldStart { instr, .. } if opts.fields => vec![Inline::FieldStart(instr.clone())], + InlineObject::FieldEnd if opts.fields => vec![Inline::FieldEnd], + // Where a bookmark ends, so it covers its text (Word's `_GoBack` is the last edit's spot). + InlineObject::BookmarkEnd { name } if opts.fields && name != "_GoBack" => vec![Inline::AnchorEnd(name.clone())], + InlineObject::Field { instr, result, locked, .. } if opts.fields => { + vec![Inline::Field { instr: instr.clone(), result: result.clone(), fmt: f.clone(), locked: *locked }] + } + _ => return None, + }) +} + +/// Comment `c` (a reply to `parent`) of `doc` as a flow comment: its text holds no comments or +/// notes of its own. +/// The flow inline for picture, shape or group `o` of `doc` (a member of groups `depth` deep), +/// its size scaled by `scale` (a group's members are in its own coordinates). A shape or text +/// box keeps its text, but not notes, comments or boxes of its own. `None` for what a flow has +/// no drawing for: a freeform's paths, a picture whose data is missing. +fn drawing_inline(doc: &Document, o: &InlineObject, opts: FlowOpts, depth: usize, scale: (f32, f32)) -> Option { + use wordcraft_doc::para::ShapeKind; + let (sx, sy) = scale; + match o { + // A freeform needs its paths. + InlineObject::Shape { kind, w, h, float, story, fill, stroke, stroke_width, extra, freeform, .. } + if *kind != ShapeKind::Freeform || freeform.is_some() => + { + // A connector stays one in formats that glue them (ODT, with boxes); elsewhere it is a + // straight line. + let kind = match kind { + ShapeKind::StraightConnector | ShapeKind::ElbowConnector | ShapeKind::CurvedConnector if !opts.boxes => ShapeKind::Line, + k => *k, + }; + let inner = FlowOpts { notes: false, comments: false, boxes: false, ..opts }; + let part = story.and_then(|id| doc.parts.get(&id)); + let blocks = part.map(|p| flow_blocks(doc, &p.blocks, 0, inner)).unwrap_or_default(); + let look = BoxLook { + fill: fill.clone().filter(|_| kind != ShapeKind::Line), + line: stroke.filter(|_| stroke_width.is_finite() && *stroke_width > 0.0).map(|c| (c, stroke_width.min(12.0))), + dash: extra.dash.clone(), + arrows: (extra.arrow_start, extra.arrow_end), + inset: part.and_then(|p| p.body.inset.is_some().then(|| p.body.insets_pt())), + auto_fit: part.is_some_and(|p| p.body.auto_fit), + vert: part.map(|p| p.body.vert).unwrap_or_default(), + // Kept only while it is still the freeform it was read as. + geometry: extra.odf_geometry.clone().filter(|_| (kind == ShapeKind::Freeform && freeform.is_some()) || kind == ShapeKind::Rectangle), + conn: (opts.boxes && (extra.id != 0 || extra.start.is_some() || extra.end.is_some())) + .then(|| Box::new(crate::model::Conn { id: extra.id, start: extra.start, end: extra.end })), + // A text box is named after its story; a linked one names the box it continues in. + chain: story.filter(|_| opts.boxes).map(|id| { + let next = part.and_then(|p| p.body.next).map(|n| format!("Frame{n}")); + Box::new(crate::model::Chain { name: format!("Frame{id}"), next }) + }), + }; + let path = freeform.clone().filter(|_| kind == ShapeKind::Freeform); + Some(Inline::Shape { kind, w: w * sx, h: h * sy, float: kept_float(float), blocks, look, path }) + } + InlineObject::Image { media, w, h, alt, float, ole, crop, .. } => { + let data = doc.media.get(media)?; + let alt = if o.is_decorative() { "" } else { alt.as_str() }; + Some(Inline::Image(Img { + data: data.clone(), + ext: media_ext(media, data), + w: w * sx, + h: h * sy, + alt: alt.to_string(), + float: kept_float(float), + object: ole.as_deref().filter(|_| opts.boxes).and_then(|e| super::odf_object::load(doc, e)), + crop: if opts.paras { *crop } else { [0.0; 4] }, + })) + } + InlineObject::Group { w, h, float, ch_w, ch_h, children, .. } if depth < MAX_GROUP_DEPTH => { + let ratio = |outer: f32, inner: f32| { + let r = outer / inner; + if r.is_finite() && r > 0.0 { r } else { 1.0 } + }; + let inner = (sx * ratio(*w, *ch_w), sy * ratio(*h, *ch_h)); + let members: Vec = children + .iter() + .filter_map(|c| { + drawing_inline(doc, &c.obj, opts, depth + 1, inner).map(|inline| Member { x: c.x * inner.0, y: c.y * inner.1, inline }) + }) + .collect(); + (!members.is_empty()).then(|| Inline::Group { w: w * sx, h: h * sy, float: kept_float(float), members }) + } + _ => None, + } +} + +/// The placement a flow keeps for a drawing: when it floats, or turns or mirrors it in line. +fn kept_float(f: &wordcraft_doc::para::Float) -> Option> { + let turned = f.rot.is_finite() && f.rot.rem_euclid(360.0) > 0.001 && f.rot.rem_euclid(360.0) < 359.999; + (f.wrap != wordcraft_doc::para::Wrap::Inline || turned || f.flip_h || f.flip_v).then(|| Box::new(f.clone())) +} + +fn flow_comment(doc: &Document, c: &wordcraft_doc::Comment, parent: Option, opts: FlowOpts) -> FComment { + let story = doc.parts.get(&c.part).map(|p| &p.blocks); + let blocks = story.map(|b| flow_blocks(doc, b, 0, FlowOpts { notes: false, comments: false, ..opts })).unwrap_or_default(); + FComment { author: c.author.clone(), initials: c.initials.clone(), date: c.date.clone(), resolved: c.resolved, parent, blocks } +} + +/// Whether `li`, the list of heading `p`, is the number its outline level has from its heading +/// style's list, not a list of its own: it states that level, and the heading style of that level +/// numbers with that list there. Past Heading 6 no such style gives the written outline a number. +fn numbered_by_outline(doc: &Document, p: &Paragraph, li: &ListInfo) -> bool { + use wordcraft_doc::props::NumRef; + p.props.outline_level == Some(li.level) + && li.level < 6 + && doc.styles.para_style_props(&format!("Heading{}", li.level + 1)).0.numbering == Some(NumRef { num: li.list, level: li.level }) +} + +/// A paragraph's list membership as the flow keeps it: without the list's identity and label +/// unless `opts` asks for them, and none for a heading numbered only through its style or +/// [`numbered_by_outline`], which a format with heading numbering of its own (ODT's outline style) +/// numbers instead, in its first six levels. +fn flow_list(doc: &Document, kind: Kind, list: Option, p: &Paragraph, opts: FlowOpts) -> Option { + let mut li = list?; + if !opts.lists { + (li.list, li.label) = (0, None); + } else if matches!(kind, Kind::Heading(_)) && li.level < 6 && (p.props.numbering.is_none() || numbered_by_outline(doc, p, &li)) { + return None; + } + Some(li) +} + +/// The spacing and indents a paragraph sets itself (its style's are not included). +fn direct_spacing(p: &wordcraft_doc::props::ParaProps) -> Spacing { + Spacing { + before: p.space_before, + after: p.space_after, + line: p.line_spacing, + left: p.indent_left, + right: p.indent_right, + first: p.indent_first, + ..Default::default() + } +} + /// A document paragraph as flow paragraphs: a page break character inside the text ends the /// paragraph, and the text after it starts a new one that carries `page_break`. +/// An object's text in the flow: ASK and SET show nothing, whatever result they hold. +fn shown_text(o: &InlineObject) -> &str { + match o { + InlineObject::Field { instr, .. } if super::shows_nothing(instr) => "", + o => o.plain_text(), + } +} + pub fn flow_paras(doc: &Document, p: &Paragraph) -> Vec { - flow_paras_in(doc, p, false) + flow_paras_in(doc, p, FlowOpts::default()) } /// [`flow_paras`]; `tracked` keeps tracked changes: deleted text stays, and text carries its /// insertion and deletion marks. -fn flow_paras_in(doc: &Document, p: &Paragraph, tracked: bool) -> Vec { +fn flow_paras_in(doc: &Document, p: &Paragraph, opts: FlowOpts) -> Vec { + let tracked = opts.tracked; let (kind, list) = para_kind(doc, p); + let list = flow_list(doc, kind, list, p, opts); let mut done: Vec = Vec::new(); - let borders = if kind == Kind::Rule { None } else { p.props.borders.filter(|b| b.any_visible()) }; + let borders = if kind == Kind::Rule { None } else { p.props.borders.filter(|b| b.takes_room()) }; let mut out = Para { kind, list, @@ -142,22 +496,33 @@ fn flow_paras_in(doc: &Document, p: &Paragraph, tracked: bool) -> Vec { page_break: p.props.page_break_before.unwrap_or(false), keep_next: p.props.keep_next.unwrap_or(false), inlines: Vec::new(), - spacing: Spacing::default(), + spacing: direct_spacing(&p.props), borders, section: None, mark_ins: None, mark_del: None, fmt_change: None, + extra: None, mark: None, + kept: None, + wrap: None, + index: None, + group: None, }; + if opts.paras { + out.extra = para_extra(doc, &p.props); + } let in_code = kind == Kind::Code; let mut k = 0usize; + let mut control = OpenControl::default(); for (range, props) in p.run_ranges() { let Some(text) = p.text.get(range.clone()) else { continue }; // Deleted objects and page breaks stay out even when tracking: the flow has no marks for them. let hidden = props.hidden.unwrap_or(false) || props.del.is_some(); - let hidden_text = props.hidden.unwrap_or(false) || (props.del.is_some() && !tracked); - let mut f = fmt_of(doc, props, in_code); + // Formats that keep hidden text get it, marked hidden. + let hidden_text = (props.hidden.unwrap_or(false) && !opts.chars) || (props.del.is_some() && !tracked); + let hidden_obj = (props.hidden.unwrap_or(false) && !opts.chars) || props.del.is_some(); + let mut f = run_fmt(doc, p.props.style.as_deref(), props, in_code, opts); if tracked { (f.ins, f.del) = rev_marks(doc, props); f.fmt_change = props.fmt_change.as_deref().map(|c| Box::new(FmtChange { mark: rev_mark(doc, c.rev), old: fmt_of(doc, &c.old, in_code) })); @@ -174,13 +539,18 @@ fn flow_paras_in(doc: &Document, p: &Paragraph, tracked: bool) -> Vec { page_break: true, keep_next: p.props.keep_next.unwrap_or(false), inlines: Vec::new(), - spacing: Spacing::default(), + spacing: direct_spacing(&p.props), borders, section: None, mark_ins: None, mark_del: None, fmt_change: None, + extra: None, mark: None, + kept: None, + wrap: None, + index: None, + group: None, }; let prev = std::mem::replace(&mut out, next); if prev.inlines.is_empty() { @@ -198,12 +568,23 @@ fn flow_paras_in(doc: &Document, p: &Paragraph, tracked: bool) -> Vec { } let obj = p.objects.get(k); k += 1; - // Hidden text, or a hidden drawing: not in the copy. - if hidden || obj.and_then(InlineObject::frame).is_some_and(|(_, _, f)| f.hidden) { + control.interrupt(obj, &mut out, &f); + // Hidden text a format leaves out, a deleted object, or a hidden drawing: not in the + // copy (a format keeping hidden text keeps its objects too, as it keeps the text). + if hidden_obj || obj.and_then(InlineObject::frame).is_some_and(|(_, _, f)| f.hidden) { + continue; + } + let from = out.inlines.len(); + if let Some(items) = obj.and_then(|o| rich_inlines(doc, o, &f, opts)) { + if !buf.is_empty() { + out.push_text(&std::mem::take(&mut buf), &f); + } + out.inlines.extend(items); + raise_drawings(&mut out.inlines, from, props.position.filter(|_| opts.paras)); continue; } match obj { - Some(o @ InlineObject::Image { media, w, h, alt, .. }) => { + Some(o @ InlineObject::Image { media, w, h, alt, float, ole, crop, .. }) => { if !buf.is_empty() { out.push_text(&std::mem::take(&mut buf), &f); } @@ -217,18 +598,19 @@ fn flow_paras_in(doc: &Document, p: &Paragraph, tracked: bool) -> Vec { w: *w, h: *h, alt: alt.to_string(), + float: kept_float(float).filter(|_| opts.paras), + object: ole.as_deref().filter(|_| opts.boxes).and_then(|e| super::odf_object::load(doc, e)), + crop: if opts.paras { *crop } else { [0.0; 4] }, })), None if !alt.is_empty() => buf.push_str(alt), None => {} } } - Some(InlineObject::Graphic { alt, .. }) => { + Some(InlineObject::Graphic { alt, w, h, float, graphic }) => { if !buf.is_empty() { out.push_text(&std::mem::take(&mut buf), &f); } - if !alt.trim().is_empty() { - out.inlines.push(Inline::Figure(alt.clone())); - } + out.inlines.extend(graphic_inline(doc, (alt, *w, *h), float, graphic, opts)); } Some(InlineObject::Equation { linear, display, math }) => { if !buf.is_empty() { @@ -253,34 +635,306 @@ fn flow_paras_in(doc: &Document, p: &Paragraph, tracked: bool) -> Vec { } out.inlines.push(Inline::Anchor(name.clone())); } - Some(o) => buf.push_str(o.plain_text()), + Some(o @ (InlineObject::ControlStart { .. } | InlineObject::ControlEnd)) if control.object(o, opts, &mut buf, &mut out, &f) => {} + Some(o) => buf.push_str(shown_text(o)), None => {} } + raise_drawings(&mut out.inlines, from, props.position.filter(|_| opts.paras)); } if !hidden_text { - out.push_text(&buf, &f); + control.run_end(&buf, &mut out, &f); } } + control.finish(&mut out); if tracked { let (ins, del) = rev_marks(doc, &p.mark); (out.mark_ins, out.mark_del) = (ins.map(Box::new), del.map(Box::new)); // The formatting change belongs to the paragraph the mark ends. out.fmt_change = p.props.fmt_change.as_deref().map(|c| { let blank = out.inlines.is_empty(); - let (kind, list) = props_kind(doc, &c.old, blank); + let (kind, mut list) = props_kind(doc, &c.old, blank); + if !opts.lists + && let Some(li) = &mut list + { + (li.list, li.label) = (0, None); + } let old = Para { kind, list, align: c.old.align, page_break: c.old.page_break_before.unwrap_or(false), ..Default::default() }; Box::new(FmtChange { mark: rev_mark(doc, c.rev), old }) }); } // The paragraph that ends a section carries its properties (the last piece of it does). out.section.clone_from(&p.section); + out.mark = empty_mark(&out, p, opts); + // Still what the file it came from had (a whole paragraph): its markup, for its format. Not + // for one starting a page: the break may be its element's or the one before's (a break after + // it), and only the model says which is written where. + if opts.paras && done.is_empty() && p.props.page_break_before != Some(true) { + // With its comments and its text boxes' text, while they're as read. + out.kept = doc + .kept + .of("odt") + .and_then(|k| { + k.para(p).filter(|xml| (!xml.contains(" Vec { +/// A chart or diagram in a flow: an editable chart for formats that keep charts (ODT), a +/// diagram's drawing as a group for formats that keep shapes, else its alt text. +fn graphic_inline( + doc: &Document, + (alt, w, h): (&str, f32, f32), + float: &wordcraft_doc::para::Float, + graphic: &wordcraft_doc::graphic::Graphic, + opts: FlowOpts, +) -> Option { + if let Some(spec) = graphic.chart.as_ref().filter(|_| opts.boxes) { + return Some(Inline::Chart(crate::model::Chart { + spec: spec.clone(), + w, + h, + alt: alt.to_string(), + float: kept_float(float).filter(|_| opts.paras), + source: graphic.source.as_deref().and_then(|e| super::odf_object::load(doc, e)), + })); + } + // A diagram (SmartArt) for formats without one: its drawing as a group of shapes, text boxes + // and pictures every reader draws. + if opts.boxes + && let Some(group) = graphic_group(doc, (w, h), float, graphic) + { + return Some(group); + } + (!alt.trim().is_empty()).then(|| Inline::Figure(alt.to_string())) +} + +/// A graphic's drawing items ([`wordcraft_doc::graphic::GraphicItem`]) as a group `w` × `h` +/// points: its shapes as shapes, its text as borderless text boxes centred on their places, its +/// pictures as pictures. `None` when nothing in it can be drawn so (paths are left out). +fn graphic_group( + doc: &Document, + (w, h): (f32, f32), + float: &wordcraft_doc::para::Float, + graphic: &wordcraft_doc::graphic::Graphic, +) -> Option { + use wordcraft_doc::graphic::{GraphicItem, TextAlign}; + use wordcraft_doc::para::ShapeKind; + let ratio = |outer: f32, inner: f32| { + let r = outer / inner; + if r.is_finite() && r > 0.0 { r } else { 1.0 } + }; + let (sx, sy) = (ratio(w, graphic.w), ratio(h, graphic.h)); + let finite = |r: &[f32; 4]| r.iter().all(|v| v.is_finite()) && r[2] >= 0.0 && r[3] >= 0.0; + let plain = BoxLook { fill: None, line: None, inset: Some([0.0; 4]), ..BoxLook::default() }; + let members: Vec = graphic + .items + .iter() + .take(10_000) + .filter_map(|item| match item { + GraphicItem::Shape { rect, kind, fill, stroke, stroke_width } if finite(rect) => { + let look = BoxLook { + fill: fill.map(wordcraft_doc::fill::Fill::solid).filter(|_| *kind != ShapeKind::Line), + line: stroke.filter(|_| stroke_width.is_finite() && *stroke_width > 0.0).map(|c| (c, stroke_width.min(12.0))), + ..plain.clone() + }; + let inline = Inline::Shape { kind: *kind, w: rect[2] * sx, h: rect[3] * sy, float: None, blocks: Vec::new(), look, path: None }; + Some(Member { x: rect[0] * sx, y: rect[1] * sy, inline }) + } + GraphicItem::Text { rect, text, size, color, bold, align, font } if finite(rect) && !text.trim().is_empty() => { + let size = if size.is_finite() { size.clamp(1.0, 400.0) } else { 11.0 }; + // One line, centred vertically in its place as the graphic draws it. + let line = size * 1.2; + let (bw, bh) = (rect[2] * sx, line.max(1.0)); + let y = rect[1] * sy + (rect[3] * sy - bh) / 2.0; + let fmt = Fmt { bold: *bold, color: Some(*color), size: Some(size), font: font.as_deref().map(Arc::from), ..Fmt::default() }; + let para = Para { + align: Some(match align { + TextAlign::Left => wordcraft_doc::Align::Left, + TextAlign::Right => wordcraft_doc::Align::Right, + _ => wordcraft_doc::Align::Center, + }), + inlines: vec![Inline::Text(text.clone(), fmt)], + spacing: Spacing { before: Some(0.0), after: Some(0.0), ..Spacing::default() }, + ..Para::default() + }; + let inline = Inline::Shape { + kind: ShapeKind::Rectangle, + w: bw, + h: bh, + float: None, + blocks: vec![FBlock::Para(para)], + look: plain.clone(), + path: None, + }; + Some(Member { x: rect[0] * sx, y, inline }) + } + GraphicItem::Image { rect, media } if finite(rect) => { + let data = doc.media.get(media)?; + let img = Img { + data: data.clone(), + ext: media_ext(media, data), + w: rect[2] * sx, + h: rect[3] * sy, + alt: String::new(), + float: None, + object: None, + crop: [0.0; 4], + }; + Some(Member { x: rect[0] * sx, y: rect[1] * sy, inline: Inline::Image(img) }) + } + _ => None, + }) + .collect(); + if members.is_empty() { + return None; + } + // A group is as big as its members together (ODF 1.3 §10.3.15): an invisible rectangle the + // size of the graphic keeps the room around its drawing. + let frame = Inline::Shape { kind: ShapeKind::Rectangle, w, h, float: None, blocks: Vec::new(), look: plain, path: None }; + let all = std::iter::once(Member { x: 0.0, y: 0.0, inline: frame }).chain(members).collect(); + Some(Inline::Group { w, h, float: kept_float(float), members: all }) +} + +/// The mark formatting of `out`, the last piece of `p`, when it holds no text (its height, its +/// drawings' formatting), for +/// formats that keep it (flows asked for paragraph formatting). +fn empty_mark(out: &Para, p: &Paragraph, opts: FlowOpts) -> Option> { + let m = CharProps { ins: None, del: None, fmt_change: None, ..p.mark.clone() }; + (opts.paras && out.textless() && !m.is_empty()).then(|| Box::new(m)) +} + +/// The drawings from `from` on (just added) raised by their run's position `raise` (points): a +/// drawing in line keeps it as its float's `y` (see [`crate::model::Img::float`]). +fn raise_drawings(inlines: &mut [Inline], from: usize, raise: Option) { + let Some(r) = raise.filter(|r| r.is_finite() && *r != 0.0) else { return }; + for i in inlines.iter_mut().skip(from) { + let float = match i { + Inline::Image(img) => &mut img.float, + Inline::Chart(c) => &mut c.float, + Inline::Shape { float, .. } | Inline::Group { float, .. } => float, + _ => continue, + }; + let f = float.get_or_insert_with(Default::default); + if f.wrap == wordcraft_doc::para::Wrap::Inline { + f.y = r; + } + } +} + +/// A content control of plain text being read (formats with form controls): it, its text so +/// far and that text's formatting. +#[derive(Default)] +struct OpenControl(Option<(Box, String, Option)>); + +impl OpenControl { + /// Object `obj` comes: anything but the control's end makes the control its text after all. + fn interrupt(&mut self, obj: Option<&InlineObject>, out: &mut Para, f: &Fmt) { + if !matches!(obj, Some(InlineObject::ControlEnd)) + && let Some((_, text, fmt)) = self.0.take() + { + out.push_text(&text, &fmt.unwrap_or_else(|| f.clone())); + } + } + + /// A content control starts or ends (`o`): whether it is one read here (a plain-text + /// control, in a flow that keeps them). + fn object(&mut self, o: &InlineObject, opts: FlowOpts, buf: &mut String, out: &mut Para, f: &Fmt) -> bool { + match o { + InlineObject::ControlStart { control: c } if opts.boxes && !c.block && plain_control(&c.kind) => { + if !buf.is_empty() { + out.push_text(&std::mem::take(buf), f); + } + self.0 = Some((c.clone(), String::new(), None)); + true + } + InlineObject::ControlEnd if self.0.is_some() => { + self.close(buf, out, f); + true + } + _ => false, + } + } + + /// The control ends: it, with its text (the rest in `buf`), goes into `out`. + fn close(&mut self, buf: &mut String, out: &mut Para, f: &Fmt) { + if let Some((c, mut text, fmt)) = self.0.take() { + text.push_str(&std::mem::take(buf)); + out.inlines.push(Inline::Control { control: c, text, fmt: fmt.unwrap_or_else(|| f.clone()) }); + } + } + + /// A run ends with `buf`: the control's text when one is open, else the paragraph's. + fn run_end(&mut self, buf: &str, out: &mut Para, f: &Fmt) { + match &mut self.0 { + Some((_, text, fmt)) => { + text.push_str(buf); + fmt.get_or_insert_with(|| f.clone()); + } + None => out.push_text(buf, f), + } + } + + /// The paragraph ends: a control it doesn't close is its text. + fn finish(&mut self, out: &mut Para) { + if let Some((_, text, fmt)) = self.0.take() { + out.push_text(&text, &fmt.unwrap_or_default()); + } + } +} + +/// A content control that holds plain text, as a form control does. +fn plain_control(kind: &wordcraft_doc::control::ControlKind) -> bool { + use wordcraft_doc::control::ControlKind as K; + matches!(kind, K::Text { .. } | K::CheckBox { .. } | K::DropDown { .. } | K::ComboBox { .. } | K::Date { .. }) +} + +/// The index kept as read starting at block `i` of `bl`, while the paragraphs it takes are all +/// as read: how many blocks, and its markup. +fn kept_index(doc: &Document, bl: &Blocks, i: usize) -> Option<(usize, std::sync::Arc)> { + let k = doc.kept.of("odt")?; + let p = bl.get(i)?.as_para()?; + let (n, run, xml) = k.index(p)?; + let paras: Vec<&Paragraph> = bl.get(i..i + n)?.iter().filter_map(|b| b.as_para()).collect(); + (paras.len() == *n && wordcraft_doc::kept::run_fingerprint(paras.into_iter()) == *run).then(|| (*n, xml.clone())) +} + +fn flow_blocks(doc: &Document, bl: &Blocks, depth: usize, tracked: FlowOpts) -> Vec { let mut out = Vec::new(); - for b in bl { + let mut skip = 0usize; + for (i, b) in bl.iter().enumerate() { + if skip > 0 { + skip -= 1; + continue; + } + // An index kept as read, while every paragraph it takes still is what was read: its + // flow paragraphs, the first carrying its markup and how many there are. + if tracked.paras + && depth == 0 + && let Some(ix) = kept_index(doc, bl, i) + { + let from = out.len(); + for b in bl.get(i..i + ix.0).unwrap_or(&[]) { + if let Block::Para(p) = &**b { + out.extend(flow_paras_in(doc, p, tracked).into_iter().map(FBlock::Para)); + } + } + let n = out.len() - from; + if let Some(FBlock::Para(first)) = out.get_mut(from) { + first.index = Some(Box::new((ix.1, n))); + } + skip = ix.0.saturating_sub(1); + continue; + } match &**b { Block::Para(p) => out.extend(flow_paras_in(doc, p, tracked).into_iter().map(FBlock::Para)), Block::Table(t) if depth < MAX_DEPTH => out.push(FBlock::Table(flow_table(doc, t, depth, tracked))), @@ -296,12 +950,138 @@ fn flow_blocks(doc: &Document, bl: &Blocks, depth: usize, tracked: bool) -> Vec< out } -fn flow_table(doc: &Document, t: &Table, depth: usize, tracked: bool) -> FTable { +/// Word's default cell margins (top, left, bottom, right), points. +const WORD_CELL_MARGINS: [f32; 4] = [0.0, 5.4, 0.0, 5.4]; + +/// What a table's style and borders give one cell, worked out as the layout does, for formats +/// that keep cell formatting (ODT) but have no table styles of Word's kind: its shading, its four +/// edges (a side without a line is a "none" border), its vertical alignment, and its text's +/// character formatting and alignment. +struct StyledCell { + fill: Option, + borders: wordcraft_doc::props::Borders, + v_align: Option, + chr: CharProps, + align: Option, + /// The style's paragraph formatting (spacing, line spacing) under each paragraph's own. + para: ParaProps, +} + +fn styled_cell(t: &Table, style: Option<&wordcraft_doc::styles::TableStyleProps>, (ri, ci): (usize, usize), ncols: usize) -> Option { + use wordcraft_doc::props::{Border, BorderStyle, Borders}; + use wordcraft_doc::styles::{PartSet, TablePart}; + let row = t.rows.get(ri)?; + let cell = row.cells.get(ci)?; + let nrows = t.rows.len(); + let g = t.grid_col(ri, ci); + let span = cell.span(); + let mut out = StyledCell { + fill: None, + borders: Borders::default(), + v_align: None, + chr: CharProps::default(), + align: None, + para: style.map(|s| s.para.clone()).unwrap_or_default(), + }; + let mut part_borders = Vec::new(); + if let Some(st) = style { + let sizes = (st.parts.band_size.unwrap_or(0), st.parts.col_band_size.unwrap_or(0)); + for part in PartSet::of_cell(&t.props.look, sizes, (ri, nrows), (g, span, ncols)).iter() { + let f = st.part(part); + out.fill = f.fill.or(out.fill); + out.v_align = f.v_align.or(out.v_align); + out.chr.overlay(&f.chr); + out.align = f.align.or(out.align); + if part != TablePart::WholeTable + && let Some(b) = f.borders + { + part_borders.push((part, b)); + } + } + } + let mut tb = style.and_then(|s| s.parts.borders).unwrap_or_default(); + if let Some(own) = t.props.borders { + tb.overlay(&own); + } + let cb = cell.props.borders.unwrap_or_default(); + let rowb = row.props.exceptions.as_ref().and_then(|e| e.borders).unwrap_or_default(); + let (first_g, last_g) = (g == row.first_grid(), g + span >= ncols.saturating_sub(row.grid_after())); + let rb = wordcraft_doc::styles::part_borders(&part_borders, (ri, nrows), (first_g, last_g)); + let edge = |own: Option, outer: bool, outer_b: Option, inner_b: Option| own.or(if outer { outer_b } else { inner_b }); + let none = Border { style: BorderStyle::None, width: 0.0, color: None, space: 0.0 }; + let top = edge(cb.top.or(if ri == 0 { rowb.top } else { rowb.between }).or(rb.top), ri == 0, tb.top, tb.between); + let bottom = edge(cb.bottom.or(if ri + 1 == nrows { rowb.bottom } else { rowb.between }).or(rb.bottom), ri + 1 == nrows, tb.bottom, tb.between); + let left = edge( + cb.left.or(if first_g { rowb.left } else { rowb.inside_v }).or(if first_g { rb.left } else { rb.inside_v }), + first_g, + tb.left, + tb.inside_v, + ); + let right = edge( + cb.right.or(if last_g { rowb.right } else { rowb.inside_v }).or(if last_g { rb.right } else { rb.inside_v }), + last_g, + tb.right, + tb.inside_v, + ); + out.borders = Borders { + top: top.or(Some(none)), + bottom: bottom.or(Some(none)), + left: left.or(Some(none)), + right: right.or(Some(none)), + between: None, + inside_v: None, + }; + Some(out) +} + +/// `blocks` with what a table style's character and paragraph formatting changes (see +/// [`wordcraft_doc::styles::StyleSheet::table_para_patch`]) stated on each paragraph and run. +fn with_cell_text(doc: &Document, blocks: &Blocks, chr: &CharProps, align: Option, para: &ParaProps) -> Blocks { + if chr.is_empty() && align.is_none() && para.is_empty() { + return blocks.clone(); + } + blocks + .iter() + .map(|b| match &**b { + Block::Para(p) => { + let mut p = p.clone(); + let pstyle = p.props.style.clone(); + if !chr.is_empty() { + for r in &mut p.runs { + let mut props = doc.styles.table_char_patch(pstyle.as_deref(), r.props.style.as_deref(), chr); + props.overlay(&r.props); + r.props = props; + } + let mut mark = doc.styles.table_char_patch(pstyle.as_deref(), p.mark.style.as_deref(), chr); + mark.overlay(&p.mark); + p.mark = mark; + } + // A part's alignment is table style paragraph formatting too, under the paragraph's styles. + let table = ParaProps { align: align.or(para.align), ..para.clone() }; + if !table.is_empty() { + let mut props = doc.styles.table_para_patch(&p.props, &table); + props.overlay(&p.props); + p.props = props; + } + Arc::new(Block::Para(p)) + } + _ => b.clone(), + }) + .collect() +} + +fn flow_table(doc: &Document, t: &Table, depth: usize, tracked: FlowOpts) -> FTable { let mut rows = Vec::new(); + // Formats that keep cell formatting get the table style's and the table's borders cell by cell. + let style = t.props.style.as_deref().and_then(|id| doc.styles.table_style(id)); + let bake = tracked.paras; + let ncols = + t.rows.iter().map(|r| r.first_grid() + r.cells.iter().map(|c| c.span()).sum::() + r.grid_after()).max().unwrap_or(0).max(t.grid.len()); for (ri, r) in t.rows.iter().enumerate() { let header = r.props.header || (ri == 0 && t.props.look.header_row && t.rows.len() > 1); let mut cells = Vec::new(); for (ci, c) in r.cells.iter().enumerate() { + let styled = if bake { styled_cell(t, style.as_ref(), (ri, ci), ncols) } else { None }; let mut rowspan = 1; if c.props.vmerge == VMerge::Restart { let g = t.grid_col(ri, ci); @@ -313,15 +1093,37 @@ fn flow_table(doc: &Document, t: &Table, depth: usize, tracked: bool) -> FTable rowspan += 1; } } + let blocks = match &styled { + Some(st) => flow_blocks(doc, &with_cell_text(doc, &c.blocks, &st.chr, st.align, &st.para), depth + 1, tracked), + None => flow_blocks(doc, &c.blocks, depth + 1, tracked), + }; cells.push(Cell { - blocks: flow_blocks(doc, &c.blocks, depth + 1, tracked), + blocks, colspan: c.span() as u32, rowspan, covered: c.props.vmerge == VMerge::Continue, header, - shading: c.props.shading, - borders: c.props.borders, - valign: c.props.valign, + shading: c.props.shading.or(styled.as_ref().and_then(|s| s.fill)), + borders: styled.as_ref().map(|s| s.borders).or(c.props.borders), + valign: c.props.valign.or(styled.as_ref().and_then(|s| s.v_align)), + // Formats that keep cell padding get each cell's, its table's or Word's default. + margins: tracked.paras.then(|| c.props.resolved_margins(t.props.cell_margins.unwrap_or(WORD_CELL_MARGINS))), + direction: c.props.text_direction, + // Its background picture, for formats that keep cell formatting (ODT). + picture: c.props.picture.as_deref().filter(|_| tracked.paras).and_then(|p| { + let data = doc.media.get(&p.media)?; + let img = Img { + data: data.clone(), + ext: media_ext(&p.media, data), + w: p.size[0], + h: p.size[1], + alt: String::new(), + float: None, + object: None, + crop: [0.0; 4], + }; + Some(Box::new(crate::model::CellPic { img, repeat: p.repeat, align: p.align })) + }), width: None, }); } @@ -331,21 +1133,60 @@ fn flow_table(doc: &Document, t: &Table, depth: usize, tracked: bool) -> FTable let visible = |b: &Option| b.as_ref().is_some_and(|b| b.any_visible()); let borderless = t.props.style.is_none() && !visible(&t.props.borders) && t.rows.iter().flat_map(|r| &r.cells).all(|c| !visible(&c.props.borders)); - FTable { rows, widths: t.grid.clone(), borderless } + // Formats that keep them get the table's alignment, width and row heights. + let extra = tracked.paras.then(|| { + use wordcraft_doc::props::HeightRule; + let heights = t + .rows + .iter() + .map(|r| match (r.props.height, r.props.height_rule) { + (Some(h), HeightRule::Exact) => Some((h, true)), + (Some(h), HeightRule::AtLeast) => Some((h, false)), + _ => None, + }) + .collect::>(); + super::types::TableExtra { + align: t.props.align, + width: t.props.width, + width_pct: t.props.width_pct, + heights, + keep_rows: t.rows.iter().map(|r| r.props.cant_split).collect(), + fixed: t.props.fixed, + space: [t.props.space_before, t.props.space_after], + header_rows: t.rows.iter().take_while(|r| r.props.header).count(), + } + }); + // Kept whole for formats that ask for it: its header rows count even without the rest. + let extra = extra.map(Box::new); + let kept = (tracked.paras && depth == 0).then(|| doc.kept.of("odt").and_then(|k| k.table(t)).cloned()).flatten(); + let wrap = (tracked.paras && depth == 0).then(|| doc.kept.of("odt").and_then(|k| k.table_wrap(t)).cloned().map(Box::new)).flatten(); + FTable { rows, widths: t.grid.clone(), borderless, extra, kept, wrap } } /// The document body as a flow. pub fn from_doc(doc: &Document) -> Flow { - flow_of(doc, false) + flow_of(doc, FlowOpts::default()) } /// [`from_doc`] keeping tracked changes: deleted text stays, and text carries its insertion and /// deletion marks ([`Fmt::ins`], [`Fmt::del`]), for formats that can write revisions (RTF). pub fn from_doc_tracked(doc: &Document) -> Flow { - flow_of(doc, true) + flow_of(doc, FlowOpts { tracked: true, ..Default::default() }) } -fn flow_of(doc: &Document, tracked: bool) -> Flow { +/// [`from_doc`] keeping what `opts` asks for. +pub fn from_doc_with(doc: &Document, opts: FlowOpts) -> Flow { + // Paragraphs kept as read are checked against the document's comments and page setup: + // worked out once for the whole document, not once per paragraph. + wordcraft_doc::kept::while_writing(doc, || flow_of(doc, opts)) +} + +/// `blocks` of `doc` (a header, footer or note) as flow blocks, keeping what `opts` asks for. +pub fn part_flow(doc: &Document, blocks: &Blocks, opts: FlowOpts) -> Vec { + flow_blocks(doc, blocks, 0, opts) +} + +fn flow_of(doc: &Document, tracked: FlowOpts) -> Flow { let c = &doc.core; Flow { blocks: flow_blocks(doc, &doc.body, 0, tracked), diff --git a/crates/formats/src/model/media.rs b/crates/formats/src/model/media.rs index cf543af2d8..4bf50a701c 100644 --- a/crates/formats/src/model/media.rs +++ b/crates/formats/src/model/media.rs @@ -52,7 +52,16 @@ pub fn sized_img(data: Arc>, ext: &str, natural: Option<(f32, f32)>, w: h *= 468.0 / w; w = 468.0; } - Img { data, ext: ext.to_string(), w: w.clamp(1.0, 1584.0), h: h.clamp(1.0, 1584.0), alt: alt.to_string() } + Img { + data, + ext: ext.to_string(), + w: w.clamp(1.0, 1584.0), + h: h.clamp(1.0, 1584.0), + alt: alt.to_string(), + float: None, + object: None, + crop: [0.0; 4], + } } const B64: &[u8; 64] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -138,6 +147,8 @@ pub fn mime_of(ext: &str) -> &'static str { "bmp" => "image/bmp", "svg" => "image/svg+xml", "ico" => "image/x-icon", + "wmf" => "image/x-wmf", + "emf" => "image/x-emf", _ => "application/octet-stream", } } diff --git a/crates/formats/src/model/odf_object.rs b/crates/formats/src/model/odf_object.rs new file mode 100644 index 0000000000..d674864cc9 --- /dev/null +++ b/crates/formats/src/model/odf_object.rs @@ -0,0 +1,72 @@ +//! ODF embedded objects ([`OdfObject`]) in a document: their files in +//! [`Document::passthrough`] under `odf-object//`, linked from the picture showing them by an +//! [`Embedded`] whose markup only names the object's media type, and taken back out for the ODT +//! writer. Other formats see the picture alone. + +use std::sync::Arc; + +use wordcraft_doc::Document; +use wordcraft_doc::graphic::{Embedded, EmbeddedRef}; + +use super::types::OdfObject; + +/// Relationship kind of an object's file, and of its replacement picture. +const FILE: &str = "file"; +const REPLACEMENT: &str = "replacement"; +/// Most objects a document keeps, and most files in one. +pub const MAX_OBJECTS: usize = 1000; +pub const MAX_FILES: usize = 256; + +fn esc(s: &str) -> String { + s.replace('&', "&").replace('"', """).replace('<', "<").replace('>', ">") +} + +fn unesc(s: &str) -> String { + s.replace(""", "\"").replace("<", "<").replace(">", ">").replace("&", "&") +} + +/// Keep `obj` in `doc`: its files as passthrough parts, and the link to them. `None` when the +/// document already holds as many objects as it keeps. +pub fn store(doc: &mut Document, obj: &OdfObject) -> Option> { + let taken = |n: usize| { + let prefix = format!("odf-object/{n}/"); + doc.passthrough.range(prefix.clone()..).next().is_some_and(|(k, _)| k.starts_with(&prefix)) + }; + let n = (0..MAX_OBJECTS).find(|&n| !taken(n))?; + let mut refs = Vec::new(); + for (k, (path, bytes)) in obj.files.iter().take(MAX_FILES).enumerate() { + let target = format!("odf-object/{n}/{k}"); + doc.passthrough.insert(target.clone(), bytes.clone()); + refs.push(EmbeddedRef { id: path.clone(), kind: FILE.into(), target, external: false }); + } + if let Some(r) = &obj.replacement { + let target = format!("odf-object/{n}/replacement"); + doc.passthrough.insert(target.clone(), r.clone()); + refs.push(EmbeddedRef { id: String::new(), kind: REPLACEMENT.into(), target, external: false }); + } + let xml = format!("{} mime=\"{}\" ole=\"{}\"/>", Embedded::ODF_OBJECT, esc(&obj.mime), obj.ole); + Some(Arc::new(Embedded { xml, refs })) +} + +/// The object `e` links to in `doc`, when it is an ODF object whose files are all there. +pub fn load(doc: &Document, e: &Embedded) -> Option> { + if !e.is_odf_object() { + return None; + } + let attr = |k: &str| { + let pat = format!(" {k}=\""); + let from = e.xml.find(&pat)? + pat.len(); + let len = e.xml.get(from..)?.find('"')?; + e.xml.get(from..from + len).map(unesc) + }; + let mut obj = OdfObject { mime: attr("mime").unwrap_or_default(), ole: attr("ole").as_deref() == Some("true"), ..Default::default() }; + for r in e.refs.iter().take(MAX_FILES + 1) { + let bytes = doc.passthrough.get(&r.target)?.clone(); + match r.kind.as_str() { + FILE => obj.files.push((r.id.clone(), bytes)), + REPLACEMENT => obj.replacement = Some(bytes), + _ => {} + } + } + (!obj.files.is_empty()).then(|| Arc::new(obj)) +} diff --git a/crates/formats/src/model/to_doc.rs b/crates/formats/src/model/to_doc.rs index d612432135..de7dcf5f09 100644 --- a/crates/formats/src/model/to_doc.rs +++ b/crates/formats/src/model/to_doc.rs @@ -1,13 +1,14 @@ use super::from_doc::uses_kind; use super::types::{ - CODE_STYLE, Cell, Dropped, FBlock, FTable, Flow, Fmt, Inline, Kind, ListInfo, MAX_DEPTH, MAX_RUN_STRINGS, MONO_FONT, Para, RUBY_BASE_SIZE, - RevMark, clean_text, dropped, ruby_object, + CODE_STYLE, Cell, Dropped, FBlock, FTable, Flow, Fmt, Inline, Kind, ListInfo, MAX_DEPTH, MAX_GROUP_DEPTH, MAX_RUN_STRINGS, MONO_FONT, Para, + RUBY_BASE_SIZE, RevMark, clean_text, dropped, ruby_object, }; use super::{ AbstractNum, Arc, Block, Blocks, Border, BorderStyle, Borders, CellProps, CharProps, Document, InlineObject, Level, ListKind, Num, NumRef, OBJ, ParaProps, Paragraph, PropChange, Revision, RevisionKind, Rgb, RowProps, Run, Style, StyleKind, Table, TextColor, Underline, VMerge, VertAlign, levels_for, para_block, }; +use wordcraft_doc::para::{GroupChild, MAX_GROUP_CHILDREN}; pub fn char_props(f: &Fmt) -> CharProps { let on = |b: bool| if b { Some(true) } else { None }; @@ -30,6 +31,71 @@ pub fn char_props(f: &Fmt) -> CharProps { shading: f.background, ..Default::default() } + .with_extra(f) +} + +/// [`Fmt::extra`] laid over the character properties of the other [`Fmt`] fields. +trait WithExtra { + fn with_extra(self, f: &Fmt) -> CharProps; +} + +impl WithExtra for CharProps { + fn with_extra(mut self, f: &Fmt) -> CharProps { + let Some(x) = f.extra.as_deref() else { return self }; + if f.underline + && let Some(u) = x.underline + { + self.underline = Some(u); + } + if f.underline { + self.underline_color = x.underline_color; + } + // Turned off on the text, over what the style of its paragraph or span turns on. + if !f.bold && x.bold == Some(false) { + self.bold = Some(false); + } + if !f.italic && x.italic == Some(false) { + self.italic = Some(false); + } + if !f.strike && x.strike == Some(false) { + // A double strike under it goes too. + (self.strike, self.double_strike) = (Some(false), Some(false)); + } + if !f.underline && x.underline == Some(Underline::None) { + self.underline = Some(Underline::None); + } + if x.double_strike == Some(true) { + (self.strike, self.double_strike) = (None, Some(true)); + } + let finite = |v: Option, lo: f32, hi: f32| v.filter(|v| v.is_finite()).map(|v| v.clamp(lo, hi)); + self.style = x.style.as_deref().map(clean_text).filter(|s| !s.is_empty()); + self.caps = x.caps; + self.small_caps = x.small_caps; + self.hidden = x.hidden; + self.spacing = finite(x.spacing, -1584.0, 1584.0); + self.scale = finite(x.scale, 1.0, 600.0); + self.kern = finite(x.kern, 0.0, 1638.0); + self.emphasis = x.emphasis; + self.position = finite(x.position, -1584.0, 1584.0); + self.outline = x.outline; + self.shadow = x.shadow; + self.emboss = x.emboss; + self.engrave = x.engrave; + self.border = x.border.filter(|b| b.is_visible() && b.width.is_finite()).map(|mut b| { + (b.width, b.space) = (b.width.clamp(0.0, 12.0), if b.space.is_finite() { b.space.clamp(0.0, 31.0) } else { 0.0 }); + b + }); + self.lang = x.lang.as_deref().map(clean_text).filter(|l| !l.is_empty() && l.len() <= 64); + let name = |s: &Option, max: usize| s.as_deref().map(clean_text).filter(|v| !v.is_empty() && v.len() <= max); + self.font_cs = name(&x.font_cs, super::types::MAX_FONT_NAME); + self.font_ea = name(&x.font_ea, super::types::MAX_FONT_NAME); + self.size_cs = x.size_cs.filter(|s| s.is_finite()).map(|s| s.clamp(1.0, 1638.0)); + self.bold_cs = x.bold_cs; + self.italic_cs = x.italic_cs; + self.lang_bidi = name(&x.lang_bidi, 64); + self.lang_ea = name(&x.lang_ea, 64); + self + } } fn code_style() -> Style { @@ -109,6 +175,39 @@ fn para_props(p: &Para, list_num: Option) -> ParaProps { if p.page_break { out.page_break_before = Some(true); } + if let Some(st) = p.extra.as_ref().and_then(|x| x.style.clone()) { + out.style = Some(st); + } + if let Some(c) = p.extra.as_ref().and_then(|x| x.contextual_spacing) { + out.contextual_spacing = Some(c); + } + if p.extra.as_ref().and_then(|x| x.bidi) == Some(true) { + out.bidi = Some(true); + } + if let Some(x) = p.extra.as_ref().filter(|x| x.drop_cap.is_some_and(|l| l > 1)) { + (out.drop_cap, out.drop_cap_distance) = + (x.drop_cap.map(|l| l.min(10)), x.drop_cap_distance.filter(|d| d.is_finite()).map(|d| d.clamp(0.0, 1584.0))); + } + if let Some(bg) = p.extra.as_ref().and_then(|x| x.shading) { + out.shading = Some(bg); + } + if let Some(x) = &p.extra { + out.keep_lines = x.keep_lines.or(out.keep_lines); + out.widow_control = x.widow_control.or(out.widow_control); + out.suppress_hyphens = x.suppress_hyphens.or(out.suppress_hyphens); + // An outline level apart from its heading style's. + out.outline_level = x.outline_level.map(|l| l.min(8)).or(out.outline_level); + } + // Tab stops a format gives the paragraph itself: finite, on the page, at most 64. + if let Some(tabs) = p.extra.as_ref().and_then(|x| x.tabs.as_ref()) { + let tabs: Vec<_> = tabs + .iter() + .filter(|t| t.pos.is_finite()) + .map(|t| wordcraft_doc::props::TabStop { pos: t.pos.clamp(-1584.0, 1584.0), ..*t }) + .take(64) + .collect(); + out.tabs = Some(tabs); + } out } @@ -118,6 +217,21 @@ struct Builder<'a> { revs: std::collections::HashMap<(u8, RevMark), u32>, /// Link and font bytes given to runs so far ([`MAX_RUN_STRINGS`]). run_strings: usize, + /// The document's comment for each flow comment id. + comments: std::collections::HashMap, + /// The document's list instance for each flow list number ([`ListInfo::list`]). + lists: std::collections::HashMap, + /// Bookmarks that cover text ([`super::types::ranged_anchors`]), those started, and those + /// ended: each started once and ended once, after its start. + ranged: std::collections::HashSet, + started: std::collections::HashSet, + ended: std::collections::HashSet, + /// Text boxes by name, and the boxes whose text continues in a box named so (linked text + /// boxes), linked once all are made ([`Builder::link_boxes`]). + boxes: std::collections::HashMap, + chains: Vec<(u32, String)>, + /// Tables made at the top of the flow so far (see `wordcraft_doc::kept`). + top_tables: usize, } fn rev_key(kind: RevisionKind) -> u8 { @@ -129,7 +243,8 @@ fn rev_key(kind: RevisionKind) -> u8 { } impl<'a> Builder<'a> { - fn new(doc: &'a mut Document) -> Builder<'a> { + /// A builder for `blocks` into `doc`. + fn new(doc: &'a mut Document, blocks: &[FBlock]) -> Builder<'a> { let mut revs = std::collections::HashMap::new(); for (i, r) in doc.revisions.iter().enumerate() { if r.move_name.is_none() { @@ -137,7 +252,19 @@ impl<'a> Builder<'a> { revs.entry((rev_key(r.kind), mark)).or_insert(i as u32); } } - Builder { doc, revs, run_strings: 0 } + Builder { + doc, + revs, + run_strings: 0, + comments: Default::default(), + lists: Default::default(), + ranged: super::types::ranged_anchors(blocks), + started: Default::default(), + ended: Default::default(), + boxes: Default::default(), + chains: Vec::new(), + top_tables: 0, + } } /// The document revision for a tracked change, added the first time it is seen. @@ -168,6 +295,236 @@ impl<'a> Builder<'a> { cp } + /// Comment `c` (flow id `id`) added to the document with its text, as a reply when its parent + /// was added before it; its document id, or `None` when the document has no room for it or + /// the flow already used `id`. + fn comment(&mut self, id: u32, c: &super::types::FComment) -> Option { + if self.comments.contains_key(&id) { + return None; + } + let blocks = self.blocks(&c.blocks, 1); + let part = self.doc.try_add_part(wordcraft_doc::PartKind::Comment, blocks).ok()?; + let ids = &self.doc.comments; + let Some(doc_id) = wordcraft_doc::free_id(ids.keys().next_back().copied(), ids.keys().copied(), 0) else { + self.doc.parts.remove(&part); + return None; + }; + let parent = c.parent.and_then(|p| self.comments.get(&p).copied()); + let comment = wordcraft_doc::Comment { + author: clean_text(&c.author), + initials: clean_text(&c.initials), + date: clean_text(&c.date), + parent, + resolved: c.resolved, + part, + ..Default::default() + }; + self.doc.comments.insert(doc_id, comment); + self.comments.insert(id, doc_id); + Some(doc_id) + } + + /// A note story holding `blocks`, as Word's: its paragraphs in the note text style, the first + /// starting with the note's mark and a space. The reference to put in the text, or `None` + /// when the document has no room for another story. + fn note(&mut self, endnote: bool, custom: &str, blocks: &[FBlock]) -> Option { + use wordcraft_doc::para::NoteKind; + let (kind, part, text, mark) = if endnote { + (NoteKind::Endnote, wordcraft_doc::PartKind::Endnote, "EndnoteText", "EndnoteReference") + } else { + (NoteKind::Footnote, wordcraft_doc::PartKind::Footnote, "FootnoteText", "FootnoteReference") + }; + let custom: String = clean_text(custom).chars().filter(|c| !c.is_control()).take(10).collect(); + let id = self.doc.try_add_part(part, Vec::new()).ok()?; + let mut story = self.blocks(blocks, 1); + if story.is_empty() { + story.push(para_block(Paragraph::new())); + } + for (i, b) in story.iter_mut().enumerate() { + if let Block::Para(p) = Arc::make_mut(b) { + if p.props.style.is_none() { + p.props.style = Some(text.into()); + } + if i == 0 { + let starts_blank = p.text.starts_with([' ', '\t']); + let reference = InlineObject::NoteRef { kind, id, custom: custom.clone() }; + if p.insert_object(0, reference, &CharProps { style: Some(mark.into()), ..Default::default() }).is_ok() && !starts_blank { + let at = p.text.len().min(wordcraft_doc::para::OBJ.len_utf8()); + let _ = p.insert_text(at, " ", &CharProps::default()); + } + } + } + } + if let Some(part) = self.doc.parts.get_mut(&id) { + part.blocks = story; + } + Some(InlineObject::NoteRef { kind, id, custom }) + } + + /// The document object for picture, shape or group `i` (members of groups `depth` deep). + fn drawing(&mut self, i: &Inline, depth: usize) -> Option { + // Offsets and distances on the page. + let fit_float = |float: &Option>| { + float.as_deref().cloned().map(|mut f| { + let fit = |v: f32| if v.is_finite() { v.clamp(-1584.0, 1584.0) } else { 0.0 }; + (f.x, f.y) = (fit(f.x), fit(f.y)); + (f.dist, f.dist_top, f.dist_bottom) = (fit(f.dist).max(0.0), fit(f.dist_top).max(0.0), fit(f.dist_bottom).max(0.0)); + f + }) + }; + match i { + Inline::Image(img) => { + let key = self.doc.add_media(img.data.to_vec(), &img.ext); + let (w, h) = (finite_or(img.w, 72.0).clamp(1.0, 1584.0), finite_or(img.h, 72.0).clamp(1.0, 1584.0)); + let float = fit_float(&img.float); + let ole = img.object.as_deref().and_then(|o| super::odf_object::store(self.doc, o)); + // A crop of finite fractions that leaves something of the picture. + let crop = img.crop.map(|c| if c.is_finite() { c.clamp(0.0, 0.99) } else { 0.0 }); + let crop = if crop[0] + crop[2] < 0.99 && crop[1] + crop[3] < 0.99 { crop } else { [0.0; 4] }; + Some(InlineObject::Image { + media: key, + w, + h, + alt: img.alt.clone(), + float: float.unwrap_or_default(), + crop, + fx: Default::default(), + ole, + }) + } + // Its drawing is made from the chart by the program that opens the document + // (`wordcraft_engine`'s chart drawing), which has the theme's colours. + Inline::Chart(c) => { + let (w, h) = (finite_or(c.w, 360.0).clamp(1.0, 1584.0), finite_or(c.h, 216.0).clamp(1.0, 1584.0)); + let mut spec = (*c.spec).clone(); + spec.sanitize(); + let source = c.source.as_deref().and_then(|o| super::odf_object::store(self.doc, o)); + let graphic = wordcraft_doc::graphic::Graphic { + kind: wordcraft_doc::graphic::GraphicKind::Chart, + w, + h, + chart: Some(Arc::new(spec)), + source, + ..Default::default() + }; + Some(InlineObject::Graphic { + w, + h, + alt: clean_text(&c.alt), + float: fit_float(&c.float).unwrap_or_default(), + graphic: Arc::new(graphic), + }) + } + Inline::Shape { kind, w, h, float, blocks, look, path } => { + // A text box always has its story; a shape only when it holds text. + let story = if *kind == wordcraft_doc::para::ShapeKind::TextBox || !blocks.is_empty() { + let story = self.blocks(blocks, 1); + self.doc.try_add_part(wordcraft_doc::PartKind::TextBox, story).ok() + } else { + None + }; + // A named box, and the box its text continues in. + if let (Some(id), Some(c)) = (story, look.chain.as_deref()) { + if !c.name.is_empty() && self.boxes.len() < MAX_NAMED_BOXES { + self.boxes.entry(c.name.clone()).or_insert(id); + } + if let Some(next) = c.next.as_ref().filter(|n| !n.is_empty() && **n != c.name) { + self.chains.push((id, next.clone())); + } + } + if let Some(part) = story.and_then(|id| self.doc.parts.get_mut(&id)) { + let emu = |v: f32| if v.is_finite() { (v.clamp(0.0, 1584.0) * 12_700.0).round() as u32 } else { 0 }; + part.body.inset = look.inset.map(|i| i.map(emu)); + part.body.auto_fit = look.auto_fit; + part.body.vert = look.vert; + } + let (stroke, stroke_width) = match look.line { + Some((c, w)) if w.is_finite() && w > 0.0 => (Some(c), w.min(12.0)), + _ => (None, 0.0), + }; + // A line may be flat; anything else has some size. + let least = if *kind == wordcraft_doc::para::ShapeKind::Line { 0.0 } else { 1.0 }; + let fit = |v: f32| if v.is_finite() { v.clamp(least, 1584.0) } else { 72.0 }; + let obj = InlineObject::Shape { + kind: *kind, + w: fit(*w), + h: fit(*h), + fill: look.fill.clone().and_then(|f| f.sanitized()), + stroke, + stroke_width, + float: float.as_deref().cloned().unwrap_or_default(), + story, + freeform: path + .clone() + .filter(|_| *kind == wordcraft_doc::para::ShapeKind::Freeform) + .map(|f| std::sync::Arc::new((*f).clone().sanitized())), + effects: Default::default(), + extra: wordcraft_doc::connector::ShapeExtra { + dash: look.dash.clone(), + arrow_start: look.arrows.0, + arrow_end: look.arrows.1, + // Its drawing id, and what a connector's ends are glued to (sites bounded). + id: look.conn.as_ref().map_or(0, |c| c.id), + start: look.conn.as_ref().and_then(|c| c.start).filter(|e| e.site <= wordcraft_doc::connector::MAX_SITE), + end: look.conn.as_ref().and_then(|c| c.end).filter(|e| e.site <= wordcraft_doc::connector::MAX_SITE), + odf_geometry: look.geometry.clone().filter(|_| { + (*kind == wordcraft_doc::para::ShapeKind::Freeform && path.is_some()) + || *kind == wordcraft_doc::para::ShapeKind::Rectangle + }), + ..Default::default() + }, + }; + Some(obj) + } + Inline::Group { w, h, float, members } if depth < MAX_GROUP_DEPTH => { + let fit = |v: f32| if v.is_finite() { v.clamp(1.0, 1584.0) } else { 72.0 }; + let (w, h) = (fit(*w), fit(*h)); + let off = |v: f32| if v.is_finite() { v.clamp(-1584.0, 1584.0) } else { 0.0 }; + let children: Vec = members + .iter() + .take(MAX_GROUP_CHILDREN) + .filter_map(|m| self.drawing(&m.inline, depth + 1).map(|obj| GroupChild { x: off(m.x), y: off(m.y), obj })) + .collect(); + (!children.is_empty()).then(|| InlineObject::Group { + w, + h, + float: float.as_deref().cloned().unwrap_or_default(), + ch_w: w, + ch_h: h, + children, + canvas: None, + }) + } + _ => None, + } + } + + /// Keeps a paragraph's markup read from the file (its own, its frame wrap, the index it + /// starts) pending until the document is sealed. + fn keep_pending(&mut self, p: &Para, rev: u64) { + if p.kept.is_none() && p.wrap.is_none() && p.index.is_none() { + return; + } + let group = p.group.as_ref().and_then(|g| g.id).filter(|_| p.kept.is_some()); + if self.doc.kept.get().is_none() { + self.doc.kept = wordcraft_doc::kept::Kept::new(Default::default()); + } + if let Some(k) = self.doc.kept.get_mut() { + if let Some(xml) = &p.kept { + k.keep_pending(rev, xml.clone()); + } + if let Some(w) = &p.wrap { + k.keep_pending_wrap(rev, (**w).clone()); + } + if let Some(ix) = &p.index { + k.keep_pending_index(rev, ix.1, ix.0.clone()); + } + if let Some(g) = group { + k.keep_pending_group(rev, g); + } + } + } + fn para(&mut self, p: &Para, list_num: Option) -> Paragraph { let mut out = Paragraph::new(); out.props = para_props(p, list_num); @@ -183,9 +540,6 @@ impl<'a> Builder<'a> { let old = para_props(&c.old, old_num); out.props.fmt_change = PropChange::boxed(self.revision(RevisionKind::Format, &c.mark), old); } - if let Some(f) = &p.mark { - out.mark = self.budget(char_props(f)); - } if p.keep_next { out.props.keep_next = Some(true); } @@ -216,17 +570,84 @@ impl<'a> Builder<'a> { } append(&mut out, &t, &cp, None); } - Inline::Image(img) => { - let key = self.doc.add_media(img.data.to_vec(), &img.ext); - let (w, h) = (finite_or(img.w, 72.0).clamp(1.0, 1584.0), finite_or(img.h, 72.0).clamp(1.0, 1584.0)); - let obj = InlineObject::Image { media: key, w, h, alt: img.alt.clone(), float: Default::default(), crop: [0.0; 4], ole: None }; + Inline::FieldStart(instr) => { + let obj = InlineObject::FieldStart { instr: clean_text(instr), locked: false, dirty: false }; append(&mut out, "", &CharProps::default(), Some(obj)); } - Inline::Anchor(name) => { + Inline::FieldEnd => append(&mut out, "", &CharProps::default(), Some(InlineObject::FieldEnd)), + Inline::Image(_) | Inline::Chart(_) | Inline::Shape { .. } | Inline::Group { .. } => { + if let Some(mut obj) = self.drawing(i, 0) { + // In line, raised or lowered: its run's position (as Word keeps it). In + // a paragraph of its own, its run has the paragraph's formatting. + let mut cp = p + .mark + .as_deref() + .filter(|_| p.textless()) + .map(|m| self.budget(CharProps { ins: None, del: None, fmt_change: None, ..m.clone() })) + .unwrap_or_default(); + if let Some(f) = obj.float_mut() + && f.wrap == wordcraft_doc::para::Wrap::Inline + && f.y != 0.0 + { + cp.position = Some(f.y.clamp(-1584.0, 1584.0)); + f.y = 0.0; + } + append(&mut out, "", &cp, Some(obj)); + } + } + // A bookmark once (the first of a name): a point, or the start of the text it covers. + Inline::Anchor(name) if self.started.insert(name.clone()) => { append(&mut out, "", &CharProps::default(), Some(InlineObject::BookmarkStart { name: name.clone() })); - append(&mut out, "", &CharProps::default(), Some(InlineObject::BookmarkEnd { name: name.clone() })); + if !self.ranged.contains(name) { + append(&mut out, "", &CharProps::default(), Some(InlineObject::BookmarkEnd { name: name.clone() })); + } + } + Inline::Anchor(_) => {} + Inline::AnchorEnd(name) => { + if self.ranged.contains(name) && self.started.contains(name) && self.ended.insert(name.clone()) { + append(&mut out, "", &CharProps::default(), Some(InlineObject::BookmarkEnd { name: name.clone() })); + } } Inline::Figure(_) => {} + Inline::Comment { id, comment } => { + // A reply is the comment's, not the text's: it has no range. + if let Some(doc_id) = self.comment(*id, comment) + && comment.parent.is_none() + { + append(&mut out, "", &CharProps::default(), Some(InlineObject::CommentStart { id: doc_id })); + } + } + Inline::CommentEnd(id) => { + if let Some(doc_id) = self.comments.get(id) { + append(&mut out, "", &CharProps::default(), Some(InlineObject::CommentEnd { id: *doc_id })); + } + } + Inline::Note { endnote, custom, blocks, fmt } => { + if let Some(obj) = self.note(*endnote, custom, blocks) { + let style = if *endnote { "EndnoteReference" } else { "FootnoteReference" }; + let cp = CharProps { style: Some(style.into()), ..self.budget(char_props(fmt)) }; + append(&mut out, "", &cp, Some(obj)); + } + } + Inline::Field { instr, result, fmt, locked } => { + let cp = self.budget(char_props(fmt)); + let (instr, result) = (clean_text(instr), clean_text(result)); + if instr.trim().is_empty() { + append(&mut out, &result, &cp, None); + } else { + let obj = InlineObject::Field { instr, result, locked: *locked, dirty: false, code: false, form: String::new() }; + append(&mut out, "", &cp, Some(obj)); + } + } + // A content control around its text. + Inline::Control { control, text, fmt } => { + let cp = self.budget(char_props(fmt)); + let mut c = control.clone(); + c.block = false; + append(&mut out, "", &cp, Some(InlineObject::ControlStart { control: c })); + append(&mut out, &clean_text(text), &cp, None); + append(&mut out, "", &cp, Some(InlineObject::ControlEnd)); + } Inline::Equation { linear, display } => { let linear = clean_text(linear); if !linear.is_empty() { @@ -250,10 +671,16 @@ impl<'a> Builder<'a> { } } } + if let Some(m) = p.mark.as_deref().filter(|_| p.textless()) { + out.mark = self.budget(CharProps { ins: None, del: None, fmt_change: None, ..m.clone() }); + } out.mark.ins = p.mark_ins.as_deref().map(|m| self.revision(RevisionKind::Insert, m)); out.mark.del = p.mark_del.as_deref().map(|m| self.revision(RevisionKind::Delete, m)); out.normalize(); out.touch(); + // Its markup kept for the writer, as long as nothing changes the paragraph from here on + // (see `wordcraft_doc::kept`: the reader seals it once the document is done). + self.keep_pending(p, out.rev); out } @@ -270,12 +697,18 @@ impl<'a> Builder<'a> { } } let mut starts: [Option; 9] = [None; 9]; + let mut labels: [Option; 9] = [None; 9]; for li in group { if let Some(s) = starts.get_mut(li.level.min(8) as usize) && s.is_none() { *s = Some(li.start); } + if let Some(l) = labels.get_mut(li.level.min(8) as usize) + && l.is_none() + { + *l = li.label; + } } // Levels nobody used follow the first level's kind. let first = group.first().map(|l| l.ordered).unwrap_or(false); @@ -287,10 +720,33 @@ impl<'a> Builder<'a> { if ordered && let Some(s) = starts.get(i).copied().flatten() { level.start = s; } + // The source's own label: its format and text, or its bullet. + match labels.get(i).copied().flatten() { + Some(l) if ordered && l.format != wordcraft_doc::section::NumFormat::Bullet => { + level.format = l.format; + level.text = l.text(i as u8); + } + Some(l) if !ordered => { + if let Some(c) = l.bullet().filter(|c| !c.is_control() && !level.text.starts_with(*c)) { + let custom = levels_for(ListKind::BulletChar(c)); + level.text = c.to_string(); + level.chr.font = custom.first().and_then(|l| l.chr.font.clone()); + } + } + _ => {} + } + if let Some(l) = labels.get(i).copied().flatten() { + if let Some((indent, hanging)) = l.position() { + (level.indent, level.hanging) = (indent, hanging); + } + if let Some(a) = l.align { + level.align = a; + } + } level }) .collect(); - let numbering = &mut self.doc.numbering; + let numbering = Arc::make_mut(&mut self.doc.numbering); let aid = numbering.abstracts.iter().map(|a| a.id + 1).max().unwrap_or(0); numbering.abstracts.push(AbstractNum { id: aid, name: None, levels, ..Default::default() }); let nid = numbering.nums.iter().map(|n| n.id + 1).max().unwrap_or(1).max(1); @@ -304,14 +760,20 @@ impl<'a> Builder<'a> { while let Some(b) = blocks.get(i) { match b { FBlock::Para(p) if p.list.is_some() => { - // A run of consecutive list paragraphs is one list, until a top-level item of - // the other kind (bulleted or numbered) starts a new one. + // A run of consecutive list paragraphs is one list, until an item of another + // list or (when the source doesn't tell lists apart) a top-level item of the + // other kind (bulleted or numbered) starts a new one. A list the source + // numbers goes on where it shows up again. let mut j = i; let mut group: Vec = Vec::new(); let mut top: Option = None; + let id = p.list.map_or(0, |l| l.list); while let Some(FBlock::Para(q)) = blocks.get(j) { let Some(li) = q.list else { break }; - if li.level == 0 { + if li.list != id { + break; + } + if li.level == 0 && id == 0 { if top.is_some_and(|o| o != li.ordered) { break; } @@ -320,7 +782,16 @@ impl<'a> Builder<'a> { group.push(li); j += 1; } - let num = self.new_list(&group); + let num = match self.lists.get(&id) { + Some(num) if id != 0 => *num, + _ => { + let num = self.new_list(&group); + if id != 0 { + self.lists.insert(id, num); + } + num + } + }; for q in blocks.get(i..j).unwrap_or(&[]) { if let FBlock::Para(q) = q { let para = self.para(q, Some(num)); @@ -350,7 +821,7 @@ impl<'a> Builder<'a> { } fn table(&mut self, t: &FTable, depth: usize) -> Option { - let rows: Vec<&Vec> = t.rows.iter().filter(|r| !r.is_empty()).take(wordcraft_doc::table::MAX_ROWS).collect(); + let rows: Vec<(usize, &Vec)> = t.rows.iter().enumerate().filter(|(_, r)| !r.is_empty()).take(wordcraft_doc::table::MAX_ROWS).collect(); if rows.is_empty() { return None; } @@ -360,16 +831,34 @@ impl<'a> Builder<'a> { // to `rows.len()` would allocate a full rows × cols cell grid only to clear it, which a // tall table (many rows, wide from merged cells) turns into a large transient spike. let mut tb = Table::new(1, cols, width); - if t.borderless { + // A table from a format that keeps cell formatting (ODT) has its cells' own borders and no + // table style of Word's kind: Table Grid's single spacing would change its text. + if t.borderless || t.extra.is_some() { tb.props.style = None; } if t.widths.len() == cols && t.widths.iter().all(|w| w.is_finite() && *w > 1.0) { tb.grid = t.widths.iter().map(|w| w.clamp(6.0, 1584.0)).collect(); } tb.rows.clear(); - for r in rows { + if let Some(x) = &t.extra { + tb.props.align = x.align; + tb.props.width_pct = x.width_pct.filter(|p| p.is_finite() && *p > 0.0).map(|p| p.min(100.0)); + tb.props.width = x.width.filter(|w| w.is_finite() && *w > 0.0).map(|w| w.min(1584.0)); + tb.props.fixed |= x.fixed; + let space = |v: Option| v.filter(|v| v.is_finite() && *v > 0.0).map(|v| v.min(1584.0)); + (tb.props.space_before, tb.props.space_after) = (space(x.space[0]), space(x.space[1])); + } + for (ri, r) in rows { let mut row = wordcraft_doc::Row { props: RowProps::default(), cells: Vec::new(), controls: Default::default() }; row.props.header = !r.is_empty() && r.iter().all(|c| c.header); + if let Some(&Some((h, exact))) = t.extra.as_ref().and_then(|x| x.heights.get(ri)) + && h.is_finite() + && h > 0.0 + { + row.props.height = Some(h.min(1584.0)); + row.props.height_rule = if exact { wordcraft_doc::props::HeightRule::Exact } else { wordcraft_doc::props::HeightRule::AtLeast }; + } + row.props.cant_split = t.extra.as_ref().is_some_and(|x| x.keep_rows.get(ri) == Some(&true)); let mut g = 0usize; for c in r.iter().take(wordcraft_doc::table::MAX_COLS) { let span = (c.colspan.clamp(1, 63) as usize).min(cols.saturating_sub(g).max(1)); @@ -386,6 +875,11 @@ impl<'a> Builder<'a> { } else { VMerge::None }; + // A background picture goes into the document's media. + let picture = c.picture.as_deref().map(|p| { + let media = self.doc.add_media(p.img.data.as_ref().clone(), &p.img.ext); + Box::new(wordcraft_doc::props::CellPicture { media, size: [p.img.w, p.img.h], repeat: p.repeat, align: p.align }) + }); row.cells.push(wordcraft_doc::Cell { props: CellProps { width: Some(w), @@ -393,7 +887,10 @@ impl<'a> Builder<'a> { vmerge, shading: c.shading, borders: c.borders, + margins: c.margins.filter(|m| m.iter().all(|v| v.is_finite())).map(|m| m.map(|v| v.clamp(0.0, 1584.0))), valign: c.valign, + text_direction: c.direction, + picture, ..Default::default() }, blocks, @@ -405,6 +902,23 @@ impl<'a> Builder<'a> { } tb.rows.push(row); } + // Its markup kept for the writer, by its place among the top's tables. + if depth == 0 { + if t.kept.is_some() || t.wrap.is_some() { + if self.doc.kept.get().is_none() { + self.doc.kept = wordcraft_doc::kept::Kept::new(Default::default()); + } + if let Some(k) = self.doc.kept.get_mut() { + if let Some(xml) = &t.kept { + k.keep_pending_table(self.top_tables, xml.clone()); + } + if let Some(w) = &t.wrap { + k.keep_pending_table_wrap(self.top_tables, (**w).clone()); + } + } + } + self.top_tables += 1; + } Some(tb) } } @@ -419,15 +933,51 @@ pub fn to_doc(flow: &Flow) -> Document { } /// [`to_doc`] on a page of the source's own size and margins (`section`), which tables size to. +/// Most named text boxes linked. +const MAX_NAMED_BOXES: usize = 10_000; + +impl Builder<'_> { + /// Each text box whose text continues in another (by name) linked to it, a chain at a time + /// (a box is in at most one chain, and a chain doesn't loop back on itself). + fn link_boxes(&mut self) { + let mut linked_to = std::collections::HashSet::new(); + for (from, name) in std::mem::take(&mut self.chains) { + let Some(&to) = self.boxes.get(&name) else { continue }; + if to == from || !linked_to.insert(to) { + continue; + } + if let Some(p) = self.doc.parts.get_mut(&from) { + p.body.next = Some(to); + } + } + // A link that closes a loop is undone. + for id in self.boxes.values().copied().collect::>() { + let mut seen = std::collections::HashSet::new(); + let mut at = id; + while let Some(next) = self.doc.parts.get(&at).and_then(|p| p.body.next) { + if !seen.insert(at) || seen.len() > MAX_NAMED_BOXES { + if let Some(p) = self.doc.parts.get_mut(&at) { + p.body.next = None; + } + break; + } + at = next; + } + } + } +} + pub fn to_doc_in(flow: &Flow, section: wordcraft_doc::SectionProps) -> Document { let mut doc = Document::new(); doc.last_section = section; doc.numbering = Default::default(); let uses_code = uses_kind(&flow.blocks, Kind::Code, 0); if uses_code { - doc.styles.upsert(code_style()); + Arc::make_mut(&mut doc.styles).upsert(code_style()); } - let body = Builder::new(&mut doc).blocks(&flow.blocks, 0); + let mut b = Builder::new(&mut doc, &flow.blocks); + let body = b.blocks(&flow.blocks, 0); + b.link_boxes(); doc.body = body; let m = &flow.meta; doc.core.title = m.title.clone(); @@ -443,7 +993,7 @@ pub fn to_doc_in(flow: &Flow, section: wordcraft_doc::SectionProps) -> Document /// `blocks` as document blocks of `doc` (their pictures go into its media), for a header, /// footer or other part an importer adds itself. pub fn part_blocks(doc: &mut Document, blocks: &[FBlock]) -> Blocks { - let mut out = Builder::new(doc).blocks(blocks, 0); + let mut out = Builder::new(doc, blocks).blocks(blocks, 0); if out.is_empty() { out.push(para_block(Paragraph::new())); } diff --git a/crates/formats/src/model/types.rs b/crates/formats/src/model/types.rs index 0747af5780..79c63da4c6 100644 --- a/crates/formats/src/model/types.rs +++ b/crates/formats/src/model/types.rs @@ -9,6 +9,9 @@ pub const CODE_STYLE: &str = "Code"; /// Nesting limit for tables in tables (hostile input). pub const MAX_DEPTH: usize = 8; +/// Deepest groups in groups kept (hostile files). +pub const MAX_GROUP_DEPTH: usize = 8; + /// Longest font name the importers keep, in bytes (as the .docx reader); a longer one (no real /// font has one) is dropped (#3713). pub const MAX_FONT_NAME: usize = 256; @@ -54,6 +57,10 @@ pub(crate) enum Dropped { RunStrings, /// A style name cut to [`MAX_FONT_NAME`]. StyleName, + /// ODT `text:s` spaces past the document's budget. + Spaces, + /// Markdown table rows and columns past the table limits or the document's cell budget. + TableCells, } impl Dropped { @@ -65,8 +72,23 @@ impl Dropped { format!("import: the document's runs carry more than {MAX_RUN_STRINGS} bytes of links and font names; later runs lose them") } Dropped::StyleName => format!("import: style names longer than {MAX_FONT_NAME} bytes are cut short"), + Dropped::Spaces => { + "import: the document's `text:s` elements ask for more spaces than it keeps; past that each stands for one".to_string() + } + Dropped::TableCells => format!( + "import: Markdown tables keep {} columns and {} rows at most, and {} cells in all; the rest are left out", + wordcraft_doc::table::MAX_COLS, + wordcraft_doc::table::MAX_ROWS, + crate::markdown::MAX_TABLE_CELLS + ), } } + + /// Whether this thread's import has logged this kind ([`dropped`]). + #[cfg(test)] + pub(crate) fn reported(self) -> bool { + REPORTED.with(|r| r.get() & (1u8 << (self as u8)) != 0) + } } /// Log that the importer left something of `kind` out: once per kind per imported document @@ -109,6 +131,11 @@ pub struct Fmt { /// Tracked formatting change of this text: who made it and the formatting before it (only /// [`from_doc_tracked`] and formats that keep revisions set it). pub fmt_change: Option>>, + /// Formatting beyond the fields above, for formats that keep it (ODT): underline style and + /// colour, double strike, caps, small caps, hidden, spacing, scale, position, outline, + /// shadow, emboss, engrave and language, as character properties. Only flows asked for it + /// ([`FlowOpts::chars`]) hold it. + pub extra: Option>, } /// A tracked formatting change in a flow: who made it, and the formatting before it. @@ -139,6 +166,44 @@ pub struct Img { pub w: f32, pub h: f32, pub alt: String, + /// How a floating picture is placed and wrapped, for formats that keep it (ODT); `None`: in + /// line with the text. + pub float: Option>, + /// The embedded object this picture shows, kept whole (ODT only; see [`OdfObject`]). + pub object: Option>, + /// How much is cut off its left, top, right and bottom, fractions of its size (0..1), for + /// formats that keep it (ODT). + pub crop: [f32; 4], +} + +/// An embedded object WordCraft shows but doesn't edit, kept whole for saving back (ODF 1.3 +/// §10.4.6 `draw:object`, a sub-document such as a spreadsheet, or §10.4.7 `draw:object-ole`). +#[derive(Clone, Debug, Default, PartialEq)] +pub struct OdfObject { + /// Its media type (`application/vnd.oasis.opendocument.spreadsheet`…). + pub mime: String, + /// An OLE object: one binary file (`draw:object-ole`) rather than a sub-document folder. + pub ole: bool, + /// Its files, by their path in its folder (an OLE object's one file: ""). + pub files: Vec<(String, Arc>)>, + /// The replacement picture as read (LibreOffice's own metafile format, say), written back + /// in place of the picture shown. + pub replacement: Option>>, +} + +/// An editable chart in a flow ([`Inline::Chart`]). +#[derive(Clone, Debug, PartialEq)] +pub struct Chart { + pub spec: Arc, + /// Display size, points. + pub w: f32, + pub h: f32, + pub alt: String, + /// How a floating chart is placed and wrapped; `None`: in line with the text. + pub float: Option>, + /// The chart object as read (ODT), written back whole while the chart is unchanged, so it + /// keeps the look WordCraft doesn't model (its fonts, lines and colours). + pub source: Option>, } #[derive(Clone, Debug, PartialEq)] @@ -147,9 +212,23 @@ pub enum Inline { Image(Img), /// A bookmark (link target). Anchor(String), + /// Where bookmark `name`, started by an [`Inline::Anchor`] before it, ends: the bookmark + /// covers the text between. Only flows asked for fields ([`FlowOpts::fields`]) hold them; + /// an anchor without one is a point. + AnchorEnd(String), /// A chart or diagram known here only by its alt text: written where alt text has a place /// (an HTML or Markdown image), left out of editable formats so it never turns into body text. Figure(String), + /// A chart WordCraft can edit, `w` × `h` points: only in flows asked for boxes + /// ([`FlowOpts::boxes`]); others get its alt text as an [`Inline::Figure`]. + Chart(Chart), + /// A content control holding plain `text` (a form control in ODT): only in flows asked for + /// boxes ([`FlowOpts::boxes`]); others get its text. + Control { + control: Box, + text: String, + fmt: Fmt, + }, /// An equation in the linear format WordCraft keeps them in (`x=(-b±√(b^2-4ac))/2a`). Formats /// without equations write `linear` as text. Equation { @@ -164,6 +243,239 @@ pub enum Inline { ruby: String, fmt: Fmt, }, + /// A field (page number, date, document property, cross-reference): its Word field code + /// (`PAGE`, `REF name \h`…) and the result it last showed, in its run's formatting. Only + /// flows asked for fields ([`FlowOpts::fields`]) hold them; formats without fields write the + /// result as text. + Field { + instr: String, + result: String, + fmt: Fmt, + /// Its result is kept, not worked out again (Word's locked field, ODF's `text:fixed`). + locked: bool, + }, + /// A footnote or endnote: its custom mark (empty: numbered) and its content, without the + /// note's own mark. Only flows asked for notes ([`FlowOpts::notes`]) hold them; formats + /// without notes leave them out. + Note { + endnote: bool, + custom: String, + blocks: Vec, + /// The reference's own formatting (beyond the note reference style). + fmt: Fmt, + }, + /// Where comment `id` (the flow's own number for it) starts, and the comment. A reply + /// ([`FComment::parent`]) has no range: it only follows its comment. Only flows asked for + /// comments ([`FlowOpts::comments`]) hold them. + Comment { + id: u32, + comment: Box, + }, + /// Where comment `id`'s range ends. + CommentEnd(u32), + /// A drawing shape or text box: its kind, its size in points, its placement when it floats, + /// its text (none for a shape without), and its look. Only flows asked for them + /// ([`FlowOpts::boxes`]) hold them. + Shape { + kind: wordcraft_doc::para::ShapeKind, + w: f32, + h: f32, + float: Option>, + blocks: Vec, + look: BoxLook, + /// A freeform's paths ([`wordcraft_doc::para::ShapeKind::Freeform`]). + path: Option>, + }, + /// The start of a field whose result is the content after it, up to the matching + /// [`Inline::FieldEnd`] (a table of contents around its entries); its field code. Only flows + /// asked for fields ([`FlowOpts::fields`]) hold them. + FieldStart(String), + /// The end of the innermost [`Inline::FieldStart`]. + FieldEnd, + /// Drawing shapes, text boxes and pictures grouped into one object: its size in points, its + /// placement when it floats, and its members, each at its offset in the group. Only flows + /// asked for shapes ([`FlowOpts::boxes`]) hold them. + Group { + w: f32, + h: f32, + float: Option>, + members: Vec, + }, +} + +/// A member of an [`Inline::Group`]: a shape, text box or picture (its placement in the group is +/// `x`, `y`, points from the group's top left corner; its own float holds only its turn and +/// mirroring). +#[derive(Clone, Debug, PartialEq)] +pub struct Member { + pub x: f32, + pub y: f32, + pub inline: Inline, +} + +/// How a text box or shape looks: its fill, its outline (colour and width, dash and +/// arrowheads), its inner margins, and whether it grows to fit its text. +#[derive(Clone, Debug, PartialEq)] +pub struct BoxLook { + /// Fill: a colour or a gradient; `None` is no fill. + pub fill: Option, + /// Outline colour and width in points; `None` is no line. + pub line: Option<(Rgb, f32)>, + /// The outline's dash pattern. + pub dash: wordcraft_doc::line_dash::LineDash, + /// Arrowheads at a line's start and end. + pub arrows: (bool, bool), + /// Inner margins (left, top, right, bottom) in points; `None` is the default. + pub inset: Option<[f32; 4]>, + /// The box grows to its text; its height is the least it is. + pub auto_fit: bool, + /// The drawing id connectors glue to, and a connector's glued ends (see + /// [`wordcraft_doc::connector`]). + pub conn: Option>, + /// A text box's name and the box its text continues in when it doesn't fit (linked text + /// boxes), by name. + pub chain: Option>, + /// Which way a text box's text runs (turned down or up). + pub vert: wordcraft_doc::props::TextVert, + /// A custom shape's geometry as read (ODT; see `ShapeExtra::odf_geometry`). + pub geometry: Option>, +} + +/// A text box's name, and the name of the box its text continues in ([`BoxLook::chain`]). +#[derive(Clone, Debug, Default, PartialEq)] +pub struct Chain { + pub name: String, + pub next: Option, +} + +/// A shape's drawing id (0: none) and, for a connector, what its ends are glued to. +#[derive(Clone, Copy, Debug, Default, PartialEq)] +pub struct Conn { + pub id: u32, + pub start: Option, + pub end: Option, +} + +impl Default for BoxLook { + /// A new text box's: white, with a thin black line. + fn default() -> BoxLook { + BoxLook { + fill: Some(wordcraft_doc::fill::Fill::solid(Rgb::WHITE)), + line: Some((Rgb::BLACK, 0.75)), + dash: Default::default(), + arrows: (false, false), + inset: None, + auto_fit: false, + conn: None, + chain: None, + vert: Default::default(), + geometry: None, + } + } +} + +/// The bookmarks in `blocks` whose end ([`Inline::AnchorEnd`]) follows their start +/// ([`Inline::Anchor`]): ranges, not points. Tables' cells, notes, comments and shapes' text +/// are looked through, in document order. +pub fn ranged_anchors(blocks: &[FBlock]) -> std::collections::HashSet { + fn walk(blocks: &[FBlock], depth: usize, started: &mut std::collections::HashSet, ranged: &mut std::collections::HashSet) { + if depth > MAX_DEPTH { + return; + } + for b in blocks { + match b { + FBlock::Para(p) => { + for i in &p.inlines { + match i { + Inline::Anchor(n) => { + started.insert(n.clone()); + } + Inline::AnchorEnd(n) if started.contains(n) => { + ranged.insert(n.clone()); + } + Inline::Note { blocks, .. } | Inline::Shape { blocks, .. } => walk(blocks, depth + 1, started, ranged), + Inline::Comment { comment, .. } => walk(&comment.blocks, depth + 1, started, ranged), + _ => {} + } + } + } + FBlock::Table(t) => { + for c in t.rows.iter().flatten() { + walk(&c.blocks, depth + 1, started, ranged); + } + } + } + } + } + let (mut started, mut ranged) = Default::default(); + walk(blocks, 0, &mut started, &mut ranged); + ranged +} + +/// `blocks` with each table replaced by the blocks of its cells, row by row (nested tables too), +/// for places that hold paragraphs only. +pub fn flatten_tables(blocks: &[FBlock]) -> Vec { + let mut out = Vec::new(); + let mut stack: Vec> = vec![blocks.iter()]; + while let Some(top) = stack.last_mut() { + match top.next() { + Some(FBlock::Para(p)) => out.push(FBlock::Para(p.clone())), + Some(FBlock::Table(t)) => { + // Cells in reverse so they come off the stack in order. + for c in t.rows.iter().rev().flat_map(|r| r.iter().rev()) { + stack.push(c.blocks.iter()); + } + } + None => { + stack.pop(); + } + } + } + out +} + +/// A comment in a flow ([`Inline::Comment`]). +#[derive(Clone, Debug, Default, PartialEq)] +pub struct FComment { + pub author: String, + pub initials: String, + /// ISO 8601; empty = unknown. + pub date: String, + pub resolved: bool, + /// The comment this one answers (its flow id). + pub parent: Option, + pub blocks: Vec, +} + +/// A field that never shows its result: `ASK` and `SET` only assign text to a bookmark +/// (ECMA-376 §17.16.5.4, §17.16.5.60), as layout shows them. Its stored result stays in the +/// flow (ODT writes it back); text exports write nothing for it. +pub fn shows_nothing(instr: &str) -> bool { + let name = instr.split_whitespace().next().unwrap_or(""); + name.eq_ignore_ascii_case("ASK") || name.eq_ignore_ascii_case("SET") +} + +/// What [`super::from_doc_with`] keeps besides text and formatting. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct FlowOpts { + /// Tracked changes: deleted text stays, and text carries its insertion and deletion marks. + pub tracked: bool, + /// Fields as [`Inline::Field`] (otherwise their result is text). + pub fields: bool, + /// Footnotes and endnotes as [`Inline::Note`] (otherwise left out). + pub notes: bool, + /// Comments as [`Inline::Comment`] and [`Inline::CommentEnd`] (otherwise left out). + pub comments: bool, + /// Text boxes and drawing shapes as [`Inline::Shape`] (otherwise left out). + pub boxes: bool, + /// Character formatting beyond the [`Fmt`] fields ([`Fmt::extra`]), hidden text kept (as + /// hidden), and a monospaced font by its name rather than as code. + pub chars: bool, + /// Paragraph formatting beyond the [`Para`] fields ([`Para::extra`]). + pub paras: bool, + /// Lists with their identity and labels ([`ListInfo::list`], [`ListInfo::label`]; otherwise + /// consecutive items form one list in the default look of its kind). + pub lists: bool, } /// Base text size (points) a phonetic guide falls back to when the source states none: the @@ -207,6 +519,136 @@ pub struct ListInfo { pub level: u8, /// Number of the first item of an ordered list (1 unless the source says otherwise). pub start: u32, + /// The list the paragraph belongs to, when the source tells its lists apart (ODT): items + /// of one list share its number, wherever they are, and a different number starts another + /// list. 0: not stated (consecutive items form one list). + pub list: u32, + /// How the paragraph's level shows its number or bullet, when the source says. + pub label: Option
`) bold unless their CSS says otherwise; `text-align` on a cell, or inherited from its row, row group or table, aligns the cell's paragraphs (#1381). An opened page looks as Word opens one: Times New Roman 12 pt, single lines, browser-sized black headings, automatic 14 pt spacing where a `p` or heading states no margin (none before the first), a span's margin replacing its paragraph's. HTML gives no page size, so it opens on the region's paper (A4 or Letter), as Markdown and plain text do (#1381). No `@page`, descendant selectors or `div` margins. No Word "Web Page" (with `_files` folder) round-trip. The same reader takes HTML from the system clipboard: Paste keeps another program's formatting (a Word document, a web page; Windows' "HTML Format" header understood), Merge Formatting keeps its emphasis (#687). A pasted `
` (LibreOffice's paragraph indented on both sides) becomes a Normal paragraph indented by the page's `blockquote` margins, else 0.5 in each side; opening an .html file keeps it as the Quote style (#1270). Equations are written as MathML (with the linear format as a UnicodeMath annotation) and read back from MathML: our annotation, else the presentation elements, else a TeX annotation (#816). A copy of one equation alone also goes in the clipboard's MathML formats (Windows "MathML" and "MathML Presentation", macOS `public.mathml.presentation` and `public.mathml`; W3C MathML 3 §6.2.4), which Microsoft documents Word reading first when it pastes math (#1297; the paste into Word is not yet verified); Ruby (furigana, phonetic guides) is written as `basereading` in the base text's formatting and read back from ``/``/`` (`` fallback parentheses dropped; malformed markup keeps its text), so docx/doc → HTML → doc keeps the annotation; HTML states no alignment, size or raise, so the Phonetic Guide's defaults apply (#1681) CRLF and lone CR input newlines normalize before tokenization, preserving preformatted lines and leaving decoded character references separate (#4810). | | `.mht/.mhtml` Single File Web Page | <1% | R/W | 🟡 | ❌ | ~60% | 2–4 | `crates/formats/src/mht.rs` | Opens: the MIME message's page (its `start` part, else the first HTML part) in its part's charset, quoted-printable or base64, pictures found by `Content-Location` (also relative to the page) or `cid:`; then read as an HTML page, on the region's paper. Not saved | | `.xml` Word XML Document (Flat OPC) | <1% | R/W | ✅ | ✅ | ~65% | — | `crates/docx/tests/it/word_xml.rs`, `roundtrip.rs` (`flat_opc_round_trip_equals_docx`) | The DOCX package in one XML file, read and written by the DOCX code (#548); File › Export › Word XML Document. `.xml` files are told apart by their root element | -| `.xml` Word 2003 XML (WordprocessingML 2003) | <1% | R/W | 🟡 | 🟡 | ~55% | 1–2 | `crates/docx/tests/it/word_xml.rs` | Opened by rewriting it as a package for the DOCX reader (#548): styles, default fonts, lists, tables, sections, headers/footers, footnotes/endnotes, comments, bookmarks, tracked insertions/deletions, hyperlinks, `w:binData` pictures, document properties. Not read: formatting changes, `w:docPr` settings, smart tags. Written (#1081) by rewriting the DOCX writer's package into the 2003 vocabulary (`crates/docx/src/wordml2003_write.rs`, `crates/docx/tests/it/wordml2003_write.rs`): core properties, styles (document defaults folded into Normal), lists, text and paragraph/character formatting, tables, hyperlinks, footnotes/endnotes inline, headers/footers in the section properties, bookmarks, comments and tracked insertions/deletions as `aml:annotation`, section page setup, and PNG/JPEG/GIF/BMP/EMF/WMF pictures as `w:pict` with `w:binData`. **Dropped on write:** shapes, text boxes, groups, charts, SmartArt, ink, equations, OLE objects, picture crop, rotation and floating position (pictures become inline), content-control wrappers (their content stays), formatting-change tracking, theme colours/fonts, custom XML, macros, even/odd header setting. File › Export › Word 2003 XML Document, `file.save`/`file.saveAs` with `format: "wordml2003"`, `wordcraft-cli convert … --format wordml2003`; a plain save over a 2003 file keeps that format. Never opened in Word yet (written from the published schemas; needs a tester) | +| `.xml` Word 2003 XML (WordprocessingML 2003) | <1% | R/W | 🟡 | 🟡 | ~55% | 1–2 | `crates/docx/tests/it/word_xml.rs` | Opened by rewriting it as a package for the DOCX reader (#548): styles, default fonts, lists, tables, sections, headers/footers, footnotes/endnotes, comments, bookmarks, tracked insertions/deletions, hyperlinks, `w:binData` pictures, document properties. Line ends in text are normalised as XML 1.0 §2.11 says, so CR LF inside `w:t` is one line feed (#5897, `word_2003_xml_with_windows_line_ends_reads_one_space_per_line_break`). Not read: formatting changes, `w:docPr` settings, smart tags. Written (#1081) by rewriting the DOCX writer's package into the 2003 vocabulary (`crates/docx/src/wordml2003_write.rs`, `crates/docx/tests/it/wordml2003_write.rs`): core properties, styles (document defaults folded into Normal), lists, text and paragraph/character formatting, tables, hyperlinks, footnotes/endnotes inline, headers/footers in the section properties, bookmarks, comments and tracked insertions/deletions as `aml:annotation`, section page setup, and PNG/JPEG/GIF/BMP/EMF/WMF pictures as `w:pict` with `w:binData`. **Dropped on write:** shapes, text boxes, groups, charts, SmartArt, ink, equations, OLE objects, picture crop, transparency, rotation and floating position (pictures become inline; brightness and contrast are kept as VML `gain`/`blacklevel`), content-control wrappers (their content stays), formatting-change tracking, theme colours/fonts, custom XML, macros, even/odd header setting. File › Export › Word 2003 XML Document, `file.save`/`file.saveAs` with `format: "wordml2003"`, `wordcraft-cli convert … --format wordml2003`; a plain save over a 2003 file keeps that format. Never opened in Word yet (written from the published schemas; needs a tester) | | `.wps` Works 6–9, WordPerfect `.wpd` (Windows) | <1% | R | ❌ | — | 0% | 10–20 | — | Windows-only converters; low value | -| `.xlsx`/`.xlsm`/`.xls`/`.ods` as a mail-merge recipient list | — | R (data source) | ✅ | — | ~90% | 1–3 | `crates/formats/src/sheet.rs`, `cmd/mailings.rs` | Read-only, one sheet's cell values (#334): shared/inline/rich strings, numbers, booleans, cached formula results, dates and times as ISO 8601 (`yyyy-mm-dd`) from the cell's number format, sparse cells; ODS value types, repeated rows/columns, covered cells. Select Table picks the sheet. Capped (64 MiB per part, 100,000 rows, 1,000 columns, 2 M cells, 32,767 characters a cell, 64 MiB of cell text a sheet so a shared string repeated in every cell can't exhaust memory, #1287). Legacy `.xls` (Excel 97–2003 BIFF8, #778): SST/LABELSST, LABEL, NUMBER, RK/MULRK, BOOLERR and cached FORMULA results with the same date handling; Excel 5.0/95 and password-protected `.xls` are refused with a message; a CSV/TSV named `.xls` reads as text; an HTML page or XML spreadsheet named `.xls` gets a message saying which it is (#1287). Text lists (.csv/.tsv/.txt) decode UTF-8/UTF-16 by BOM or shape, else the detected legacy encoding (GBK/GB18030, Big5, Shift_JIS, EUC-KR, Windows code pages; `encoding` param overrides) (#778). Not shown: number formats other than dates (currency, percent, thousands separators); no Access or Outlook sources | +| `.xlsx`/`.xlsm`/`.xls`/`.ods` as a mail-merge recipient list | — | R (data source) | ✅ | — | ~90% | 1–3 | `crates/formats/src/sheet.rs`, `cmd/mailings.rs` | Read-only, one sheet's cell values (#334): shared/inline/rich strings, numbers, booleans, cached formula results, dates and times as ISO 8601 (`yyyy-mm-dd`) from the cell's number format, sparse cells; ODS value types, repeated rows/columns, covered cells. Select Table picks the sheet. Capped (64 MiB per part, 100,000 rows, 1,000 columns, 2 M cells, 32,767 characters a cell, 64 MiB of cell text a sheet so a shared string repeated in every cell can't exhaust memory, #1287). Legacy `.xls` (Excel 97–2003 BIFF8, #778): SST/LABELSST, LABEL, NUMBER, RK/MULRK, BOOLERR and cached FORMULA results with the same date handling; Excel 5.0/95 and password-protected `.xls` are refused with a message; a CSV/TSV named `.xls` reads as text; an HTML page or XML spreadsheet named `.xls` gets a message saying which it is (#1287). Text lists (.csv/.tsv/.txt) infer comma, semicolon or tab from the complete first record, ignoring quoted punctuation, doubled quotes and quoted line breaks. They decode UTF-8/UTF-16 by BOM or shape, else the detected legacy encoding (GBK/GB18030, Big5, Shift_JIS, EUC-KR, Windows code pages; `encoding` param overrides) (#778). Not shown: number formats other than dates (currency, percent, thousands separators); no Access or Outlook sources | | Encrypted/password-protected `.docx` | 1% | R/W | ✅ | ✅ | ~60% | 1–2 | `crates/docx/src/crypt.rs` (9 unit tests), `tests/malformed.rs`, `crates/engine/src/tests.rs::password_protected_documents_round_trip`, `aes_encrypted_packages_open_under_any_word_extension` | ECMA-376 / [MS-OFFCRYPTO] agile encryption (AES-256-CBC, SHA-512): a protected `.docx` opens with its password and saves encrypted (#55, #281). Standard encryption (Word 2007: AES-128/192/256-ECB, SHA-1, 50,000 spins) opens too, and either kind opens when named `.doc`/`.dot` (gap 9); saving stays agile. Synthetic files only; never checked against Word-made protected files | | Encrypted/password-protected `.doc` (XOR/RC4) | <1% | R | 🟡 | — | ~60% | 1–2 | `crates/docbin/src/tests/encrypted.rs` | XOR obfuscation, RC4 and RC4 CryptoAPI open with a password (`docbin` `crypt.rs`, #1079). An AES header (`fAES`) is refused with a clear message: [MS-OFFCRYPTO] defines AES only for encrypted packages, which open through the `.docx` reader (gap 9) | | `.md` Markdown | — | (no) | ✅ | ✅ | — | — | `crates/formats/src/tests.rs` | Beyond Word | @@ -101,6 +125,7 @@ Measured by grepping `crates/docx/src/read` and `src/write` for the OOXML elemen | DrawingML pictures inline and anchored (`wp:anchor`), wrap square/tight/through/top-bottom | ✅ | ✅ | Tight/through read and written with their `wp:wrapPolygon` (and `edited`); without one, a shape's outline is written (a picture's rectangle). `wrapText` (both sides, left, right, largest) read and written for square, tight and through | | Legacy form fields (`w:ffData`), check boxes, drop-downs | ❌ | ❌ | | | DrawingML pictures inline and anchored (`wp:anchor`), wrap square/tight/through/top-bottom | ✅ | ✅ | Tight/through read and written with their `wp:wrapPolygon` (and `edited`); without one, a shape's outline is written (a picture's rectangle). `wrapText` (both sides, left, right, largest) read and written for square, tight and through. DrawingML `layoutInCell="0"` is kept and written back; a VML shape in a header or footer table cell is always treated the same way (user-checked in Word for Mac, whatever `o:allowincell` says; saved as DrawingML `layoutInCell="0"`). In a header or footer table cell, such a picture placed relative to the page or margins is placed on the page, so a picture watermark in a header that starts with a table is centred behind the text instead of sitting in the cell (#1775) | +| Picture and shape hyperlinks (`wp:docPr/a:hlinkClick`, ECMA-376 Part 1 §20.4.2.5) | ✅ | ✅ | Read as the drawing's link (a `w:hyperlink` around the run wins); a linked picture, shape or chart is written with both the `w:hyperlink` around its run and the `a:hlinkClick` Word keeps on the drawing, one relationship for both; a link to a place in the document is the `w:hyperlink w:anchor` only (#5267). `picture_links.rs` | | WordArt text effects (`w14:textFill`, `w14:textOutline`, `w14:shadow`, `w14:glow`, `w14:reflection` in `w:rPr`) | ✅ | ✅ | Solid, gradient (linear) and no fill, outline colour/width, shadow, glow, reflection (#416); `w14:scene3d`/`w14:props3d` dropped | | Legacy font effects (`w:outline`, `w:shadow`, `w:emboss`, `w:imprint` in `w:rPr`) | ✅ | ✅ | Drawn on screen and in PDFs as Word's PDFs show them (#2534): hollow outlined letters; a sharp grey copy down-right (shadow, emboss) or up-left (imprint); WordArt effects on the same run win; tracked insertions and deletions keep them. Not drawn on colour emoji, or on top-to-bottom text with upright East Asian characters. Emboss and imprint are approximations (no highlight edge) | | OpenType ligatures (`w14:ligatures` in `w:rPr`: runs, styles, document defaults) | ✅ | ✅ | All 16 values; an unknown value is ignored; nothing is written when the document has none | @@ -108,9 +133,9 @@ Measured by grepping `crates/docx/src/read` and `src/write` for the OOXML elemen | DrawingML shapes and text boxes (`wps:`) | ✅ | ✅ | Preset geometries subset (callouts and flowchart boxes drawn as the nearest shape, #611); `flowChartOr` draws a circle with horizontal and vertical spokes; rounded rectangles keep their own corner (`roundRect` `adj`: read, written back, drawn on screen and in PDF, #1476); fill and outline from the shape or from the theme through its style references (`a:fillRef`/`a:lnRef`, #611), scheme, preset, system, scRGB and HSL colours; rotation and flips (`a:xfrm` `rot`/`flipH`/`flipV`, pictures and groups too, #332), the effect extent covering the rotated bounds; `wps:bodyPr` `vert` and `anchor`, internal margins (`lIns`/`tIns`/`rIns`/`bIns`) and Resize shape to fit text (`a:spAutoFit`: the text is never cut, #743), linked text boxes (`wps:txbx/@id`, `wps:linkedTxbx` `id`/`seq`, #369); text warps (`a:prstTxWarp` with adjust values, all 41 presets kept; unknown ones dropped), connectors (`straightConnector1`, `bentConnector2`–`5`, `curvedConnector2`–`5` read; 3-segment forms written) with glued ends (`wps:cNvCnPr` `a:stCxn`/`a:endCxn`; the glued shapes keep their drawing ids) and arrowheads (`a:headEnd`/`a:tailEnd` with their `type`, `w` and `len` kept; drawn as triangles 2, 3 or 5 times the line's width long and wide, as Word does), including custom-geometry paths (#416); fills with transparency (`a:alpha`) and gradients (`a:gradFill`: up to 10 stops each with its transparency, `a:lin` angle and `scaled`, `a:path` circle/rect/shape with `fillToRect`, `tileRect`, `rotWithShape`, `flip`) read and written as stated, also through the theme's fill styles (`a:fillRef` 1–999 `a:fillStyleLst`, 1001+ `a:bgFillStyleLst`, `phClr` in the reference's colour; written as the resolved fill), outline gradients kept (drawn in their middle stop) (#1500). Drawn: linear and circular; rectangular and shape-following paths drawn circular; `tileRect`/`flip` not drawn; pattern fills drawn and saved as their foreground colour. Hidden drawings (`wp:docPr/@hidden`, a group member's `cNvPr/@hidden`) are kept and saved but neither drawn nor laid out, nor exported to other formats, as in Word for Windows; `.doc` and RTF shapes don't read their hidden flag yet | | Freeform shapes (`a:custGeom`: `a:moveTo`, `a:lnTo`, Bézier curves flattened) and WordCraft ink | ✅ | ✅ | Ink is written as a freeform `wps:wsp` in a `wp:anchor` (round caps, alpha for highlighter) and recognised again by its drawing name (#307). It is saved as a custom-geometry shape, not as Word's own ink (InkML in `w14:contentPart`), so Word shows WordCraft ink as a freeform shape it can move and recolour but not erase with its ink eraser; arcs drawn straight | | Group shapes (`wpg:`), drawing canvas (`wpc:`) | ✅ | ✅ | Groups (#267) and canvases (#344) with pictures, shapes, freeforms (custom geometry, #743; a path drawn back to its start without `a:close` is filled, as in Word) and text boxes; nested groups flattened; members' `a:grpFill` takes their group's fill, and a canvas background (`wpc:bg`) may be a gradient or transparent (#1500). The canvas schema has no transform, so a turned or flipped canvas keeps its turn in our own `wpc:extLst` extension (`urn:wordcraft:canvas-xfrm`; Word shows it unturned). Legacy VML canvases (`v:group editas="canvas"`) aren't read as canvases | -| VML (`w:pict`, `v:shape`, `v:textbox`) | 🟡 | 🟡 | Pictures, text boxes, lines (with arrowheads, their kind, width and length kept), rectangles and ovals, best effort (#242, #611); `v:fill` opacity and gradients (`type="gradient"`/`gradientRadial`, `color2`, `colors`, `angle`, `focus`, `focusposition`, `o:opacity2`), saved as DrawingML (#1500). Preset shapes (`v:shape` whose `o:spt`, own or from its `v:shapetype`, or Word's shapetype id `_x0000_tNN`, names a preset; [MS-ODRAW] §2.4.24 numbers) are drawn and saved like the DrawingML preset of the same shape: exactly for rectangle, rounded rectangle, ellipse, diamond, isosceles triangle, five-point star, right arrow, line and straight connector, heart, text box, and the flowchart process, decision and connector; the others as their nearest shape, as for DrawingML (left/up/down arrows as the arrow, right triangle as the triangle, callouts as their box). Picture frames without a picture aren't drawn. Fill, outline and size come from the shape, else its shapetype; text inside keeps the shape around it (#1377). Adjust values (`adj`) aren't read: presets use WordCraft's proportions. Text boxes keep their internal margins (`inset`, unless `o:insetmode="auto"`), Resize shape to fit text (`mso-fit-shape-to-text`) and vertical alignment (`v-text-anchor`). Hidden shapes (`visibility:hidden`, like DrawingML's `wp:docPr/@hidden`) are kept and saved but neither drawn nor laid out, as in Word for Windows (Word for Mac draws them). Not read: vertical text (`layout-flow`) Word's text watermark (a `v:textpath` shape in a header or footer, recognised by Word's `PowerPlusWaterMarkObject` id or by being centred on the page both ways) becomes the document's watermark: text, font, fill colour, semitransparent (`v:fill` `opacity`) and diagonal (any turn); drawn with WordCraft's own size and angle, on every page even when only some sections' headers (or only the first-page header) have it (#1290). Saving writes the watermark back the same way: a `v:textpath` shape centred on the margins, behind the text, at the start of every header's first paragraph; a section whose pages would show no header gets a header holding only the watermark (default, and first-page or even-page ones when those are on), while sections linked to an earlier header stay linked. Freeforms (`v:shape` with its own `path`: moves, lines, Béziers and closes in its `coordsize`/`coordorigin` space, `nf`/`ns`, `v:stroke` opacity) are read as freeforms and saved as DrawingML custom geometry; fill opacity kept (no fill at 0); arcs are drawn straight; shapes whose path uses formulas (`@n`) and paths inherited from a `v:shapetype` aren't read. Word signature lines (Insert › Signature Line: a VML picture with an `o:signatureline`) are shown as their picture and saved back whole with it, at the size set in WordCraft, so they stay signable in Word instead of becoming plain pictures. Other VML is written only for OLE object pictures and signature lines. Other VML WordArt (Word 2007's: `v:textpath` in the body, or a header logo) becomes a text box without fill or outline holding its `string`, in the textpath's font, the shape's fill colour and a size from the shape's height; its WordArt shape (`o:spt` 136–175) becomes the DrawingML text warp of the same shape (#2875). Its outline, shadow and 3-D effects aren't read | +| VML (`w:pict`, `v:shape`, `v:textbox`) | 🟡 | 🟡 | Pictures, text boxes, lines (with arrowheads, their kind, width and length kept), rectangles and ovals, best effort (#242, #611); `v:fill` opacity and gradients (`type="gradient"`/`gradientRadial`, `color2`, `colors`, `angle`, `focus`, `focusposition`, `o:opacity2`), saved as DrawingML (#1500). Preset shapes (`v:shape` whose `o:spt`, own or from its `v:shapetype`, or Word's shapetype id `_x0000_tNN`, names a preset; [MS-ODRAW] §2.4.24 numbers) are drawn and saved like the DrawingML preset of the same shape: exactly for rectangle, rounded rectangle, ellipse, diamond, isosceles triangle, five-point star, right arrow, line and straight connector, heart, text box, and the flowchart process, decision and connector; the others as their nearest shape, as for DrawingML (left/up/down arrows as the arrow, right triangle as the triangle, callouts as their box). Picture frames without a picture aren't drawn. Fill, outline and size come from the shape, else its shapetype; text inside keeps the shape around it (#1377). Adjust values (`adj`) aren't read: presets use WordCraft's proportions. Text boxes keep their internal margins (`inset`, unless `o:insetmode="auto"`), Resize shape to fit text (`mso-fit-shape-to-text`) and vertical alignment (`v-text-anchor`). Hidden shapes (`visibility:hidden`, like DrawingML's `wp:docPr/@hidden`) are kept and saved but neither drawn nor laid out, as in Word for Windows (Word for Mac draws them). Picture `gain` and `blacklevel` on `v:imagedata` (Word's picture watermark "Washout") are read as brightness and contrast (#1711). Saving as DOCX writes them as DrawingML `a:lum`; saving as Word 2003 XML writes them back as VML `gain`/`blacklevel` (transparency has no place on `v:imagedata` and is dropped there). Text-box text direction is read as Word reads it: `mso-layout-flow-alt:bottom-to-top` as `vert270` whatever `layout-flow` says, else `layout-flow:vertical` or `vertical-ideographic` as `vert`, else horizontal (#5193). Word's text watermark (a `v:textpath` shape in a header or footer, recognised by Word's `PowerPlusWaterMarkObject` id or by being centred on the page both ways) becomes the document's watermark: text, font, fill colour, semitransparent (`v:fill` `opacity`) and diagonal (any turn); drawn with WordCraft's own size and angle, on every page even when only some sections' headers (or only the first-page header) have it (#1290). Saving writes the watermark back the same way: a `v:textpath` shape centred on the margins, behind the text, at the start of every header's first paragraph; a section whose pages would show no header gets a header holding only the watermark (default, and first-page or even-page ones when those are on), while sections linked to an earlier header stay linked. Freeforms (`v:shape` with its own `path`: moves, lines, Béziers and closes in its `coordsize`/`coordorigin` space, `nf`/`ns`, `v:stroke` opacity) are read as freeforms and saved as DrawingML custom geometry; fill opacity kept (no fill at 0); arcs are drawn straight; shapes whose path uses formulas (`@n`) and paths inherited from a `v:shapetype` aren't read. Word signature lines (Insert › Signature Line: a VML picture with an `o:signatureline`) are shown as their picture and saved back whole with it, at the size set in WordCraft, so they stay signable in Word instead of becoming plain pictures. Other VML is written only for OLE object pictures and signature lines. Other VML WordArt (Word 2007's: `v:textpath` in the body, or a header logo) becomes a text box without fill or outline holding its `string`, in the textpath's font, the shape's fill colour and a size from the shape's height; its WordArt shape (`o:spt` 136–175) becomes the DrawingML text warp of the same shape (#2875). Its outline, shadow and 3-D effects aren't read | | Alt text of drawings (`wp:docPr`/`cNvPr` `descr` and `title`, decorative mark `adec:decorative` from [MS-ODRAWXML]) and tables (`w:tblCaption`, `w:tblDescription`) | ✅ | ✅ | Pictures, shapes, text boxes, groups and their members, charts and SmartArt; OLE objects get theirs written into the kept XML (#386) | -| Charts (`c:chart`), SmartArt (`dgm`) | ✅ | ✅ | Drawn from the chart's cached data and SmartArt's stored drawing (#292), with data labels (`c:showVal`); their text (title, axis labels, legend) is drawn in the document's body font, and characters it lacks (Chinese in Calibri's substitute) in a fallback face that covers them, one face per run as in body text (#4720); a chart of only types not drawn yet (radar, stock, bubble, surface, 3-D, pie of pie) shows a placeholder in its frame with its title and type (#998). Charts made in WordCraft (Insert › Chart, #409) are written as a `c:chartSpace` part with their data as literals (`c:strLit`/`c:numLit`, no embedded workbook, so Word shows them and offers to create a workbook on Edit Data) and read back as editable; a chart part holding anything more (any chart from Word, or one re-saved by Word) stays read-only. Saved back as read, with every part they reach (chart, embedded workbook, colours and style; diagram data, layout, quick style, colours and drawing) and their content types; a moved or resized one keeps its new frame, and a pasted copy gets its own parts (#319). SmartArt made in WordCraft (#497) is written from its model: data (`dgm:dataModel` points and connections), our own layout, quick-style and colour definitions under the built-in layout identifiers, and a `dsp:drawing` with every shape placed; it reads back editable only when its data part is exactly what WordCraft writes | +| Charts (`c:chart`), SmartArt (`dgm`) | ✅ | ✅ | Drawn from the chart's cached data and SmartArt's stored drawing (#292), with data labels (`c:showVal`); a series without its own colour takes the accent its `c:idx` picks, as Word does (#5963); their text (title, axis labels, legend) is drawn in the document's body font, and characters it lacks (Chinese in Calibri's substitute) in a fallback face that covers them, one face per run as in body text (#4720); a chart of only types not drawn yet (radar, stock, bubble, surface, 3-D, pie of pie) shows a placeholder in its frame with its title and type (#998). Charts made in WordCraft (Insert › Chart, #409) are written as a `c:chartSpace` part with their data as literals (`c:strLit`/`c:numLit`, no embedded workbook, so Word shows them and offers to create a workbook on Edit Data) and read back as editable; a chart part holding anything more (any chart from Word, or one re-saved by Word) stays read-only. Saved back as read, with every part they reach (chart, embedded workbook, colours and style; diagram data, layout, quick style, colours and drawing) and their content types; a moved or resized one keeps its new frame, and a pasted copy gets its own parts (#319). SmartArt made in WordCraft (#497) is written from its model: data (`dgm:dataModel` points and connections), our own layout, quick-style and colour definitions under the built-in layout identifiers, and a `dsp:drawing` with every shape placed; it reads back editable only when its data part is exactly what WordCraft writes | | OLE objects (`w:object`: embedded or linked files, ActiveX) | 🟡 | ✅ | Shown as their picture (VML or DrawingML); saved back whole with the embedding and picture parts, at the size, rotation and flips set in WordCraft (#319, #332). Can't be opened or edited | | Native Word ink (`w14:contentPart`, InkML) | 🟡 | 🟡 | Drawing-level ink kept opaque with its InkML part, relationship and content type; direct run-level `w:contentPart` and run-level `mc:AlternateContent` keep the native branch and VML picture fallback. Direct content parts remain direct through repeated save/reopen cycles, without a native rendering. Drawing-level ink shows the preview or a missing-picture box. Ink members of groups (`wpg:wgp`, nested groups too) and drawing canvases (`wpc:wpc`), bare or in `mc:AlternateContent` with a `pic:pic` fallback, keep their markup, part, relationship and place among the members; they are written at the member's current position in the group and drawn from their fallback picture. Such a group can't be ungrouped yet (Ungroup is unavailable, so the ink is never left in a form it can't be saved in). Their part is dropped with the group (no orphan part); ink whose part is missing or isn't InkML gives way to its fallback, else is dropped. No native stroke rendering, eraser, conversion or replay | | 3D models | ❌ | ❌ | Dropped on read, not preserved on save | @@ -123,6 +148,7 @@ Measured by grepping `crates/docx/src/read` and `src/write` for the OOXML elemen | Document grid (`w:docGrid`: type, line pitch, `w:charSpace`), `w:snapToGrid` on paragraphs, runs and styles | ✅ | ✅ | #391; run and character-style flags keep absent/true/false across repeated saves; inherited true remains explicit false when overridden. `w:webHidden` remains distinct from `w:vanish` and preserves absent/true/false through runs, styles and repeated saves; Print Layout still shows web-hidden text | | Alternative format chunks (`w:altChunk`) | ✅ | — | Brought into the document where they stand when it opens, as Word does: MHT, HTML and XHTML as web pages, RTF and plain text through their readers, a nested WordprocessingML package by the docx reader (at most 4 deep, 256 chunks and 512 MB of chunk data a file). The chunk's pictures, lists, styles, notes, comments and tracked changes come along (the document's own styles win by id, unless the chunk asks to keep its source formatting, `w:matchSrc`: then its styles come along under new ids, carrying its own defaults); its section breaks don't. Saving writes the content as ordinary paragraphs, as Word does. In a Word XML (Flat OPC) file only WordprocessingML chunks come in | | Two lines in one and horizontal in vertical (`w:eastAsianLayout`, §17.3.2.10) | ✅ | ✅ | Every attribute (`w:id`, `w:combine`, `w:combineBrackets`, `w:vert`, `w:vertCompress`) read into the run's formatting and written back after `w:lang`, in runs and styles; values outside the schema are dropped (`crates/docx/tests/it/east_asian_layout.rs`). Not laid out yet: the text shows as ordinary text | +| Emphasis marks (`w:em`, §17.3.2.12: Font › Emphasis mark) | ✅ | ✅ | Dot, comma, circle and dot below read, drawn over (or under) each character with room made in the line, set by `format.emphasisMark`, and written in their place in `w:rPr`; ODT's `style:text-emphasize` maps to them (an accent is the comma, a disc the dot) | | `w:fitText` | ❌ | ❌ | East Asian layout | | Glossary document (building blocks) | ✅ | ✅ | `w:docPart` entries (name, style, gallery, category, types, behaviours, description, guid, body) are read into `Document::glossary` and offered by Insert › Quick Parts and AutoText; `save` with `"in": "document"` stores one in the file. An untouched glossary is written back byte for byte with its own parts (styles, settings, fonts…); an edited one, or one whose parts weren't kept, is written from the model as `word/glossary1.xml` with copies of the document's styles and numbering. The glossary's own styles, settings and fonts, text boxes inside entries, and the notes and comments of a selection saved into the document don't survive an edit. Tests: `crates/docx/tests/it/glossary.rs` | | Sub-documents | ❌ | ❌ | | @@ -283,17 +309,177 @@ Repeated DOCX style IDs use the last complete definition. The original regressio Custom document properties retain their bookmark link targets through DOCX saves, native JSON reopens, value edits and dialog renames (#4767). `file.properties` accepts a text string or a linked text object with `value` and optional `linkTarget`. Strings keep the existing association. Objects replace it, with an omitted or null target meaning unlinked. Values and bookmark targets are limited to 1 MiB each. Linked values are not evaluated; the dialog layout and field-update behavior are unchanged. Original fixtures cover ordinary and raw property values; broader corpus qualification and readiness estimates remain unchanged. Table rows and cells inside `mc:AlternateContent` use the same selected-branch policy as paragraphs and runs (#5219), rather than disappearing on open and save. Original synthetic fixtures cover Choice/Fallback selection, namespace aliases, mixed requirements, row/cell order and nested content controls through two DOCX saves. This fixes a focused preservation case; native Word and broader real-world corpus qualification remain open. +## Citation refresh source lookups + +Built-in citation refresh and first-cited bibliography ordering use temporary tag and number +indexes (#4888). A duplicate tag still chooses the first source record and the first bibliography +position with that tag. Tag case, unknown-source caches, source records, field instructions and +flags, style sorting and native/DOCX save behavior remain unchanged. Multi-source discovery, +CSL and library import are separate work. + +## Field arguments + +For field results, the engine parser treats a backslash in quoted arguments as escaping the next character, as Word does. The DOCX HYPERLINK target reader applies the same rule; escaped asterisks remain argument text instead of starting a format switch. Engine parser and DOCX import tests cover these cases. ## Revision history +> 2026-11-08 · `convert --strict` for PDF and PNG output, and the pictures a DOCX open leaves out are recorded (#6005); recorded in the progress log, readiness unchanged. + +> 2026-11-07 · VML text boxes: `mso-layout-flow-alt:bottom-to-top` reads as `vert270` with any `layout-flow`, and `layout-flow:vertical` or `vertical-ideographic` otherwise as `vert`, so a compatibility-mode header's turned text box is drawn turned (#5193, `it::text_boxes::vml_text_boxes_keep_their_inset_fit_and_anchor`). + +> 2026-11-03 · Section `w:chapStyle` values preserve the full unsigned-byte range, including 10, while values above 255 are rejected. + +| 2026-10-30 | trivial | DOCX section metadata now preserves independent printer trays, section endnote suppression, chapter numbering settings, and footnote columns through native JSON and repeated save/reopen | > 2026-10-28 · Charts and SmartArt: text the font lacks (Chinese axis labels and legends) is drawn in a fallback face instead of boxes, one face per run as in body text (#4720, `layout::tests::chart_text_the_font_lacks_is_drawn_in_a_fallback_face`). - +> > 2026-10-25 · Arabic list labels: `arabicAlpha` and `arabicAbjad` draw the 28 Arabic letters (alphabetical and abjad order), doubling past the last letter; Hebrew, Hindi, Thai and Vietnamese still show decimal (`doc::section::tests::arabic_letters_count_in_both_orders`). - +> > 2026-10-23 · cu20we: DrawingML flat, square and round line caps are imported, saved, displayed and exported to PDF; absent or unknown caps default to flat. VML end caps (including shapetype inheritance) are preserved through DOCX save. Ink and metafile stroke handling remain separate. Synthetic DOCX, raster and PDF regressions cover the change; no new native Word comparison. | Date | Change | Summary | |---|---|---| +| 2026-11-08 | trivial | ODT row corrected: a file whose tab stops are measured from the indent is saved measuring from it, not always from the margin (the 2026-11-03 change); the default stops are counted from the indent | +| 2026-11-05 | trivial | ODT: a table's columns stating only their share (`style:rel-column-width`, as LibreOffice's CV template does) keep their proportions; they opened and saved as equal columns. An aligned table's stated width is what they divide, columns with only a width take it first, and the default style can give a share. In an aligned table whose every column has a share, the shares win over any widths stated with them, as LibreOffice 26.8 reads them, and a share too small for a column gives the narrowest one (6 pt) instead of losing the grid. A table in a cell, frame or narrower column with widths stated as well as shares, or with nothing to divide, splits equally as before. | +| 2026-11-05 | trivial | ODT: a size is written for Asian and complex-script text too (`style:font-size-asian`, `style:font-size-complex`), as bold and italic are. Chinese text set to 24 pt stayed at the default size in LibreOffice. A complex-script size like the text's stays where a style or default underneath states another, or where a size stated alone over it would show it. A run or paragraph style stating only a size keeps the complex size above it when saved, rather than getting its own size for it. | +| 2026-11-05 | trivial | ODT: text turning off bold, italic, underline, strike-through, capitals or small capitals that its paragraph or character style turns on stays off, read and written. It showed the style's, on screen and in LibreOffice after a save. An Asian or complex-script weight or slant of normal says nothing of Latin text. Strike-through turned off over a double one is off. A span's character style wins over its paragraph turning bold, italic, underline, strike-through or capitals off. | +| 2026-11-06 | trivial | ODT: a custom paragraph style with an outline level (`style:default-outline-level`) stays the paragraph's style. It draws with the file's look, is a heading at that level and is numbered with the outline, and an edited paragraph is saved under its own name (``). It became WordCraft's Heading 1, on screen and in LibreOffice after an edit. Custom styles based on a heading, Title, Quotations or Preformatted Text also keep their name when edited A heading's own `text:outline-level` gives its number, as in LibreOffice. A style at a level the outline doesn't number takes no number from its parent. A heading past level six numbered through its style keeps its list too. | +| 2026-11-05 | trivial | ODT: a picture keeps the size its frame states. Opening a file fitted one wider than the text to it, and any wider than 6.5 in to that, which took its paragraph off being written as read and moved things in LibreOffice after a save Stated on one side, the other follows its proportions. In line with no size stated, it is fitted to the text when read, an object's picture too. A frame stating a width of nothing states no size. A picture in line that is raised, turned or mirrored is fitted too. | +| 2026-11-05 | trivial | ODT: a frame or shape anchored to a page keeps its page number (`text:anchor-page-number`). It was written without one, so a frame on page 3 came back on page 1 in LibreOffice after a save. WordCraft's own layout still places it on its anchor paragraph's page. Groups keep theirs too, and a number on another anchor is ignored, as LibreOffice does. Moved in WordCraft onto a spot where a paragraph starts, a frame is placed by that paragraph and its page number is removed, not only hidden. Dropped where no paragraph starts, it stays anchored to the page and its number becomes the new page's. | +| 2026-11-05 | trivial | ODT: a document's language, stated in its default style or Standard, is read and written back from the model. After numbering or a new style it was dropped on save, so LibreOffice showed the document in its own default language; WordCraft also proofed such a document as English. A document stating no language has none A language's script (`fo:script`) is kept with it, and a style with no parent takes the default style's language when Standard's differs. The language written is Normal's, as WordCraft has it, not the defaults' under it. | +| 2026-11-05 | trivial | ODT: a table's or row's background (`fo:background-color`) shows behind cells with none of their own. It was dropped, on screen and in LibreOffice after a save A cell with no style takes its column's default cell style, and `transparent` clears a parent style's background. A cell style saying `transparent` stops its parent's colour, as in LibreOffice. | +| 2026-11-08 | trivial | XML text and CDATA read with their line ends normalised (XML 1.0 §2.11): CR LF and a lone CR are one line feed, ` ` stays a CR, so a line break inside `w:t` in a file saved with Windows line ends is one space, not two (#5897) | +| 2026-11-07 | trivial | Charts: a series without its own colour takes the accent its `c:idx` picks, as Word does, not the one its place in the file picks (#5963) | +| 2026-11-05 | trivial | ODT: text of another size in a heading, title or code paragraph keeps it. Every run's size went with the style, on screen and in LibreOffice after a save Text at the heading's size goes with the style, stated or not, and a percentage is of the heading's size. Text in a heading style that states no size keeps a size it states. | +| 2026-11-05 | trivial | ODT: a table row kept from breaking across pages (`fo:keep-together` on the row) is read and written; it came back from a save free to break A row whose style doesn't say follows the default style. A row free to break says so where the file's default row style, which stays, keeps rows together. | +| 2026-11-05 | trivial | ODT: a watermark added, changed or removed, and Different Odd & Even Pages turned on or off, in a file read from ODT are saved. The file's own page definitions were written back whatever happened to these, so the change was gone from the saved file (`odt::tests_more::headers`). Such a change writes the page definitions from the model, as other changes to what a page is made of do, so what WordCraft doesn't model of the page (a header's background) doesn't survive that save. Over 79 LibreOffice-authored files with a watermark added: all 79 have it, with the same page count in LibreOffice 26.8. | +| 2026-11-05 | trivial | ODT: a font the file declares stays declared as the file does. WordCraft's own guess at its kind replaced the declaration, so on a computer without the font LibreOffice picked another substitute: one document came back from a save with no edits at 70 pages instead of 83 In single quotes too, and with the name spaces their container declares. A font's name spelled another way in XML is the same declaration. So does a face named other than its family (`F1`, `Mystery`) for text written from the model. | +| 2026-11-05 | trivial | ODT: a frame offering one picture in several formats (LibreOffice's `.svm` metafile, then a PNG) shows the first WordCraft can read; it took the first whatever it was, and the picture was missing on screen and gone once the paragraph was rewritten An object's replacement picture coming before it is kept too. A readable picture after an unreadable replacement is shown, wherever the object comes, and a save from the model keeps both. | +| 2026-11-04 | trivial | Engine field parsing and DOCX HYPERLINK targets consume quoted backslash escapes consistently | +| 2026-11-03 | trivial | Quoted field arguments honor Word backslash escapes, including literal asterisks | +| 2026-11-04 | trivial | CLI input paths keep their native filename when a value-taking option comes first; regression coverage includes conversion to Flat OPC and rejection of non-Unicode option values. | +| 2026-11-05 | trivial | `.dotx`/`.dotm`/`.dot`: a template the platform hands the app starts a new, untitled document attached to it, as Word's default verb does; File › Open still edits the template (#3433); fidelity estimate unchanged | +| 2026-11-02 | trivial | DOCX: a picture's or shape's hyperlink is read from its `wp:docPr/a:hlinkClick` (Word's place for it) and written there too, beside the `w:hyperlink` around the run (#5267) | +| 2026-11-05 | trivial | Strict Open XML: shapes, text boxes, groups and canvases in the Strict drawing namespace, and Word's `wne:txbxContent`, read as their Word 2010 names (#3548); fidelity estimate unchanged | +| 2026-11-05 | trivial | DOCX paragraph `w:adjustRightInd` keeps its default and explicit values in schema-ordered repeated saves | +| 2026-11-04 | trivial | REF context update: 2026-11-04 · #4609 retains the label and template actually rendered by an ancestor list instance; implicitly counted levels remain distinct from explicitly rendered paragraphs. Synthetic instance-override and field-update regressions; no new native Word qualification or readiness change. | +| 2026-11-04 | trivial | PR #4609: relative REF keeps context already displayed by the own or a needed ancestor label; six synthetic legal-template cases and separate-list context follow the Word for Windows measurements reported by @pakiat in PR discussion. Existing unknown-switch/cache boundaries and readiness estimates unchanged; no new native Word run. | +| 2026-11-04 | trivial | Picture brightness, contrast and transparency: DrawingML `a:lum` and `a:alphaModFix`, VML `gain`/`blacklevel` (Washout watermarks) read, drawn on screen and in PDF as Word does (PDF test reads the embedded pixels back), and written as DrawingML; Word 2003 XML writes brightness and contrast as `gain`/`blacklevel` (#1711, #1766) | +| 2026-11-02 | trivial | ODT form controls: one hanging from the baseline (as LibreOffice places those it makes) was saved with no placement, which LibreOffice puts at the line's top; its place on the line is kept (`ContentControl::form_raise`) and written, standing on the baseline when it had none. A multi-line text field was saved without LibreOffice's `MultiLine` property, so it showed one centred line; it says so, and text fields have LibreOffice's flat border. ODT custom shapes: a shape drawn from its own geometry was saved as WordCraft's path of it, and a preset WordCraft draws as a rectangle (a cloud) as a rectangle; the geometry as read (type, path, equations, handles) is kept (`ShapeExtra::odf_geometry`) and written back, mirrored as the shape is now, until the shape is made another kind. The forms document round-trips pixel-identical (from 2,949), the shape presets to 1,220 (from 2,467; what's left is LibreOffice's hairline outline, which WordCraft keeps as 0.5 pt) (`forms::controls_keep_their_place_on_the_line_and_a_text_area_its_lines`, `custom_geometry::a_custom_shapes_geometry_is_written_back_as_it_was_read`, `engine::tests::changing_a_shape_drops_the_geometry_kept_from_a_file`) | +| 2026-11-02 | trivial | ODT, found with LibreOffice's style templates: an in-line frame placed against the text (`style:vertical-rel="text"` or `"char"`: `middle`, `top`, `bottom`) stood on the baseline; it's raised or lowered against the text's height from its size (measured in LibreOffice: `middle` centres it on the text). An in-line picture or chart was saved with no placement, which LibreOffice puts at the line's top (measured); it's saved standing on the baseline, as WordCraft and Word show it. Two templates round-trip with a third to a half of their difference (`floats::an_inline_frame_placed_against_the_text_is_raised_from_its_size`, `floats::an_inline_picture_is_saved_standing_on_the_baseline`). Left in them: template instantiation (LibreOffice refreshes a template's fixed dates and fills its sender fields from the user's data when opening it), a first-page footer's frame placed against the page content, and a page background picture centred in the margins rather than on the page | +| 2026-11-02 | trivial | ODT: a chart lost the look WordCraft doesn't model (its fonts and sizes, axis and grid lines) on save, written anew from WordCraft's chart. The chart object as read is kept (through drawing it again when it opens or is resized), and written back whole while the chart reads the same; an edited chart is written from WordCraft's chart as before. The chart documents round-trip pixel-identical (`charts::an_unchanged_chart_is_written_back_as_it_was_and_an_edited_one_anew`, `engine::tests::redrawing_a_chart_keeps_the_chart_as_read`). Found with LibreOffice's serif business letter: a text frame outlined by its drawn stroke (`draw:stroke`, no `fo:border`) lost its outline; it's the frame's line. A header or footer whose style states no height (or that has none) was 0 tall; it's LibreOffice's 0.5 cm (measured), so the text no longer moves up. The letter round-trips to 116 differing pixels (from 4,223) (`text_boxes::a_frames_drawn_stroke_is_its_line_when_it_has_no_border`, `headers::a_header_without_a_stated_height_is_half_a_centimetre`) | +| 2026-11-02 | trivial | ODT, found with LibreOffice's agendas: saving wrote every table's first row as a header row (`table:table-header-rows`), repeated at the top of each page, because a table style's header row (on by default in Word's table look) was taken for Repeat as header row; a table crossing a page showed its first row twice. Only rows set to repeat are written so. The agendas round-trip to about 145 differing pixels (from 5,269 and 5,086), their text the same (`tables::only_rows_set_to_repeat_are_written_as_header_rows`) | +| 2026-11-02 | trivial | ODT, found with LibreOffice's report templates and one-page résumé. A paragraph's padding on a side without a border (measured: LibreOffice gives it room) was dropped; it's kept, laid out (see layout-parity) and written back. Unequal columns (`style:column` `style:rel-width` and indents, on pages and sections) were made equal; they keep their widths, written back as shares, without the gap LibreOffice ignores them beside. Columns with no stated gap have none (it had been Word's 0.5 in). A paragraph starting a column (`fo:break-before="column"`) didn't; it starts with Word's column break, written back on the paragraph. The report templates round-trip to 0–11 differing pixels (from 9,600), the résumé to 24 (from 6,286) (`para_borders::padding_without_a_border_keeps_its_room`, `odt::tests::unequal_columns_keep_their_widths_and_columns_without_a_gap_have_none`, `odt::tests::a_paragraph_starting_a_column_starts_with_a_column_break`) | +| 2026-11-04 | trivial | ODT: the settings for what the standard leaves open are gone (File › Options › Advanced › OpenDocument files, `file.options` `odf`, `WORDCRAFT_ODF`, the LibreOffice style and custom values): WordCraft makes one choice for each case, the one the default made. What a file states is still followed | +| 2026-11-04 | trivial | ODT: paragraphs tied together are written back as read as a group: a comment over text from one paragraph into another, a tracked change or an index mark likewise, a text box continuing in another's. While every paragraph of the group is as read, all are written so; one edited (or copied), all are written from the model, which names what ties them afresh. | +| 2026-11-04 | trivial | ODT: a paragraph showing a chart is written back as read while unchanged: drawing the chart from its data on opening (which changes nothing) no longer stops its markup matching. | +| 2026-11-04 | trivial | ODT: a named section inside a table's cell (StarOffice's specification template hides some there) is written as read around the cell's paragraphs, closed in the cell; one starting or ending at a paragraph with twins elsewhere (an empty one, as in LibreOffice's agenda templates) is kept too, by that paragraph's own identity, and opened once whatever is copied. Over the corpus 126 of 133 files round-trip pixel-identical (124); over the 220 from other applications 176 (175), 218 with the same page count (216). | +| 2026-11-04 | trivial | ODT element audit ([odt-element-audit.md](odt-element-audit.md)): every element of the ODF 1.3 schema against two corpora (365 files) and a document of our own for each a text document can hold that no file did. Found: index marks over text, plugins and floating frames weren't kept, a form's data source was taken for a control, and password, number, time and grid form controls were dropped; all kept now. | +| 2026-11-04 | trivial | ODT, found in StarOffice's long specifications: a reference mark (§6.6.2 `text:reference-mark`, which `text:reference-ref` names) was written as a bookmark only, so references to it found nothing once its paragraph was written from the model; it is written as both (a reference mark over its text when it ends in the paragraph, else at a point). Lists without an `xml:id` (older files') are kept as read too, given one. | +| 2026-11-07 | trivial | `.doc`: bracket and brace shapes (MSOSPT 85–88, 185, 186) are unfilled unless `fFilled` is set, the default of Word's shapetypes for them, so the box they are drawn as no longer hides the text behind it (#5943) | +| 2026-11-04 | trivial | ODT, found checking 220 files from Microsoft Office, OpenOffice.org, StarOffice, Calligra, Lotus Symphony and others: a section hidden with `text:display="none"` showed its text once written without the section (ending in a list, or in a table's cell); what a hidden section holds is now hidden text, so it stays hidden whatever is written, and WordCraft hides it too. A top-level list whose items nobody edited is written as read whole (a label followed by a space, picture bullets, an unnumbered header: what a paragraph's own markup can't say), a list going on with it naming it; a section may begin or end with a list, which then breaks there. A damaged package's media type isn't shown in its error. Of the 220, 166 round-trip pixel-identical and 194 with the same text. | +| 2026-11-03 | trivial | ODT, found checking files from other applications: a kept package part without a media type (LibreOffice's empty `Configurations2/accelerator/current.xml`, another application's file the manifest didn't list) was written without a manifest entry, and LibreOffice refused to open the saved file; every file written has its entry now (ODF 1.3 Part 2 §4.3), its media type empty as read. | +| 2026-11-03 | trivial | ODT: more paragraphs written back as read while unchanged: those holding bookmarks (their names kept, so a bookmark may start in markup as read and end in a paragraph written from the model; each name written once), footnotes and endnotes (each note's text fingerprinted when read; while the note numbering is as read, as the citation is its number), formulas, charts and other embedded objects (with their files and preview pictures, only while the paragraph showing them is written as read), and those page-anchored frames LibreOffice puts in the text before a paragraph join (their markup kept before the paragraph's). Styles of different families with one name (LibreOffice's paragraph and graphic "Marginalia") are kept apart, as list styles were. The text keeps `text:use-soft-page-breaks` while markup kept as read holds soft page breaks. Still written from the model: form controls (named afresh in the forms), and a chart's paragraph (WordCraft draws the chart after reading it). | +| 2026-11-03 | trivial | ODT: a paragraph showing text boxes or shapes holding text is written back as read while their text is as read (each story fingerprinted when read, with the boxes and notes it holds; an edit to it sends the paragraph to the model). Linked boxes (`draw:chain-next-name`), a comment in a box's text, charts and formulas are still written from the model. | +| 2026-11-03 | trivial | ODT: a paragraph holding comments or tracked changes is written back as read while they are as read: comments whose range, replies and end are in it (a comment's text, author, state and replies fingerprinted when read: one edited, resolved, answered or deleted sends the paragraph to the model), and changes whose start and end are in it, with their regions as read (a deletion's content, the changes inside it first, and the change's own remark); a region without the date ODF requires is written from the model, dated. An older file's region gets the `xml:id` ODF 1.3 names it by. WordCraft's own regions take the writer's prefix (`wcct1`) beside the file's. Over the corpus the words a save loses fall from 29 to 4. | +| 2026-11-03 | trivial | ODT: a paragraph or table holding pictures and drawing shapes (no text in them) is written back as read while nothing in it changed, with the pictures it shows (only those: a picture an edited or deleted paragraph showed isn't written) and its frames' styles: wrapping, contour, picture adjustments and the rest of what WordCraft doesn't model are kept. Text boxes, shapes holding text, charts, formulas and form controls are still written from the model. The file's own `Graphics` and `Frame` styles are written as read. A flat document's pictures are put inline whatever form their element has (one holding a title lost what followed it). Over the corpus the attributes and values a save loses halve (1,551 → 789). | +| 2026-11-03 | trivial | ODT: a named section inside a text box (LibreOffice's letter, fax and business-card templates put the sender's address in one) is written as read around the box's paragraphs, and always closes inside the box, whatever in it is edited. Still written from the model: a section starting or ending at a paragraph with a twin elsewhere (an empty one), and one in a table cell. | +| 2026-11-03 | trivial | ODT, found by the loss check: a list style with a paragraph style's name (LibreOffice's "Numbering 1" and "List 1" are both) overwrote it among the definitions kept as read, so a file's unused list styles were dropped — names are unique only within a kind of definition (§16.2), and each kind is now kept apart. A named section that starts or ends with a table (LibreOffice's report and agenda templates), nested ones included, is written as read around it, as around paragraphs; still written from the model: one starting or ending at a paragraph with a twin elsewhere (an empty one). An unchanged chart keeps its replacement picture (`ObjectReplacements/`, what readers that can't draw charts show); an edited one has none. A note's citation is the number the document gives it (its format and first number, §6.3.3), not LibreOffice's default 1, 2, 3. Frames, pictures, charts and shapes keep their place in the stacking order (§19.231 `draw:z-index`), read and written; it was always 0. The no-edit test now counts elements, so a section of three lost is caught. | +| 2026-11-03 | trivial | ODT: form definitions and indexes are written back as read. The file's `office:forms` keeps its own head and each `form:form` with its settings, properties, event listeners and anything WordCraft doesn't model; each control WordCraft keeps is merged with the file's own (its unmodelled attributes, `form:properties` and `office:event-listeners`). A table of contents, alphabetical index, bibliography or other index whose generated entries nobody edited is written as read, with its source settings and entry templates; once its entries change it is written from the model. The no-edit test now saves nine samples of our own. | +| 2026-11-03 | trivial | ODT: a gradient's unitless angle in an ODF 1.3 file is read in degrees, as the standard says (§18.3.1; it was read in tenths of a degree in every file). In files older than ODF 1.3 it is still read in tenths, as LibreOffice and OpenOffice wrote and read them: a deviation from the standard, out of necessity, documented in `docs/odf-interpretation.md`. The ODF 1.2 → 1.3 changes were checked; none other changes what kept markup means. | +| 2026-11-03 | minor | ODT: more is written back as read when unedited — tables, the document's properties WordCraft doesn't model (template, statistics, editing time, printing), the declarations opening the text and the document's scripts, page layouts and master pages while the page setup is unchanged (with the master page each section started with), and named sections around unedited paragraphs (start tag and section style as read). A file's package files and folders that kept markup names (a style's fill picture, a header's embedded object) are written with it, with their manifest entries. Files are saved as ODF 1.3; markup kept from an older file is brought to 1.3's meaning (a gradient's or hatch's unitless angle was tenths of a degree). WordCraft's own drawings state `style:flow-with-text`, which the standard leaves open. A test now saves seven samples of our own without edits and finds nothing lost (`odt::tests_more::lossless`). Over the 133-file corpus: round-trip difference 191k → 51k pixels, pixel-identical files 62 → 95, lost element kinds 65 → 38. | +| 2026-11-03 | minor | ODT: what isn't edited is written back as it was read. A paragraph nothing changed (by a fingerprint of how it was modelled) is written with its own markup, unknown elements and attributes included, with the automatic styles, common styles, font faces, namespaces and package files it names; while no style or list definition changed, `styles.xml`'s styles are the file's own (unused list styles, note and line numbering configuration, attributes WordCraft doesn't read). Paragraphs with drawings, comments, tracked changes, ranged marks, or that start a page are written from the model; the default graphic style and drawing definitions are WordCraft's, as drawings are written from the model. Kept markup stays in memory only (`wordcraft_doc::kept`, 64 MB at most). Round-trip differences over the 133-file corpus 528k → 191k pixels, pixel-identical files 46 → 62. | +| 2026-11-03 | trivial | ODT: an author field that follows the document is written with `text:fixed="false"`, as LibreOffice writes it; LibreOffice reads one without the attribute as fixed (§19.807 says not fixed), so an empty author field stayed empty instead of showing the author. | +| 2026-11-03 | trivial | ODT, found with Google Docs' and ONLYOFFICE's files: the default paragraph style's text colour (`fo:color`, Google's grey résumé) is read into the document's default and written back (it came back black; round trip 9.2k → 3.4k differing pixels); what a covered table cell holds (§9.1.5: not shown) is skipped instead of landing before the table as empty paragraphs, which pushed ONLYOFFICE's table down the page. | +| 2026-11-03 | trivial | ODT: widow and orphan control a file doesn't state is a profile case (`widowControl`: WordCraft on, as XSL's initial value; LibreOffice off, as it reads such files), and WordCraft writes it on its default style either way. Tab stops measured from the indent (LibreOffice's `TabsRelativeToIndent`, its default) now count the default stops from the indent too, as measured in LibreOffice, and such a file is written back measuring them so; it was written from the margin, which moved LibreOffice's default stops in every indented paragraph. | +| 2026-11-03 | trivial | ODT, found with ONLYOFFICE's converter snapshots: kerning turned on or off span by span (`style:letter-kerning`, §20.317) is read and written where it differs from the document's default (without it LibreOffice set the text wider and every page of a 10-page file broke elsewhere after a save); a note reference keeps its own formatting (a span around `text:note`); a note starting with a tab keeps it (only the space WordCraft puts after the mark is left out). The 10-page RTF-derived snapshot's round trip went from 333k to 279k differing pixels, its DOCX-derived twin from 5.3k to 2.2k with the same text. | +| 2026-11-03 | trivial | ODT fixed fields (§19.807 `text:fixed`) open as locked fields and are written back fixed, a date or time with the value its text shows under its picture (`text:date-value`, `text:time-value`, which LibreOffice needs to keep it); one whose text can't be read back is written as its text. Sender fields (§7.3.6 `text:sender-*`) open as `SENDER` fields and are written back as themselves. | +| 2026-11-03 | trivial | ODT user fields (§7.4.7 `text:user-field-decl`, §7.4.9 `text:user-field-get`; LibreOffice's report templates) are written back as user fields, with their declared values in the content, instead of as document properties (`CustomProp::odf_user_field`). | +| 2026-11-03 | trivial | ODT, found by a loss check that compares what a file uses with what WordCraft writes back: each font is now declared (`office:font-face-decls`, §16.21: family, generic family, pitch) and named where used (`style:font-name`), so a reader without it picks a like one; who changed the document last, when, and how often it was saved (`dc:creator`, `dc:date`, `meta:editing-cycles`) are read into and written from the document's properties. | +| 2026-11-03 | trivial | ODT, found with Google Docs' and ONLYOFFICE's files (now in the corpus): a heading's look comes from its style and its outline level from its element, so a `text:h` without `text:outline-level` (level 1, §19.850.4) in a style based on Heading 2 looks as Heading 2, as LibreOffice draws it, and stays level 1 (it became Heading 1). Widow and orphan control is stated in the default paragraph style (`fo:widows`/`fo:orphans` 2) when Normal has it, since LibreOffice reads none unsaid as off. Google's 2011 Fundamentals export now round-trips with its 88 pages and text (1.27M → 139k differing pixels). | +| 2026-11-03 | trivial | ODT `settings.xml`: LibreOffice ignored every setting WordCraft wrote, because the set's name (`ooo:configuration-settings`) is a qualified name and the `ooo` namespace wasn't declared (observed); and a set it does read must be complete, since LibreOffice gives any setting it lacks its old pre-OpenOffice value (observed). WordCraft now writes LibreOffice's current layout defaults (observed in a new LibreOffice document), Word's layout rules for documents WordCraft lays out as Word does, and its own tab and paragraph spacing choices. How the space between paragraphs adds up follows a file's `AddParaTableSpacing` (false: the larger of the two, as Word), else the ODF interpretation profile (`sumParagraphSpacing`: WordCraft the larger, LibreOffice the sum). WordCraft's own documents opened in LibreOffice now differ by 80k pixels over 42 documents, from 142k. | +| 2026-11-03 | trivial | ODT cell background pictures (§17.3 `style:background-image` in a cell style: LibreOffice's elegant agenda) are read, drawn under the cell's text and cut off at its edges (once where `style:position` puts it, tiled, or stretched, as `style:repeat` says), and written back; WordCraft's cells can carry one (`CellProps::picture`). DOCX has none, so it stays in WordCraft's model only. | +| 2026-11-03 | trivial | ODT page borders: the padding inside a page border was capped at Word's 31 pt border spacing on opening, so text inside a wide padding (WordCraft's own page borders around 1 inch margins) moved towards the border; it is now any distance on the page. | +| 2026-11-03 | trivial | ODT watermarks: WordCraft's watermark (Design › Watermark) is saved as LibreOffice's and Word's are, a fontwork shape (`draw:text-path`) named PowerPlusWaterMarkObject behind the text in every header (one written for it alone, inside the top margin, when there is none), which LibreOffice draws; such a shape opens as the watermark (its text, colour, see-through, turn and size), not a shape. Before, the watermark was left out of ODT files. | +| 2026-11-03 | trivial | ODT, found by saving WordCraft's own documents and opening them in LibreOffice: a table style's look (header and band fills, its cell borders, bold header text, its paragraph spacing) was left out of the saved file; each cell now states what the style gives it, under the paragraph's own styles as in the layout (ECMA-376 §17.7.2). Tables read from ODT no longer get Word's Table Grid style, whose single spacing changed their text. A columned section states whether its columns end balanced (`text:dont-balance-text-columns`, §20.428, whose value descriptions contradict its name: read as the name says); when a file doesn't say, the ODF interpretation profile decides (`balanceSectionColumns`). SmartArt diagrams (ODF has none) are saved as a group of their shapes and text, which LibreOffice draws as WordCraft does; WordCraft opens them back as a group. | +| 2026-11-02 | trivial | ODT: what ODF 1.3 defines (including XSL's initial values for `fo:` properties) is followed whatever the settings; what it leaves to the application (Part 3 §16.2) is an interpretation profile, WordCraft's by default, LibreOffice's or custom, in File › Options › Advanced › OpenDocument files and `file.options` `odf`. Every case is in [odf-interpretation.md](odf-interpretation.md). Unstated page margins (WordCraft 0, XSL's initial value; LibreOffice 2 cm), header heights, column gaps, shape colours and hairlines, tab measuring, frame relations the standard doesn't define and picture-only line heights follow the profile. Google Docs and ONLYOFFICE files checked: no preset of their own needed yet. | +| 2026-11-02 | trivial | ODT: a document opens with LibreOffice's layout for lines of only pictures (as tall as the pictures; see layout-parity), so WordCraft draws LibreOffice's rules and logos at their height. A document with no page layout at all (no styles.xml) had Word's Letter page and 1 inch margins; it has the region's paper and LibreOffice's 2 cm margins (`page_setup::a_document_without_a_page_layout_has_libreoffices_default_page`) | +| 2026-11-02 | trivial | ODT, found with LibreOffice's elegant agenda: a paragraph holding only pictures lost its own font size (the pictures' runs had none), so its line grew; the size is the paragraph mark's and the pictures' runs', read and written. An in-line frame's raise was dropped when a parent style gave it a relation no in-line frame has (`style:vertical-rel="paragraph"`); it's measured from the baseline, as LibreOffice reads it. The agenda's round-trip difference falls from 6,542 to 1,331 pixels (`floats::a_picture_alone_in_its_paragraph_keeps_its_raise_and_the_paragraphs_size`) | +| 2026-11-02 | trivial | ODT, found with LibreOffice's report templates: a table filling the margins (`table:align="margins"`) wider than them ran off the page; it's fitted to them, as LibreOffice fits it. A table's own space above and below (`fo:margin-top`/`fo:margin-bottom`) was dropped; it's kept, laid out and written back. A header or footer taller than its band lost its spacing from the body, moving the text up; it's kept unless the spacing is dynamic (`style:dynamic-spacing`). One report template's round-trip difference falls from 7,646 to 602 pixels (`flow_breaks::a_tables_own_space_above_and_below_is_kept`, `a_tables_columns_keep_their_widths`, `headers::a_headers_spacing_stays_below_content_taller_than_it`) | +| 2026-11-02 | trivial | ODT: a frame that doesn't say how it's anchored or where it sits takes both from its graphic style (`text:anchor-type`, `svg:x`, `svg:y` in `style:graphic-properties`). LibreOffice's business card holds its card in line by the Labels style and puts its credit at the top of the page by the Graphics style; WordCraft had floated the card, and a save gained a page (`floats::a_frames_style_gives_the_anchor_and_place_it_leaves_unsaid`) | +| 2026-11-02 | trivial | ODT: saving wrote the default font size as 12 pt whatever the document's was, so LibreOffice's 11 pt letters gained a page after a save; Normal's size is written. A page-anchored frame placed "from the paragraph" (LibreOffice's letter logos) was moved by the page margin; it's placed from the page, and "from the paragraph's content" from the page's text area. A custom style naming only paragraphs in text boxes (the fax template's centred "Frame contents") was dropped, leaving them Normal; it's kept. An empty paragraph's own font size (its height: the fax's 6 pt line) was dropped; it's the paragraph mark's, read and written (`odt::tests::the_default_styles_font_size_is_the_documents`, `odt::tests::an_empty_paragraph_keeps_its_marks_size`, `floats::a_page_anchored_frames_paragraph_relations_are_the_pages`, `text_boxes::a_custom_style_only_in_a_text_box_is_kept`) | +| 2026-11-02 | trivial | ODT: the document's default font size (the default paragraph style's, 10 pt in LibreOffice's letters) was ignored, leaving 12 pt; it is the document's default. A date style ordered by the locale showed "2026November2"; it shows "November 2, 2026" (`odt::tests::the_default_styles_font_size_is_the_documents`, `fields::a_date_in_the_locales_order_shows_so`) | +| 2026-11-02 | trivial | ODT: page background pictures (LibreOffice's report templates' world map) were dropped; they are page pictures, centred ones drawn at their own size in the middle of the page (on screen and in PDF), and written back (`page_setup::a_page_background_picture_is_read_and_written`, `render::tests::page_picture_is_painted_behind_the_text`) | +| 2026-11-02 | trivial | ODT: a table starting a page (LibreOffice's agenda minutes) didn't; it does, in WordCraft and after a save, and LibreOffice's 6orange agenda round-trips with its text the same. ODT tables are fixed layout, as LibreOffice's columns never fit their content (`flow_breaks::a_table_starting_a_page_starts_it`, `a_tables_columns_keep_their_widths`) | +| 2026-11-02 | trivial | Emphasis marks (Font › Emphasis mark) weren't modelled: DOCX `w:em` and ODT `style:text-emphasize` were dropped. They are read, drawn over (or under) each character with the line made taller for them, set by `format.emphasisMark`, and written back in both formats (`docx/tests/it/emphasis_marks.rs`, `odt::tests_more::chars::emphasis_marks_are_read_and_written`, `engine::tests::emphasis_marks_are_set_and_drawn`) | +| 2026-11-02 | trivial | ODT: variables were their text; they are SET and REF fields (WordCraft now evaluates SET: it shows nothing and gives REF its value), written back as declared variables; a LibreOffice document with variables round-trips with its text the same. Character styles keep what they turn off too (`fields::variables_open_as_set_and_ref_fields`, `odt_fields.rs::odt_variables_update_as_set_and_ref`, `references::tests::set_gives_a_value_that_ref_shows`, `char_styles::what_a_character_style_turns_off_stays_off`) | +| 2026-11-02 | trivial | ODT: a named style turning off its parent's bold (LibreOffice's agenda dates under bold titles) showed bold in WordCraft and in LibreOffice after a save; what a style turns off is kept and written (`named_styles::what_a_style_turns_off_stays_off`). The harness's own paper setting had made LibreOffice draw unsized pages as Letter; with that fixed, LibreOffice's templates compare page by page on the same paper | +| 2026-11-02 | trivial | ODT: WMF and EMF pictures (LibreOffice's fax and letter logos) were dropped; they open as pictures and are saved with their media types. A floating picture in a text box saved by WordCraft didn't show in LibreOffice; picture frames derive from the Graphics style (`text_boxes::a_windows_metafile_picture_is_kept`, `a_picture_in_a_section_in_a_page_anchored_text_box_is_kept`) | +| 2026-11-02 | trivial | ODT: a page margin the file leaves unsaid was 1 in, and a page layout with no properties was ignored; both are LibreOffice's default (2 cm margins, observed), so LibreOffice's CV template lays out as LibreOffice draws it. Page-anchored frames before the first paragraph made a paragraph of their own on the default page style, putting the running header on a letter's first page and pushing it onto two; they join the first paragraph (`page_setup::a_page_layout_stating_nothing_has_libreoffices_margins`, `floats::a_drawing_outside_any_paragraph_belongs_to_the_next_one`) | +| 2026-11-02 | trivial | ODT, from round-tripping LibreOffice's 78 bundled templates: a "First Page" master followed by another put the running header on the first page; it is a different first page. Columns lost their proportions on a narrower page; their shares are written. Placeholders were printed text; they open as content controls showing them and are written back as placeholders. A value-less fixed date was lost; it is a date field. `USERNAME`/`USERINITIALS` fields show the user's name and initials. A page layout without a size was Letter; it is the default page's (A4 where that is the default). Style-only templates failed to open; they open empty with their styles (`odt::tests_more::placeholders`, `fields`, `page_setup::a_page_layout_without_a_size_is_the_default_pages_size`, `flat::a_template_of_styles_only_opens_empty_with_its_styles`, `references::tests::user_name_fields_show_the_users_name`) | +| 2026-11-02 | trivial | ODT: hidden form controls were dropped; they are kept and written back. OpenDocument text templates (`.ott`) weren't opened; they open as documents and save as templates (password too), and LibreOffice's template round-trips with its text the same (`odt::tests_more::forms::hidden_controls_are_kept`, `flat::a_template_is_saved_and_opened_as_one`, `odt_password.rs::an_odt_template_opens_and_saves_as_a_template_with_a_password_too`) | +| 2026-11-01 | trivial | ODT re-estimated at ~90% (20–35 h left) after custom shapes, cell formulas, kept package parts, turned text and control sizes and buttons; a kept form control made another kind is saved as that kind | +| 2026-11-01 | trivial | ODT: form controls were sized to their text on save, and buttons and other controls WordCraft has no kind for were dropped; controls keep their size, and those controls show their label and are kept verbatim, so LibreOffice's button round-trips as a button (`odt::tests_more::forms::controls_keep_their_size`, `buttons_are_kept`, `hostile_kept_controls_are_bounded`) | +| 2026-11-01 | trivial | ODT: text turned down or up in table cells and text boxes (`style:writing-mode`, `loext:writing-mode`) opened across; it opens and saves turned, and LibreOffice's turned cells render as LibreOffice draws them (`odt::tests_more::text_direction`) | +| 2026-11-01 | trivial | ODT: package parts WordCraft doesn't read (LibreOffice Basic macros, `manifest.rdf`, other applications' files) were dropped on save; they are kept and written back with their manifest entries, and LibreOffice finds a round-tripped document's macro intact; thumbnails and signatures are dropped (`odt::tests_more::parts`) | +| 2026-11-01 | trivial | ODT: table cell formulas (`table:formula`) were lost, leaving their value as text; LibreOffice's formulas open as Word formula fields that Update Field recalculates, and formula fields in cells are written back as cell formulas LibreOffice calculates (numbers in cells written as numbers, `ooow` declared); a LibreOffice table of sums round-trips with its text the same (`odt::tests_more::cell_formulas`, `odt_fields.rs::a_table_formula_updates_as_a_word_formula`) | +| 2026-11-01 | trivial | ODT: custom shapes of a type WordCraft has no kind for (hexagon, smiley, can, moon, lightning, block arc…) opened as rectangles; they are drawn from their own enhanced path and equations as freeforms, and a freeform with closed and open paths is saved as a custom shape so LibreOffice fills its closed parts; LibreOffice's preset shapes render as LibreOffice draws them (`odt::tests_more::custom_geometry`) | +| 2026-11-01 | trivial | ODT: citations (`text:bibliography-mark`) were read as text and their sources lost; they are `CITATION` fields of the document's sources, so a bibliography updates from them, written back as marks carrying their source; a LibreOffice citation and bibliography round-trip pixel-identical (`odt::tests_more::fields::bibliography_marks_are_citations_of_sources`, `odt_toc.rs::an_odt_bibliography_updates_from_its_citations_sources`) | +| 2026-11-01 | trivial | ODT: linked text boxes (`draw:chain-next-name`) lost their link, the following box's text gone; they stay linked both ways, a LibreOffice chain round-tripping pixel-identical (`odt::tests_more::text_boxes::linked_text_boxes_stay_linked`) | +| 2026-11-01 | trivial | ODT: picture crops (`fo:clip`) and contour wrapping (`style:wrap-contour`, `draw:contour-polygon`) were dropped; they are read as WordCraft's crop and Tight/Through wrapping with its wrap polygon and written back; a cropped LibreOffice picture round-trips pixel-identical (`odt::tests_more::floats::a_cropped_picture_keeps_its_crop`, `contour_wrapping_and_its_outline_are_kept`) | +| 2026-11-01 | trivial | ODT fidelity re-estimated at ~85% (was ~82%): flow breaks, table placement, ruby, index marks, text borders, connectors and custom properties landed; a 20,000-paragraph document round-trips in about a second with nothing lost; 400 fuzzed documents opened without a crash. Left: emphasis marks (no WordCraft model), rotated text, variables as fields, captions and measures, control sizes, embedded spreadsheets' contents, chart fonts | +| 2026-11-01 | trivial | ODT: custom document properties (`meta:user-defined`) and user fields were dropped or left as text; they are WordCraft's custom properties, the fields showing them `DOCPROPERTY` fields that update, all written back (a user field as a property) (`odt::tests_more::fields::custom_properties_and_user_fields_are_docproperty_fields`, `odt_fields.rs::a_user_field_updates_from_its_property`) | +| 2026-11-01 | trivial | ODT: connectors (`draw:connector`) were left out; they open as WordCraft connectors glued to their shapes' connection sites and placed between them, and are written back glued, which LibreOffice re-routes (`odt::tests_more::connectors`) | +| 2026-11-01 | trivial | ODT: a border around text (LibreOffice's `loext:border`) is read as Word's text border and written back, which LibreOffice draws (`odt::tests_more::chars::a_border_around_text_is_read_and_written`) | +| 2026-11-01 | trivial | ODT: index marks (`text:alphabetical-index-mark`, at a point or over text) were dropped, so updating an opened index emptied it; they are read as `XE` fields and written back as marks, and Update Index rebuilds a list held as a field around its entries (ODT's and Word's form) instead of leaving it as it was (`odt::tests_more::indexes::index_marks_are_xe_fields_and_written_back`, `odt_toc.rs::an_odt_index_updates_from_its_marks`) | +| 2026-11-01 | trivial | ODT: ruby (`text:ruby`) was read as its base and ruby text run together and written as plain text; it is read as a Phonetic Guide and written back as ODF ruby, which LibreOffice shows over its base (`odt::tests_more::ruby`) | +| 2026-11-01 | trivial | ODT: a page break after a paragraph (lost, so a two-page document saved as one page), lines kept together, widow and orphan control, hyphenation (the document hyphenates when a paragraph does), a table's alignment and width and its rows' heights are read and written; a LibreOffice document with them round-trips at 573 px instead of 4 407 and keeps its pages (`odt::tests_more::flow_breaks`) | +| 2026-11-01 | trivial | Layout: an in-line picture, shape or chart moves with its run's raise or lowering (Word's `w:position`), the line growing to hold it. ODT: an in-line frame centred on or hanging from the baseline keeps that place (read as that lowering, written back as `from-top`) instead of standing on the baseline; leading's extra space after the last line is kept; a text box's frame derives from the Frame style, without which LibreOffice ignored its border. LibreOffice round trips: shapes 13 864 → 1 273 px, spacing 2 973 → 706 px, text box 736 → 0 px (`layout::tests::an_inline_picture_moves_with_its_runs_position`, `odt::tests_more::floats::an_inline_frame_keeps_its_place_on_the_baseline`, `odt::tests_more::text_boxes::a_text_box_frame_derives_from_the_frame_style`) | +| 2026-11-01 | trivial | ODT: form controls (`office:forms`, `draw:control`) — text fields, text areas, check boxes, radio buttons, list and combo boxes, date fields — were dropped with their values; they open as content controls (which save to DOCX as Word's) and are written back as form controls LibreOffice shows (`odt::tests_more::forms`, `odt_forms.rs`) | +| 2026-11-01 | trivial | ODT: password-protected files open with their password (AES-256-CBC, SHA-256/SHA-1 start key, PBKDF2 — LibreOffice's encryption; Blowfish refused with a message) instead of failing, and save with a password writes them encrypted as LibreOffice does, which LibreOffice opens (`odt::tests_more::encryption`, `odt_password.rs`) | +| 2026-11-01 | trivial | ODT: shapes, text boxes, charts and embedded objects in headers and footers were dropped on save (header and footer text was written without drawings other than pictures), and embedded objects there were lost on open; both now as in the body (`odt::tests_more::objects::an_object_in_a_header_is_kept_too`) | +| 2026-11-01 | trivial | Flat ODT: an inline sub-document (a chart since the chart change) lacked the `office:mimetype` an `office:document` must have, and the schema rejected the file; sub-documents now go inline with their media type, styles and settings, objects' replacement pictures inline rather than linked to files a flat document doesn't have, OLE objects as base64 (`odt::tests_more::objects::a_flat_document_holds_its_objects_and_their_pictures_inline`) | +| 2026-11-01 | trivial | ODT: embedded objects WordCraft doesn't edit — spreadsheets and other sub-documents (`draw:object`), OLE files (`draw:object-ole`) — were lost on open when their replacement picture was in LibreOffice's own metafile format (as LibreOffice writes it); they are now kept whole with their files, media type and replacement picture, shown by that picture or a placeholder WordCraft draws, and saved back as the same objects (LibreOffice draws a round-tripped spreadsheet identically); DOCX gets the picture alone (`odt::tests_more::objects`, `odt_objects.rs`) | +| 2026-11-01 | trivial | ODT: a chart that is a member of a drawing group (`draw:g`) is drawn on open instead of showing blank (`odt_charts.rs::a_chart_in_a_group_opens_drawn`) | +| 2026-11-01 | trivial | ODT: charts (`draw:object` holding an `office:chart`) open as editable WordCraft charts — type, categories, series and gaps from the chart's own table, title, legend, data labels — instead of their replacement picture, drawn in the theme's colours, and WordCraft charts are saved as ODF chart objects LibreOffice draws and edits (each series and slice in its accent colour); charts WordCraft can't edit keep their picture. Flat ODT: an inline sub-document's own `office:body` no longer ends the document's body early, so text after an inline chart is kept (`odt::tests_more::charts`, `odt::tests_more::flat::an_inline_sub_document_does_not_end_the_body`, `odt_charts.rs`) | +| 2026-11-01 | trivial | ODT: leading (`style:line-spacing`, extra space between lines) is read as at least a 12 pt line and the leading instead of a proportional spacing, so the extra space goes above each line as LibreOffice draws it: a LibreOffice spacing document went from 6,190 px apart after a round trip to 2,973, and WordCraft's drawing of it from 8,570 to 5,521 (`leading_is_at_least_a_line_and_the_leading`) | +| 2026-11-01 | trivial | ODT: tracked formatting changes (`text:format-change` between change marks) open as formatting revisions with their author and date (the old formatting is the text's own: ODF doesn't record it, LibreOffice can't reject them after reopening either), instead of being dropped, and WordCraft's formatting revisions are written as format changes. Fixed: changed regions were written without the `xml:id` ODF 1.3 requires (and the change marks refer to), so a document with tracked changes didn't validate; a region named by `xml:id` alone is read too | +| 2026-11-01 | trivial | ODT: drop caps (`style:drop-cap`, lines and distance) read and written. Fixed: a paragraph with its own tab stops lost the background, borders, contextual spacing and right-to-left direction written after them, which went into the style's tab stops instead of onto it (`tab_stops_and_other_paragraph_properties_together`) | +| 2026-11-01 | trivial | Flat OpenDocument text (`.fodt`) opened and saved (Open, Save As, the CLI, the web app): taken apart into a package's files and put together again, its pictures inline as base64 and its formulas inline in their objects; LibreOffice's own flat documents round-trip as their packages do. ODT fidelity re-estimated at ~80% (tables of contents and indexes, field formats and references, bookmarks over text, page settings and flat files since ~72%; still missing: embedded charts and other objects, form controls, password-protected files, tracked formatting changes, variables, drop caps) | +| 2026-11-01 | trivial | ODT: page settings read and written — page number format (the page style's, and a page number field's own as `PAGE \* Arabic` and the like), page colour, page borders (at ODF's margin, the text inside their padding; WordCraft measures them from the edge), footnote and endnote numbering and line numbering. Fixed: in a document with footnotes (or comments, or text boxes) and a header or footer, the header or footer took the story id of a note, so the note showed the footer's text (`a_footnote_keeps_its_text_beside_a_footer`). A LibreOffice document with all of these round-trips pixel for pixel, and WordCraft draws it 7,213 px from LibreOffice (24,025 before the border was placed right) | +| 2026-11-01 | trivial | ODT: dates and times keep their format (date and time styles ↔ Word's `\@` pictures, both ways), sequences numbering figures and tables open as `SEQ` fields with a bookmark over the caption's label and number, chapter fields as `STYLEREF`, reference marks as bookmarks, and references to marks and sequences as `REF`/`PAGEREF`, instead of as plain text, so Update Field renumbers captions and refreshes references (`odt_fields.rs`); a LibreOffice document with all of them round-trips 13 px apart. Fields: a date-time picture's text in single quotes is shown as it is (`date_pictures_keep_quoted_text`) | +| 2026-11-01 | trivial | ODT: a bookmark over text (`text:bookmark-start`…`-end`, in one paragraph or across several) keeps the text it covers, both ways (it was read as a point at its start, and a Word bookmark over text was written as a point), so a reference to it — LibreOffice's references to headings included — updates to that text instead of to nothing (`odt_fields.rs`) | +| 2026-11-01 | trivial | ODT: tables of contents, tables of figures, alphabetical indexes and bibliographies open as WordCraft's (`TOC`, `INDEX`, `BIBLIOGRAPHY` fields over their entries; LibreOffice's Contents styles as the TOC styles), so Update Table works on them, and are saved as ODF indexes LibreOffice updates (a LibreOffice document with a table of contents, a table of figures and an index round-trips pixel for pixel). Found on the way: a style based on LibreOffice's generic Heading style lost that parent on save (its font and spacing), and a paragraph's tab stops weren't measured from an indent its style gives (`tabs_are_measured_from_the_indent_a_style_gives`, `a_style_based_on_libreoffices_heading_keeps_it`). ODT fidelity re-estimated at ~72% (weighted by how often documents use each area; the gaps: fields' formats and references, page-level settings, embedded objects other than equations, flat and encrypted files) | +| 2026-11-01 | trivial | ODT: polygons, polylines, paths (`svg:d`: moves, lines, cubic and quadratic curves, smooth curves and elliptical arcs, absolute and relative; curves followed in 16 straight steps) and regular polygons and stars open as WordCraft freeforms in their view box, and circles (`draw:circle`, by size or centre and radius) as ellipses, instead of being skipped; WordCraft's freeforms (ink included) are written as `draw:path` in a view box of hundredths of a point. A LibreOffice document with a polygon, a polyline and a closed Bézier curve round-trips 333 px apart, and WordCraft draws it 529 px from LibreOffice | +| 2026-11-01 | trivial | ODT: arrowheads (`draw:marker-start`/`-end`), line dashes (`draw:stroke-dash`) and gradient fills (`draw:gradient`) of shapes and frames are read into WordCraft's arrowheads, dash patterns (named ones when they match) and gradients, and written back as definitions in `styles.xml` (WordCraft's own triangle arrowhead); a line keeps the direction it is drawn in, so its arrowheads stay at their ends. A LibreOffice document with arrowheads, dashes and gradients round-trips 215 px apart, and WordCraft draws it 518 px from LibreOffice. Layout: a sloped line's arrowheads were drawn at the other diagonal's corners (the arrowhead code assumed a line from bottom left to top right, the renderers draw top left to bottom right); they now sit at the line's ends (`tests::a_lines_arrowheads_sit_at_its_ends`) | +| 2026-11-01 | trivial | ODT: groups (`draw:g`) of shapes, text boxes and pictures open as one WordCraft group (anchored and wrapped as the group is, its members at their places in it, turned members turned, nested groups flattened) instead of being skipped, and WordCraft's groups are saved as `draw:g` (a canvas as a plain group). A frame, shape or group whose styles state no `style:wrap` now has text on both sides, as LibreOffice wraps it, instead of above and below only; `biggest` is read as the larger side. A shape whose only paragraph is LibreOffice's empty `` no longer gets an empty text story. A LibreOffice document with turned shapes and a group: 7,464 px apart after a round trip, now 586 | +| 2026-11-01 | trivial | ODT: shapes and pictures turned by `draw:transform` open turned (the file's anticlockwise turn about the object's corner, then a move, becomes WordCraft's clockwise turn about the centre of the unrotated box) and are written back that way, in line too; custom shapes keep their mirroring (`draw:mirror-horizontal`/`-vertical`); a turned line is written by its turned ends. Before, a turned shape lost its turn and its position (LibreOffice writes no `svg:x`/`svg:y` for one) | +| 2026-11-01 | trivial | ODT: drawing shapes (`draw:rect`, `draw:ellipse`, `draw:line`, `draw:custom-shape` with a predefined `draw:type`) open as WordCraft shapes with their size, placement, fill, line, text and direction instead of being skipped, and WordCraft's shapes are saved as them (rectangle, rounded rectangle, ellipse, flowchart or, triangles, diamond, block arrows, star, heart, line; connectors as lines); a shape keeps its own size in LibreOffice unless it resizes to fit its text (`draw:auto-grow-height`). A LibreOffice shapes document now round-trips with all nine shapes and the same text (13,864 px apart, mostly in-line shapes moved onto the baseline) | +| 2026-11-01 | trivial | ODT: a text box frame keeps its line, fill and padding from its graphic style chain (LibreOffice's Frame style included) instead of a fixed thin black line on white, and a frame without a height (`fo:min-height`) opens as a box that resizes to fit its text and is written back that way; floating boxes that resize to fit now take their text's height in layout too (a LibreOffice text-box document: 1,117 px apart after a round trip, now 736). A formula sub-document's `content.xml` stays a bare `math:math` root, as ODF 1.3 Part 3 §2.2.9 requires, and one wrapped in `office:math` still reads | +| 2026-11-01 | trivial | ODT: Asian and complex-script fonts, the complex script's size, weight and posture, and both script languages (`style:font-name-asian`/`-complex`, `style:font-size-complex`, `style:language-asian`/`-complex`…) are read and written, on runs and as the document defaults, so Hebrew, Arabic and CJK text keep their fonts. `formats::odt::tests_more::chars` | +| 2026-11-01 | trivial | ODT: right-to-left paragraphs (`style:writing-mode` `rl-tb`/`rl`, ODF 1.3 §20.404) open as bidirectional paragraphs and are written back, in paragraph and custom styles. `formats::odt::tests_more::rtl` | +| 2026-11-01 | trivial | ODT: text boxes (`draw:text-box` in a `draw:frame`) open as WordCraft text boxes holding their text, in line or floating as the frame is anchored and placed, and are written back as framed text boxes; their text was dropped on open. `formats::odt::tests_more::text_boxes` | +| 2026-11-01 | trivial | ODT: a heading style whose level the outline doesn't number is written with `style:list-style-name=""`, as LibreOffice writes it; otherwise LibreOffice gave the heading the outline's unnumbered level and its indent. `formats::odt::tests_more::outline` | +| 2026-11-01 | trivial | ODT: contextual spacing (`style:contextual-spacing`) is read and written and the List Paragraph style is written, so list items keep their spacing; a file's own `settings.xml` (LibreOffice's layout compatibility switches) is kept through a save, and a document from elsewhere gets the switches LibreOffice uses for Word files, as WordCraft lays text out as Word does (a Word-made document saved as ODT: 38,652 px apart in LibreOffice before, 3,302 now). `formats::odt::tests_more::{spacing, settings}` | +| 2026-11-01 | trivial | ODT: custom character styles are kept: a common text style other than LibreOffice's link, note-mark and list-label styles (Emphasis, a user's own) opens as a document character style with its name, parent and own formatting, the text in it naming it; saving writes the character styles the text uses as common text styles, the spans' automatic styles based on them. `formats::odt::tests_more::char_styles` | +| 2026-11-01 | trivial | ODT: each list level's indent, hanging and number alignment (`style:list-level-label-alignment`, `fo:text-align` of `style:list-level-properties`, ODF 1.3 §17.19–17.20) are read and written, for lists and heading numbering; every list was written 36 pt a level with left-aligned numbers. `formats::odt::tests_more::lists` | +| 2026-11-01 | trivial | ODT: custom paragraph styles are kept: a common paragraph style other than Standard, the kinds' and the note texts' (LibreOffice's Text body, a user's own style) opens as a document style with its name, parent and own formatting, and its paragraphs stay in it instead of taking its formatting as direct formatting; saving writes the custom styles the paragraphs use, and those they are based on, as common styles. `formats::odt::tests_more::named_styles` | +| 2026-11-01 | trivial | ODT: equations are written as formula objects (`draw:object` and a formula sub-document whose `content.xml` is the equation's MathML, declared in the manifest), framed at about the size the formula takes and centred on the line, so LibreOffice shows and edits them; they were written as their linear text. `formats::odt::tests_more::equations`, `formats::odt::formula_size` | +| 2026-11-01 | trivial | ODT: numbered headings are written as headings the outline style numbers, not as list items: wrapped in a list they took that list's indents in LibreOffice (level 2's number sat 54 pt in); the outline levels get label alignment followed by a tab, and the heading styles no longer state zero indents that override it. `formats::odt::tests_more::outline` | +| 2026-11-01 | trivial | ODT: floating pictures keep their place: a frame anchored to a paragraph, character or page opens as a floating picture with its wrap (`style:wrap`, `style:run-through`), alignment or offset (`style:horizontal-pos`/`-rel`, `style:vertical-pos`/`-rel`, `svg:x`/`svg:y`) and distances (`fo:margin-*`), and is written back the same way; every picture used to open in line with the text. `formats::odt::tests_more::floats` | +| 2026-11-01 | trivial | ODT: paragraph borders (`fo:border*`, each side's `fo:padding*` as its distance from the text) and background (`fo:background-color`) are read and written; only an empty paragraph with a bottom border was kept, as a rule. `formats::odt::tests_more::para_borders` | +| 2026-11-01 | trivial | ODT: heading numbering (`text:outline-style`, ODF 1.3 §16.34) is read into one list linked to the heading styles, so LibreOffice's 1. / 1.1. headings stay numbered, and written back from the heading styles' numbering; before, the numbers were lost on open. `formats::odt::tests_more::outline` | +| 2026-11-01 | trivial | ODT: a `style:font-name` is read as the `svg:font-family` of the `style:font-face` it names (in `content.xml` or `styles.xml`), not as the face's name: LibreOffice's `FreeSans1` is FreeSans. `formats::odt::tests_more::fonts` | +| 2026-11-01 | trivial | ODT: table cell borders (`fo:border*`: width, style, colour) and padding (`fo:padding*`) are read, an edge LibreOffice gives to one cell only shared by both, and written with each shared edge once (left and bottom, the first row's top, the last column's right), so lines no longer double; cells were written with a fixed 4 pt padding and a grid even in tables without lines. `formats::odt::tests_more::tables` | +| 2026-11-01 | trivial | ODT: the file's heading, title, quotation and preformatted styles give WordCraft's matching styles their look on open (a LibreOffice heading is bold Liberation Sans, not WordCraft's blue), with `fo:font-size` percentages of the parent size read; saving writes those styles from the document's own definitions, so a WordCraft heading looks the same in LibreOffice. `formats::odt::tests_more::style_look` | +| 2026-11-01 | trivial | ODT: tab stops (`style:tab-stops`, ODF 1.3 §17.7–17.8) with their alignment and leader, and the default tab interval (`style:tab-stop-distance`), are read and written; LibreOffice's `TabsRelativeToIndent` (positions from the paragraph's indent, its default) is followed on open, and saved files carry a `settings.xml` measuring from the margin, as Word does. `formats::odt::tests_more::tabs` | +| 2026-11-01 | trivial | ODT: character formatting beyond bold, italic and colour is read and written: underline styles (double, thick, dotted, dashes, wave, words only) and colour, double strike, caps, small caps, hidden text (kept, hidden), letter spacing, scale, text raised or lowered at full size, outline, shadow, emboss, engrave and language; a monospaced font keeps its name (it was written as Courier New), and the default style's pair kerning (`style:letter-kerning`) round-trips, so lines break where LibreOffice breaks them. `formats::odt::tests_more::chars` | +| 2026-10-31 | trivial | ODT: lists keep their look and identity: each level's number format, prefix, suffix, levels shown, start value and bullet character are read from the list style and written back, and separate `text:list`s stay separate lists unless one continues another; before, consecutive lists of different styles merged into one decimal list (1–7 for three LibreOffice lists numbered 1., i., A.). `formats::odt::tests_more::lists` | +| 2026-10-31 | trivial | ODT: comments (`office:annotation`, ODF 1.3 §14.1–14.2) open with their ranges (across paragraphs too), author, date, initials, resolved state and replies (`loext:resolved`, `loext:parent-name`, kept by LibreOffice when it saves our files), and are written back; an end with no comment is dropped and a comment whose end never comes covers nothing; before, comments were dropped on open. `formats::odt::tests_more::comments` | +| 2026-10-31 | trivial | ODT: footnotes and endnotes (`text:note`, ODF 1.3 §6.3) open as note stories built as Word's (Footnote Text or Endnote Text paragraphs starting with the note's mark, the reference in the reference style, a `text:label` custom mark kept) and are written back with `text:note-citation`s numbered as LibreOffice shows them (footnotes 1, 2, 3; endnotes i, ii, iii); before, notes were dropped on open. `formats::odt::tests_more::notes` | +| 2026-10-31 | trivial | ODT: headers and footers are written to each section's master page (every, left and first page), with Word's header and footer distances converted to ODF's header and footer bands and back on open; text fields (`text:page-number`, `text:page-count`, `text:date`, `text:time`, document information, `text:bookmark-ref`) open as WordCraft fields and are written back as ODF fields. `formats::odt::tests_more::{headers, fields}` | +| 2026-10-31 | trivial | ODT: paragraph spacing, indents and line spacing (`fo:margin-*`, `fo:text-indent`, `fo:line-height`, `style:line-height-at-least`; `style:line-spacing` leading as a proportional approximation) read from automatic and common styles and written back; the default and Standard paragraph styles give the document defaults, so an ODT paragraph without spacing has none instead of Word's 8 pt after and 1.15 lines. `formats::odt::tests_more::spacing` | +| 2026-10-28 | trivial | Print Markup text-copy comment discovery walks paragraph objects once (#3614); quotes, order, limits and readiness estimates unchanged | +| 2026-10-17 | trivial | RTF on the system clipboard: Copy and Cut write the copy as RTF beside its text and HTML (Windows, macOS, Wayland; not X11), and Paste reads RTF on macOS and X11 too | | 2026-11-03 | trivial | Replace Table of Contents keeps Word's title above the section break over entries in columns, and Remove takes the title, the blank paragraph and its break with the table, as observed in Word for Mac (#4041) | | 2026-11-02 | minor | `w:altChunk` content (MHT, HTML, RTF, text, nested documents) brought in on open, where it stands; `.mht`/`.mhtml` open; HTML reads `style` element rules, paragraph margins, indents and line height, cell widths and borders, and an opened page takes Word's web-page defaults. Insert › Text from File keeps the file's pictures and lists | | 2026-11-02 | trivial | DOCX: a VML horizontal rule (`v:rect o:hr`, a web page's `
` pasted into Word) is drawn across its line as Word draws it — the whole width inside the paragraph's indents, or `o:hrpct` of it, or its own width, placed by `o:hralign` — instead of as a 1 pt dot; in a table cell it follows the column; it saves back as the same VML rule | @@ -301,6 +487,8 @@ Table rows and cells inside `mc:AlternateContent` use the same selected-branch p | 2026-11-01 | trivial | Preserve table rows and cells inside selected alternate-content branches (#5219); readiness estimates unchanged. | | 2026-11-01 | trivial | Arrowheads keep their kind, width and length (DrawingML `a:headEnd`/`a:tailEnd` `type`/`w`/`len`, VML `startarrow`/`endarrow` with `…arrowwidth`/`…arrowlength`), read and written back, and are drawn 2, 3 or 5 times the line's width long and wide (small, medium, large), a line under 2 points as a 2-point one, as measured in Word for Windows; every kind is still drawn as a triangle | | 2026-10-31 | trivial | .doc import: text naming no font takes the stylesheet's standard fonts (rgftcStandardChpStsh, ftcBi), not the font table's first entry; runs' East Asian and complex-script fonts are read (#5066) | +| 2026-10-31 | trivial | Preserve recipient columns after an unquoted whitespace-only prefix in a headered CSV (#4249); keep quoted headers, headerless whitespace records and shared CSV parsing. | +| 2026-10-31 | trivial | Integrate complete-record recipient CSV delimiter detection (#4249) with current main; preserve leading blank-line detection (#5042), original regressions and readiness estimates. | | 2026-10-31 | trivial | DOCX: a paragraph naming a style the file doesn't define is formatted as Normal, as in Word (#5077) | | 2026-10-31 | trivial | DOCX: a hyperlinked table of contents writes each page number as a `PAGEREF _Toc… \h` field to the heading's bookmark, as Word does, so updating the fields in Word moves the numbers with the headings; they were plain text (checked in Word for Mac 16.93: with the headings moved a page down, the three fields update from 2, 3, 4 to 3, 4, 5). `engine::tests::toc_page_numbers_are_pageref_fields` | | 2026-10-31 | trivial | HTML import ends the empty comments `` and `` at once, as the HTML spec does, instead of swallowing the rest of the page (#5040) | @@ -312,12 +500,18 @@ Table rows and cells inside `mc:AlternateContent` use the same selected-branch p | 2026-10-28 | trivial | #4658: bound Markdown reference-label rejection work, preserving literal source and ordinary link matching | | 2026-10-17 | trivial | macOS launch arguments (`-psn_*`, `-NS*`, `-Apple*`) are no longer opened as files; a file that fails to open (command line, open event, drop) names the file and the cause on the status bar and in the log (#1103) | | 2026-10-29 | trivial | HTML import keeps preformatted lines with CR, CRLF or LF input newlines (#4810); numeric character references retain their separate meaning; readiness estimates unchanged. | +| 2026-10-22 | trivial | Legacy form names and labels decode valid numeric XML references once, preserving raw field XML | +| 2026-10-27 | trivial | Preserve #4249 complete-record CSV delimiter detection and its regressions in the mailings modules; recipient commands, limits and refusal behavior unchanged. | +| 2026-10-26 | trivial | Integrate #4249 with current-main CSV helpers, preserving logical-record detection, existing recipient limits and refusal behavior. | +| 2026-10-25 | trivial | Recipient CSV delimiter detection reads the first complete record, including quoted line breaks and doubled quotes; separator ties and cell parsing remain unchanged. Original parser and CLI import/save/reopen checks; readiness estimates unchanged. | | 2026-10-17 | trivial | Encryption rows: Standard (Word 2007, AES-ECB) encrypted packages open with a password, also when named `.doc`/`.dot`; AES headers in Word 97-2003 files are outside the public spec and refused (gap 9). The duplicate combined `.docx`/`.doc` row is removed; the `.doc` row reads 🟡 ~60% (it opens XOR/RC4/RC4 CryptoAPI); hours 2–4 → 1–2 and 4–6 → 1–2 (left: checks against Word-written files); total re-summed from the rows, 175–287 h | | 2026-10-25 | trivial | Repeated DOCX style IDs: repeated save/reopen regression for whole-definition replacement. | | 2026-10-25 | trivial | Arabic list labels: `arabicAlpha` and `arabicAbjad` draw the 28 Arabic letters (alphabetical and abjad order), doubling past the last letter; Hebrew, Hindi, Thai and Vietnamese still show decimal (`doc::section::tests::arabic_letters_count_in_both_orders`) | | 2026-10-26 | trivial | DOCX: a package spelling `WORD/FONTTABLE.XML` and its fonts in another casing than the relationships still loads and saves its embedded fonts (the font table is found by its stored spelling), and a save that removes personal information escapes the attribute values of a kept glossary (`w:val='Say "hi"'` stays well-formed) (#3872 review) | | 2026-10-23 | trivial | cu20we: preserve and render outline caps across DOCX/VML, screen and PDF; synthetic regressions; readiness estimates unchanged | -> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-28 · **Change:** trivial (custom-property bookmark-link preservation, #4767; previously trivial: the `.doc` reader logs what its copy budget leaves out, once a kind per document; previously trivial: repeated DOCX style IDs: save/reopen regression; previously trivial: Markdown code spans keep line-broken text literal, #3738; previously trivial: Arabic list labels: `arabicAlpha` and `arabicAbjad` draw the 28 Arabic letters (alphabetical and abjad order), doubling past the last letter; Hebrew, Hindi, Thai and Vietnamese still show decimal (`doc::section::tests::arabic_letters_count_in_both_orders`); previously trivial: localized TOC style ids read as the TOC styles, and a TOC in columns keeps its layout through Update Table, #3889; previously trivial: cu20we: outline caps; previously trivial: a relationship the markup names without the prefix is read as it wrote: an unqualified `id` on an element that carries a relationship names that relationship, and the writer keeps the attribute with the id the new package holds the part under; an ordinary `id` — a VML shape's, a drawing's — names no part; previously trivial: the reader takes the relationship ids the markup refers to from the relationship attributes of the main document it has already parsed, so a document with many relationships opens in the time its part takes, #3411; previously trivial: a table cell span from a `.json` file stays within 63 columns through Insert Column and Merge Cells, #3637; previously trivial: the file commands that change the document are checked on a protected document, the protection of a protected document needs an explicit stop, the session author can't change through `file.setAuthor` under protection (the CLI's `--author` uses the same protection check), and the post-check compares the settings and the metadata; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: `majorBidi`/`minorBidi` theme fonts follow the settings' theme font language, as measured in Word; previously trivial: Word signature lines are kept on save, still signable; previously trivial: Times New Roman keeps Liberation Serif under the roman-font rule; previously trivial: shape gradients and transparency, #1500; previously trivial: a folder that keeps no Unix modes, such as a NAS share mounted by GVFS, still takes a save, #3003; previously trivial: a text frame in the paragraph defaults frames nothing, #2360; previously trivial: table style band sizes written, a style without them unbanded as in Word, #3415; previously trivial: HTML export writes ruby (furigana, phonetic guides) and HTML import reads it back, #1681; previously trivial: RTF import decodes the East Asian multibyte code pages, #1653; previously trivial: PDF export: lam-alef drawn as two glyphs at one x extracts in reading order, #2310; previously trivial: native .json stores pictures and kept parts as base64, #586 follow-up; previously trivial: ODT headers and footers read from each master page, #863; previously trivial: RTF import compares heading and code formatting with the file's stylesheet; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: Word XML and web pages saved as `.doc` open by what they hold, #2853; previously trivial: a VML shape in a header cell is always placed on the page, user-checked in Word for Mac, #1775; previously trivial: `w:sym` characters keep their symbol font when the text's font changes and are written back as `w:sym`, #2036; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: two lines in one and horizontal in vertical (`w:eastAsianLayout`) kept on save; previously trivial: PDF outline targets follow leading page breaks; previously trivial: positional tabs `w:ptab` read and kept on save, #2367; previously trivial: DOCX: mixed right-to-left runs split and marked `w:rtl` with their language, #1543; previously trivial: `w:doNotTrackMoves` round-trips and turns move tracking off; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: DOCX glossary documents (building blocks) read, kept and written; previously trivial: cached field results keep their visible run formatting; previously trivial: cached REF results retain hyperlink destinations; previously trivial: CLI conversions can explicitly refresh fields; previously trivial: a copied equation also goes in the clipboard's MathML formats, #1297; previously trivial: a pasted HTML `
` is an indented paragraph, not the Quote style, #1270); previously trivial: every table style part round-trips, #714; previously trivial: VML freeforms read and kept on save; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: `flowChartOr` draws its circle and cross spokes, as in Word; previously trivial: RTF: Mac OS Roman and DOS text, #1653; previously trivial: VML text boxes keep their internal margins, fit to their text and vertical alignment; hidden drawings not shown; previously trivial: PDF export draws horizontal and vertical lines inside groups, #1474; previously trivial: symbol-font text exported as Unicode, #776; previously trivial: text-box margins, Resize shape to fit text and freeforms in groups, #743; previously trivial: formatted paste from the system clipboard's HTML and RTF, #687; previously trivial: independent complex-script formatting inheritance and round-trip regression tests; previously trivial: import/export fixes for TXT, RTF, ODT, HTML and LaTeX, #433–#440; previously major: first version; every format Word reads or writes, measured from the readers and writers on origin/main) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4, plus Word for Windows' extra formats + + +> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-30 · **Change:** trivial (custom-property bookmark-link preservation, #4767; previously trivial: the `.doc` reader logs what its copy budget leaves out, once a kind per document; previously trivial: repeated DOCX style IDs: save/reopen regression; previously trivial: Markdown code spans keep line-broken text literal, #3738; previously trivial: Arabic list labels: `arabicAlpha` and `arabicAbjad` draw the 28 Arabic letters (alphabetical and abjad order), doubling past the last letter; Hebrew, Hindi, Thai and Vietnamese still show decimal (`doc::section::tests::arabic_letters_count_in_both_orders`); previously trivial (built-in citation source lookups, #4888; current-main progress records retained); previously trivial (custom-property bookmark-link preservation, #4767; previously trivial: the `.doc` reader logs what its copy budget leaves out, once a kind per document; previously trivial: repeated DOCX style IDs: save/reopen regression; previously trivial: Markdown code spans keep line-broken text literal, #3738; previously trivial: Arabic list labels: `arabicAlpha` and `arabicAbjad` draw the 28 Arabic letters (alphabetical and abjad order), doubling past the last letter; Hebrew, Hindi, Thai and Vietnamese still show decimal (`doc::section::tests::arabic_letters_count_in_both_orders`); previously trivial: localized TOC style ids read as the TOC styles, and a TOC in columns keeps its layout through Update Table, #3889; previously trivial: cu20we: outline caps; previously trivial: a relationship the markup names without the prefix is read as it wrote: an unqualified `id` on an element that carries a relationship names that relationship, and the writer keeps the attribute with the id the new package holds the part under; an ordinary `id` — a VML shape's, a drawing's — names no part; previously trivial: the reader takes the relationship ids the markup refers to from the relationship attributes of the main document it has already parsed, so a document with many relationships opens in the time its part takes, #3411; previously trivial: a table cell span from a `.json` file stays within 63 columns through Insert Column and Merge Cells, #3637; previously trivial: the file commands that change the document are checked on a protected document, the protection of a protected document needs an explicit stop, the session author can't change through `file.setAuthor` under protection (the CLI's `--author` uses the same protection check), and the post-check compares the settings and the metadata; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: `majorBidi`/`minorBidi` theme fonts follow the settings' theme font language, as measured in Word; previously trivial: Word signature lines are kept on save, still signable; previously trivial: Times New Roman keeps Liberation Serif under the roman-font rule; previously trivial: shape gradients and transparency, #1500; previously trivial: a folder that keeps no Unix modes, such as a NAS share mounted by GVFS, still takes a save, #3003; previously trivial: a text frame in the paragraph defaults frames nothing, #2360; previously trivial: table style band sizes written, a style without them unbanded as in Word, #3415; previously trivial: HTML export writes ruby (furigana, phonetic guides) and HTML import reads it back, #1681; previously trivial: RTF import decodes the East Asian multibyte code pages, #1653; previously trivial: PDF export: lam-alef drawn as two glyphs at one x extracts in reading order, #2310; previously trivial: native .json stores pictures and kept parts as base64, #586 follow-up; previously trivial: ODT headers and footers read from each master page, #863; previously trivial: RTF import compares heading and code formatting with the file's stylesheet; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: Word XML and web pages saved as `.doc` open by what they hold, #2853; previously trivial: a VML shape in a header cell is always placed on the page, user-checked in Word for Mac, #1775; previously trivial: `w:sym` characters keep their symbol font when the text's font changes and are written back as `w:sym`, #2036; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: two lines in one and horizontal in vertical (`w:eastAsianLayout`) kept on save; previously trivial: PDF outline targets follow leading page breaks; previously trivial: positional tabs `w:ptab` read and kept on save, #2367; previously trivial: DOCX: mixed right-to-left runs split and marked `w:rtl` with their language, #1543; previously trivial: `w:doNotTrackMoves` round-trips and turns move tracking off; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: DOCX glossary documents (building blocks) read, kept and written; previously trivial: cached field results keep their visible run formatting; previously trivial: cached REF results retain hyperlink destinations; previously trivial: CLI conversions can explicitly refresh fields; previously trivial: a copied equation also goes in the clipboard's MathML formats, #1297; previously trivial: a pasted HTML `
` is an indented paragraph, not the Quote style, #1270); previously trivial: every table style part round-trips, #714; previously trivial: VML freeforms read and kept on save; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: `flowChartOr` draws its circle and cross spokes, as in Word; previously trivial: RTF: Mac OS Roman and DOS text, #1653; previously trivial: VML text boxes keep their internal margins, fit to their text and vertical alignment; hidden drawings not shown; previously trivial: PDF export draws horizontal and vertical lines inside groups, #1474; previously trivial: symbol-font text exported as Unicode, #776; previously trivial: text-box margins, Resize shape to fit text and freeforms in groups, #743; previously trivial: formatted paste from the system clipboard's HTML and RTF, #687; previously trivial: independent complex-script formatting inheritance and round-trip regression tests; previously trivial: import/export fixes for TXT, RTF, ODT, HTML and LaTeX, #433–#440; previously major: first version; every format Word reads or writes, measured from the readers and writers on origin/main) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4, plus Word for Windows' extra formats | 2026-10-23 | trivial | `.doc` reader logs what its copy budget leaves out (floating objects, link targets, alt text, Prm formatting), once a kind per document (#3692) | | 2026-10-22 | trivial | `.doc` reader bounds hostile files: oversized sector tables refused, per-character re-reads removed, copy and decode budgets (#3642, #3692, #3708-#3712) | | 2026-10-22 | trivial | Hostile input: DOCX package, comment, font, chart and Flat OPC hardening (#3692, #3723, #3704, #3742, #3648) | @@ -342,6 +536,7 @@ Table rows and cells inside `mc:AlternateContent` use the same selected-branch p | 2026-10-16 | trivial | A `HYPERLINK` field reads as a link with its result as ordinary text, so a Word for the web table of contents keeps its tabs, dot leaders and page fields (#2174) | | 2026-10-19 | trivial | Restrict Editing: with Filling in forms enforced, inserting content controls, their Properties and Remove Content Control are refused, as in Word (it greys them out), so a form's fields stay as they are and only their content is filled in | | 2026-10-19 | trivial | Content controls: text typed over a placeholder takes the control's own run properties (`w:sdtPr/w:rPr`, ECMA-376 §17.5.2.27), as in Word, and the placeholder style is recognised by its built-in name "Placeholder Text" whatever its localized id (German Word: `Platzhaltertext`), so entries in forms from localized Word no longer stay grey | +| 2026-10-12 | trivial | RTF reads and writes footnotes, endnotes and comments with author, initials, date and commented range (#1053) | | 2026-10-18 | trivial | A Word 2003 XML or Flat OPC document, or a web page, saved under a `.doc`, `.docx` or `.rtf` name opens by what it holds, as in Word, instead of going to the Word 97-2003 reader and showing a blank page (#2853) | | 2026-10-18 | trivial | `w:sym`: the symbol's `w:font` is kept apart from the run font (ECMA-376 §17.3.3.30), so changing the text's font (or Clear Formatting) keeps Wingdings/Symbol characters showing, and they are written back as ``; Insert › Symbol in a symbol font does the same (#2036). A private-use character with no symbol font of its own in a non-symbol run is not guessed | | 2026-10-18 | trivial | Manage Sources imports Word's `Sources.xml` (`b:Sources`) into the document's bibliography sources, sharing the reader of a document's own bibliography part (#2640) | @@ -496,6 +691,11 @@ Table rows and cells inside `mc:AlternateContent` use the same selected-branch p | 2026-10-16 | trivial | Word's Table of Contents content control (`w:docPartObj`) is kept around a TOC that isn't in the heading-and-entries form (#2427) | | 2026-10-23 | trivial | `.json`: a table cell span past 63 columns no longer overflows when a column is inserted through the cell or the cell is merged (#3637) | | 2026-10-29 | trivial | Bibliography sources: a corporate author (`b:Corporate`, Word's Corporate Author box) is read and written whole instead of being dropped, and citations and bibliographies show it as written in every style; APA puts its full stop after a group author ("World Health Organization. (2021).") (#4848) | +| 2026-10-29 | trivial | Temporary citation lookup indexes preserve existing source, order and save contracts (#4888) | | 2026-10-28 | trivial | RTF import: pictures stored as Windows Metafiles (`\wmetafile`) or Enhanced Metafiles (`\emfblip`) are kept as WMF/EMF media instead of dropped, and RTF export writes WMF/EMF pictures back as `\wmetafile8`/`\emfblip` instead of dropping them (`rtf::tests::metafile_pictures_are_imported`, #4259) | | 2026-11-01 | trivial | Markdown export: a list inside a block quote keeps its `>` marker on every line (nested levels and continuation lines included), so the list no longer moves out of the quote when the document is saved as Markdown, also after a .docx round trip | | 2026-11-03 | trivial | Opening a password-protected file named on the command line shows the Password box also when a chosen region replaced the first blank document (the window followed the replacement only on the first frame, which dropped the box, #5299) | +| 2026-10-27 | trivial | 2026-10-27 · #4533 review: numeric REF updates lazily index body bookmarks once per update, retaining the first body bookmark for duplicate names. Unsupported switches and ordinary REF/PAGEREF behavior are unchanged; a synthetic 64-reference regression covers repeated updates and duplicate names. Estimates unchanged. | +| 2026-10-27 | trivial | 2026-10-27 · #4533: numeric REF fields use paragraph list numbers for no/full/relative context, reusing bounded numbering. Shared context already embedded in a level label is removed; merged-away cells do not count. Unsupported separator/text/position switches and ambiguous contexts or delimiter-free joins retain cached results. Synthetic OOXML regressions; no native Word or real-document validation, estimates unchanged. | +| 2026-11-05 | trivial | DOCX: a block-level content control (including `w15:repeatingSection` / `w15:repeatingSectionItem` nested around one paragraph) followed by body-level bookmark, comment or permission markup (Word's `_GoBack` bookmark) is written back around its paragraph instead of inside it, so Word opens the saved file; the markers are kept at the end of that paragraph (P0069). | +| 2026-11-04 | trivial | DOCX: paragraph and list-level indents (`w:ind`) and paragraph spacing (`w:spacing` before/after) written as plain twips beyond 16 bits keep their low 16 bits, as Word reads them (`w:left="66256"` is a 36 pt indent), instead of pushing the text off the page (`twips_wrap.rs`, P0059) | diff --git a/docs/gaps.md b/docs/gaps.md index 2342091ce1..80d2e148a8 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,15 +1,26 @@ # Where WordCraft falls short of Word -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-03 · **Change:** trivial (#3 narrowed: unclosed Markdown inline comments don't rescan the paragraph); previously trivial (#8: language-packs-2 is published and pinned: 75 packs, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch and Swedish (Sweden, Finland); no ranked gap changed); previously trivial (#8: language-packs-1 is published and pinned, 61 packs: Lithuanian, Romanian, Catalan, French, Greek, Slovak, Serbian and Latvian install as Language packs; Dutch, German and the other compounding languages wait on craft-proof; no ranked gap changed); previously minor (#8: Language packs: every other language's spelling and hyphenation installs from File › Options › Language or the missing-pack bar, through the font store; Lithuanian and Romanian are available as a Language pack once language-packs-1 is published; Dutch, Catalan, French, Greek, Slovak, Serbian and Latvian packs wait on craft-proof engine support); previously trivial (gap 8: English spelling reads SCOWL 2026, one dictionary per English, #40, #520, #5205; no ranked gap changed);; previously trivial (DOCX table rows and cells inside selected alternate-content branches survive open and repeated saves (#5219); broader corpus qualification and readiness estimates unchanged); previously trivial (#26 narrowed: MHT opens and `w:altChunk` content is brought in on open; saving MHT remains) previously trivial (gap 8 points at craft-proof in craft-libs, its data in craft-i18n, #5202; no ranked gap changed); previously trivial (arrowheads keep their kind, width and length and are drawn at Word's sizes; no ranked gap changed); previously trivial (.doc default font from the stylesheet's standard font, #5066; no ranked gap changed); previously trivial (a middle or bottom cell of a row split across pages lines up on the first page; no ranked gap changed); previously trivial (tab leader dots spaced and placed as in Word; no ranked gap changed); previously trivial (a list level above counts its first number at the first deeper item; no ranked gap changed); previously trivial (only the PDF sent to the printer leaves out link annotations; Save these pages as PDF keeps them, #4734; no ranked gap changed); previously trivial (documents with links print: the print job leaves out link annotations, #4734; no ranked gap changed; previously trivial: aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion reference-run membership uses one ordered walk, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (gap 19: RTF reads and writes WMF and EMF pictures, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (View windows: several open documents and Switch Windows in the engine; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: automatic Asian/Latin and Asian/number spacing laid out, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: numbered headings, #1793; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: #8 narrowed: Indonesian proofing from the installed Hunspell dictionary, #498; previously trivial: glossary/building blocks closed; previously trivial: Split Cells and Convert Text to Table follow the Word check, #2592; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: #29: a copied equation also goes in the MathML clipboard formats, #1297; previously trivial: #24: the Spike, Ctrl+F3 and Ctrl+Shift+F3; previously trivial: VML freeforms read and kept on save; previously trivial: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: copies keep their formatting on the clipboard as HTML, #1523; previously trivial: sample-text formulas on Enter, #1067; previously trivial: #29: copied equations as MathML, OMML open as #1297, #816; previously trivial: the Font list no longer keeps every previewed font in memory, #848; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: first version; every known shortfall from the 2026-10-10 re-measure, ranked) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-03 · **Change:** trivial (#3 narrowed: a pasted text box story is charged for the formatting it copies); previously trivial (#3 narrowed: a .doc table row keeps one override per cell); previously trivial (#3 narrowed: a .doc file's sections find their paragraphs by index); previously minor (#11: Arabic interface with mirrored shell landed, #1195; hi/id/pt-PT and Hebrew UI remain); previously trivial (#8: language-packs-2 is published and pinned: 75 packs, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch and Swedish (Sweden, Finland); no ranked gap changed); previously trivial (#8: language-packs-1 is published and pinned, 61 packs: Lithuanian, Romanian, Catalan, French, Greek, Slovak, Serbian and Latvian install as Language packs; Dutch, German and the other compounding languages wait on craft-proof; no ranked gap changed); previously minor (#8: Language packs: every other language's spelling and hyphenation installs from File › Options › Language or the missing-pack bar, through the font store; Lithuanian and Romanian are available as a Language pack once language-packs-1 is published; Dutch, Catalan, French, Greek, Slovak, Serbian and Latvian packs wait on craft-proof engine support); previously trivial (gap 8: English spelling reads SCOWL 2026, one dictionary per English, #40, #520, #5205; no ranked gap changed);; previously trivial (DOCX table rows and cells inside selected alternate-content branches survive open and repeated saves (#5219); broader corpus qualification and readiness estimates unchanged); previously trivial (#26 narrowed: MHT opens and `w:altChunk` content is brought in on open; saving MHT remains) previously trivial (gap 8 points at craft-proof in craft-libs, its data in craft-i18n, #5202; no ranked gap changed); previously trivial (arrowheads keep their kind, width and length and are drawn at Word's sizes; no ranked gap changed); previously trivial (.doc default font from the stylesheet's standard font, #5066; no ranked gap changed); previously trivial (a middle or bottom cell of a row split across pages lines up on the first page; no ranked gap changed); previously trivial (tab leader dots spaced and placed as in Word; no ranked gap changed); previously trivial (a list level above counts its first number at the first deeper item; no ranked gap changed); previously trivial (only the PDF sent to the printer leaves out link annotations; Save these pages as PDF keeps them, #4734; no ranked gap changed); previously trivial (documents with links print: the print job leaves out link annotations, #4734; no ranked gap changed; previously trivial: aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion reference-run membership uses one ordered walk, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (gap 19: RTF reads and writes WMF and EMF pictures, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (View windows: several open documents and Switch Windows in the engine; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: automatic Asian/Latin and Asian/number spacing laid out, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: numbered headings, #1793; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: #8 narrowed: Indonesian proofing from the installed Hunspell dictionary, #498; previously trivial: glossary/building blocks closed; previously trivial: Split Cells and Convert Text to Table follow the Word check, #2592; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: #29: a copied equation also goes in the MathML clipboard formats, #1297; previously trivial: #24: the Spike, Ctrl+F3 and Ctrl+Shift+F3; previously trivial: VML freeforms read and kept on save; previously trivial: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: copies keep their formatting on the clipboard as HTML, #1523; previously trivial: sample-text formulas on Enter, #1067; previously trivial: #29: copied equations as MathML, OMML open as #1297, #816; previously trivial: the Font list no longer keeps every previewed font in memory, #848; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: first version; every known shortfall from the 2026-10-10 re-measure, ranked) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **CLI path update:** 2026-11-04 · Options before a non-Unicode input filename no longer make the CLI reject that filename; text option values still require Unicode; `run --file` and `run --script` retain native paths. No ranked gap or readiness estimate changes. + +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-08 · **Change:** trivial (#19: ODT default language kept when styles are written from the model); previously trivial (#10 narrowed: a turned inline picture whose file keeps no room for the turn keeps its line to its frame, as in Word); previously trivial (Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged; previously trivial: View windows: several open documents and Switch Windows in the engine; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial (gap 4: a float anchored right after a page break, before text, is drawn on the new page, #4262); previously trivial (Drawing Canvas members picked and moved on their own, #2637); previously trivial (gap 4: a float anchored on a later page of a long paragraph is drawn there, #4250); previously trivial (#29: typed `\int`, `\sum`… + Space wait for their limits, observed in Word for Windows on #4938, #4917); previously trivial (only the PDF sent to the printer leaves out link annotations; Save these pages as PDF keeps them, #4734; no ranked gap changed); previously trivial (print helpers erase loaded plaintext inputs before driver work, #5710); previously trivial (Windows print submissions use isolated helpers so a cancelled driver cannot block a retry, #5710); previously trivial (print cancellation remains available without a document; sending-boundary limitation clarified, #5710); previously trivial (gap 6: a print job waiting on its driver can be cancelled, #5710; no ranked gap changed); previously trivial (gap 6: the printer list no longer waits on printer drivers, #5710; no ranked gap changed); previously trivial (Page drawing indexes text-box warp lookups per paragraph (#3614)); previously trivial (built-in citation source lookups, #4888; current-main progress records retained); previously trivial (MATH construction reuse, #3630); previously trivial (DOCX `w:adjustRightInd` defaults true and is written in schema order); previously trivial (ink page lookups reuse scanned paragraph prefixes, #3614); previously trivial (#19: ODT settings for what the standard leaves open removed); previously trivial (#19: ODT element audit; files from other applications checked); previously trivial (#11: the dialogs of the mirrored Arabic interface read right to left: label-and-field rows, tables (list columns, the Models table), tile galleries and the Add/Remove arrows follow the reading direction, through one `rtl::Table` helper that draws exactly as before in English; no ranked gap closed, readiness estimates unchanged); previously trivial (#4: fonts that aren't installed are flagged in the font box and status bar); previously trivial (#19: ODT sections inside text boxes kept as read); previously trivial (#19: an ODT saved without edits keeps what WordCraft doesn't model); previously trivial (#19: ODT interpretation profile, WordCraft / LibreOffice / custom); previously trivial (#19: ODT form controls placed and multi-line; custom shapes keep their geometry); previously trivial (#19: ODT in-line frames placed against the text; template instantiation listed as left); previously trivial (#19: ODT charts kept as read; frame outlines; default header height); previously trivial (#19: ODT tables no longer gain repeated header rows); previously trivial (#19: ODT padding without a border, unequal columns, column breaks, picture-only lines); previously trivial (#19: ODT tables' margins and spacing, header spacing, pictures alone in a paragraph); previously trivial (#19: no LibreOffice template changes page count through a save); previously trivial (#19: ODT variables, emphasis marks, page backgrounds, fixed tables, default size); previously trivial (#19: ODT checked against LibreOffice's own templates: placeholders, first-page styles, unsized pages, metafile logos, `.ott`); previously trivial (#19: ODT at ~90%: custom shapes, cell formulas, macros kept, turned text, control sizes and buttons); previously trivial (#19 narrowed: ODT read and written nearly whole; estimate 18–27 h → 10–16 h); previously trivial (#10 narrowed: text in a turned text box is drawn turned with it); previously trivial (gap 19 narrowed: ODT heading numbering read and written); previously trivial (gap 19 narrowed: ODT table borders and padding read and written); previously trivial (gap 19 narrowed: ODT heading style looks read and written); previously trivial (gap 19 narrowed: ODT tab stops read and written); previously trivial (gap 19 narrowed: ODT character formatting read and written); previously trivial (gap 19 narrowed: ODT list formats read and written); previously trivial (gap 19 narrowed: ODT comments read and written); previously trivial (gap 19 narrowed: ODT footnotes and endnotes read and written); previously trivial (gap 19 narrowed: ODT headers and footers written, text fields and paragraph spacing read and written); previously trivial (#8: Options › Language lists Your languages and Add a language… replaces the Language packs table); previously trivial (#8: the missing-pack bar works on a fresh install and counts the caret's language); previously trivial (#8: Language pack languages are in Set Proofing Language, Review › Language and the status bar; built-in proofing is named as such); previously trivial (#20: layout resource caps and linear-time passes (#3867, #3866)); previously trivial (#3 narrowed: a pasted text box story is charged for the formatting it copies); previously trivial (#3 narrowed: a .doc table row keeps one override per cell); previously trivial (#3 narrowed: a .doc file's sections find their paragraphs by index); previously minor (#11: Arabic interface with mirrored shell landed, #1195; hi/id/pt-PT and Hebrew UI remain); previously trivial (#8: language-packs-2 is published and pinned: 75 packs, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch and Swedish (Sweden, Finland); no ranked gap changed); previously trivial (#8: language-packs-1 is published and pinned, 61 packs: Lithuanian, Romanian, Catalan, French, Greek, Slovak, Serbian and Latvian install as Language packs; Dutch, German and the other compounding languages wait on craft-proof; no ranked gap changed); previously minor (#8: Language packs: every other language's spelling and hyphenation installs from File › Options › Language or the missing-pack bar, through the font store; Lithuanian and Romanian are available as a Language pack once language-packs-1 is published; Dutch, Catalan, French, Greek, Slovak, Serbian and Latvian packs wait on craft-proof engine support); previously trivial (gap 8: English spelling reads SCOWL 2026, one dictionary per English, #40, #520, #5205; no ranked gap changed);; previously trivial (DOCX table rows and cells inside selected alternate-content branches survive open and repeated saves (#5219); broader corpus qualification and readiness estimates unchanged); previously trivial (#26 narrowed: MHT opens and `w:altChunk` content is brought in on open; saving MHT remains) previously trivial (gap 8 points at craft-proof in craft-libs, its data in craft-i18n, #5202; no ranked gap changed); previously trivial (arrowheads keep their kind, width and length and are drawn at Word's sizes; no ranked gap changed); previously trivial (.doc default font from the stylesheet's standard font, #5066; no ranked gap changed); previously trivial (a middle or bottom cell of a row split across pages lines up on the first page; no ranked gap changed); previously trivial (tab leader dots spaced and placed as in Word; no ranked gap changed); previously trivial (a list level above counts its first number at the first deeper item; no ranked gap changed); previously trivial (only the PDF sent to the printer leaves out link annotations; Save these pages as PDF keeps them, #4734; no ranked gap changed); previously trivial (documents with links print: the print job leaves out link annotations, #4734; no ranked gap changed; previously trivial: aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion reference-run membership uses one ordered walk, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (gap 19: RTF reads and writes WMF and EMF pictures, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (View windows: several open documents and Switch Windows in the engine; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: automatic Asian/Latin and Asian/number spacing laid out, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: numbered headings, #1793; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: #8 narrowed: Indonesian proofing from the installed Hunspell dictionary, #498; previously trivial: glossary/building blocks closed; previously trivial: Split Cells and Convert Text to Table follow the Word check, #2592; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: #29: a copied equation also goes in the MathML clipboard formats, #1297; previously trivial: #24: the Spike, Ctrl+F3 and Ctrl+Shift+F3; previously trivial: VML freeforms read and kept on save; previously trivial: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: copies keep their formatting on the clipboard as HTML, #1523; previously trivial: sample-text formulas on Enter, #1067; previously trivial: #29: copied equations as MathML, OMML open as #1297, #816; previously trivial: the Font list no longer keeps every previewed font in memory, #848; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: first version; every known shortfall from the 2026-10-10 re-measure, ranked) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 + +> **Page Setup update:** 2026-11-07 · Page Setup number boxes keep long input inside the field, including accepted margin values after focus leaves (#5650); accepted ranges and readiness estimates are unchanged. +> **Floating anchor row segments:** 2026-11-07 · A floating anchor after a manual page/column break counts visible content on the far side of the same wrapped row. Marker-only cover anchors retain their previous-page rule. Synthetic picture spacing, placement and history controls; no new native Word measurement. Readiness estimates unchanged. > **Highlight update:** 2026-10-25 · Highlight shortcut toggles the last chosen colour off when the whole selection has it; explicit colour commands remain setters (#4085). Readiness estimates unchanged. -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-29 · **Change:** trivial (aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (#15: bibliography sources keep a corporate author, #4848); previously trivial (Table Properties applies to the selected rows, columns and cells, #4857); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (#7: Custom Document Properties dialog, #2982; previously trivial: egui 0.37 migration: the interface catalogs stay shared and pinned by `craft-i18n.rev` at `9205108cfdced5177706264038848b68b2422d2b` (27 languages, English fallback); input-method handling has new regressions but managed CI passed, and native IME acceptance plus native-speaker catalog review remain open; previously trivial: Markdown code spans keep line-broken text literal, #3738; previously trivial: small follow-ups from the field, table and AutoFormat batch, #4232; previously trivial: highlight target includes selected paragraph marks, #4085; previously trivial: full-target highlight check beyond 10,000 runs, #4085; previously trivial: Exact-spacing table contact uses the specified line height rather than paragraph-mark metrics (#3977); previously trivial: cu20we: restrict pre-spacing float origins to paragraph anchors; document cap helpers and regressions; previously trivial: a command that changes nothing is not an edit: no undo step, no unsaved changes, no relayout, and the redo stack survives it; previously minor: #8 narrowed: Spanish proofing (Spain, Mexico, Latin America, Uruguay) from the installed Hunspell dictionaries, #3360, #3553; previously trivial: gap 10: group connector rerouting preserves transformed free and unresolved endpoints under nonuniform scaling; obstacle routing still missing; readiness estimates unchanged; previously trivial: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: the ranked gap list held two rows each for #19, #20 and #21; each gap appears once now; a document with many relationships opens in the time its part takes, #3411; previously trivial: the file commands that change the document are checked on a protected document, the protection of a protected document needs an explicit stop, the session author can't change through `file.setAuthor` under protection (the CLI's `--author` uses the same protection check), and the post-check compares the settings and the metadata; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: automatic Asian/Latin and Asian/number spacing laid out, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: numbered headings, #1793; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: #8 narrowed: Indonesian proofing from the installed Hunspell dictionary, #498; previously trivial: glossary/building blocks closed; previously trivial: Split Cells and Convert Text to Table follow the Word check, #2592; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: #29: a copied equation also goes in the MathML clipboard formats, #1297; previously trivial: #24: the Spike, Ctrl+F3 and Ctrl+Shift+F3; previously trivial: VML freeforms read and kept on save; previously trivial: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: copies keep their formatting on the clipboard as HTML, #1523; previously trivial: sample-text formulas on Enter, #1067; previously trivial: #29: copied equations as MathML, OMML open as #1297, #816; previously trivial: the Font list no longer keeps every previewed font in memory, #848; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: first version; every known shortfall from the 2026-10-10 re-measure, ranked) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** trivial (RTF footnotes, endnotes and comments, #1053); previously trivial (RTL paragraph direction in HTML/ODT/RTF implemented in #2695, pending merge); previously trivial (only the PDF sent to the printer leaves out link annotations; Save these pages as PDF keeps them, #4734; no ranked gap changed); previously trivial (Windows print submissions use isolated helpers so a cancelled driver cannot block a retry, #5710); previously trivial (print cancellation remains available without a document; sending-boundary limitation clarified, #5710); previously trivial (built-in citation source lookups, #4888; current-main progress records retained); previously trivial (aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (#15: bibliography sources keep a corporate author, #4848); previously trivial (Table Properties applies to the selected rows, columns and cells, #4857); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (#7: Custom Document Properties dialog, #2982; previously trivial: egui 0.37 migration: the interface catalogs stay shared and pinned by `craft-i18n.rev` at `9205108cfdced5177706264038848b68b2422d2b` (27 languages, English fallback); input-method handling has new regressions but managed CI passed, and native IME acceptance plus native-speaker catalog review remain open; previously trivial: Markdown code spans keep line-broken text literal, #3738; previously trivial: small follow-ups from the field, table and AutoFormat batch, #4232; previously trivial: highlight target includes selected paragraph marks, #4085; previously trivial: full-target highlight check beyond 10,000 runs, #4085; previously trivial: Exact-spacing table contact uses the specified line height rather than paragraph-mark metrics (#3977); previously trivial: cu20we: restrict pre-spacing float origins to paragraph anchors; document cap helpers and regressions; previously trivial: a command that changes nothing is not an edit: no undo step, no unsaved changes, no relayout, and the redo stack survives it; previously minor: #8 narrowed: Spanish proofing (Spain, Mexico, Latin America, Uruguay) from the installed Hunspell dictionaries, #3360, #3553; previously trivial: gap 10: group connector rerouting preserves transformed free and unresolved endpoints under nonuniform scaling; obstacle routing still missing; readiness estimates unchanged; previously trivial: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: the ranked gap list held two rows each for #19, #20 and #21; each gap appears once now; a document with many relationships opens in the time its part takes, #3411; previously trivial: the file commands that change the document are checked on a protected document, the protection of a protected document needs an explicit stop, the session author can't change through `file.setAuthor` under protection (the CLI's `--author` uses the same protection check), and the post-check compares the settings and the metadata; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: automatic Asian/Latin and Asian/number spacing laid out, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: numbered headings, #1793; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: #8 narrowed: Indonesian proofing from the installed Hunspell dictionary, #498; previously trivial: glossary/building blocks closed; previously trivial: Split Cells and Convert Text to Table follow the Word check, #2592; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: #29: a copied equation also goes in the MathML clipboard formats, #1297; previously trivial: #24: the Spike, Ctrl+F3 and Ctrl+Shift+F3; previously trivial: VML freeforms read and kept on save; previously trivial: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: copies keep their formatting on the clipboard as HTML, #1523; previously trivial: sample-text formulas on Enter, #1067; previously trivial: #29: copied equations as MathML, OMML open as #1297, #816; previously trivial: the Font list no longer keeps every previewed font in memory, #848; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: first version; every known shortfall from the 2026-10-10 re-measure, ranked) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> +> **Recipient CSV update:** 2026-10-27 · Complete quoted header records choose the delimiter (#4249); detection and regressions follow the current mailings module split. Recipient limits and readiness estimates are unchanged. +> +> **Headered CSV prefix update:** 2026-10-31 · Unquoted whitespace-only prefix lines are skipped before choosing recipient headers (#4249); quoted whitespace headers, headerless records, the shared CSV reader and recipient limits remain unchanged. + Recovery discovery no longer interrupts an explicitly created or opened document. Older copies remain in File › Recover, whose buttons use the interface palette. See [local recovery](recovery.md). Group connectors (gap 10): re-routing preserves displayed rotated and flipped free endpoints after unit, uniform or nonuniform group scaling, including ends whose target shape or site cannot be resolved. Glued endpoints still use their existing connection-site path. Degenerate display scales that cannot be inverted, or fallback spans exceeding the renderer's 4000 pt child-size cap, leave connectors needing fallback endpoints unchanged; fully resolved connectors still reroute. Invalid child extents retain the renderer's unit-scale fallback. Model and engine regressions cover this geometry and guard against nonfinite coordinate writes and repeated shrinkage at the display cap; routing around shapes remains missing, with no new native Word comparison. > **Printing update:** 2026-10-12 · direct desktop printing through craft-print; details below. +Table Sort rejects invalid explicit column selectors instead of silently sorting another column (#5531). This command-boundary correction leaves the ranked gaps and readiness estimates unchanged. + The work list. One entry per shortfall, ranked by how much it stops a Word user from switching (**B** = blocks beta). Each says what's missing, the evidence, who it hurts, an Opus 5.5 agent wall-clock estimate, and which parity document tracks it. Agents: pick from the top, check open PRs @@ -26,6 +37,8 @@ An otherwise empty section at page start retains its line before continuous cont Consistent cell widths override stale table grid proportions when their totals agree. Conflicting widths, spans and percentages still need the shared-grid algorithm. +Protected typing boundary discovery (#3614) counts earlier objects once and uses an editable-ID set when moving through consecutive permission markers. Permission matching, protection enforcement and saved formats are unchanged. This narrows gap #3; broader stability and mutation costs remain. + Local desktop recovery now covers unsaved drafts and edits to existing files; see [recovery.md](recovery.md). This narrows gap #3 but does not resolve the crash/hang reports or establish cross-platform reliability. @@ -48,6 +61,8 @@ Legacy Word imports (#2445): interactive Save for `.doc`/`.dot` uses the existin Document model hangs (#3614, #3692): paragraph object walks, image deduplication, linear-equation letter runs and text box paste no longer do quadratic work or unbounded copies on hostile files. This narrows gap #3; the engine, DOCX reader and UI loops named in #3614 remain. +Print Markup text-copy exports also walk paragraph objects once when collecting comment quotes (#3614). Body/table traversal, quote limits, reply order and exported text remain unchanged. Other engine, reader and UI scans remain separate. + Active footnote and endnote text stays readable while editing (#2545). This fixes a display-context defect; the broader fidelity, accessibility and readiness gates below are unchanged. Russian language-aware sorting now keeps ё with е instead of after я, with the diaeresis as a secondary difference. Composed and decomposed ё and й compare equally. Fixed synthetic collation tests cover order, case and index headings; this does not establish full Cyrillic or CLDR collation parity. @@ -60,39 +75,49 @@ Set Proofing Language › Set As Default now persists in user preferences and ap Text context menus now include the existing formatting mini toolbar (#2959), including at a caret. Object, equation and whole-cell menus keep their own controls; Read Mode and the mini-toolbar preference suppress it. The toolbar reuses the selection toolbar's commands; additional controls from Word's toolbar are not added. Context-menu paste choices remain tracked by #2583 / PR #2599. +Page drawing indexes text-box warp lookups by paragraph and story for the current call (#3614). Ordinary text boxes no longer rescan every preceding marker to find that they have no warp. Only requested offsets are retained; traversal stops after the last requested character. Original Linux display and save/reopen checks cover the correction; other drawing and command scans remain open. Gap and readiness estimates are unchanged. + ## Ranked | # | Gap | B | Evidence | Impact | Hours | Doc | |---|---|---|---|---|---|---| | 1 | **DOCX never tested on real-world files.** No corpus of files from Word, Google Docs, LibreOffice and Pages has been opened, rendered and round-tripped and compared with Word page by page | B | No corpus in the repo; `crates/docx/tests` are synthetic fixtures (including omitted/empty paragraph defaults and imported TOC range preservation); "DOCX fidelity corpus: not started" since 2026-10-06. Field reports fixed one by one: a cover page's theme-coloured shapes (#611), freeforms inside groups and text-box margins and Resize to fit (#743), shape gradients and transparency (#1500), cover-page positions relative to the page and freeforms drawn back to their start (#743), Word's text watermark in headers, read and written (#1290), VML freeform rule lines in headers, and `flowChartOr` drawn with its spokes (#1644); explicit DrawingML outline dashes and flat/square/round caps preserved; paragraph-relative header/footer/cell/text-box float origins corrected (cu20we, synthetic regressions) | Everyone: the files people receive are the files that break | 30–50 | [file-format-parity.md](file-format-parity.md) | | 3 | **Crashes and freezes in the field**: startup crash on Intel UHD Graphics (#170, open), a crash on macOS 12.7.6 Intel (#979, open) (lag on GPUs without a DirectX 12 driver fixed, #316; 32-bit Windows exited at launch because DirectX 12 graphics pipeline creation failed, now OpenGL), freezes (#59 Thai fonts and #31 font selector, both open; #77 closed), broken shape tool (#142, open); the Windows 11 no-write-without-admin (#218) and unmovable images (#82) reports are closed (pictures and shapes in Behind Text drag through the text over them, #1313); memory growth on every font change fixed (#848: the font list no longer loads each family it previews) | B | 197 open issues (2026-10-12), among them the crash and freeze reports #170, #979, #59 and #31 | Anyone hit loses work or trust; the never-crash standard covers panics, not hangs or GPU driver faults | 20–30 | [target-app-parity.md](target-app-parity.md) (Stability) | -| 4 | **Pagination differs from Word**: Aptos has no metric-matched substitute; legacy compatibility options only partially covered; no page-by-page comparison harness | B | SECTIONPAGES now counts shared continuous-section pages in body and header/footer fields; legacy same-style cell spacing preserved for measured modes 11/12/14, with mode 15 and non-cell controls; Contextual spacing corrected in body/header probes and repeated table-cell runs; [layout-parity.md](layout-parity.md); [typing-parity.md](typing-parity.md) Known gaps; non-overlapping body floating tables clear header tables; stray labels on page-break-only list paragraphs fixed multi-paragraph field-code blank lines fixed; centred numbered heading labels after leading page breaks fixed (#2964); Arial Unicode MS no longer selects monospace substitutes; a slash opening a word travels whole to the next line (#2963) A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, so a TOC entry's page number keeps its leader (#1840). | Page counts and line breaks differ, which matters for forms, legal and academic work | 30–50 + owner (font) | [layout-parity.md](layout-parity.md) | +| 4 | **Pagination differs from Word**: Aptos has no metric-matched substitute; legacy compatibility options only partially covered; no page-by-page comparison harness | B | In-line pictures raised or lowered (`w:position`) set their line's height as in Word, past their own height too (#3984, #5796). SECTIONPAGES now counts shared continuous-section pages in body and header/footer fields; legacy same-style cell spacing preserved for measured modes 11/12/14, with mode 15 and non-cell controls; Contextual spacing corrected in body/header probes and repeated table-cell runs; [layout-parity.md](layout-parity.md); [typing-parity.md](typing-parity.md) Known gaps; non-overlapping body floating tables clear header tables; stray labels on page-break-only list paragraphs fixed multi-paragraph field-code blank lines fixed; centred numbered heading labels after leading page breaks fixed (#2964); Arial Unicode MS no longer selects monospace substitutes; a slash opening a word travels whole to the next line (#2963) A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, so a TOC entry's page number keeps its leader (#1840). A floating object anchored on a later page of a long paragraph is drawn on that page, also when footnotes or widow control move its line on (#4250). Fonts the document uses that aren't installed are flagged in the font box and status bar, except those drawn in a metric-compatible substitute (Carlito for Calibri, Liberation Sans for Arial) and symbol-font text (Symbol, Wingdings, Webdings), so the user knows when line breaks can differ from where the document was made; `font.missing` lists the substituted fonts in the text the current view lays out (capped, for hostile documents), marking the metric-compatible ones `metricCompatible`. | Page counts and line breaks differ, which matters for forms, legal and academic work | 30–50 + owner (font) | [layout-parity.md](layout-parity.md) | +| 4 | **Pagination differs from Word**: Aptos has no metric-matched substitute; legacy compatibility options only partially covered; no page-by-page comparison harness | B | SECTIONPAGES now counts shared continuous-section pages in body and header/footer fields; legacy same-style cell spacing preserved for measured modes 11/12/14, with mode 15 and non-cell controls; Contextual spacing corrected in body/header probes and repeated table-cell runs; [layout-parity.md](layout-parity.md); [typing-parity.md](typing-parity.md) Known gaps; non-overlapping body floating tables clear header tables; stray labels on page-break-only list paragraphs fixed multi-paragraph field-code blank lines fixed; centred numbered heading labels after leading page breaks fixed (#2964); Arial Unicode MS no longer selects monospace substitutes; a slash opening a word travels whole to the next line (#2963) A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, so a TOC entry's page number keeps its leader (#1840). A floating object anchored on a later page of a long paragraph is drawn on that page, also when footnotes or widow control move its line on (#4250); one anchored right after a page break, before text, is drawn on the new page (#4262). Fonts the document uses that aren't installed are flagged in the font box and status bar, except those drawn in a metric-compatible substitute (Carlito for Calibri, Liberation Sans for Arial) and symbol-font text (Symbol, Wingdings, Webdings), so the user knows when line breaks can differ from where the document was made; `font.missing` lists the substituted fonts in the text the current view lays out (capped, for hostile documents), marking the metric-compatible ones `metricCompatible`. | Page counts and line breaks differ, which matters for forms, legal and academic work | 30–50 + owner (font) | [layout-parity.md](layout-parity.md) | +| 4 | **Pagination differs from Word**: Aptos has no metric-matched substitute; legacy compatibility options only partially covered; no page-by-page comparison harness | B | SECTIONPAGES now counts shared continuous-section pages in body and header/footer fields; legacy same-style cell spacing preserved for measured modes 11/12/14, with mode 15 and non-cell controls; Contextual spacing corrected in body/header probes and repeated table-cell runs; [layout-parity.md](layout-parity.md); [typing-parity.md](typing-parity.md) Known gaps; non-overlapping body floating tables clear header tables; stray labels on page-break-only list paragraphs fixed multi-paragraph field-code blank lines fixed; centred numbered heading labels after leading page breaks fixed (#2964); Arial Unicode MS no longer selects monospace substitutes; a slash opening a word travels whole to the next line (#2963) A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, so a TOC entry's page number keeps its leader (#1840). Page break before now applies at a continuous section's mid-page top (#5287); the later-column case remains unmeasured in Word. | Page counts and line breaks differ, which matters for forms, legal and academic work | 30–50 + owner (font) | [layout-parity.md](layout-parity.md) | +| 4 | **Pagination differs from Word**: Aptos has no metric-matched substitute; legacy compatibility options only partially covered; no page-by-page comparison harness | B | SECTIONPAGES now counts shared continuous-section pages in body and header/footer fields; legacy same-style cell spacing preserved for measured modes 11/12/14, with mode 15 and non-cell controls; Contextual spacing corrected in body/header probes and repeated table-cell runs; [layout-parity.md](layout-parity.md); [typing-parity.md](typing-parity.md) Known gaps; non-overlapping body floating tables clear header tables; stray labels on page-break-only list paragraphs fixed multi-paragraph field-code blank lines fixed; centred numbered heading labels after leading page breaks fixed (#2964); Arial Unicode MS no longer selects monospace substitutes; a slash opening a word travels whole to the next line (#2963); a hyphen before a slash and a letter is also a break opportunity (#3408), while a hyphen before a slash and a digit stays whole A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, so a TOC entry's page number keeps its leader (#1840). | Page counts and line breaks differ, which matters for forms, legal and academic work | 30–50 + owner (font) | [layout-parity.md](layout-parity.md) | +| 4 | **Pagination differs from Word**: Aptos has no metric-matched substitute; legacy compatibility options only partially covered; no page-by-page comparison harness | B | SECTIONPAGES now counts shared continuous-section pages in body and header/footer fields; legacy same-style cell spacing preserved for measured modes 11/12/14, with mode 15 and non-cell controls; Contextual spacing corrected in body/header probes and repeated table-cell runs; [layout-parity.md](layout-parity.md); [typing-parity.md](typing-parity.md) Known gaps; non-overlapping body floating tables clear header tables; stray labels on page-break-only list paragraphs fixed multi-paragraph field-code blank lines fixed; centred numbered heading labels after leading page breaks fixed (#2964); Arial Unicode MS no longer selects monospace substitutes; a slash opening a word travels whole to the next line (#2963); a nested table's Can't Split row moves on with its outer row when the row splits across pages (#5456) A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, so a TOC entry's page number keeps its leader (#1840). | Page counts and line breaks differ, which matters for forms, legal and academic work | 30–50 + owner (font) | [layout-parity.md](layout-parity.md) | +| 4 | **Pagination differs from Word**: Aptos has no metric-matched substitute; legacy compatibility options only partially covered; no page-by-page comparison harness | B | SECTIONPAGES now counts shared continuous-section pages in body and header/footer fields; legacy same-style cell spacing preserved for measured modes 11/12/14, with mode 15 and non-cell controls; Contextual spacing corrected in body/header probes and repeated table-cell runs; [layout-parity.md](layout-parity.md); [typing-parity.md](typing-parity.md) Known gaps; non-overlapping body floating tables clear header tables; stray labels on page-break-only list paragraphs fixed multi-paragraph field-code blank lines fixed; centred numbered heading labels after leading page breaks fixed (#2964); Arial Unicode MS no longer selects monospace substitutes; a slash opening a word travels whole to the next line (#2963); a hyphen before a slash and a letter is also a break opportunity (#3408), while a hyphen before a slash and a digit stays whole; a full stop followed by an opening parenthesis stays on one line (#5437) A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, so a TOC entry's page number keeps its leader (#1840). | Page counts and line breaks differ, which matters for forms, legal and academic work | 30–50 + owner (font) | [layout-parity.md](layout-parity.md) | +| 4 | **Pagination differs from Word**: Aptos has no metric-matched substitute; legacy compatibility options only partially covered; no page-by-page comparison harness | B | In-line pictures raised or lowered (`w:position`) set their line's height as in Word, past their own height too (#3984, #5796). SECTIONPAGES now counts shared continuous-section pages in body and header/footer fields; legacy same-style cell spacing preserved for measured modes 11/12/14, with mode 15 and non-cell controls; Contextual spacing corrected in body/header probes and repeated table-cell runs; a cell's last Normal paragraph drops its contextual space after (#5450); [layout-parity.md](layout-parity.md); [typing-parity.md](typing-parity.md) Known gaps; non-overlapping body floating tables clear header tables; stray labels on page-break-only list paragraphs fixed multi-paragraph field-code blank lines fixed; centred numbered heading labels after leading page breaks fixed (#2964); Arial Unicode MS no longer selects monospace substitutes; a slash opening a word travels whole to the next line (#2963) A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, so a TOC entry's page number keeps its leader (#1840). A floating object anchored on a later page of a long paragraph is drawn on that page, also when footnotes or widow control move its line on (#4250). Fonts the document uses that aren't installed are flagged in the font box and status bar, except those drawn in a metric-compatible substitute (Carlito for Calibri, Liberation Sans for Arial) and symbol-font text (Symbol, Wingdings, Webdings), so the user knows when line breaks can differ from where the document was made; `font.missing` lists the substituted fonts in the text the current view lays out (capped, for hostile documents), marking the metric-compatible ones `metricCompatible`. | Page counts and line breaks differ, which matters for forms, legal and academic work | 30–50 + owner (font) | [layout-parity.md](layout-parity.md) | +| 4 | **Pagination differs from Word**: Aptos has no metric-matched substitute; legacy compatibility options only partially covered; no page-by-page comparison harness | B | SECTIONPAGES now counts shared continuous-section pages in body and header/footer fields; legacy same-style cell spacing preserved for measured modes 11/12/14, with mode 15 and non-cell controls; Contextual spacing corrected in body/header probes and repeated table-cell runs; a cell's last Normal paragraph drops its contextual space after (#5450); [layout-parity.md](layout-parity.md); [typing-parity.md](typing-parity.md) Known gaps; non-overlapping body floating tables clear header tables; stray labels on page-break-only list paragraphs fixed multi-paragraph field-code blank lines fixed; centred numbered heading labels after leading page breaks fixed (#2964); Arial Unicode MS no longer selects monospace substitutes; a slash opening a word travels whole to the next line (#2963) A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, so a TOC entry's page number keeps its leader (#1840). A floating object anchored on a later page of a long paragraph is drawn on that page, also when footnotes or widow control move its line on (#4250); one anchored right after a page break, before text, is drawn on the new page (#4262). Fonts the document uses that aren't installed are flagged in the font box and status bar, except those drawn in a metric-compatible substitute (Carlito for Calibri, Liberation Sans for Arial) and symbol-font text (Symbol, Wingdings, Webdings), so the user knows when line breaks can differ from where the document was made; `font.missing` lists the substituted fonts in the text the current view lays out (capped, for hostile documents), marking the metric-compatible ones `metricCompatible`. | Page counts and line breaks differ, which matters for forms, legal and academic work | 30–50 + owner (font) | [layout-parity.md](layout-parity.md) | | 2 | **Word's native ink is not drawn from its strokes**; OLE objects show only their picture | B | Every native ink form is preserved: drawing-level ink with its optional picture fallback, direct run-level content parts, and ink members of groups and drawing canvases (kept in their place among the members, drawn from their fallback picture). Drawing canvases are read and written (#344); group shapes (`wpg`) read and written (#267). Charts and SmartArt are drawn (#292) and, with OLE objects, written back with all their parts on save (#319) | Pen notes from Word show only as their picture and can't be edited; OLE objects can't be opened | 45–70 to render and edit charts and SmartArt (#13) | [file-format-parity.md](file-format-parity.md) | | 5 | **Content controls** landed (#381): `w:sdt` kept, shown and edited (Developer tab, Design Mode, Properties). Move tracking landed (#400): `w:moveFrom`/`w:moveTo` with their named ranges round-trip, a tracked cut and paste of a paragraph or sentence records a move, either end accepts/rejects both, green double strike/underline markup and "Moved from/to" balloons; Track Changes Options has the Moves rows (Moved from / Moved to mark and colour) and `w:doNotTrackMoves` (Track moves off: a cut and paste is a deletion and an insertion) round-trips; still missing: drag-and-drop moves (no text drag yet). Formatting revisions landed (#41): `w:rPrChange`/`w:pPrChange`/`w:tblPrChange`/`w:trPrChange`/`w:tcPrChange`/`w:sectPrChange`/`w:numberingChange` round-trip, are recorded while tracking, accepted/rejected and shown in balloons; still missing: tracked style-definition changes (table, row, cell and section property changes now record in WordCraft too, #41 follow-up). Opaque custom XML backing stores now survive saves; binding evaluation remains absent. Replace All now checks content-control locks before editing any match; a refused batch preserves the document and undo history. | B | List-label pitch corrected in synthetic metric controls; Issues #41, #400; source grep | Legal and editorial review workflows; templates with form controls | 5–8 | [file-format-parity.md](file-format-parity.md) | -| 6 | **Print dialog depth**: desktop printer choice, copies, collation, duplex and grayscale submit through craft-print; File › Print retains preview, page ranges and odd/even (#641) and scales pages to another paper size (#2108); driver tray/options and pages per sheet remain; web prints through the browser (#209) | B | `ui.print` → `apps/wordcraft/src/print.rs`; issue #15 | Everyone who prints | 5–8 | [hardware-parity.md](hardware-parity.md) | +| 6 | **Print dialog depth**: desktop printer choice, copies, collation, duplex and grayscale submit through craft-print; File › Print retains preview, page ranges and odd/even (#641) and scales pages to another paper size (#2108); print-only N-up and booklets are available; driver tray/options remain; web prints through the browser (#209) | B | `ui.print` → `apps/wordcraft/src/print.rs`; issue #15 | Everyone who prints | 5–8 | [hardware-parity.md](hardware-parity.md) | | 7 | **Dialog depth**: Word-observed spelling/grammar task pane added (shared review commands, current-story traversal; see [spelling-review.md](spelling-review.md)); 61 modal dialogs vs Word's ~100 (Custom Document Properties from File › Info, #2982; Drop Cap Options matches Word's menu and dialog; Split Cells and Convert Text to Table match Word's observed limits and defaults; Format Page Numbers carries Word's number formats and Continue from previous section / Start at, #1113) | B | `Dialog` enum in `crates/ui-egui/src/dialogs.rs`; Cell Margins (#1960) now opens with current defaults and applies only confirmed edits | Power users reach for dialogs the ribbon alone doesn't cover | 11–19 | [ui-parity.md](ui-parity.md) | | 9 | **Password-protected `.doc` files with an AES header in the Word 97-2003 format** can't be opened: [MS-OFFCRYPTO] defines AES only for encrypted packages, so these are refused with a clear message. Encrypted packages open under any Word extension (`.docx`, `.doc`, `.dot`…) with either agile (Word 2010+) or Standard (Word 2007, AES-ECB) encryption; protected `.docx` saves with agile encryption (#55, #281, gap 9) | | `crates/docx/src/crypt.rs` (agile and Standard); `crates/docbin/src/crypt.rs` opens XOR/RC4/RC4 CryptoAPI `.doc` with a password (#1079). All synthetic fixtures; untested on Word-written files | Corporate and legal users with old files | 0 (refused by design; nothing left to build) | [file-format-parity.md](file-format-parity.md) | -| 8 | **Proofing covers English, Polish, Portuguese, Italian, Croatian, Turkish, Russian, Czech, Indonesian and Spanish only**; no dictionaries or grammar for the other ~41 languages Word proofs (text in them is left unmarked), and no hyphenation for them except Bulgarian and German | | craft-proof (storytold/craft-libs `crates/proof`, data in craft-i18n `language-data/`) `ProofLang::PROOFED`: English (American, British-spelling and Canadian, each checked against its own SCOWL 2026 dictionary and flagging the other's spellings, #1281, #40, #520), Polish, Portuguese (pt-BR via the installed VERO dictionary, #797), Italian (it-IT via the installed Hunspell dictionary), Croatian (hr-HR, 2026-10-13), Turkish (tr_TR spelling, grammar, TDK hyphenation, 2026-10-13) Russian (the installed `ru_RU` dictionary, 2026-10-12) Indonesian (the installed `id_ID` dictionary, #498, 2026-10-16) and Spanish (es-ES, es-MX, es-419 and es-UY via the installed RLA-ES dictionaries, Uruguayan `vos` forms, #3360, #3553, 2026-10-22), a language per run; Bulgarian (#826) and German (TeX patterns, 2026-10-14) have hyphenation only; open PRs add Danish (#723), Russian (#894) and Czech (#1048); Word ships 120 proofing tools; issues #25, #100 open. **Language packs** (CP4, 2026-11-01): a pack per locale (spelling dictionary, hyphenation, licence texts) installs from File › Options › Language or the missing-pack bar through the font store and is read at once; language-packs-1 (pinned, 61 packs) has Lithuanian [#4707](https://github.com/storytold/wordcraft/issues/4707), Romanian [#3438](https://github.com/storytold/wordcraft/issues/3438), Catalan [#2895](https://github.com/storytold/wordcraft/issues/2895)/[#4947](https://github.com/storytold/wordcraft/issues/4947), French [#1325](https://github.com/storytold/wordcraft/issues/1325), Greek [#2561](https://github.com/storytold/wordcraft/issues/2561), Slovak [#3806](https://github.com/storytold/wordcraft/issues/3806), Serbian [#4968](https://github.com/storytold/wordcraft/issues/4968) and Latvian [#4438](https://github.com/storytold/wordcraft/issues/4438), with Polish, Portuguese, Italian, Russian, Czech, Spanish, Bulgarian, Bosnian, Slovenian and the rest; Dutch [#4145](https://github.com/storytold/wordcraft/issues/4145)/[#2505](https://github.com/storytold/wordcraft/issues/2505), German, Danish, Swedish, Norwegian, Hungarian and the other compounding languages are packs in language-packs-2 (craft-proof's flag-based compounding, storytold/craft-libs#497); Mongolian waits on faster suggestions, Thai on word segmentation, and Basque, Ukrainian and Uyghur are excluded on licence grounds (see [installing languages](spelling-dictionaries.md#language-packs)) | Every writer outside English, Polish, Portuguese, Italian, Croatian, Turkish, Russian, Czech, Indonesian and Spanish | 20–40 | [localization-parity.md](localization-parity.md) | -| 10 | **Objects**: text in a freely rotated text box (free rotation and flips landed, #332; live rotation preview while dragging fixed for pictures and shapes without text stories, #2277; text direction, alignment and linked text boxes landed, #369; contour wrap and wrap side landed, #354), shape effects, WordArt 3-D effects and connector routing around shapes (WordArt effects and warps and glued connectors landed, #416), dragging members inside a Drawing Canvas (the canvas landed, #344) | | [parity-checklist.md](parity-checklist.md) (Shape Format 11/11, Layout 22/22); group and ungroup landed (#267) | Newsletters, flyers, reports with diagrams | 20–30 | [target-app-parity.md](target-app-parity.md) | -| 11 | **Interface languages**: 2 of the 12 key languages missing (hi, id) and pt-PT (Arabic landed with a mirrored shell, #1195; French landed, #729; Vietnamese, #1434; Korean, #1216; 28 interface languages in `crates/ui-egui/src/i18n`); open PRs for Indonesian (#572), pt-PT (#1028) and Hebrew with RTL (#20); ~5% of strings still English in the translated catalogs | | [localization-parity.md](localization-parity.md) | Most of the world's writers | 40–70 | [localization-parity.md](localization-parity.md) | +| 8 | **Built-in proofing covers English, Polish, Portuguese, Italian, Croatian, Turkish, Russian, Czech, Indonesian and Spanish only**; the other languages Word proofs get spelling and their own hyphenation only from an installed Language pack (without one their text is left unmarked and hyphenated with the English patterns; Bulgarian and German have their own), and none of them has grammar rules | | craft-proof (storytold/craft-libs `crates/proof`, data in craft-i18n `language-data/`) `ProofLang::PROOFED`: English (American, British-spelling and Canadian, each checked against its own SCOWL 2026 dictionary and flagging the other's spellings, #1281, #40, #520), Polish, Portuguese (pt-BR via the installed VERO dictionary, #797), Italian (it-IT via the installed Hunspell dictionary), Croatian (hr-HR, 2026-10-13), Turkish (tr_TR spelling, grammar, TDK hyphenation, 2026-10-13) Russian (the installed `ru_RU` dictionary, 2026-10-12) Indonesian (the installed `id_ID` dictionary, #498, 2026-10-16) and Spanish (es-ES, es-MX, es-419 and es-UY via the installed RLA-ES dictionaries, Uruguayan `vos` forms, #3360, #3553, 2026-10-22), a language per run; Bulgarian (#826) and German (TeX patterns, 2026-10-14) have hyphenation only; open PRs add Danish (#723), Russian (#894) and Czech (#1048); Word ships 120 proofing tools; issues #25, #100 open. **Language packs** (CP4, 2026-11-01): a pack per locale (spelling dictionary, hyphenation, licence texts) installs from File › Options › Language or the missing-pack bar through the font store and is read at once (the bar offers a language before the list is fetched, and the caret's typing language counts); language-packs-1 (pinned, 61 packs) has Lithuanian [#4707](https://github.com/storytold/wordcraft/issues/4707), Romanian [#3438](https://github.com/storytold/wordcraft/issues/3438), Catalan [#2895](https://github.com/storytold/wordcraft/issues/2895)/[#4947](https://github.com/storytold/wordcraft/issues/4947), French [#1325](https://github.com/storytold/wordcraft/issues/1325), Greek [#2561](https://github.com/storytold/wordcraft/issues/2561), Slovak [#3806](https://github.com/storytold/wordcraft/issues/3806), Serbian [#4968](https://github.com/storytold/wordcraft/issues/4968) and Latvian [#4438](https://github.com/storytold/wordcraft/issues/4438), with Polish, Portuguese, Italian, Russian, Czech, Spanish, Bulgarian, Bosnian, Slovenian and the rest; Dutch [#4145](https://github.com/storytold/wordcraft/issues/4145)/[#2505](https://github.com/storytold/wordcraft/issues/2505), German, Danish, Swedish, Norwegian, Hungarian and the other compounding languages are packs in language-packs-2 (craft-proof's flag-based compounding, storytold/craft-libs#497); Mongolian waits on faster suggestions, Thai on word segmentation, and Basque, Ukrainian and Uyghur are excluded on licence grounds (see [installing languages](spelling-dictionaries.md#language-packs)) | Every writer outside English, Polish, Portuguese, Italian, Croatian, Turkish, Russian, Czech, Indonesian and Spanish | 20–40 | [localization-parity.md](localization-parity.md) | +| 10 | **Objects**: editing text in a freely rotated text box (its text is drawn turned; free rotation and flips landed, #332; live rotation preview while dragging fixed for pictures and shapes without text stories, #2277; text direction, alignment and linked text boxes landed, #369; contour wrap and wrap side landed, #354), shape effects, WordArt 3-D effects and connector routing around shapes (WordArt effects and warps and glued connectors landed, #416), picking several Drawing Canvas members at once and dragging one out of its canvas (the canvas landed, #344; its members are picked, moved, resized and formatted on their own, #2637); a turned inline picture whose file keeps no room for the turn keeps its line to its frame and is cut at the line, as in Word (landed) | | [parity-checklist.md](parity-checklist.md) (Shape Format 11/11, Layout 22/22); group and ungroup landed (#267) | Newsletters, flyers, reports with diagrams | 20–30 | [target-app-parity.md](target-app-parity.md) | +| 11 | **Interface languages**: 2 of the 12 key languages missing (hi, id) and pt-PT (Arabic landed with a mirrored shell, #1195; French landed, #729; Vietnamese, #1434; Korean, #1216; 28 interface languages in `crates/ui-egui/src/i18n`); its dialogs, tables and galleries read right to left too; open PRs for Indonesian (#572), pt-PT (#1028) and Hebrew with RTL (#20); ~5% of strings still English in the translated catalogs | | [localization-parity.md](localization-parity.md) | Most of the world's writers | 40–70 | [localization-parity.md](localization-parity.md) | | 12 | **Draw tab / ink**: pens, pencil, highlighter, eraser, Select and Hide Ink landed (#307); Lasso Select, Add Pen, Ink to Shape and Ink Replay landed (#395); Ink to Shape also recognises single-stroke arrows (a line plus a V head drawn in one stroke becomes a straight connector with an arrowhead); two-stroke arrows (a line and a separate V or closed-triangle head) and one-stroke arrows with a closed triangle head landed (#1778); missing: Ink to Math, pressure, rendering/editing Word's own ink (drawing-level and direct run-level InkML content parts now survive DOCX save) | | [parity-checklist.md](parity-checklist.md) (Draw 10/11) | Pen and tablet users | 4–8 | [hardware-parity.md](hardware-parity.md) | | 13 | **Charts and SmartArt editing** (editing charts and SmartArt from Word, more chart types and formatting) | | `insert.chart` and Chart Design basics landed (#409): WordCraft's own charts are editable; charts from Word stay read-only (no embedded-workbook editing), radar charts are drawn (#1890); no combo/3D/stock charts (charts of those types show a placeholder with their title and type, #998), axis or series formatting; Insert › SmartArt landed (#497) for graphics WordCraft makes | Reports and business documents | 35–55 | [target-app-parity.md](target-app-parity.md) | | 14 | **`.doc` can't be written; Word 6/95 files refused** | | `crates/docbin` is read-only | Users exchanging files with old Word or legacy systems | 25–40 | [file-format-parity.md](file-format-parity.md) | | 15 | **References depth**: no EndNote/Mendeley desktop integration (bibliography sources are saved in DOCX, #790; Zotero landed, #189; Word's own `Sources.xml` master list imports into Manage Sources, #2640) | | #790 stores sources in `customXml` and reads them back; `crates/zotero`; `references.sources` `import` reads a Word bibliography file (`b:Sources`) | Students and researchers | 3–6 | [target-app-parity.md](target-app-parity.md) | -| 16 | **Right-to-left completeness**: kashida, RTL in HTML/ODT/RTF; six still-open older RTL bug reports to re-verify after #207 (#211, #199, #66, #63, #48, #19; #215 is closed). RTL tables and sections landed (#362); mirrored Arabic UI landed (#1195); PDF export's Hebrew and Arabic text copies and searches as whole words (#1383) | | [layout-parity.md](layout-parity.md) | Arabic, Persian, Hebrew writers | 5–9 | [layout-parity.md](layout-parity.md) | +| 16 | **Right-to-left completeness** (letters join across a change of formatting since #4093): kashida; RTL in HTML/ODT/RTF implemented in #2695 (pending merge; the estimate drops from 5–9 to 4–8 once it merges); six still-open older RTL bug reports to re-verify after #207 (#211, #199, #66, #63, #48, #19; #215 is closed). RTL tables and sections landed (#362); mirrored Arabic UI landed (#1195); PDF export's Hebrew and Arabic text copies and searches as whole words (#1383) | | [layout-parity.md](layout-parity.md) | Arabic, Persian, Hebrew writers | 5–9 | [layout-parity.md](layout-parity.md) | | 17 | **East Asian typography**: hint-reliant DFKai-SB contours repaired (local Windows regression; no readiness estimate change); Asian Typography options (Phonetic Guide landed, #288; Enclose Characters landed, #297; document grid landed, #391; vertical text landed, #491) | | `para.asianTypography` is live (Paragraph dialog Asian Typography tab, #323), automatic Asian/Latin and Asian/number spacing is laid out (#2358), and no East Asian item is left in the catalog's missing list; the remaining depth is not measured | Chinese, Japanese and Korean documents | 11–19 | [layout-parity.md](layout-parity.md) | -| 19 | **RTF and ODT depth**: notes, comments, revisions (RTF and ODT insertions and deletions done; RTF paragraph-mark and character/paragraph formatting revisions done; RTF section/table and ODT formatting revisions left), sections (RTF and ODT import and export done, #1378, #1379), RTL. ODT sections landed on import (#1379): page-style changes and columned `text:section`s; ODT table column widths are read (they were dropped on every open). ODT export writes sections back (a master page per new-page section, a columned `text:section` per continuous one); RTF export writes every section (`\sect`, `\sectd`); RTF reads and writes WMF and EMF pictures (#4259) | | ~2,100 (RTF) and ~1,600 (ODT) lines in `crates/formats`; RTF code pages (#896) and page setup (#902), ODT page setup (#829) landed; open PRs: RTF notes and comments (#1056), ODT notes and comments (#1057), ODT headers and footers (#873) | Users exchanging with LibreOffice or older tools | 18–27 | [file-format-parity.md](file-format-parity.md) | +| 19 | **RTF and ODT depth**: notes and comments (done: RTF #1053), revisions (RTF and ODT insertions and deletions done; RTF paragraph-mark and character/paragraph formatting revisions done; ODT formatting revisions done; RTF section/table revisions left), sections (RTF and ODT import and export done, #1378, #1379), RTL. ODT is read and written nearly whole (~90%, see [file-format-parity.md](file-format-parity.md)): sections, headers and footers, page setup, styles (named paragraph and character styles), character and paragraph formatting, lists and heading numbering, tab stops, tables (borders, padding, alignment, width, row heights, header rows), notes, comments, tracked changes, fields (dates, sequences, chapters, references, index marks), bookmarks, tables of contents and indexes, pictures, text boxes, shapes, groups, rotation, strokes and gradients, equations, charts, embedded objects kept whole, form controls, ruby, drop caps, password protection, flat `.fodt`; checked against LibreOffice by round trips compared page by page and the ODF 1.3 schema. Left in ODT: turned characters (no Word equivalent), conditional text as fields (variables done, as SET/REF), control looks, drawing embedded spreadsheets' contents, dates in locales other than US English (`number:automatic-order`). Emphasis marks, fixed-width tables, tables starting a page, page background pictures, the default font size and styles turning things off are done. Checked against LibreOffice's 78 bundled templates as well as synthetic documents: all open and round-trip; placeholders, first-page styles, unsized pages, WMF/EMF logos and `.ott` templates done; what ODF leaves to the application is WordCraft's one choice for each case ([odf-interpretation.md](odf-interpretation.md)); WordCraft's own documents (templates, themes, every feature) saved as ODT open in LibreOffice with the same pages, valid against the ODF 1.3 schema, with table styles, SmartArt, watermarks and cell pictures kept; RTF export writes every section (`\sect`, `\sectd`); RTF reads and writes WMF and EMF pictures (#4259); an ODT saved without edits keeps what WordCraft doesn't model: unedited paragraphs, tables, named sections, indexes, forms, style definitions, page layouts and document properties are written back as read, checked by a no-edit loss test and a loss check over the corpus (left: paragraphs showing form controls are written from the model; every schema element audited in [odt-element-audit.md](odt-element-audit.md)) | | ~2,100 (RTF) and ~11,000 (ODT, plus ~7,000 of tests) lines in `crates/formats`; RTF code pages (#896) and page setup (#902) landed; RTF notes and comments landed (#1053) | Users exchanging with LibreOffice or older tools | 10–16 | [file-format-parity.md](file-format-parity.md) | | 18 | **Screen-reader access** to the document canvas: exposed, not yet tried with real screen readers | | The canvas describes paragraphs, headings, lists, tables, links, pictures and the caret to AccessKit (#488), tested headlessly; the ribbon's font name and size boxes, and the dropdown arrows beside them, say what they are (#3172); Windows Magnifier follows the caret, onto a new line too (#1119); no NVDA, VoiceOver or Orca run yet | Blind and low-vision users; public-sector procurement | 3–6 | [ui-parity.md](ui-parity.md) | -| 20 | **Performance on large real-world documents** unmeasured (500+ pages, many pictures) | | DOCX comment saves avoid repeated paragraph-ID and durable-ID reservation searches; large threaded-comment fixtures retain metadata through save/reopen. Only the 188-page sample benchmark; scrolling a 1,096-page one-table document went from ~600 ms to ~2–5 ms a frame (#811), but opening it still lays out for seconds; opening a document with pictures no longer copies them (92 MB with 20 pictures: about 90 MB less); opening a document with many relationships now costs the size of its part and not that size times the number of relationships (1024 relationships and a 64 MiB part: 224 s → 0.2 s, #3411); a word with no break opportunity in it no longer lays out quadratically (1 MiB: 29.4 s → 0.35 s, #3412); saving a document with many content controls now costs the time the controls take (32,000 controls: 3.6 s → 0.1 s, #13) | Thesis and book authors | 10–20 | [layout-parity.md](layout-parity.md) | +| 20 | **Performance on large real-world documents** unmeasured (500+ pages, many pictures) | | DOCX comment saves avoid repeated paragraph-ID and durable-ID reservation searches; large threaded-comment fixtures retain metadata through save/reopen. Only the 188-page sample benchmark; scrolling a 1,096-page one-table document went from ~600 ms to ~2–5 ms a frame (#811), but opening it still lays out for seconds; opening a document with pictures no longer copies them (92 MB with 20 pictures: about 90 MB less); opening a document with many relationships now costs the size of its part and not that size times the number of relationships (1024 relationships and a 64 MiB part: 224 s → 0.2 s, #3411); a word with no break opportunity in it no longer lays out quadratically (1 MiB: 29.4 s → 0.35 s, #3412); saving a document with many content controls now costs the time the controls take (32,000 controls: 3.6 s → 0.1 s, #13); repeated table headers are capped by item counts, the wrap cache by decoded pixels and linked text box layout by its lines, items and story text, and PDF export, hit testing, tracked changes, clipped tables and long endnote selections cost linear time (#3867, #3866; not measured on real documents) | Thesis and book authors | 10–20 | [layout-parity.md](layout-parity.md) | +| 20 | **Performance on large real-world documents** unmeasured (500+ pages, many pictures) | | DOCX comment saves avoid repeated paragraph-ID and durable-ID reservation searches; large threaded-comment fixtures retain metadata through save/reopen. Only the 188-page sample benchmark; scrolling a 1,096-page one-table document went from ~600 ms to ~2–5 ms a frame (#811), but opening it still lays out for seconds; opening a document with pictures no longer copies them (92 MB with 20 pictures: about 90 MB less); opening a document with many relationships now costs the size of its part and not that size times the number of relationships (1024 relationships and a 64 MiB part: 224 s → 0.2 s, #3411); a word with no break opportunity in it no longer lays out quadratically (1 MiB: 29.4 s → 0.35 s, #3412); saving a document with many content controls now costs the time the controls take (32,000 controls: 3.6 s → 0.1 s, #13); built-in citation refresh and first-cited bibliography ordering use temporary source and number indexes (#4888), retaining existing ordering and source metadata | Thesis and book authors | 10–20 | [layout-parity.md](layout-parity.md) | | 21 | **Mail merge data sources**: no Outlook/Contacts, Access or database sources, no email merge; CSV, typed lists (#247) and Excel/OpenDocument spreadsheets (#334, legacy .xls #778) only | | Select Recipients reads .csv/.tsv/.txt in any common encoding (UTF-8/16, GBK, Big5, Shift_JIS…), .xlsx/.xlsm, .xls and .ods; Edit Recipient List filters and sorts (#778), finds records and can show only the merged ones (#1576) | Office administrators | 4–8 | [target-app-parity.md](target-app-parity.md) | | 22 | **Ecosystem**: no VBA execution (macros preserved only), no Office add-ins, no cloud storage, no real-time co-authoring | | `.docm` keeps macros (#172) | Enterprise users with macro templates; teams | 40–80 + owner decisions | [target-app-parity.md](target-app-parity.md) | | 23 | **PDF Reflow** (open a PDF as an editable document, Word for Windows) | | | Users who edit PDFs they receive | 30–50 | [file-format-parity.md](file-format-parity.md) | | 24 | **Default shortcuts**: 140 (macOS) / 158 (Linux/Windows) of Word's ~250 (#330, #339, #343; Customize Keyboard #368, Customize Ribbon and Quick Access Toolbar #379; inspector, macros, strikethrough, file/edit keys, the Spike) | | [ui-parity.md](ui-parity.md) | Power users | 1–3 | [ui-parity.md](ui-parity.md) | | 25 | **In-app AI assistant** (Copilot-style draft, rewrite, summarize) | | Chat PR #178 and AI assistant PR #815 open | Users expecting Copilot | 15–30 + owner (provider) | [target-app-parity.md](target-app-parity.md) | -| 27 | **View windows**: Side by Side, Synchronous Scrolling, Arrange All; a window per open document (the engine holds several open documents and Switch Windows lists and switches them) | | [parity-checklist.md](parity-checklist.md) (View 26/29); PR #331 open | Comparing documents | 3–5 | [ui-parity.md](ui-parity.md) | +| 27 | **View windows**: Switch Windows, Arrange All, View Side by Side and Synchronous Scrolling work across the native windows, one per open document or New Window (#322). Left: Split is a placeholder; Wayland doesn't let apps place windows | | [parity-checklist.md](parity-checklist.md) (View 29/29 ids) | Comparing documents | 2–4 | [ui-parity.md](ui-parity.md) | | 26 | **Minor formats**: saving MHT, Works/WordPerfect | | Word XML Document (Flat OPC) opens and saves, Word 2003 XML opens (#548) and saves (#1081, not yet checked in Word); MHT opens and documents' `w:altChunk` content is brought in | Rare | 12–23 | [file-format-parity.md](file-format-parity.md) | | 28 | **Dictate** | | `tools.dictate` missing | Dictation users | 8–15 + owner (speech model) | [hardware-parity.md](hardware-parity.md) | -| 29 | **Equations**: ink equations; a copied equation pasting into Word as an editable equation, still to be confirmed (#816, #1297) | | #191 notes; long display equations wrap at operators (#326); a copy holding an equation puts MathML in HTML on the clipboard (#816), and a copy of one equation alone also its MathML in the "MathML" clipboard formats Word reads first (Windows, macOS; #1297; Word/LibreOffice paste not yet verified) | Maths-heavy documents | 2–3 | [layout-parity.md](layout-parity.md) | +| 29 | **Equations**: ink equations; a copied equation pasting into Word as an editable equation, still to be confirmed (#816, #1297) | | #191 notes; long display equations wrap at operators (#326); typed `\int`, `\sum`… + Space wait for their limits, and `\int_0^1` corrects on `_`, as observed in Word for Windows on #4938 (#4917); a copy holding an equation puts MathML in HTML on the clipboard (#816), and a copy of one equation alone also its MathML in the "MathML" clipboard formats Word reads first (Windows, macOS; #1297; Word/LibreOffice paste not yet verified) | Maths-heavy documents | 2–3 | [layout-parity.md](layout-parity.md) | **Beta needs #1–#7** (~150–230 h with the stability and layout work they imply): they are the blocking gaps, and closing them lifts file formats, layout, stability and UI enough to take the @@ -100,6 +125,8 @@ full number from ~60% to ~75%. Everything else is depth on the way to full parit > **Three-column preset update:** 2026-10-15 · the header/footer preset uses editable table cells and screen-only editing guides (#2197). Synthetic command, undo/redo and repeated DOCX save/reopen checks cover this preset; broader template/layout gaps and readiness estimates remain unchanged. +Normal Find and Replace now match a keyboard apostrophe against straight and typographic single quotes (#5388), including text entered with smart quotes. Exact search modes and numeric character codes retain their character identity. This fixes a focused editing case; ranked gaps and readiness estimates are unchanged. + ## By kind List toggles now recognise numbering inherited from paragraph styles (related to #3459). This closes that command-level case; the broader issue and readiness estimates are unchanged. See [typing-parity.md](typing-parity.md) for the original-fixture and round-trip coverage. @@ -115,11 +142,13 @@ The same gaps grouped the way the parity documents are, for agents working in on their formatting (system clipboard HTML/RTF), Merge Formatting keeps emphasis, Paste Special lists what the system clipboard holds, and Linux/Wayland clipboard pictures paste (#687, #833); - **UI/UX gaps:** #7, #18, #24; context menus for objects (the table's landed; it still lacks Border Styles); Linux title bar theming (#78); File › - still missing: the Paste Options button after a paste, and RTF on macOS and X11. Copy puts - HTML beside the text on the clipboard, so other programs keep the formatting (#1523), with - equations as MathML (#816), and a lone equation also in the MathML clipboard formats on - Windows and macOS (#1297; pasting into Word/LibreOffice not yet verified); RTF on the - clipboard is not written yet. + still missing: the Paste Options button after a paste. Copy puts HTML and RTF beside the text + on the clipboard, so other programs keep the formatting (#1523), with equations as MathML + (#816), and a lone equation also in the MathML clipboard formats on Windows and macOS (#1297; + pasting into Word/LibreOffice not yet verified); RTF is written on Windows, macOS and Wayland, + while an X11 copy still carries text and HTML only (arboard owns the selection there); a + copy of only pictures or shapes carries neither, so WordCraft pastes its own copy. Paste + reads RTF on all four. Options › Animation effects › Use system setting reads macOS (Reduce motion) and the Linux/BSD desktops (`apps/wordcraft/src/animations.rs`) but hasn't been tried on a Mac or in a real GNOME or KDE session yet. @@ -140,34 +169,100 @@ Small follow-ups from the 2026-10-25 field, table and AutoFormat batch (#4232): - AutoFormat's `*bold*` and `_italic_` don't convert when a closing bracket or quote follows the closing mark (`(*see note*)`): the trigger checks only space and `,.;:!?` (#4098). - The ribbon's Accept and Reject buttons only open their menus; Word's main half runs Accept (Reject) and Move to Next. The ribbon needs a big split button (Paste needs one too) (#4205). +Ink replay, eraser picking, lasso selection and arrow-candidate discovery reuse the paragraph prefixes they have already scanned (#3614). Page item order, stroke geometry and saved data retain their behavior. This narrows the stability work; ink import fidelity, native pen input and broader corpus qualification remain open. +MATH glyphs that reference the same construction now share its immutable variants and assembly data (#3630). Glyph mappings, values and the existing partial-record fallback stay unchanged. Repeated glyph IDs keep their last valid reference without retaining superseded constructions. Distinct overlapping constructions and assembly-only sharing remain separate. Recipient label generation (#4880) now includes all selected recipients across as many sheets as needed, retaining filtered/sorted order and the chosen product geometry. This fixes the one-sheet omission; Update Labels and Finish & Merge template behavior remain separate, and gap 21 remains open. Readiness estimates are unchanged. +File > Print offers 2, 4, 6, 9 or 16 logical pages per physical sheet side and left/right-bound booklets (#641). Preview and print PDF share the sheet plan, selected pages, parity, copy padding and markup geometry. Custom-range changes reset the preview to the first sheet; Print Markup invalidates preview layout and textures. Native jobs omit link annotations as required by upstream #4734, while saved print PDFs keep their remapped links. Native printing submits copies to the spooler without multiplying them in the PDF. Ordinary PDF export remains single-page by default. Translations are reviewed separately in craft-i18n#38. Physical-printer qualification and driver-specific options remain unverified. + Table rows and cells inside `mc:AlternateContent` use the same selected-branch policy as paragraphs and runs (#5219), rather than disappearing on open and save. Original synthetic fixtures cover Choice/Fallback selection, namespace aliases, mixed requirements, row/cell order and nested content controls through two DOCX saves. This fixes a focused preservation case; native Word and broader real-world corpus qualification remain open. +Page Setup's margin, paper-size and document-grid number boxes scroll long text inside the field instead of enlarging the dialog (#5650). Readiness estimates unchanged. Accepted long margin values also stay inside the field after focus leaves; their accepted range, units and parsing are unchanged. + ## Revision history +> 2026-11-03 · Section `w:chapStyle` values now preserve the complete unsigned-byte range, including 10; values above 255 are rejected. + +> 2026-11-05 · Gap 16: Arabic letters join across a change of formatting and past hidden or deleted text (#4093); readiness unchanged. +> +> 2026-11-03 · Gap 11: the Arabic dialogs, tables and galleries read right to left (rtl::Table); readiness unchanged. +> > 2026-10-27 · Technical synchronization: existing Proofing pane hooks and regression tests follow the extracted engine/UI modules on main `436d444`; compact context menus remain upstream. New-SHA validation is pending; readiness unchanged. > > 2026-10-23 · cu20we review follow-up: Only paragraph-relative box floats use the pre-spacing origin. Line-relative floats and page/margin fallbacks in cells and text boxes keep the text-top origin. Synthetic controls compare zero and 24 pt space-before across all four box contexts. New cap conversion helpers and regression tests document their contracts; readiness estimates unchanged. - +> > 2026-10-23 · cu20we: DrawingML flat, square and round line caps are imported, saved, displayed and exported to PDF; absent or unknown caps default to flat. VML end caps (including shapetype inheritance) are preserved through DOCX save. Ink and metafile stroke handling remain separate. Synthetic DOCX, raster and PDF regressions cover the change; no new native Word comparison. - +> > 2026-10-23 · cu20we: Paragraph-relative floats in headers, footers, cells and text boxes now start above effective space before; synthetic layout regressions cover all four contexts. Framed paragraphs already used the pre-spacing position. No new native Word comparison; broader object-position parity remains open. | Date | Change | Summary | |---|---|---| +| 2026-11-08 | trivial | #10 narrowed: a turned inline picture with no recorded effect extent keeps its line to its frame (exchanged near a quarter turn in Word 2013+ layout), cut at the line; gap stays open | +| 2026-11-08 | trivial | #4 narrowed: a cell's last Normal paragraph drops its contextual space after, the end-of-cell mark counting as a Normal paragraph (#5450) | +| 2026-11-07 | trivial | Page Setup also bounds the unfocused margin display after a long numeric paste; the accepted value is retained (#5650). | +| 2026-11-05 | trivial | Page Setup's margin, paper-size and document-grid number boxes scroll long text inside the field instead of enlarging the dialog (#5650). Readiness estimates unchanged. | +| 2026-11-04 | trivial | Field argument import and page-format-aware layout/cache follow-ups; no ranked gap changed | +| 2026-11-03 | trivial | Field argument parsing follows Word quoted backslash escapes; body PAGE formatting follows the active section in paragraphs and tables; no ranked gap changed | +| 2026-11-07 | trivial | Pagination gap #4: An in-line picture lowered past its own height (`w:position`) lowers its line as far, as in Word; all 156 synthetic lines measured for #3984 match Word (#5796). | +| 2026-10-31 | trivial | A list level with numFmt none shows its literal text as its label and still counts, as in Word (#4985); no ranked gap changed; readiness estimates unchanged | +| 2026-11-02 | trivial | Picture hyperlinks show on hover, follow on Ctrl/⌘+click and round-trip as Word stores them (#5267); no ranked gap changed; readiness estimates unchanged | +| 2026-11-02 | trivial | #26 narrowed: MHT opens and `w:altChunk` content is brought in on open; saving MHT remains | +| 2026-11-01 | trivial | Preserve table rows and cells inside selected alternate-content branches (#5219); readiness estimates unchanged. | +| 2026-11-07 | trivial | Empty paragraph deletion preserves following paragraph/mark formatting (Leaf #152); synthetic regressions only, no ranked gap closed or estimate changed. | +| 2026-11-07 | trivial | Charts: a series without its own colour takes the accent its `c:idx` picks, as Word does, not the one its place in the file picks (#5963) | +| 2026-11-07 | trivial | A floating anchor after a manual page/column break counts visible content on the far side of the same wrapped row. Marker-only cover anchors retain their previous-page rule. Synthetic picture spacing, placement and history controls; no new native Word measurement. Estimates unchanged. | +| 2026-11-06 | trivial | Print helpers remove loaded PDF/settings files before driver work, tolerate prior removal and report cleanup errors; a held-driver regression checks the files are already absent (#5710) | +| 2026-11-06 | trivial | Windows print submissions use a separate helper per job, preserving provider serialization inside the helper. An acknowledged cancellation stops that helper, so a stalled cancelled driver cannot block a later job; normal shutdown reaps helpers and removes temporary PDFs. The helper erases its plaintext inputs before driver work; a hard app crash during startup can still leave private temporary files. Startup requires an explicit start grant; after sending begins, jobs complete (#5710) | +| 2026-11-06 | trivial | Gap 6: File › Print: before sending starts, Cancel printing (`ui.printCancel`) stops a waiting job and frees the Print page while keeping its settings, including after the last document closes; a successfully cancelled job is never sent. Quitting cancels waiting jobs and joins jobs already sending (#5710). On Windows, winprint repeats the DEVMODE conversion after sending starts. A stall during that repeat prevents cancellation and can keep shutdown waiting, even before a native job exists. No ranked gap changed; readiness estimates unchanged | +| 2026-11-06 | trivial | Gap 6: On Windows the Print panel lists printers without asking their drivers anything, removing the driver query a networked printer in power save could hold, which kept the list empty with Refresh unavailable (#5710; likely also behind the long "Finding printers" waits of #5645 and #5413): discovery uses craft-print's `printer_queues` (storytold/craft-libs#618), and printing still checks the job's options with the driver; the reported printer is awaiting retest; no ranked gap changed; readiness estimates unchanged | +| 2026-11-05 | trivial | PR #4545: eligible cell floats retain in-bounds offsets and touch the outer cell edge only on overflow, ignoring wrap distances for object placement. Front-of-text, turned-cell and outside-cell opt-outs remain. Synthetic geometry controls; native front/behind-text parity remains unqualified. | +| 2026-10-30 | trivial | #29: typed `\int`, `\sum` and the other n-ary operators wait for their limits; `_x^y` then Space builds them and the operand typed next goes inside; any character that can't continue `\name` corrects it (`\int_0^1`), observed in Word for Windows on #4938 (#4917); estimate unchanged | +| 2026-10-17 | trivial | #10 narrowed: Drawing Canvas members are picked, moved, resized and formatted on their own (#2637); several at once and dragging one out of the canvas remain | +| 2026-11-04 | trivial | CLI input paths keep their native filename when a value-taking option comes first; regression coverage includes conversion to Flat OPC and rejection of non-Unicode option values. | +| 2026-11-05 | trivial | DOCX preserves `w:adjustRightInd` with its true default and writes it in schema order; grid layout remains open | +| 2026-10-28 | trivial | Ink page lookups reuse scanned paragraph prefixes, #3614. Drawing order, geometry and saved data retain their behavior; no readiness estimate change | +| 2026-11-05 | trivial | #19: ODT default language kept when styles are written from the model | +| 2026-10-28 | trivial | Shared MATH construction records reuse variants and assembly data without changing glyph mappings or existing limits (#3630); readiness estimates unchanged | +| 2026-10-29 | trivial | Page drawing indexes text-box warp lookups per paragraph (#3614); requested offsets only, bounded prefix traversal, original Linux display and persistence controls; readiness estimates unchanged | +| 2026-10-31 | trivial | Pagination gap #4: a float anchored right after a page break inside a paragraph, before text, is drawn on the new page (#4262) | +| 2026-10-31 | trivial | Pagination gap #4: a float anchored on a later page of a long paragraph is drawn on that page, also when footnotes or widow control move its line on (#4250) | +| 2026-10-28 | trivial | Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged. | +| 2026-11-02 | trivial | In Print Layout the horizontal ruler shades the spaces between the caret section's text columns, and their edges drag the spacing (#5197); no ranked gap changed; readiness estimates unchanged | +| 2026-11-01 | trivial | Arrowheads keep their kind, width and length (DrawingML `a:headEnd`/`a:tailEnd` `type`/`w`/`len`, VML `startarrow`/`endarrow` with `…arrowwidth`/`…arrowlength`), read and written back, and are drawn 2, 3 or 5 times the line's width long and wide (small, medium, large), a line under 2 points as a 2-point one, as measured in Word for Windows; every kind is still drawn as a triangle; no ranked gap changed; readiness estimates unchanged | +| 2026-11-04 | trivial | #19: ODT settings for what the standard leaves open removed: one choice for each case | +| 2026-11-04 | trivial | #19: ODT element audit; files from other applications checked | +| 2026-11-04 | trivial | PR #4609: relative REF keeps context already displayed by the own or a needed ancestor label; six synthetic legal-template cases and separate-list context follow the Word for Windows measurements reported by @pakiat in PR discussion. Existing unknown-switch/cache boundaries and readiness estimates unchanged; no new native Word run. | +| 2026-11-01 | trivial | #19 narrowed: ODT read and written nearly whole on this branch (styles, tables, notes, comments, tracked changes including formatting, fields, indexes and marks, drawings, charts, embedded objects, forms, ruby, password protection, flat ODT), checked against LibreOffice; what's left listed; estimate 18–27 h → 10–16 h | +| 2026-11-01 | trivial | #10 narrowed: text in a turned text box is drawn turned with it on screen and in PNG and PDF (upside down when flipped across, never mirrored); editing it still goes by its upright text; estimate unchanged | +| 2026-10-29 | trivial | Print Markup balloon anchor discovery no longer repeats paragraph-prefix scans (#3614); readiness estimates unchanged | +| 2026-10-28 | trivial | Print Markup text-copy comment discovery walks paragraph objects once (#3614); quotes, order, limits and readiness estimates unchanged | +| 2026-11-04 | trivial | Table Sort rejects malformed or nonexistent explicit columns before mutation; valid columns, the omitted-column default and history are retained (#5531). Readiness estimates unchanged. | +| 2026-10-30 | trivial | #20 narrowed: layout resource caps and linear-time passes (#3867, #3866) | +| 2026-10-17 | trivial | UI/UX gaps: copies put RTF on the clipboard (Windows, macOS, Wayland; not X11), and paste reads RTF on macOS and X11 too | +| 2026-11-03 | trivial | Find smart-quoted text with a keyboard apostrophe (#5388); exact search modes and replacement spelling preserved. | +| 2026-11-03 | trivial | #4 narrowed: a nested table's Can't Split row moves on with its outer row when the row splits across pages (#5456); Word shows this for a nested row first in its outer row, the split above a later one is inferred and not yet checked in Word; readiness estimates unchanged | +| 2026-11-03 | trivial | #4 narrowed: a full stop followed by an opening parenthesis stays on one line, as in Word (#5437) | | 2026-11-03 | minor | #11: Arabic interface with mirrored shell (#1195); key languages missing are now hi and id (plus pt-PT); Hebrew UI still open | +| 2026-11-03 | trivial | #8 (CP4.3): one language list: Set Proofing Language, Review › Language and the status bar offer the Language pack languages (Bulgarian was in none); every published pack named in English; Valencian is `ca-ES-valencia`; gap 8 names built-in proofing | +| 2026-11-03 | trivial | #8 (CP4.3): the missing-pack bar offers a language before the list of packs is fetched (a fresh install, or a list cached for an older pin) and gets it on Install; with downloading on, a missing or stale list is fetched once in the background; the caret's typing language counts; the spelling context menu's heading is in the interface language | +| 2026-11-03 | trivial | #8 (CP4.3): File › Options › Language lists Your languages and Add a language… (searchable, sorted by name) replaces the Language packs table; the Dictionaries folder and the Dictionary files list moved from Proofing | +| 2026-10-28 | trivial | #4: fonts the document uses that aren't installed are flagged in the font box and status bar (metric-compatible substitutes and symbol fonts aren't); a missing font is drawn in an installed metric twin before other substitutes (Arial for Helvetica on Windows), so pages break as in the document's own font wherever such a twin is installed | +| 2026-11-03 | trivial | #4: a hyphen before a slash and a letter is a line break opportunity, a hyphen before a slash and a digit stays whole (#3408) | | 2026-11-03 | trivial | #8: language-packs-2 published and pinned, 75 packs; Danish, German, Dutch, Swedish, Norwegian, Hungarian, Estonian, Croatian, Persian and Esperanto available as Language packs | | 2026-11-02 | trivial | #8 (CP4.4): language-packs-1 published and pinned, 61 packs; Lithuanian, Romanian, Catalan, French, Greek, Slovak, Serbian and Latvian available as Language packs; Dutch, German and the other compounding languages wait on craft-proof; Basque, Ukrainian and Uyghur excluded; no ranked gap changed | | 2026-11-02 | trivial | Gap 8's evidence: English spelling reads the SCOWL 2026 dictionaries, one per English (en-US, British-spelling via en-GB, en-CA), with regression tests for #40 (British words in en-GB) and #520 (common modern words); #40 is no longer listed as open (#5205). No ranked gap changed. | | 2026-11-01 | minor | #8: Language packs (CP4.3): install and remove a language's spelling and hyphenation from File › Options › Language, the missing-pack bar, About › Language data, `proof.packs`/`proof.installPack`/`proof.removePack`; Lithuanian [#4707](https://github.com/storytold/wordcraft/issues/4707) and Romanian [#3438](https://github.com/storytold/wordcraft/issues/3438) are available as a Language pack once language-packs-1 is published (with Polish, Portuguese, Italian, Russian, Czech, Spanish, Bulgarian, Bosnian, Slovenian, Ukrainian and the other packs that pass CI); the packs for Dutch [#4145](https://github.com/storytold/wordcraft/issues/4145)/[#2505](https://github.com/storytold/wordcraft/issues/2505) and Catalan [#2895](https://github.com/storytold/wordcraft/issues/2895)/[#4947](https://github.com/storytold/wordcraft/issues/4947) are defined but wait on craft-proof engine support (two-character flags, `FLAG long`), French [#1325](https://github.com/storytold/wordcraft/issues/1325) on `OCONV`, Greek [#2561](https://github.com/storytold/wordcraft/issues/2561) on ISO 8859-7 decoding, Slovak [#3806](https://github.com/storytold/wordcraft/issues/3806) on `CIRCUMFIX`, Serbian [#4968](https://github.com/storytold/wordcraft/issues/4968) on numeric flags (`FLAG num`), and Latvian [#4438](https://github.com/storytold/wordcraft/issues/4438) on `FULLSTRIP` (and `CIRCUMFIX`, `NEEDAFFIX`) | | 2026-11-01 | trivial | Gap 8's evidence names craft-proof (storytold/craft-libs `crates/proof`) and craft-i18n `language-data/` instead of WordCraft's removed `crates/proof` (#5202). No ranked gap changed. | -| 2026-11-02 | trivial | #26 narrowed: MHT opens and `w:altChunk` content is brought in on open; saving MHT remains | +| 2026-11-02 | trivial | Honor page break before at a continuous section's mid-page top (#5287); its later-column case remains unmeasured in Word. Readiness unchanged. | | 2026-11-01 | trivial | Preserve table rows and cells inside selected alternate-content branches (#5219); readiness estimates unchanged. || 2026-11-01 | trivial | Arrowheads keep their kind, width and length (DrawingML `a:headEnd`/`a:tailEnd` `type`/`w`/`len`, VML `startarrow`/`endarrow` with `…arrowwidth`/`…arrowlength`), read and written back, and are drawn 2, 3 or 5 times the line's width long and wide (small, medium, large), a line under 2 points as a 2-point one, as measured in Word for Windows; every kind is still drawn as a triangle; no ranked gap changed; readiness estimates unchanged | | 2026-10-31 | trivial | The .doc reader's default font is the stylesheet's standard font, not the font table's first entry (#5066); no ranked gap changed; readiness estimates unchanged | | 2026-11-01 | trivial | A middle or bottom cell of a row split across pages lines up on the first page; no ranked gap changed; readiness estimates unchanged | | 2026-11-01 | trivial | Tab leader dots spaced and placed as in Word; no ranked gap changed; readiness estimates unchanged | | 2026-10-31 | trivial | A list level above that hasn't counted yet takes its first number at the first deeper item, as measured in Word (10.1–10.4, then 11); not a ranked gap; readiness estimates unchanged | +| 2026-11-01 | trivial | #3915: preserve guarded whole-line ordinary-tab alignment with current main. Existing controls retained; source checks only, primary qualification pending. | +| 2026-10-31 | trivial | Preserve recipient columns after an unquoted whitespace-only prefix in a headered CSV (#4249); keep quoted headers, headerless whitespace records and shared CSV parsing. | +| 2026-10-31 | trivial | Integrate complete-record recipient CSV delimiter detection (#4249) with current main; preserve leading blank-line detection (#5042), original regressions and readiness estimates. | +| 2026-11-01 | trivial | #2437: Preserve finite paragraph-border flow extents and terminal-break keep preflight with current-main changes. Recursive terminal-successor lookahead remains outside scope. Source checks only; primary qualification pending. | | 2026-10-30 | trivial | Only the PDF sent to the printer omits link annotations; File › Print › Save these pages as PDF (`file.printPdf`) keeps them, like Export (#4734); no ranked gap changed; readiness estimates unchanged | | 2026-10-29 | trivial | The print job's PDF omits link annotations, which the spooler refused to fit to the paper, so documents with links reach the printer (#4734); physical printer output remains to be validated; no ranked gap changed; readiness estimates unchanged | | 2026-10-31 | trivial | Synchronize the existing Proofing pane with main `eecbb8f`; preserve explicit-position lookup, implicit selection, navigation, undo and per-window state; fresh exact-SHA hosted validation pending, readiness unchanged | @@ -185,6 +280,10 @@ Table rows and cells inside `mc:AlternateContent` use the same selected-branch p | 2026-10-29 | trivial | Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880). Filtered/sorted order, product geometry and single-label mode retained; readiness estimates unchanged. | | 2026-10-29 | trivial | HTML import keeps preformatted lines with CR, CRLF or LF input newlines (#4810); numeric character references retain their separate meaning; readiness estimates unchanged. | | 2026-10-26 | minor | Word-observed Proofing task pane uses shared review commands; clicking a suggestion corrects and advances; context, suggestion cards and ignore/dictionary links follow the Windows reference; inspected previews prompted a full-width context and scrollable three-card list; exact selected spelling takes priority over overlapping grammar, with command/pane regressions and integration workflow paths; readiness estimates unchanged | +| 2026-11-01 | trivial | N-up and booklet print imposition (#641): integrate current print-job link handling (#4734), preserve markup preview and sheet/copy planning; readiness estimates unchanged. | +| 2026-10-27 | trivial | Preserve #4249 complete-record CSV delimiter detection and its regressions in the mailings modules; recipient commands, limits and refusal behavior unchanged. | +| 2026-10-26 | trivial | Integrate #4249 with current-main CSV helpers, preserving logical-record detection, existing recipient limits and refusal behavior. | +| 2026-10-25 | trivial | Recipient CSV delimiter detection reads the first complete record, including quoted line breaks and doubled quotes; separator ties and cell parsing remain unchanged. Original parser and CLI import/save/reopen checks; readiness estimates unchanged. | | 2026-10-22 | trivial | View windows: several open documents and Switch Windows in the engine | | 2026-10-25 | trivial | egui 0.37 migration: interface catalogs remain pinned by `craft-i18n.rev` (`9205108…`; 27 languages, English fallback); IME surrounding deletions and composition resets are implemented with regressions, but managed CI passed; native IME acceptance and native-speaker catalog review remain open; no gap or readiness change | | 2026-10-17 | trivial | Gap 9 narrowed: Standard (Word 2007, AES-ECB) encrypted packages open with a password under any Word extension; AES headers in Word 97-2003 files are outside the public spec and refused with a clear message; estimate 3–5 → 0 h, since the remaining AES-in-`.doc` case is refused by design | @@ -227,6 +326,8 @@ Table rows and cells inside `mc:AlternateContent` use the same selected-branch p | 2026-10-18 | trivial | Gap 8 narrowed: German text hyphenates by the TeX German patterns (reformed spelling); German spelling and grammar remain | | 2026-10-19 | trivial | Restrict Editing: with Filling in forms enforced, inserting content controls, their Properties and Remove Content Control are refused, as in Word (it greys them out), so a form's fields stay as they are and only their content is filled in | | 2026-10-19 | trivial | Content controls: text typed over a placeholder takes the control's own run properties (`w:sdtPr/w:rPr`, ECMA-376 §17.5.2.27), as in Word, and the placeholder style is recognised by its built-in name "Placeholder Text" whatever its localized id (German Word: `Platzhaltertext`), so entries in forms from localized Word no longer stay grey | +| 2026-10-11 | trivial | #27: Switch Windows, Arrange All, View Side by Side, Synchronous Scrolling landed (#322); New Window and Split left | +| 2026-10-17 | trivial | #16: RTL paragraph direction (`w:bidi`) is implemented for HTML/ODT/RTF in #2695 (pending merge) (`dir="rtl"` / CSS `direction:rtl`, `style:writing-mode="rl-tb"`, `\rtlpar`); kashida and the six old RTL reports remain open | | 2026-10-18 | trivial | Font list starts at its first row after clearing a no-match query; recent heading remains visible (#2068) | | 2026-10-19 | trivial | #2964: a centred or end-aligned list label after a leading page break uses its text line's alignment. Synthetic LTR/RTL numbered/bulleted controls and the issue's DOCX export; broader pagination gaps and readiness estimates unchanged | | 2026-10-17 | trivial | #1327: Restrict Editing exceptions no longer let table, row or cell formatting change protected tables; formatting-only protection refuses Paste Formatting, table shading/borders/alignment/margins/text direction, table-style edits and locked table styles; recipient-list commands no longer rewrite merge-field results in a protected document. No gap row (enforcement fix); estimates unchanged | @@ -387,10 +488,26 @@ Table rows and cells inside `mc:AlternateContent` use the same selected-branch p | 2026-10-12 | trivial | #811: large-table scrolling fixed; performance gap (#20) narrowed | | 2026-10-12 | trivial | #13: radar, stock and other undrawn chart types show a placeholder instead of blank space (#998) | | 2026-10-19 | trivial | Personal templates in File › New and Save as Word Template (#2852); no gap entry tracked it | +| 2026-11-02 | trivial | #19 narrowed: ODT form controls keep their place on the line, and multi-line text fields their lines; custom shapes keep their own geometry. The corpus round-trip difference falls from 45k to 41k pixels; 42 of 125 documents round-trip pixel-identical, 92 with their text the same. Left: LibreOffice's hairline outline (kept as 0.5 pt) | +| 2026-11-02 | trivial | #19 narrowed: ODT in-line frames placed against the text, and in-line pictures saved standing on the baseline. Left from LibreOffice's style templates: template instantiation (fixed dates refreshed and sender fields filled from the user's data when LibreOffice opens a template), a first-page footer's frame against the page content, a page background picture centred in the margins | +| 2026-11-02 | trivial | #19 narrowed: ODT charts keep their look on save (the object as read, while unchanged); a frame's drawn outline is kept; a header with no stated height is LibreOffice's 0.5 cm. The corpus round-trip difference falls from 60k to 47k pixels; 41 of 125 documents round-trip pixel-identical | +| 2026-11-02 | trivial | #19 narrowed: ODT tables no longer gain a repeated header row on save; all 16 LibreOffice agenda templates now round-trip with their text the same (91 of 125 corpus documents). The corpus round-trip difference falls from 82k to 60k pixels | +| 2026-11-02 | trivial | #19 narrowed: ODT documents open with LibreOffice's layout where it differs from Word (`Settings::odf_layout`: lines of only pictures, padding without a border); unequal columns and column breaks kept. The corpus round-trip difference falls from 155k to 82k pixels (408k this morning); 38 of 125 documents round-trip pixel-identical. Left: columns nested in a page's columns (WordCraft's own rendering; no Word equivalent), cell background pictures | +| 2026-11-02 | trivial | #19 narrowed: ODT tables filling the margins fit them and keep their own space above and below; header and footer spacing kept past a tall header; pictures alone in a paragraph keep its size and their raise. The corpus round-trip difference falls from 241k to 155k pixels. Left: paragraph padding without a border, cell background pictures (no Word equivalent), WordCraft's own height for a picture-only line | +| 2026-11-02 | trivial | #19 narrowed: all 125 corpus documents keep their page count through a save (letters, faxes, business card): the default font size, page-anchored frames, text box styles, empty paragraphs' size and frames anchored by their style | +| 2026-11-02 | trivial | #19 narrowed: ODT variables (as SET/REF, SET now evaluated), emphasis marks (new: model, layout, DOCX, ODT, command), page background pictures, fixed-width tables and tables starting a page, the default font size, styles turning off bold or italic | +| 2026-11-02 | trivial | #19 narrowed: ODT round-trips all 78 of LibreOffice's bundled templates; placeholders as content controls, first-page page styles, unsized pages and LibreOffice's default margins, WMF/EMF pictures, hidden form controls and `.ott` templates done | +| 2026-11-03 | trivial | #19 narrowed: an ODT saved without edits keeps what WordCraft doesn't model (unedited paragraphs, tables, named sections, indexes, forms, style definitions, page layouts, document properties written back as read). Over the 133-file corpus 95 files round-trip pixel-identical, and the element kinds a save loses fall from 77 to 19 | +| 2026-11-01 | trivial | #19 narrowed: ODT custom shapes drawn from their own geometry, table cell formulas as formula fields, macros and unknown package parts kept, turned text in cells and text boxes, form control sizes and buttons kept (~90%) | | 2026-10-29 | trivial | #15 narrowed: a Word bibliography source with a corporate author keeps it (read, saved, cited and listed whole), and Create Source has the Corporate Author box (#4848) | | 2026-10-29 | trivial | Table Properties: row, column and cell settings apply to the selected rows, columns and cells, not only the caret's (#4857); no gap entry tracked it | +| 2026-10-29 | trivial | Gap #20 narrowed: built-in citation source lookups; broader corpus/performance acceptance remains open (#4888) | | 2026-10-28 | trivial | Gap 19 narrowed: RTF reads and writes WMF and EMF pictures, chosen by their bytes (#4259); ranking unchanged | +| 2026-10-27 | trivial | 2026-10-27 · #4533 review: numeric REF updates lazily index body bookmarks once per update, retaining the first body bookmark for duplicate names. Unsupported switches and ordinary REF/PAGEREF behavior are unchanged; a synthetic 64-reference regression covers repeated updates and duplicate names. Estimates unchanged. | +| 2026-10-27 | trivial | 2026-10-27 · #4533: numeric REF fields use paragraph list numbers for no/full/relative context, reusing bounded numbering. Shared context already embedded in a level label is removed; merged-away cells do not count. Unsupported separator/text/position switches and ambiguous contexts or delimiter-free joins retain cached results. Synthetic OOXML regressions; no native Word or real-document validation, estimates unchanged. | ## Layout validation fonts Four geometry-dependent regression controls request Source Sans 3 explicitly. Platform-installed substitutes otherwise change their expected line counts. Assertions remain unchanged; renderer font metrics and substitution gaps remain open. + +> 2026-10-29 · Port #2437 to split layout modules: finite border extents and terminal-break keep preflight. Recursive keep lookahead remains outside scope. Source port only; no test execution or new native measurements. diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index bf62281b0f..5615e592bd 100644 --- a/docs/hardware-parity.md +++ b/docs/hardware-parity.md @@ -1,6 +1,6 @@ # Hardware parity with Microsoft Word -> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-30 · **Change:** trivial (only the PDF sent to the printer has no link annotations; Save these pages as PDF keeps them, #4734); previously trivial (a document with links prints: the print job's PDF has no link annotations, #4734; previously trivial: Pen / stylus row: two-stroke and closed-head arrows; previously trivial: Pen / stylus row: ink, eraser and Ink to Shape incl. arrows landed; previously trivial: a window too big for its screen shrinks to fit when it opens, #1215; previously trivial: 32-bit Windows starts on OpenGL; previously major: first version) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 and Word for Windows +> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-11-07 · **Change:** trivial (newly opened window dimensions are constrained to fit available screen dimensions, #5871); previously trivial (print helpers erase loaded plaintext inputs before driver work, #5710); previously trivial (Windows print submissions use isolated helpers so a cancelled driver cannot block a retry, #5710); previously trivial (print cancellation remains available without a document; sending-boundary limitation clarified, #5710); previously trivial (a print job waiting on its driver can be cancelled, and quitting doesn't wait for it, #5710); previously trivial (the printer list no longer waits on printer drivers, #5710); previously trivial (Linux Read Aloud: a sentence a screen reader cuts off is said again); previously trivial (ink page lookup work, #3614); previously trivial (only the PDF sent to the printer has no link annotations; Save these pages as PDF keeps them, #4734); previously trivial (a document with links prints: the print job's PDF has no link annotations, #4734; previously trivial: Pen / stylus row: two-stroke and closed-head arrows; previously trivial: Pen / stylus row: ink, eraser and Ink to Shape incl. arrows landed; previously trivial: a window too big for its screen shrinks to fit when it opens, #1215; previously trivial: 32-bit Windows starts on OpenGL; previously major: first version) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 and Word for Windows > **Printing update:** 2026-10-12 · direct desktop printing through craft-print; details below. @@ -12,21 +12,35 @@ pens, microphones (Dictate) and speakers (Read Aloud), and displays. | Hardware | Word | WordCraft macOS | Windows | Linux / BSD | Web | Parity | Hours | |---|---|---|---|---|---|---|---| -| Printers: native print dialog, printer choice, copies, duplex, page ranges, tray, scaling | ✅ (`WordPDE.plugin` print-dialog extension on Mac) | 🟡 Direct CUPS printing; printer, copies, collation, duplex, ranges, grayscale and scale to paper size; on every desktop the PDF sent to the printer leaves out link annotations, which the spooler can't fit to the paper; Save these pages as PDF keeps them (#4734) | 🟡 Direct spooler printing; printer, copies, collation, duplex, ranges, grayscale and scale to paper size; on every desktop the PDF sent to the printer leaves out link annotations, which the spooler can't fit to the paper; Save these pages as PDF keeps them (#4734) | 🟡 Direct spooler printing; printer, copies, collation, duplex, ranges, grayscale and scale to paper size; on every desktop the PDF sent to the printer leaves out link annotations, which the spooler can't fit to the paper; Save these pages as PDF keeps them (#4734) | ✅ browser print dialog (#209) | 35% | 5–8 | +| Printers: native print dialog, printer choice, copies, duplex, page ranges, tray, scaling | ✅ (`WordPDE.plugin` print-dialog extension on Mac) | 🟡 Direct CUPS printing; printer, copies, collation, duplex, ranges, grayscale, scale to paper size, N-up and booklets; on every desktop the PDF sent to the printer leaves out link annotations, which the spooler can't fit to the paper; Save these pages as PDF keeps them (#4734) | 🟡 Direct spooler printing; printer, copies, collation, duplex, ranges, grayscale, scale to paper size, N-up and booklets; on every desktop the PDF sent to the printer leaves out link annotations, which the spooler can't fit to the paper; Save these pages as PDF keeps them (#4734) | 🟡 Direct spooler printing; printer, copies, collation, duplex, ranges, grayscale, scale to paper size, N-up and booklets; on every desktop the PDF sent to the printer leaves out link annotations, which the spooler can't fit to the paper; Save these pages as PDF keeps them (#4734) | ✅ browser print dialog (#209) | 35% | 5–8 | | GPU rendering, HiDPI/Retina, pixel-aligned text | ✅ | ✅ wgpu + vello_cpu rasteriser, whole-pixel text (#110, #165) | ✅ DirectX 12 default (#50), OpenGL when DirectX 12 has no GPU driver (#316) or on 32-bit; startup crash on Intel UHD (#170) | ✅ (soft text on KDE at some zooms, #140) | ✅ | 80% | 3–5 (bugs) | | Pen / stylus: ink, pressure, eraser, ink to shape/math | ✅ (Draw tab, `InkRender.bundle`) | 🟡 ink, stroke eraser, Ink to Shape incl. one- and two-stroke arrows with open or closed heads (#307, #395); pressure and Ink to Math missing | 🟡 same | 🟡 same | 🟡 same | 50% | (Draw tab, 15–25) | | Multiple monitors, per-monitor DPI, remembered window position, a window that fits its screen | ✅ | ✅ (#38, #76, #1215) | ✅ (winit DPI fix pending, #155) | ✅ | — | 85% | 1 | | Microphone: Dictate | ✅ (cloud speech service) | ❌ | ❌ | ❌ | ❌ | 0% | 8–15 + owner (speech model choice) | -| Speakers: Read Aloud | ✅ | ✅ system speech, speed, sentence skip (#190) | ✅ | 🟡 | 🟡 | 75% | 1–2 | +| Speakers: Read Aloud | ✅ | ✅ system speech, speed, sentence skip (#190) | ✅ | 🟡 espeak-ng, then espeak, then Speech Dispatcher (over its socket), each sentence in its language's voice; packages recommend a speech program; silent in the Flatpak (no audio access, no speech program) | 🟡 | 75% | 1–2 | | Touch screens and touchpads: pinch zoom, inertial scroll | ✅ | ✅ pinch (#179) | ✅ | ✅ inertial scroll (#252) | ✅ | 85% | 0–1 | | Scanners/cameras (Insert from device / Continuity Camera on Mac) | ✅ | ❌ | ❌ | ❌ | ❌ | 0% | 2–4 | +Ink replay, eraser picking, lasso selection and arrow-candidate discovery reuse the paragraph prefixes they have already scanned (#3614). Page item order, stroke geometry and saved data retain their behavior. This narrows the stability work; ink import fidelity, native pen input and broader corpus qualification remain open. +File > Print offers 2, 4, 6, 9 or 16 logical pages per physical sheet side and left/right-bound booklets (#641). Preview and print PDF share the sheet plan, selected pages, parity, copy padding and markup geometry. Custom-range changes reset the preview to the first sheet; Print Markup invalidates preview layout and textures. Native jobs omit link annotations as required by upstream #4734, while saved print PDFs keep their remapped links. Native printing submits copies to the spooler without multiplying them in the PDF. Ordinary PDF export remains single-page by default. Translations are reviewed separately in craft-i18n#38. Physical-printer qualification and driver-specific options remain unverified. + ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-11-07 | trivial | Newly opened secondary windows constrain their initial viewport dimensions to the monitor's usable area, preventing windows from exceeding screen width on scaled displays (#5871) | +| 2026-11-06 | trivial | Print helpers remove loaded PDF/settings files before driver work, tolerate prior removal and report cleanup errors; a held-driver regression checks the files are already absent (#5710) | +| 2026-11-06 | trivial | Windows print submissions use a separate helper per job, preserving provider serialization inside the helper. An acknowledged cancellation stops that helper, so a stalled cancelled driver cannot block a later job; normal shutdown reaps helpers and removes temporary PDFs. The helper erases its plaintext inputs before driver work; a hard app crash during startup can still leave private temporary files. Startup requires an explicit start grant; after sending begins, jobs complete (#5710) | +| 2026-11-06 | trivial | File › Print: before sending starts, Cancel printing (`ui.printCancel`) stops a waiting job and frees the Print page while keeping its settings, including after the last document closes; a successfully cancelled job is never sent. Quitting cancels waiting jobs and joins jobs already sending (#5710). On Windows, winprint repeats the DEVMODE conversion after sending starts. A stall during that repeat prevents cancellation and can keep shutdown waiting, even before a native job exists. | +| 2026-11-06 | trivial | On Windows the Print panel lists printers without asking their drivers anything, removing the driver query a networked printer in power save could hold, which kept the list empty with Refresh unavailable (#5710; likely also behind the long "Finding printers" waits of #5645 and #5413): discovery uses craft-print's `printer_queues` (storytold/craft-libs#618), and printing still checks the job's options with the driver; physical sleeping-printer output remains to be confirmed by the reporter | +| 2026-10-28 | trivial | Ink page lookup work, #3614. Drawing order, geometry and saved data retain their behavior; no readiness estimate change | +| 2026-11-01 | trivial | N-up and booklet print imposition (#641): integrate current print-job link handling (#4734), preserve markup preview and sheet/copy planning; readiness estimates unchanged. | | 2026-10-30 | trivial | Only the PDF sent to the printer leaves out link annotations; Save these pages as PDF (`file.printPdf`) keeps them (#4734) | | 2026-10-29 | trivial | A document with links prints: the print job's PDF leaves out link annotations, which the spooler refused to fit to the paper (#4734) | +| 2026-10-28 | trivial | A window restored to a place no monitor covers opens centred on the primary monitor. The check compared monitor sizes only, so when a monitor was replaced by one of the same size (a dock unplugged, a display rearranged), the window opened off screen and the app looked like it quit at once | +| 2026-10-26 | trivial | Linux Read Aloud: a sentence another program's message cancels (a screen reader's announcement) is said again after a short pause, twice at most; cancelled again, paused by another program, or never begun, it pauses reading with a message | +| 2026-10-21 | trivial | Linux Read Aloud review fixes: Speech Dispatcher is found at `SPEECHD_ADDRESS` (`unix_socket`, `inet_socket`) or the default socket, gets the sentence's language and region, and a sentence another program cancels or pauses (a screen reader's message, a stop for every program) pauses reading on it with a message instead of being skipped or said over the other program | +| 2026-10-18 | trivial | Linux Read Aloud: Speech Dispatcher (over its socket, with the sentence's language; stopping cancels only WordCraft's own speech) when neither espeak-ng nor espeak is installed, a message naming the program to install when none is, and a speech program recommended by the `.deb` (`espeak-ng` or `speech-dispatcher`) and `.rpm` (`espeak-ng`) packages | | 2026-10-15 | trivial | Pen / stylus row: Ink to Shape also makes two-stroke arrows and arrows with a closed triangle head | | 2026-10-17 | minor | File › Print's Scale to paper size (#2108): pick Letter, Legal, A4 or any Layout › Size paper and every page is scaled to it and centred, the paper turned to each page's orientation, in the preview, the print job (with the spooler's media) and Save these pages as PDF; the document keeps its page size. `paper` param on `ui.print`/`file.printPdf` | | 2026-10-14 | trivial | Pen / stylus row corrected: ink, eraser and Ink to Shape (with arrows) work; pressure and Ink to Math missing | diff --git a/docs/layout-parity.md b/docs/layout-parity.md index 0681502353..1f2f967632 100644 --- a/docs/layout-parity.md +++ b/docs/layout-parity.md @@ -1,6 +1,8 @@ # Layout and pagination parity with Microsoft Word -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-01 · **Change:** trivial (the line between columns runs as tall as the section's text, so columns for selected text have it, #5178); previously trivial (a table row that would leave a cell empty on a page that already holds something, its picture or first line not fitting there, moves on whole instead of leaving the other cells' text beside the empty cell, #4272); previously trivial (a middle or bottom cell of a row split across pages lines up on the first page); previously trivial (tab leader dots spaced and placed as in Word); previously trivial (a level above that hasn't counted yet takes its first number at the first deeper item); previously trivial (paragraph side borders lie beyond their distance from the text, #5036); previously trivial (with a header taller than the top margin, Margin-anchored drawings, header-cell pins and header-table obstacles use the rendered body top; TopMargin and InsideMargin keep their declared band, #2485; previously trivial: connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (field results take the `\* DollarText`, `\* Hex` and `\* ArabicDash` switches, #4226; previously trivial: a cell spanning columns shares its extra minimum width by the columns' preferred widths, equally in automatic tables, #1883; previously trivial: continuous sections one after another go onto new pages instead of running off the page; empty marks after another empty section mark take a line each until the page is full, then stay at its bottom drawing nothing, not even a list label; an empty mark that takes no room draws no list label either; a kept-together paragraph is measured against the page it would move to, so a tall different first-page header no longer splits it, #3907; previously trivial: a justified line ending in a manual line break is stretched to the margin unless `w:doNotExpandShiftReturn` is set, #3924; previously trivial: a no-break space is as wide as a space, #4192; previously trivial: a bookmark or other zero-width marker is no line-break opportunity, #4193; previously trivial: Arabic list labels: `arabicAlpha` and `arabicAbjad` draw the 28 Arabic letters (alphabetical and abjad order), doubling past the last letter; Hebrew, Hindi, Thai and Vietnamese still show decimal (`doc::section::tests::arabic_letters_count_in_both_orders`); previously trivial: Preserve grapheme edit/wrap boundaries across independently drawn font/style pieces; Exact-spacing table contact uses the specified line height rather than paragraph-mark metrics (#3977); previously trivial: cu20we: restrict pre-spacing float origins to paragraph anchors; document cap helpers and regressions; previously trivial: cu20we: outline caps; previously trivial: cu20we: box float paragraph origin; previously trivial: group connector rerouting preserves transformed free and unresolved endpoints under nonuniform scaling; readiness estimates unchanged; previously trivial: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: an empty paragraph whose mark is hidden shows nothing, not even its list number, which is still counted, #3982; previously trivial: a Thai run with Latin finds one installed font covering it all on Linux too, #1549; previously trivial: symbol fonts keep their line height without the font; previously trivial: an equation-array row without `&` is centred, #2617; previously trivial: a superscript or subscript sizes its line at the full font size, without its raise or drop, as Word does; previously trivial: an object dragged near the bottom of a page lands where it is dropped, #3169; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: justified lines shrink their spaces by Word's measured limits; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: a click below a floating table goes to the text beside or after it, not to a cell of its last row, #2038; previously trivial: shapes drawn with their gradients and transparency, #1500; previously trivial: paragraphs above a float's anchor wrap around it, also when that pushes the anchor onto the next page, #2048; previously trivial: triple borders draw three lines, #1740; previously trivial: the caret, clicks and selection edges fall between the letters of a ligature, #1974; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: VML header-cell floats always on the page, user-checked in Word for Mac, #1775; previously trivial: an at-least row with no room for its minimum starts the next page whole, #1742; previously trivial: AutoFit donors lose equal widths down to their content minima; previously trivial: automatic space between Asian text and Latin text or digits, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: positional tabs go to the margins or indents, #2367; previously trivial: field results with right-to-left text read right to left, #1670; previously trivial: a list bullet no installed font can draw shows the level's default bullet, #1683; previously trivial: a missing Thai font is drawn in one Thai face for the whole run, #1549; previously trivial: the caret after spaces hanging past the margin stays at the margin, #2146; previously trivial: covered black-circle fallback before UI sans; previously trivial: resolved split-cell continuation top insets; previously trivial: Symbol PCL6 alias uses Symbol encoding; previously trivial: exact full font names select their installed face; previously trivial: Arial Unicode MS uses proportional fallbacks; previously trivial: DrawingML outline dashes, including zero-width paths; previously trivial: TOCs include table-cell headings and retain full targets; previously trivial: kept table rows follow the next row; previously trivial: consistent cell widths override a stale table grid; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: paragraph spacing adds up when the document turns HTML auto spacing off; previously trivial: an inherited footer sizes its percentage tables by its own section; previously trivial: an empty section mark stays on a full page; previously trivial: a fitting row with less room than its minimum height moves on whole; oversized rows still split; previously trivial: text past an exact-height row is cut off; previously trivial: a list number stays with text after a leading page break; previously trivial: a bookmark after a page break takes no line; previously trivial: a page break followed by a page break before or a next-page section starts one page; previously trivial: All Caps and Small Caps draw ß as SS, #1581; previously trivial: justified vertical page alignment, #1320; previously trivial: page numbers restart at 0; previously trivial: a list label moves with its first line when the paragraph is centred or end-aligned (#1159); previously trivial: PAGE fields in a paragraph split across pages show the page they are on, #1352; previously trivial: a dragged floating object anchors in the column it lands in, #884; previously trivial: a paragraph ending on a page with footnotes keeps its space after above the separator, #1116; previously trivial: symbol-font text drawn as Unicode symbols, #776; previously trivial: large-table scrolling measured and fixed, #811; previously trivial: text boxes use their own margins; Resize shape to fit text never cuts text, #743; previously trivial: complex-script shaping and Myanmar line breaking, #604; previously trivial: body page totals, table-cell footnotes and bookmark link pages fixed, #450 #451 #455; previously major: first version; line breaking, pagination and object placement checked against Word's behaviour from the layout source on origin/main) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-08 · **Change:** trivial (a turned inline picture whose file keeps no room for the turn keeps its line to its frame, the frame turned a quarter in Word 2013+ layout); previously trivial (a picture lowered further than its own height lowers its line as far, its top on the baseline); previously trivial (a float anchored right after a page break, before text, is drawn on the new page, #4262); previously trivial (a float anchored on a later page of a long paragraph is drawn there, #4250); previously trivial (the line between columns runs as tall as the section's text, so columns for selected text have it, #5178); previously trivial (a line of only pictures is as tall as they reach, never less than its font's height; a legacy check box sizes its line as text of its size, #3984); previously trivial (spaces before a line's first character keep their width in justified and distributed lines, as in Word); previously trivial (Page drawing indexes text-box warp lookups per paragraph (#3614)); previously trivial (Times and Courier take their Windows counterparts' line spacing; previously trivial: group connector rerouting preserves transformed free and unresolved endpoints under nonuniform scaling; readiness estimates unchanged; previously trivial: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: an empty paragraph whose mark is hidden shows nothing, not even its list number, which is still counted, #3982; previously trivial: a Thai run with Latin finds one installed font covering it all on Linux too, #1549; previously trivial: symbol fonts keep their line height without the font; previously trivial: an equation-array row without `&` is centred, #2617; previously trivial: a superscript or subscript sizes its line at the full font size, without its raise or drop, as Word does; previously trivial: an object dragged near the bottom of a page lands where it is dropped, #3169; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: justified lines shrink their spaces by Word's measured limits; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: a click below a floating table goes to the text beside or after it, not to a cell of its last row, #2038; previously trivial: shapes drawn with their gradients and transparency, #1500; previously trivial: paragraphs above a float's anchor wrap around it, also when that pushes the anchor onto the next page, #2048; previously trivial: triple borders draw three lines, #1740; previously trivial: the caret, clicks and selection edges fall between the letters of a ligature, #1974; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: VML header-cell floats always on the page, user-checked in Word for Mac, #1775; previously trivial: an at-least row with no room for its minimum starts the next page whole, #1742; previously trivial: AutoFit donors lose equal widths down to their content minima; previously trivial: automatic space between Asian text and Latin text or digits, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: positional tabs go to the margins or indents, #2367; previously trivial: field results with right-to-left text read right to left, #1670; previously trivial: a list bullet no installed font can draw shows the level's default bullet, #1683; previously trivial: a missing Thai font is drawn in one Thai face for the whole run, #1549; previously trivial: the caret after spaces hanging past the margin stays at the margin, #2146; previously trivial: covered black-circle fallback before UI sans; previously trivial: resolved split-cell continuation top insets; previously trivial: Symbol PCL6 alias uses Symbol encoding; previously trivial: exact full font names select their installed face; previously trivial: Arial Unicode MS uses proportional fallbacks; previously trivial: DrawingML outline dashes, including zero-width paths; previously trivial: TOCs include table-cell headings and retain full targets; previously trivial: kept table rows follow the next row; previously trivial: consistent cell widths override a stale table grid; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: paragraph spacing adds up when the document turns HTML auto spacing off; previously trivial: an inherited footer sizes its percentage tables by its own section; previously trivial: an empty section mark stays on a full page; previously trivial: a fitting row with less room than its minimum height moves on whole; oversized rows still split; previously trivial: text past an exact-height row is cut off; previously trivial: a list number stays with text after a leading page break; previously trivial: a bookmark after a page break takes no line; previously trivial: a page break followed by a page break before or a next-page section starts one page; previously trivial: All Caps and Small Caps draw ß as SS, #1581; previously trivial: justified vertical page alignment, #1320; previously trivial: page numbers restart at 0; previously trivial: a list label moves with its first line when the paragraph is centred or end-aligned (#1159); previously trivial (a click just outside a floating table, by a cell whose text is turned, goes to the text beside or after it, #4181; previously trivial: group connector rerouting preserves transformed free and unresolved endpoints under nonuniform scaling; readiness estimates unchanged; previously trivial: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: an empty paragraph whose mark is hidden shows nothing, not even its list number, which is still counted, #3982; previously trivial: a Thai run with Latin finds one installed font covering it all on Linux too, #1549; previously trivial: symbol fonts keep their line height without the font; previously trivial: an equation-array row without `&` is centred, #2617; previously trivial: a superscript or subscript sizes its line at the full font size, without its raise or drop, as Word does; previously trivial: an object dragged near the bottom of a page lands where it is dropped, #3169; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: justified lines shrink their spaces by Word's measured limits; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: a click below a floating table goes to the text beside or after it, not to a cell of its last row, #2038; previously trivial: shapes drawn with their gradients and transparency, #1500; previously trivial: paragraphs above a float's anchor wrap around it, also when that pushes the anchor onto the next page, #2048; previously trivial: triple borders draw three lines, #1740; previously trivial: the caret, clicks and selection edges fall between the letters of a ligature, #1974; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: VML header-cell floats always on the page, user-checked in Word for Mac, #1775; previously trivial: an at-least row with no room for its minimum starts the next page whole, #1742; previously trivial: AutoFit donors lose equal widths down to their content minima; previously trivial: automatic space between Asian text and Latin text or digits, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: positional tabs go to the margins or indents, #2367; previously trivial: field results with right-to-left text read right to left, #1670; previously trivial: a list bullet no installed font can draw shows the level's default bullet, #1683; previously trivial: a missing Thai font is drawn in one Thai face for the whole run, #1549; previously trivial: the caret after spaces hanging past the margin stays at the margin, #2146; previously trivial: covered black-circle fallback before UI sans; previously trivial: resolved split-cell continuation top insets; previously trivial: Symbol PCL6 alias uses Symbol encoding; previously trivial: exact full font names select their installed face; previously trivial: Arial Unicode MS uses proportional fallbacks; previously trivial: DrawingML outline dashes, including zero-width paths; previously trivial: TOCs include table-cell headings and retain full targets; previously trivial: kept table rows follow the next row; previously trivial: consistent cell widths override a stale table grid; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: paragraph spacing adds up when the document turns HTML auto spacing off; previously trivial: an inherited footer sizes its percentage tables by its own section; previously trivial: an empty section mark stays on a full page; previously trivial: a fitting row with less room than its minimum height moves on whole; oversized rows still split; previously trivial: text past an exact-height row is cut off; previously trivial: a list number stays with text after a leading page break; previously trivial: a bookmark after a page break takes no line; previously trivial: a page break followed by a page break before or a next-page section starts one page; previously trivial: All Caps and Small Caps draw ß as SS, #1581; previously trivial: justified vertical page alignment, #1320; previously trivial: page numbers restart at 0; previously trivial: a list label moves with its first line when the paragraph is centred or end-aligned (#1159); previously trivial (PR #4545: eligible cell floats keep in-bounds offsets; overflow confinement retains the front-of-text, turned-cell and native-acceptance limits); previously trivial (MATH construction reuse, #3630; previously trivial: continuous sections one after another go onto new pages instead of running off the page; empty marks after another empty section mark take a line each until the page is full, then stay at its bottom drawing nothing, not even a list label; an empty mark that takes no room draws no list label either; a kept-together paragraph is measured against the page it would move to, so a tall different first-page header no longer splits it, #3907; previously trivial: a justified line ending in a manual line break is stretched to the margin unless `w:doNotExpandShiftReturn` is set, #3924; previously trivial: a no-break space is as wide as a space, #4192; previously trivial: a bookmark or other zero-width marker is no line-break opportunity, #4193; previously trivial: Arabic list labels: `arabicAlpha` and `arabicAbjad` draw the 28 Arabic letters (alphabetical and abjad order), doubling past the last letter; Hebrew, Hindi, Thai and Vietnamese still show decimal (`doc::section::tests::arabic_letters_count_in_both_orders`); previously trivial (ODT documents: a line of only pictures keeps its font's height; no setting for it any more); previously trivial (ODT documents: padding is the standard's box model always; picture-only line height is an ODF interpretation setting); previously trivial (行頭禁則 also covers the small kana and the prolonged sound mark at ordinary break opportunities, as JIS X 4051 §4 specifies, inferred from the standard and synthetic tests rather than checked in Word); previously trivial (a missing font is drawn in an installed metric twin before any other substitute: Arial for Helvetica on Windows, Tinos before macOS Times for Times New Roman); previously trivial (ODT documents: padding without a border takes room); previously trivial (ODT documents: a line of only pictures is as tall as they are); previously trivial (ODT documents: a table's own space above and below; header and footer spacing kept past a tall header); previously trivial (a page break before a table's first row moves the table; emphasis marks drawn with room in the line); previously trivial (text in a turned text box turns with it; previously trivial: an in-line picture, shape or chart moves with its run's raise or lowering, Word's `w:position`; previously trivial (layout work bounds: header-row repeats budgeted per layout, cached picture outlines charged to the decode budget, linked-box chain widths exact up to a work cap, #3867); previously trivial (the line between columns runs as tall as the section's text, so columns for selected text have it, #5178); previously trivial (a table row that would leave a cell empty on a page that already holds something, its picture or first line not fitting there, moves on whole instead of leaving the other cells' text beside the empty cell, #4272); previously trivial (a middle or bottom cell of a row split across pages lines up on the first page); previously trivial (tab leader dots spaced and placed as in Word); previously trivial (a level above that hasn't counted yet takes its first number at the first deeper item); previously trivial (paragraph side borders lie beyond their distance from the text, #5036); previously trivial (with a header taller than the top margin, Margin-anchored drawings, header-cell pins and header-table obstacles use the rendered body top; TopMargin and InsideMargin keep their declared band, #2485; previously trivial: connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (field results take the `\* DollarText`, `\* Hex` and `\* ArabicDash` switches, #4226; previously trivial: a cell spanning columns shares its extra minimum width by the columns' preferred widths, equally in automatic tables, #1883; previously trivial: continuous sections one after another go onto new pages instead of running off the page; empty marks after another empty section mark take a line each until the page is full, then stay at its bottom drawing nothing, not even a list label; an empty mark that takes no room draws no list label either; a kept-together paragraph is measured against the page it would move to, so a tall different first-page header no longer splits it, #3907; previously trivial: a justified line ending in a manual line break is stretched to the margin unless `w:doNotExpandShiftReturn` is set, #3924; previously trivial: a no-break space is as wide as a space, #4192; previously trivial: a bookmark or other zero-width marker is no line-break opportunity, #4193; previously trivial: Arabic list labels: `arabicAlpha` and `arabicAbjad` draw the 28 Arabic letters (alphabetical and abjad order), doubling past the last letter; Hebrew, Hindi, Thai and Vietnamese still show decimal (`doc::section::tests::arabic_letters_count_in_both_orders`); previously trivial: Preserve grapheme edit/wrap boundaries across independently drawn font/style pieces; Exact-spacing table contact uses the specified line height rather than paragraph-mark metrics (#3977); previously trivial: cu20we: restrict pre-spacing float origins to paragraph anchors; document cap helpers and regressions; previously trivial: cu20we: outline caps; previously trivial: cu20we: box float paragraph origin; previously trivial: group connector rerouting preserves transformed free and unresolved endpoints under nonuniform scaling; readiness estimates unchanged; previously trivial: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: an empty paragraph whose mark is hidden shows nothing, not even its list number, which is still counted, #3982; previously trivial: a Thai run with Latin finds one installed font covering it all on Linux too, #1549; previously trivial: symbol fonts keep their line height without the font; previously trivial: an equation-array row without `&` is centred, #2617; previously trivial: a superscript or subscript sizes its line at the full font size, without its raise or drop, as Word does; previously trivial: an object dragged near the bottom of a page lands where it is dropped, #3169; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: justified lines shrink their spaces by Word's measured limits; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: a click below a floating table goes to the text beside or after it, not to a cell of its last row, #2038; previously trivial: shapes drawn with their gradients and transparency, #1500; previously trivial: paragraphs above a float's anchor wrap around it, also when that pushes the anchor onto the next page, #2048; previously trivial: triple borders draw three lines, #1740; previously trivial: the caret, clicks and selection edges fall between the letters of a ligature, #1974; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: VML header-cell floats always on the page, user-checked in Word for Mac, #1775; previously trivial: an at-least row with no room for its minimum starts the next page whole, #1742; previously trivial: AutoFit donors lose equal widths down to their content minima; previously trivial: automatic space between Asian text and Latin text or digits, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: positional tabs go to the margins or indents, #2367; previously trivial: field results with right-to-left text read right to left, #1670; previously trivial: a list bullet no installed font can draw shows the level's default bullet, #1683; previously trivial: a missing Thai font is drawn in one Thai face for the whole run, #1549; previously trivial: the caret after spaces hanging past the margin stays at the margin, #2146; previously trivial: covered black-circle fallback before UI sans; previously trivial: resolved split-cell continuation top insets; previously trivial: Symbol PCL6 alias uses Symbol encoding; previously trivial: exact full font names select their installed face; previously trivial: Arial Unicode MS uses proportional fallbacks; previously trivial: DrawingML outline dashes, including zero-width paths; previously trivial: TOCs include table-cell headings and retain full targets; previously trivial: kept table rows follow the next row; previously trivial: consistent cell widths override a stale table grid; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: paragraph spacing adds up when the document turns HTML auto spacing off; previously trivial: an inherited footer sizes its percentage tables by its own section; previously trivial: an empty section mark stays on a full page; previously trivial: a fitting row with less room than its minimum height moves on whole; oversized rows still split; previously trivial: text past an exact-height row is cut off; previously trivial: a list number stays with text after a leading page break; previously trivial: a bookmark after a page break takes no line; previously trivial: a page break followed by a page break before or a next-page section starts one page; previously trivial: All Caps and Small Caps draw ß as SS, #1581; previously trivial: justified vertical page alignment, #1320; previously trivial: page numbers restart at 0; previously trivial: a list label moves with its first line when the paragraph is centred or end-aligned (#1159); previously trivial: PAGE fields in a paragraph split across pages show the page they are on, #1352; previously trivial: a dragged floating object anchors in the column it lands in, #884; previously trivial: a paragraph ending on a page with footnotes keeps its space after above the separator, #1116; previously trivial: symbol-font text drawn as Unicode symbols, #776; previously trivial: large-table scrolling measured and fixed, #811; previously trivial: text boxes use their own margins; Resize shape to fit text never cuts text, #743; previously trivial: complex-script shaping and Myanmar line breaking, #604; previously trivial: body page totals, table-cell footnotes and bookmark link pages fixed, #450 #451 #455; previously major: first version; line breaking, pagination and object placement checked against Word's behaviour from the layout source on origin/main) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Floating anchor row segments:** 2026-11-07 · A floating anchor after a manual page/column break counts visible content on the far side of the same wrapped row. Marker-only cover anchors retain their previous-page rule. Synthetic picture spacing, placement and history controls; no new native Word measurement. Readiness estimates unchanged. + A document only "opens correctly" if its pages break where Word breaks them: the same lines, the same page count, footnotes and pictures on the same pages. This checklist covers line breaking, @@ -22,30 +24,37 @@ Exact line spacing keeps the run font baseline around tall equations; automatic | Feature | State | Evidence / gap | Hours | |---|---|---|---| -| 2026-10-16 | trivial | Split-cell content retains its resolved top margin and border band on continuation pages, matching original Word Mac16.113.2 controls. Synthetic regressions cover margins, borders, line spacing and image frames. | | Hint-reliant CJK glyph outlines (DFKai-SB / 標楷體) | 🟡 | Required TrueType interpreter runs at units-per-em size; local Windows glyph-bounds regression and synthetic DOCX page/window comparison pass. Other platforms and hint-reliant families remain unmeasured; no native Word comparison. A font asking for a twilight zone over 1,024 points or a stack over 4,096 values, or a glyph past 256 KiB of hinting buffer, is drawn unhinted; on desktop, once at least three of a face's hinted draws have taken over 50 ms and those slow draws are at least 1/16 of its hinted draws, its later glyphs are drawn unhinted (#3692). | — | | Subpoint table grid columns | 🟡 | Preserve positive grid widths rather than imposing a text-box minimum; ECMA-376 §17.4.16. Native Word for Mac 16.113.2 build26092012 confirms narrow trailing grid units. `layout::tests::subpoint_grid_keeps_widths`, `tiny_grid_scales_to_width`. Tiny totals normalize without overflowing the scale factor. Zero and invalid widths retain their fallback. Border painting remains separate. | n/a | -| Line breaking (UAX #14 with Word's exceptions: no break after `/`, a break after `-` before a digit) | ✅ | `layout::tests::no_line_break_right_after_a_slash`, `layout::tests::a_hyphen_before_digits_is_a_break_opportunity_like_word`, `layout::tests::a_bookmark_is_no_line_break_opportunity` | — | +| Line breaking (UAX #14 with Word's exceptions: no break after `/`, a break after `-` before a digit) | ✅ | `layout::tests::no_line_break_right_after_a_slash`, `layout::tests::a_hyphen_before_digits_is_a_break_opportunity_like_word`, `layout::tests::a_bookmark_is_no_line_break_opportunity; the paragraph's kinsoku (JIS X 4051 §4 行頭禁則) lists the small kana (っゃゕヶ, the katakana phonetic extensions ㇰ…ㇿ, the halfwidth small kana ァ…ッ) and the prolonged sound mark ー/ー as non-starters — CJ/NS in UAX #14, where the break before them is only a tailoring choice — as JIS X 4051 §4 specifies, inferred from the standard and the synthetic tests named here rather than checked in Word. The rule covers ordinary break opportunities only: a line too narrow for any of them takes the emergency break in `para::break_lines`, which can still start with one, as the module doc records. `layout::tests::a_line_never_starts_with_a_small_kana_or_the_prolonged_sound_mark`, `layout::kinsoku::tests::no_start_holds_every_small_kana_and_the_prolonged_sound_mark` | — | +| Line breaking (UAX #14 with Word's exceptions: no break after `/`, a break after `-` before a digit, or before a slash and a letter (`Dataprotection-` / `/Secrecyviolation` in the #3408 report's Word PDF; `fitness-/1589` stays whole in the arabic_rice_benefits_article reference), no break between `.` and `(`) | ✅ | `layout::tests::no_line_break_right_after_a_slash`, `layout::tests::a_hyphen_before_digits_is_a_break_opportunity_like_word`, `layout::tests::a_hyphen_before_a_slash_is_a_break_opportunity_like_word`, `layout::tests::a_full_stop_before_a_parenthesis_is_no_break`, `layout::tests::a_bookmark_is_no_line_break_opportunity` | — | | A break before a slash that starts a word (" /word" wraps whole; not after a no-break space) | 🟡 | `layout::tests::a_word_after_a_slash_wraps_whole`, `layout::tests::a_no_break_space_before_a_slash_still_holds`; behaviour from the #2963 report, not compared with Word yet | — | | Narrow table cells | ✅ | `layout::tests::narrow_cells_keep_their_width`: usable widths below 12 pt wrap without expansion; oversized glyphs still make progress | 0 | -| Justification, Word 2013+ space shrinking (compat mode 15) | ✅ | #109 | — | +| Justification, Word 2013+ space shrinking (compat mode 15) | ✅ | #109; spaces before a line's first character (paragraph indented with spaces, after a line break or a tab, a bookmark, hidden text or a floating object's anchor before them) keep their width in justified and distributed lines, `layout::tests::leading_spaces_keep_their_width_in_justified_lines` | — | | Spaces at the end of a line hang past the right margin instead of wrapping; the caret after them stays at the margin, in the body and in headers and footers | ✅ | `layout::tests::caret_after_hanging_spaces_stays_at_the_margin` (#2146): a letter typed after them wraps to the next line | — | | Complex scripts (Myanmar, Khmer, Indic): shaped per script run with OpenType fallback fonts, one cluster per syllable, Myanmar wraps between syllables | 🟡 | `layout::tests::complex` (#604). Khmer, Thai and Lao still wrap only at spaces (need a dictionary) | 4–8 | +| Cursive joining (Arabic, Syriac, Mongolian, N'Ko…) across runs: a letter takes its form from the text shown beside it, across a change of formatting, past a vowel sign in a run of its own and past hidden or tracked-deleted text left out of the view; a tab, break, object or drop cap still stops the join | ✅ | `layout::tests::bidi::letters_join_across_a_change_of_formatting`, `letters_join_past_text_left_out_of_the_layout`, `letters_join_past_a_mark_in_a_run_of_its_own`, `letters_stay_apart_where_nothing_joins_them` (#4093); not compared with Word on this machine | 0 | | Kashida justification (Arabic) | ❌ | no kashida in `crates/layout` | 3–5 | | Missing Thai document fonts (TH Sarabun New, Angsana New, Cordia New, Browallia New, the UPC families, Leelawadee): one Thai substitute face for the whole run, Latin letters, digits and ฿ included, so the run keeps one font at one size as Word's Cordia New substitution does | ✅ | `fonts::word::tests::a_missing_thai_font_resolves_to_an_installed_thai_face`, `fonts::fontdb::tests::a_thai_run_with_latin_falls_back_to_one_face`, `layout::tests::complex::a_missing_thai_font_draws_the_whole_run_in_one_thai_face`, `layout::tests::complex::a_thai_substitute_without_latin_hands_the_run_to_one_face_covering_it`, `fonts::fontdb::tests::sysfonts::a_run_no_preferred_face_covers_whole_loads_an_installed_font_that_does` (#1549). Windows: Cordia New, then Leelawadee UI, Tahoma, Noto Sans Thai; macOS: Thonburi (Sathu for the serif families); Linux: Noto Sans Thai, then the TLWG fonts. The first listed face with Latin letters and digits as well as Thai wins. Other Thai names (`TH …`, `…UPC`, names with `Thai`) use the same lists. When no listed face is installed, or the one found lacks the run's Thai or Latin letters, the run moves to one installed face covering its Thai and Latin text if there is one, even when a preferred Thai family without Latin letters (Noto Sans Thai) is installed; that face's whole family is loaded, so regular text keeps the Regular face. Only Thai fonts: a missing Latin font keeps Latin text in its own substitute, and a run with its own complex-script font keeps it for the Thai letters, as Word does | — | | Distributed / Thai distributed alignment | 🟡 | read; layout untested | 1–2 | +| Default font metrics (Aptos, Calibri, Cambria…) | 🟡 | Missing Arial Unicode MS tries Arial then the Arial substitutes, case-insensitively (`fonts::word::tests::unicode_arial_is_proportional`); glyph coverage and exact Word line height can differ. Carlito/Caladea/Liberation are metric-compatible for Calibri/Cambria/Arial/Times/Courier, and a missing font is drawn in the first installed font of its metric twins (`fonts::word::METRIC_TWINS`) before any other substitute; **Aptos (Word's default since 2024) has no metric-compatible open substitute**, so new Word documents wrap differently ([typing-parity.md](typing-parity.md) Known gaps). Needs an owner decision (commission or license a metric-matched font) | 6–10 + owner | +| Distributed / Thai distributed alignment | 🟡 | read (Thai distributed laid out as distributed); spaces before a line's first character keep their width and the last character reaches the margin (`layout::tests::leading_spaces_keep_their_width_in_justified_lines`); the rest of the layout untested | 1–2 | | Default font metrics (Aptos, Calibri, Cambria…) | 🟡 | Missing Arial Unicode MS tries Arial then the Arial substitutes, case-insensitively (`fonts::word::tests::unicode_arial_is_proportional`); glyph coverage and exact Word line height can differ. Carlito/Caladea/Liberation are metric-compatible for Calibri/Cambria/Arial/Times/Courier; **Aptos (Word's default since 2024) has no metric-compatible open substitute**, so new Word documents wrap differently ([typing-parity.md](typing-parity.md) Known gaps). Needs an owner decision (commission or license a metric-matched font) | 6–10 + owner | | Colour emoji and colour fonts on screen and in page renders: COLR v0/v1 paint graphs (solid fills, linear, radial and sweep gradients, composite modes) and bitmap strikes (Apple Color Emoji `sbix`, Noto Color Emoji `CBDT`) drawn in the font's colours at the layout's position and size; a dark page doesn't invert them, the same as pictures | 🟡 | `fonts::color` (skrifa), `render::color_glyph`; `render::tests::color_glyphs::emoji_are_drawn_in_colour` and `emoji_keep_their_colours_on_a_dark_page` (system font, skip without one), `render::color_glyph::tests`, `fonts::color::tests` (#1269). A glyph copies at most 65,536 gradient stops and clip-path elements in all, else it falls back to its outline, and the cache charges what it keeps (#3692). CBDT is verified on a real page with Noto Color Emoji; COLR v0/v1 and sbix are implemented to the OpenType spec and tested with synthetic data, but not yet seen on a real font (Segoe UI Emoji, COLRv1 Noto, Apple Color Emoji). PDF export already drew them through krilla | 1–2 | +| Default font metrics (Aptos, Calibri, Cambria…) | 🟡 | Missing Arial Unicode MS tries Arial then the Arial substitutes, case-insensitively (`fonts::word::tests::unicode_arial_is_proportional`); glyph coverage and exact Word line height can differ. Carlito/Caladea/Liberation are metric-compatible for Calibri/Cambria/Arial/Times/Courier; **Aptos (Word's default since 2024) has no metric-compatible open substitute**, so new Word documents wrap differently ([typing-parity.md](typing-parity.md) Known gaps). Needs an owner decision (commission or license a metric-matched font). Apple's Times and Courier (one em tall) take Times New Roman's and Courier New's single line spacing, as Word for Mac lays them out (measured at 11 and 20 pt on synthetic documents); Helvetica and Symbol lines are also taller in Word than their own metrics, rule not yet known | 6–10 + owner | +| Colour emoji and colour fonts on screen and in page renders: COLR v0/v1 paint graphs (solid fills, linear, radial and sweep gradients, composite modes) and bitmap strikes (Apple Color Emoji `sbix`, Noto Color Emoji `CBDT`) drawn in the font's colours at the layout's position and size; a dark page doesn't invert them, the same as pictures | 🟡 | `fonts::color` (skrifa), `render::color_glyph`; `render::tests_color_glyphs::emoji_are_drawn_in_colour` and `emoji_keep_their_colours_on_a_dark_page` (system font, skip without one), `render::color_glyph::tests`, `fonts::color::tests` (#1269). CBDT is verified on a real page with Noto Color Emoji; COLR v0/v1 and sbix are implemented to the OpenType spec and tested with synthetic data, but not yet seen on a real font (Segoe UI Emoji, COLRv1 Noto, Apple Color Emoji). PDF export already drew them through krilla | 1–2 | | Full font names in document font requests | ✅ | Exact English (or first available) OpenType name ID4 lookup in loaded faces and the native lazy catalog; family and legacy-family matches keep priority. No style-suffix guessing; named variable-instance aliases remain unsupported | 0 | | Symbol fonts (Symbol including its PCL6 alias, Wingdings, Wingdings 2/3, Webdings) without the proprietary font: each character, stored as U+F020–U+F0FF or a plain 8-bit code, is drawn as its Unicode equivalent from a face that has it; PDF text and copies read as those symbols | ✅ | `doc::symbol_fonts` tables (Adobe Symbol table and Unicode L2/12-368), `layout::tests::wingdings_text_draws_and_reads_as_its_unicode_symbols` (#776). Shapes come from Noto Sans Symbols / Symbols 2, DejaVu Sans or Segoe UI Symbol, so they differ from Word's; Wingdings 0xFF (not in Unicode) still has no symbol. A line keeps the symbol font's own height (Symbol, Wingdings: the ascent and descent Word's PDFs give them), so a Symbol bullet makes its line as tall as in Word, `layout::tests::a_symbol_bullet_sizes_its_line_by_the_symbol_font`. Apple's one-em Symbol takes the same height, as in Word for Mac (`fonts::word::tests::a_one_em_symbol_face_takes_windows_symbols_line`) | 0 | | List bullets stored as a private-use character (U+E000–U+F8FF) in a font that isn't installed and isn't a mapped symbol-font code: drawn as the level's default bullet (• ○ ▪), not as whatever an installed icon font has at that code | ✅ | `layout::tests::private_use_bullet_no_font_draws_shows_the_levels_default_bullet` (#1683: U+F081 showed Font Awesome's Twitter logo) | — | | Indents in characters (`w:firstLineChars`, `w:leftChars`…), measured in the paragraph mark's font size | ✅ | #534, `layout::tests::character_indents_use_the_paragraph_mark_size`; spacing in lines (`w:beforeLines`/`w:afterLines`) uses the stored points (needs the document grid) | — | -| Line spacing (single, 1.5, double, at least, exactly, multiple), spacing before/after, contextual spacing | 🟡 | Contextual spacing measured in body paragraphs and headers (below), with a four-paragraph table-cell regression; list-label ascent overflow is unscaled by multiple spacing and uses descent for automatic and at-least spacing (#601); a superscript or subscript sizes its line at the full font size and its raise or drop doesn't grow the line, while a `w:position` raise or lowering does (Word for Mac); other line-spacing combinations remain (#108, #135 open) | 3–5 | +| Line spacing (single, 1.5, double, at least, exactly, multiple), spacing before/after, contextual spacing | 🟡 | Contextual spacing measured in body paragraphs and headers (below), with a four-paragraph table-cell regression; list-label ascent overflow is unscaled by multiple spacing and uses descent for automatic and at-least spacing (#601); a superscript or subscript sizes its line at the full font size and its raise or drop doesn't grow the line, while a `w:position` raise or lowering does, and its text is set at 0.65 of its size rounded to the half point (Word for Mac); other line-spacing combinations remain (#108, #135 open) | 3–5 | +| Line spacing (single, 1.5, double, at least, exactly, multiple), spacing before/after, contextual spacing | 🟡 | Contextual spacing measured in body paragraphs and headers (below), with a four-paragraph table-cell regression; a cell's last paragraph with contextual spacing, in the Normal style (or an undefined one), drops its space after, the end-of-cell mark counting as a Normal paragraph beside it (not where `allowSpaceOfSameStyleInTable` keeps same-style space in modes 11/12/14); this rule is inferred from docxide-pdf's notes and its `cell-end-*` fixtures, and a Word comparison that tells it apart from the neighbouring paragraph's style is still open; a middle or bottom cell of a split row lines up without that dropped space (`contextual_spacing_drops_the_space_after_a_cells_last_normal_paragraph`, `a_bottom_cell_of_a_split_row_ignores_a_dropped_space_after_beside_it`, `a_bottom_cell_of_a_split_row_lines_up_with_a_kept_space_after_beside_it`); list-label ascent overflow is unscaled by multiple spacing and uses descent for automatic and at-least spacing (#601); a superscript or subscript sizes its line at the full font size and its raise or drop doesn't grow the line, while a `w:position` raise or lowering does (Word for Mac); other line-spacing combinations remain (#108, #135 open) | 3–5 | | Kerning only where Kerning for fonts asks for it (`w:kern`, at or above its size) | ✅ | Measured in Word for Windows: no `w:kern` or `w:kern="0"` is unkerned; WordCraft kerned every run, so its lines held more text than Word's. `layout::tests::kerning_follows_kerning_for_fonts_like_word` | — | | OpenType ligatures as the document asks (`w14:ligatures`: standard `liga`, contextual `clig`, historical `hlig`, discretional `dlig`, any combination, in runs, styles and defaults) | 🟡 | `layout::tests::ligatures_follow_w14_ligatures`, `ligature_flags_map_to_opentype_features`. Without the property WordCraft keeps drawing standard and contextual ligatures, while Word draws none; the Font dialog's Ligatures choice is still missing | 1 | | Automatic (HTML-style) paragraph spacing (`w:beforeAutospacing`, `w:afterAutospacing`) | ✅ | Measured in Word for Windows: 14 pt at any size, none at the top of the document or a cell or after a cell's last paragraph, the larger of two neighbouring spaces. `layout::tests::automatic_paragraph_spacing_like_word`, `…_drops_at_cell_edges` | — | | Paragraph boundaries inside field instructions | ✅ | Synthetic DOCX observed in Word: instruction-only paragraphs add no height; the empty result keeps a line. `docx::fixtures::field_code_spans_paragraphs`, `layout::tests::hidden_marks_take_no_space`. Other field-code display modes remain unverified | — | -| Widow/orphan control, keep with next, keep lines together, page break before | ✅ | `lib.rs` keep_next/keep_lines; a line holding only a page break stays at the bottom of a full page instead of leaving a blank page (#534); a paragraph ending with a page break keeps its space after on the old page, so the next page starts at the top (compatibility modes 12 to 15, `layout::tests::space_before_at_the_top_of_a_page_like_word`); a three-line paragraph with room for two moves whole (neither a widow nor an orphan is allowed), as in Word | — | +| Widow/orphan control, keep with next, keep lines together, page break before | ✅ | a page break before a table's first-row paragraph moves the whole table to a new page, as Word does (`layout::tests::a_page_break_in_a_tables_first_row_moves_the_table`); emphasis marks make their line taller to fit; `lib.rs` keep_next/keep_lines; a line holding only a page break stays at the bottom of a full page instead of leaving a blank page (#534); a paragraph ending with a page break keeps its space after on the old page, so the next page starts at the top (compatibility modes 12 to 15, `layout::tests::space_before_at_the_top_of_a_page_like_word`); a three-line paragraph with room for two moves whole (neither a widow nor an orphan is allowed), as in Word | — | +| Widow/orphan control, keep with next, keep lines together, page break before | ✅ | `lib.rs` keep_next/keep_lines; a line holding only a page break stays at the bottom of a full page instead of leaving a blank page (#534); a paragraph ending with a page break keeps its space after on the old page, so the next page starts at the top (compatibility modes 12 to 15, `layout::tests::space_before_at_the_top_of_a_page_like_word`); a three-line paragraph with room for two moves whole (neither a widow nor an orphan is allowed), as in Word; page break before applies at a continuous section's mid-page top (#5287, `layout::tests::a_page_break_before_after_a_continuous_mark_starts_a_page`, original Word for Mac 16.113 probe). The break also starts a new page at the top of a later column in such a section; that case remains unmeasured in Word | — | | Tabs (left, center, right, decimal, bar), leaders | 🟡 | Bar tabs untested. Positional tabs (`w:ptab`, ECMA-376 §17.3.3.23) go to the left edge, centre or right edge of the margins or indents whatever the tab stops, and to the next line when the text has passed that place (#2367, `layout::tests::right_positional_tab_ends_text_on_the_right_margin` and the three after it); not compared with Word on lines narrowed by floating objects or right-to-left paragraphs; a right, centre or decimal tab whose text doesn't fit, and a left tab whose stop is past the right indent, go to the next line with their text, as in Word, so a TOC page number keeps its leader; an ordinary left tab inside the margin can still leave its next word on the next line (#1840) Leader dots are spaced by the dot's advance in whole 600-dpi pixels, on the page's grid of that pitch from the first place after the text before the tab to the last that ends before the text after it, as measured in Word (`layout::tests::leader_dots_are_spaced_and_placed_as_in_word`). | 1–2 | | Hyphenation (automatic, zone from the document, words in capitals, soft hyphens, consecutive limit, Manual Hyphenation, #407) | 🟡 | Per the text's language: English, Polish, Portuguese, Italian and German patterns, Bulgarian and Turkish syllable rules, Russian word-division rules; other languages use the English patterns | in localization | | Drop caps (dropped and in margin, lines, distance, font; `w:framePr w:dropCap`) | ✅ | 2026-10-17 | — | @@ -55,21 +64,25 @@ Exact line spacing keeps the run font baseline around tall equations; automatic | Section breaks (next page, continuous, even, odd), different first page, odd/even headers | ✅ | Section breaks don't show in Draft view (#42). A break inserted with text selected goes before the selection and keeps it, as in Word (#852). An otherwise empty section at page start retains its line (`empty_page_section_keeps_line`); a closing mark after text stays quiet, but one after another section's mark takes its line while it fits and then stays at the page's bottom, so the text after a long run starts the next page; a run of continuous sections with text goes onto new pages like plain text, and a kept-together paragraph low in a continuous section is measured against the next page's body (its header, footer and carried notes), not the current one's (#3907). | 1–2 | | Labels on page-break-only list paragraphs | ✅ | `layout::tests::break_only_list_has_no_label`: no bullet or number on the break, but the next number is still 3 after item 1 and a break. Plain empty items keep their labels. Synthetic DOCX observed through Adobe PDF conversion | — | | List labels after a leading page break | ✅ | `layout::tests::bidi::list_label_after_leading_page_break_uses_its_text_lines_alignment`: the number/bullet and text retain the no-break horizontal positions for start, centre, end and justified alignment, LTR/RTL, including text with a tab. The issue's synthetic DOCX exports with the number before the heading, matching the reporter's Word/LibreOffice reference (#2964); reference applications were not rerun locally | — | -| List labels: number formats (decimal, letters, Russian letters, roman, ordinal text, Chinese/Japanese/Korean counting and legal, 一〇一 digits, 甲乙丙, ①…⑳, full-width), `%n` text such as `第%1章` / `(%1)`, legal numbering | ✅ | a level above that hasn't counted yet takes its first number at the first deeper item, as measured in Word: after 10.1–10.4 the next level-1 item is 11 (`doc::numbering::tests::a_deeper_item_first_counts_the_levels_above_it`); `doc::cjk_numbers` tests, `doc::section::tests::russian_letters_follow_word`, `layout::tests::chinese_counting_list_labels_and_their_font_runs`, `layout::tests::russian_letter_list_labels_draw_cyrillic`; a label mixing faces (digit + CJK comma) is drawn run by run (#534); Russian letters skip ё, й, ъ and ь and then double (аа, бб), as observed in Word. Hebrew, Hindi, Thai and Vietnamese formats show decimal; `arabicAlpha` and `arabicAbjad` draw Arabic letters, then double (أأ, بب) (`doc::section::tests::arabic_letters_count_in_both_orders`). The label stays attached to the start of the text when the paragraph is centred or aligned to the end, as in Word (#1159). | — | +| List labels: number formats (decimal, letters, Russian letters, roman, ordinal text, Chinese/Japanese/Korean counting and legal, 一〇一 digits, 甲乙丙, ①…⑳, full-width), `%n` text such as `第%1章` / `(%1)`, legal numbering | ✅ | a level above that hasn't counted yet takes its first number at the first deeper item, as measured in Word: after 10.1–10.4 the next level-1 item is 11 (`doc::numbering::tests::a_deeper_item_first_counts_the_levels_above_it`); `doc::cjk_numbers` tests, `doc::section::tests::russian_letters_follow_word`, `layout::tests::chinese_counting_list_labels_and_their_font_runs`, `layout::tests::russian_letter_list_labels_draw_cyrillic`; a label mixing faces (digit + CJK comma) is drawn run by run (#534); Russian letters skip ё, й, ъ and ь and then double (аа, бб), as observed in Word. Hebrew, Hindi, Thai and Vietnamese formats show decimal; `arabicAlpha` and `arabicAbjad` draw Arabic letters, then double (أأ, بب) (`doc::section::tests::arabic_letters_count_in_both_orders`). The label stays attached to the start of the text when the paragraph is centred or aligned to the end, as in Word (#1159). A level with number format `none` is an ordinary level whose own number reads as nothing, as in Word for Windows (Microsoft 365, checked by MeHail-02): its label is its text with that number empty (`RESPONSE:`; `Part` above `%1.%2` gives `.1`), it counts and restarts the levels below it, it stays empty in legal numbering, and an empty label still tabs the text to the indent unless it already ends there (Heading 2 of the Chapter 1 list stays at the margin) (#4985; `doc::numbering::tests::a_none_level_shows_its_text_and_still_counts`, `layout::tests::a_none_format_label_shows_its_text_and_tabs_to_the_indent`). | — | | Body top below a tall header, footer pushes body up | ✅ | #138; a footer taller than the bottom margin moves the body bottom up (#453), and a header or footer linked to the previous section takes its room too (#454) | — | | Tables: row border exceptions (`w:tblPrEx/w:tblBorders`) | ✅ | `row_borders_stay_on_row`, `row_nil_overrides_style`: explicit cell borders win; row exceptions precede table styles and table borders | — | | Footnotes at the page bottom, endnotes at the end, note numbering | 🟡 | A long note continues onto the next page at a line boundary (its first line stays with the reference), first in that page's note area under a full-width continuation separator (#352); the document's own separator, continuation separator and continuation notice are drawn (the notice under a note that continues); on a page with footnotes a paragraph ending there keeps its space after above the separator, or its last lines go to the next page with the note (#1116); a long endnote continues on the next column or page at a line boundary (#456), and the caret finds note text on its continuation page (#457); each section's note options: footnotes below the text, endnotes at the end of each section, start at, numbering restarted each section or each page (counted from where the notes land, at most three passes) (#385) | 1–2 | -| Tables: row heights (at least/exact), rows split across pages, header rows repeat, Can't Split | ✅ | 2026-10-06, #138; omitted cell-margin edges inherit current table defaults; every cell in a row gets the row's largest top and bottom margin; an exact height covers the top border, top margin and text, the bottom margin comes on top, and an exact row never splits; a row split across pages keeps its cells' bottom margin, border and last space after on the first page, widow/orphan control applies in its cells, each cell continues at the top of the next page and an at-least row keeps its minimum; an at-least row with less room than its minimum on a page that already holds something starts the next page whole (Allow row to break on or off, vAlign centre too), as observed in Word for Mac 2026-10-15 (a row of about 2.6 cm), #1742; that repeated header rows go with it and that a row taller than a page splits from the top of the next page come from the issue and synthetic tests, not a Word check (`…_an_at_least_row_with_no_room_starts_the_next_page_whole_either_way_breaking_is_set`, `…_an_at_least_row_taller_than_a_page_splits_from_the_top_of_the_next_page`, `layout::tests::a_row_shares_its_largest_top_and_bottom_margins`, `…_a_split_row_keeps_its_bottom_margin_and_widow_control`, `…_split_row_cells_each_continue_at_the_top`); a row's `gridAfter` is bounded to 63 columns in native documents too, and repeated header rows stop after 500 000 copied items across a table (hostile documents, #3692); a cell aligned to the middle or bottom of a split row is aligned within the part left on the page when all its text fits there (as tall as the other cells' text there), and runs from the top of the cell otherwise, as measured in Word (`layout::tests::a_middle_or_bottom_cell_of_a_split_row_lines_up_on_the_first_page`); a row whose first part on a page that already holds something would leave a cell empty there, because that cell's first line or inline picture (one line, never split) runs past the room, moves on whole instead of leaving the other cells' text beside the empty cell, so an at-least row grown taller than its minimum by a picture no longer splits off its picture (#4272; inferred from the reporter's Word result and the earlier observation that Word doesn't leave a cell empty for widow control, not yet checked in Word for rows without a minimum; at the top of a page such a row still splits; `layout::tests::an_at_least_row_grown_by_its_picture_moves_on_whole_rather_than_leave_the_picture_behind`, `…_a_picture_row_that_fits_stays_and_text_rows_beside_a_short_picture_still_split`, `…_a_picture_row_too_tall_for_any_page_splits_from_the_top_of_the_next_one`) | — | +| Tables: row heights (at least/exact), rows split across pages, header rows repeat, Can't Split | ✅ | 2026-10-06, #138; omitted cell-margin edges inherit current table defaults; every cell in a row gets the row's largest top and bottom margin; an exact height covers the top border, top margin and text, the bottom margin comes on top, and an exact row never splits; a row split across pages keeps its cells' bottom margin, border and last space after on the first page, widow/orphan control applies in its cells, each cell continues at the top of the next page and an at-least row keeps its minimum; an at-least row with less room than its minimum on a page that already holds something starts the next page whole (Allow row to break on or off, vAlign centre too), as observed in Word for Mac 2026-10-15 (a row of about 2.6 cm), #1742; that repeated header rows go with it and that a row taller than a page splits from the top of the next page come from the issue and synthetic tests, not a Word check (`…_an_at_least_row_with_no_room_starts_the_next_page_whole_either_way_breaking_is_set`, `…_an_at_least_row_taller_than_a_page_splits_from_the_top_of_the_next_page`, `layout::tests::a_row_shares_its_largest_top_and_bottom_margins`, `…_a_split_row_keeps_its_bottom_margin_and_widow_control`, `…_split_row_cells_each_continue_at_the_top`); a row's `gridAfter` is bounded to 63 columns in native documents too, and repeated header rows stop after 500 000 copied items across a table (hostile documents, #3692); a cell aligned to the middle or bottom of a split row is aligned within the part left on the page when all its text fits there (as tall as the other cells' text there), and runs from the top of the cell otherwise, as measured in Word (`layout::tests::a_middle_or_bottom_cell_of_a_split_row_lines_up_on_the_first_page`); a row whose first part on a page that already holds something would leave a cell empty there, because that cell's first line or inline picture (one line, never split) runs past the room, moves on whole instead of leaving the other cells' text beside the empty cell, so an at-least row grown taller than its minimum by a picture no longer splits off its picture (#4272; inferred from the reporter's Word result and the earlier observation that Word doesn't leave a cell empty for widow control, not yet checked in Word for rows without a minimum; at the top of a page such a row still splits; `layout::tests::an_at_least_row_grown_by_its_picture_moves_on_whole_rather_than_leave_the_picture_behind`, `…_a_picture_row_that_fits_stays_and_text_rows_beside_a_short_picture_still_split`, `…_a_picture_row_too_tall_for_any_page_splits_from_the_top_of_the_next_one`); a row of a nested table marked Can't Split isn't split with its outer row: the outer row moves on whole when that row comes first in it (docxide-pdf `nested-first-row-*-cant1`) and otherwise splits above it (inferred, not yet checked in Word), and on a fresh page a nested row taller than the room still splits; `layout::tests::nested_cant_split::nested_cant_split_row_moves_on_with_its_outer_row`, `…::the_outer_row_splits_above_a_nested_cant_split_row`, `…::the_cut_moves_up_until_no_nested_cant_split_row_runs_through_it`, `…::the_outer_row_breaks_between_nested_cant_split_rows_above_its_bottom_band`, `…::a_bottom_aligned_cell_keeps_its_nested_cant_split_row_whole`, `…::header_rows_go_on_with_a_first_row_whose_nested_cant_split_row_comes_first`, `…::a_kept_row_goes_on_with_a_row_whose_nested_cant_split_row_cant_start_below_it`, `…::a_merged_cell_doesnt_stretch_its_cant_split_row`, `…::nested_cant_split_row_taller_than_a_page_still_splits` | — | | Tables: autofit to contents/window, fixed widths, Word 2013 edge | 🟡 | #137; #44: AutoFit Contents measures each column's narrowest and widest text and shares the width like Word, once (not live as you type); consistent a percentage width past 100% is kept, as Word does; a table with its own preferred width keeps it, however far past the margin, and only an automatic-width table over 1.5× the text width is squeezed to the margins (Word squeezes it as soon as it is wider) (#1721); cell widths override stale grid proportions when their totals agree (`cell_widths_override_grid`); conflicting widths and spans still differ | 3–5 | | Floating tables (`w:tblpPr`) | 🟡 | #137; one placed on the page or margin that would cover visible text before it and does not fit below it moves to the next page (#534); empty line-break lines do not count as text; a click below one, outside its cells, goes to the text beside or after it, not to its last row, as checked in Word (#2038); exact line-bottom contact counts for tables only (#3977), both in row-span selection and word skipping; exact-spacing table contact uses the specified height rather than paragraph-mark metrics, with original Source Sans 3 controls in modes 11/12/14/15; expected Word rule from [cyril265's Word for Mac 16.114.1 measurements](https://github.com/storytold/wordcraft/issues/3977#issuecomment-6374217574), not a new Word run of these originals; anchor-order replay remains #3790's scope; other overlap rules untested | 2–3 | +| Floating tables (`w:tblpPr`) | 🟡 | #137; one placed on the page or margin that would cover visible text before it and does not fit below it moves to the next page (#534); empty line-break lines do not count as text; a click below one, outside its cells, goes to the text beside or after it, not to its last row, as checked in Word (#2038); the same for a click within 2pt of a cell whose text is turned comes from the issue and synthetic tests, not a check by hand (#4181); other overlap rules untested | 2–3 | +| Floating tables (`w:tblpPr`) | 🟡 | #137; one placed on the page or margin that would cover visible text before it and does not fit below it moves to the next page (#534); empty line-break lines do not count as text; a click below one, outside its cells, goes to the text beside or after it, not to its last row, as checked in Word (#2038); exact line-bottom contact counts for tables only (#3977), both in row-span selection and word skipping; exact-spacing table contact uses the specified height rather than paragraph-mark metrics, with original Source Sans 3 controls in modes 11/12/14/15; expected Word rule from [cyril265's Word for Mac 16.114.1 measurements](https://github.com/storytold/wordcraft/issues/3977#issuecomment-6374217574), not a new Word run of these originals; anchor-order replay remains #3790's scope; one with `tblOverlap=never` moved below another keeps its distance from the text's left edge only in Word 2013 layout (mode 15), before it its own left edge, also when its first cell has no left margin (docxide `displaced-anchor-*`); other overlap rules untested | 2–3 | +| Floating tables (`w:tblpPr`) | 🟡 | #137; one placed on the page or margin that would cover visible text before it and does not fit below it moves to the next page (#534); empty line-break lines do not count as text; a click below one, outside its cells, goes to the text beside or after it, not to its last row, as checked in Word (#2038); exact line-bottom contact counts for tables only (#3977), both in row-span selection and word skipping; exact-spacing table contact uses the specified height rather than paragraph-mark metrics, with original Source Sans 3 controls in modes 11/12/14/15; expected Word rule from [cyril265's Word for Mac 16.114.1 measurements](https://github.com/storytold/wordcraft/issues/3977#issuecomment-6374217574), not a new Word run of these originals; anchor-order replay remains #3790's scope; other overlap rules untested; an empty paragraph (or one of bookmarks and other markers only) after a document's leading floating table takes no space before (docxide-pdf's `leading-empty-before-float` Word PDFs, the paragraph beside the table); below a full-width one it loses it too, untested; a paragraph with text below a full-width one keeps it (`connector-paragraph-anchor-0`/`-240`); one with text beside a narrow one, and later pages and columns, are untested and keep it | 2–3 | | Nested tables | 🟡 | render; polish missing | 2–4 | -| Floating pictures/shapes placement (relative to page/margin/column/paragraph/line/character) | ✅ | #136; in a header or footer table cell, a float not laid out in its cell (`layoutInCell="0"`, VML `o:allowincell="f"`, or any VML shape in a header or footer: user-checked in Word for Mac) and placed relative to the page or margins is placed on the page, drawn with the header behind or in front of its text, on every page: Word's picture watermark in a header that starts with a table is centred behind the body text (#1775, `layout::tests::header_cell_float_placed_on_the_page`). Other cell floats are still placed relative to their cell | — | +| Floating pictures/shapes placement (relative to page/margin/column/paragraph/line/character) | ✅ | #136; in a header or footer table cell, a float not laid out in its cell (`layoutInCell="0"`, VML `o:allowincell="f"`, or any VML shape in a header or footer: user-checked in Word for Mac) and placed relative to the page or margins is placed on the page, drawn with the header behind or in front of its text, on every page: Word's picture watermark in a header that starts with a table is centred behind the body text (#1775, `layout::tests::header_cell_float_placed_on_the_page`). Other cell floats are still placed relative to their cell. A float anchored in a line of a long paragraph that goes onto a later page is drawn on that page (observed in Word for Mac: a picture dragged onto a page that only continues a paragraph stays there, saved with its anchor on that page and its offset from the paragraph's top there), and that page's lines are broken again around it (the #1374 relay, so not past its limit); relative to the paragraph, it is measured from where the paragraph continues there; text added on the pages before leaves it where it is. One anchored right after a page break stays on the page before (a cover page, #1632). The page is decided before the lines are placed; a float whose anchor only goes to the next page because the float itself narrows the lines stays on the first page, with the text wrapping around it; on a later page, a float anchored on a line moved to a later page by footnotes or widow control is drawn on that page, and one whose own wrap pushes its line on stays with the text wrapping around it. Not yet: a float anchored in a later column of the same page is still placed with the paragraph's first piece, as before (#4250, `layout::tests::a_float_anchored_on_a_later_page_of_its_paragraph_is_drawn_on_that_page` and the tests after it) | — | +| Floating pictures/shapes placement (relative to page/margin/column/paragraph/line/character) | ✅ | #136; in a header or footer table cell, a float not laid out in its cell (`layoutInCell="0"`, VML `o:allowincell="f"`, or any VML shape in a header or footer: user-checked in Word for Mac) and placed relative to the page or margins is placed on the page, drawn with the header behind or in front of its text, on every page: Word's picture watermark in a header that starts with a table is centred behind the body text (#1775, `layout::tests::header_cell_float_placed_on_the_page`). Other cell floats are still placed relative to their cell. A float anchored in a line of a long paragraph that goes onto a later page is drawn on that page (observed in Word for Mac: a picture dragged onto a page that only continues a paragraph stays there, saved with its anchor on that page and its offset from the paragraph's top there), and that page's lines are broken again around it (the #1374 relay, so not past its limit); relative to the paragraph, it is measured from where the paragraph continues there; text added on the pages before leaves it where it is. One anchored right after a page break, with nothing after it that takes room (other anchors, bookmarks, comment or field marks), stays on the page before (a cover page, #1632); with anything after it that takes room (text, a space or tab, an inline picture, another break), it is on the new page with it (observed in Word for Mac: a shape dragged beside the first line after a page break inside a paragraph is saved anchored right after the break, positioned from the paragraph's top on the new page, and stays there, #4262, `layout::tests::a_float_anchored_before_text_after_a_page_break_is_drawn_on_the_next_page`). The page is decided before the lines are placed; a float whose anchor only goes to the next page because the float itself narrows the lines stays on the first page, with the text wrapping around it; on a later page, a float anchored on a line moved to a later page by footnotes or widow control is drawn on that page, and one whose own wrap pushes its line on stays with the text wrapping around it. Not yet: a float anchored in a later column of the same page is still placed with the paragraph's first piece, as before (#4250, `layout::tests::a_float_anchored_on_a_later_page_of_its_paragraph_is_drawn_on_that_page` and the tests after it) | — | | Shape fills: gradients and transparency | 🟡 | #1500: linear (angle, `scaled`) and circular gradients and transparent fills drawn on screen, PNG and PDF (axial/radial shadings), soft edges fading the real fill; rectangular and shape-following path gradients drawn circular, `tileRect`/`flip` not drawn, outline gradients drawn in their middle colour, `rotWithShape="0"` drawn as turning with the shape | 2–4 | | Text wrap: square, top-and-bottom, behind, in front | ✅ | 2026-10-06; beside an object, a line's first word that doesn't fit the strip goes on whole to the row's next strip or the next row, instead of being split (#1376, `layout::tests::a_word_too_wide_for_the_strip_beside_a_float_moves_on_whole`; inferred from a reporter's comparison, not yet measured in Word) a paragraph running on into the next column or page is broken again there around that column's shapes, its own floating objects left where they are (#1374). Text in an earlier column doesn't yet wrap around a shape anchored in a later one (#1158) | #884: an object dragged on a multi-column page anchors to a paragraph in the column it lands in, so that column's text wraps around it. Text laid out before the anchor (an earlier column) doesn't yet wrap around an object anchored later on the page, nor do lines a paragraph continues into the next column (broken once, in the column it starts in) | | Text wrap: square, top-and-bottom, behind, in front | ✅ | 2026-10-06; beside an object, a line's first word that doesn't fit the strip goes on whole to the row's next strip or the next row, instead of being split (#1376, `layout::tests::a_word_too_wide_for_the_strip_beside_a_float_moves_on_whole`; inferred from a reporter's comparison, not yet measured in Word) a paragraph running on into the next column or page is broken again there around that column's shapes, its own floating objects left where they are (#1374). Text in an earlier column doesn't yet wrap around a shape anchored in a later one (#1158) | #884: an object dragged on a multi-column page anchors to a paragraph in the column it lands in, so that column's text wraps around it. Paragraphs above an object's anchor wrap around it when it is placed higher up the page (the page is laid out again with it known from the start, #2048; when that wrap pushes the anchor onto the next page, the first page keeps the room and the object goes with its anchor, and a layout that still hasn't settled moves the object down to its paragraph rather than over text); text in an earlier column beside it doesn't yet, nor do lines a paragraph continues into the next column (broken once, in the column it starts in) | | Text wrap: tight, through (contour, wrap polygon) | 🟡 | #354: lines follow the wrap polygon, or the outline worked out from the object (shape geometry; a picture's opaque pixels as a convex hull; otherwise the rectangle), turned and flipped with it, kept the left/right distance from text; Through also uses gaps inside the outline. Wrap side (`wrapText`: both sides, left only, right only, largest side per line) applies to square, tight and through wraps, turned objects included; picture outlines are convex; a picture is decoded once for all its crops, pictures whose header says they are opaque are not decoded, and at most 2^28 pixels per layout are decoded (later pictures wrap as rectangles in that layout, #3692); not compared page-for-page with Word | 1–2 | | Text boxes, overflow, linked text boxes | ✅ | #46; linked text boxes (#369): the text runs on through each box in turn at that box's line length, overflow past the last box hidden; Align Text top / middle / bottom; the box's own internal margins, and a box set to Resize shape to fit text shows all its text (#743); a chain's story is laid out at no more than 16 box widths (told apart to a twip), later boxes needing another taking the nearest one in their text direction (#3692) | — | -| Rotated objects and text | 🟡 | #332: pictures, shapes, charts and groups drawn turned and flipped about their centre (screen and PDF); square wrap and inline lines keep clear of the rotated bounds; hit testing on the turned shape. Text in a rotated text box stays upright | 2–3 | +| Rotated objects and text | 🟡 | #332: pictures, shapes, charts and groups drawn turned and flipped about their centre (screen and PDF); square wrap and inline lines keep clear of the rotated bounds — unless the file keeps no room for the turn (no or a zero `wp:effectExtent`): then an inline one's line keeps to its frame, exchanged in width and height from 45° to 135° and 225° to 315° in Word 2013+ layout, and the picture overhangs it, cut at the line's top and bottom, as in Word; hit testing on the turned shape. Text in a rotated text box turns with it (on screen, PNG and PDF; upside down when the box is flipped across, never mirrored, as Word draws it); clicks and the caret in it still go by its upright text | 1–2 | | Connector lookup cost | 🟡 | One temporary layout-object index per reroute replaces repeated page scans. Repeated positions retain page-hint preference, first-match order and first-page fallback; same-page glue and free/unresolved endpoints are unchanged. Synthetic lookup equivalence, geometry and 8,000-page scaling regressions; model object access and obstacle routing remain separate, no new native Word comparison | #3631 | | Group connector rerouting | 🟡 | Glued ends keep their existing connection-site path; free ends, missing targets and invalid sites retain their displayed rotated and flipped position when the connector frame is rebuilt, including under nonuniform group scaling. Model and engine regressions cover all connector kinds, both ends, rotations/flips, unit/uniform/nonuniform scale, idempotent rerouting, degenerate dimensions without nonfinite writes, and fallback spans beyond the 4000 pt display-size cap without endpoint movement or repeated shrinkage. Non-invertible display scales and unrepresentable fallback spans leave connectors needing fallback endpoints unchanged; fully resolved connectors still reroute. Invalid child extents use the renderer's unit-scale fallback. Routing around obstacles remains missing; no new native Word comparison | — | | Page borders (from page edge or text), page colour, watermark | ✅ | | — | @@ -83,10 +96,11 @@ Exact line spacing keeps the run font baseline around tall equations; automatic | Bidirectional paragraphs, mixed-direction lines; RTL tables and sections | 🟡 | #207; RTL tables (#362): grid columns from the right edge, start alignment and indent from the right margin, cell margins and left/right borders mirrored, merged and turned cells and nested tables included; RTL sections (#362): newspaper columns right to left with the line between mirrored. Right-hand page gutter (`w:rtlGutter`) missing | 1 | | Equations: display layout, numbering, wrapping long display equations | ✅ | #191; long display equations break at top-level operators (`m:brkBin`, `m:brkBinSub`), manual breaks and `m:alnAt`, continuation lines indented by `m:wrapIndent` or set right (`m:wrapRight`) (#326); an n-ary operator, delimiter, accent or group character the math font lacks is drawn from a fallback font instead of a missing-glyph box (#1273); an equation-array row without `&` is centred among aligned rows, as in Word (#2617) | — | | Hidden text excluded from breaking and hyphenation | ✅ | #173 | — | -| Empty paragraph with a hidden mark (`w:pPr/w:rPr/w:vanish`) | ✅ | Synthetic DOCX observed in Word for Windows 16.0.20527: no room, no list number, and the number is still counted (`1.`, hidden item, `3.`), in the body and in table cells. `layout::tests::empty_list_paragraph_with_a_hidden_mark_counts_but_shows_nothing`, #3982. A paragraph with text and a hidden mark shown together with the next one (Word) is #3986 | - | +| Empty paragraph with a hidden mark (`w:pPr/w:rPr/w:vanish`) | ✅ | Synthetic DOCX observed in Word for Windows 16.0.20527: no room, no list number, and the number is still counted (`1.`, hidden item, `3.`), in the body and in table cells. `layout::tests::empty_list_paragraph_with_a_hidden_mark_counts_but_shows_nothing`, #3982. Not observed in Word: when such a paragraph closes a section before a continuous one and holds only an in-line picture (or a note reference, or a legacy check box), the picture keeps its room and the next section starts below it instead of over it (`a_hidden_mark_with_an_inline_picture_keeps_its_room`, #5288). A paragraph with text and a hidden mark shown together with the next one (Word) is #3986 | - | | Fields: PAGE, NUMPAGES, SECTIONPAGES, TOC page numbers | ✅ | #52; totals in the body need a second pass once the page count is known (#451); SECTIONPAGES includes shared continuous-section start pages | — | | Compatibility modes (Word 2003/2007/2010 layout for old files: `w:compat` options) | 🟡 | `allowSpaceOfSameStyleInTable` supported in modes 11/12/14; mode 15 retains contextual suppression. `doNotExpandShiftReturn` keeps justified lines that end in a manual line break short (#3924). Most other legacy compat options remain ignored | 10–20 | | Fields: STYLEREF in headers and footers (running chapter titles) | ✅ | Evaluated per page at layout time: the page's first (or with `\l` last) paragraph of the style, else the nearest before it; style name, id or heading level (a level finds the style named `heading N` whatever its id, so localized documents match, #1286); character styles; `\n \r \w \s \t \p` (`\r` treated as `\w`); body STYLEREF updated with the other fields (#775). Field results with right-to-left text (a Hebrew heading, "פרק א") are laid out with bidi reordering like ordinary text: the result is an isolate taking its first strong letter's direction (else the text's around the field), and each level run is shaped and mirrored in its own direction, so `{ PAGE }` in field-code view and `(Chapter 1)` keep their brackets in right-to-left paragraphs; this covers every field and note mark shown as text (#1670). Header paragraphs are cached on their per-page results, so typing in body text no STYLEREF shows doesn't lay the headers out again (#1286) | — | +| Fields filled in for output: SEQ, STYLEREF, REF in the body | ✅ | PDF export, print jobs and page images lay out a copy whose unlocked SEQ, STYLEREF and REF fields show their current results, as Word does when printing or exporting with Update fields before printing off (measured in Word for Windows with stale stored results); a locked SEQ keeps its result but still counts, its `\r` too, and a SEQ in a tracked deletion keeps its result and doesn't count, with markup shown or hidden (measured in Word for Windows); NUMWORDS, FILENAME, the document properties and formulas keep their stored results, as in Word; REF fields with `\p`, `\r`, `\n` or `\w` (above or below, and paragraph numbers) keep theirs until those are computed, and so does a REF to a bookmark that ends in a later paragraph (Word shows its paragraphs as paragraphs of the result); SEQ numbers are filled in before the STYLEREF and REF fields that read them, so a STYLEREF to a heading holding a SEQ field shows its new number (after F9 too); SEQ fields in text boxes are numbered where their boxes are anchored, after F9 too, and a REF to a bookmark in a text box, header, footer, footnote, endnote or comment shows that text as stored, as in Word; a REF to a bookmark the document lacks prints "Error! Reference source not found."; the document is unchanged (`cmd::references::tests::output_shows_fresh_seq_styleref_and_ref_results`, `cmd::references::tests::output_numbers_text_box_captions_where_their_boxes_are_anchored`, `cmd::references::tests::output_shows_references_to_bookmarks_outside_the_body`, `cmd::references::tests::output_shows_words_error_for_a_reference_to_a_missing_bookmark`, `cmd::references::tests::output_counts_locked_seq_fields_and_not_deleted_ones`) | — | | Fields: PAGE, NUMPAGES, SECTIONPAGES, TOC page numbers, PAGEREF in headers and footers | ✅ | #52; totals in the body need a second pass once the page count is known (#451); SECTIONPAGES includes shared continuous-section start pages; a PAGE field in a paragraph that runs onto a later page (a page break inside it, or a natural split) shows that page's number, the rest of the paragraph broken again for the wider result (#1352); PAGEREF in headers and footers shows its bookmark's page, filled in after pagination like their totals (#1477); in the body it keeps its result until fields are updated | — | | Fields: `\* DollarText`, `\* Hex` and `\* ArabicDash` | 🟡 | `\* DollarText` writes lowercase cardinal text, "and", and the first two decimals over 100 (`{ = 9.20 + 5.35 \* DollarText }` shows "fourteen and 55/100"), `\* Hex` uppercase hexadecimal digits (458 shows "1CA"), and `\* ArabicDash` the number between hyphens (`{ PAGE \* ArabicDash }` shows "- 31 -"), in table formulas and in the page-number, SEQ, PAGEREF, NUMWORDS, NUMCHARS and REVNUM fields; a capitalization switch applies after them (#4226). A result past 999,999 in cardinal or ordinal text, or past 999,999.99 in dollar text, keeps its digits, and so does a negative result or a fractional Hex or ArabicDash result. `layout::fields::tests::dollar_text_hex_and_arabic_dash_switches`, `engine::cmd::table_formula::tests::dollar_text_and_hex_switches_write_the_result`, `engine::tests::table_formula_results_take_dollar_text_and_hex`; not compared with Word | — | | Page-by-page comparison harness against Word | ❌ | Run Word locally on our own synthetic documents, export PDF, compare line breaks; Word output stays under `plan/` (never committed) | 8–12 | @@ -189,8 +203,11 @@ No overall parity estimate changes from these probes. ## Performance +Page drawing resolves requested text-box warps in one prefix walk per paragraph and story (#3614), including boxes with no transform. Temporary lookup entries are limited to requested offsets and are discarded after the call. Item order, duplicate placements, warp geometry and saved content are preserved in original Linux display and CLI/MCP checks; native Word comparison is untested. + | Measure | WordCraft | Word | Kind | |---|---|---|---| +| Print Markup balloon anchor discovery with many unrelated inline markers (#3614) | Single forward object walk; document order, first-root filtering, UTF-8 byte positions and the 5,000-anchor cap unchanged | not measured | `balloons::anchor_tests` semantic, cap and thread-CPU scaling regressions | | Cold layout, 188-page document | 61 ms | not measured | measured 2026-10-06 (not re-run this pass) | | Relayout after an edit | 1.4 ms | not measured | measured 2026-10-06 | | Font picker with many installed fonts | fixed freezes (#233) | instant | issue #31, #59 | @@ -262,8 +279,20 @@ new mixed-style emoji and mixed bundled-font combining-mark controls cover LTR/b hit stops, full selection, and narrow/overwide line wrapping. Independent review and the full layout suite are pending; this is not a new Word/native-IME acceptance claim. +Body `PAGE` fields in paragraphs and tables use the active section's number format; section headers and footers are measured with that format before body placement. Regression coverage includes Web, Draft, Read and Outline views. +MATH glyphs that reference the same construction now share its immutable variants and assembly data (#3630). Glyph mappings, values and the existing partial-record fallback stay unchanged. Repeated glyph IDs keep their last valid reference without retaining superseded constructions. Distinct overlapping constructions and assembly-only sharing remain separate. + +The front-of-text opt-out is retained from the earlier implementation; this patch does not establish native Word equivalence between front-of-text and behind-text pictures. Synthetic placement tests cover the two paths, while a new native comparison of those wrap modes remains open. Turned-cell layouts disable horizontal cell confinement because their frame x axis becomes page y. + ## Revision history +> 2026-11-05 · Arabic letters join across a change of formatting and past hidden or deleted text (#4093): each run is shaped with the text shown on either side of it. + +> 2026-11-01 · Text in a turned text box is drawn turned with it, about its centre, on screen and in PNG and PDF export; flipped across, upside down; flipped side to side, still readable (as Word draws it). Clicks and the caret inside a turned box still go by its upright text (`layout::tests::a_turned_text_box_turns_its_text_with_it`). + +> 2026-11-01 · An in-line picture, shape or chart is raised or lowered by its run's position (Word's `w:position`, Font › Advanced › Position): lowered, it reaches below the baseline and the line grows down to hold it (at most until its top is on the baseline); raised, it stands clear of the baseline. It used to stand on the baseline whatever the position (`layout::tests::an_inline_picture_moves_with_its_runs_position`). +> 2026-11-03 · Before Word 2013 layout a floating table that may not overlap another and is moved below it keeps its own left edge instead of stepping in by its distance from the text, also when its first cell has no left margin (`layout::tests::a_floating_table_moved_below_another_keeps_its_edge_before_word_2013_layout`). + > 2026-11-01 · Paragraph side borders lie beyond their distance from the text, as the top and bottom ones do; top and bottom reach the corners and the shading fills out to the outer edges (#5036) (`layout::tests::side_borders_lie_beyond_their_distance_from_the_text`). > 2026-10-25 · Field results take the `\* DollarText`, `\* Hex` and `\* ArabicDash` switches in table formulas and in the page-number, SEQ, PAGEREF and count fields (#4226) (`layout::fields::tests::dollar_text_hex_and_arabic_dash_switches`). @@ -278,6 +307,37 @@ layout suite are pending; this is not a new Word/native-IME acceptance claim. | Date | Change | Summary | |---|---|---| +| 2026-11-08 | trivial | Turned inline pictures with no recorded effect extent keep their line to the frame (exchanged near a quarter turn in Word 2013+ layout) and overhang it, cut at the line's top and bottom, as in Word | +| 2026-11-08 | trivial | Contextual spacing drops the space after a table cell's last paragraph in the Normal style, the end-of-cell mark counting as a Normal paragraph; another style keeps it, and a middle or bottom cell of a split row lines up without the dropped space (#5450) (`layout::tests::contextual_spacing_drops_the_space_after_a_cells_last_normal_paragraph`, `a_bottom_cell_of_a_split_row_ignores_a_dropped_space_after_beside_it`). | +| 2026-11-04 | trivial | Header table measurements and fitted text-box heights use the page section’s PAGE format; cache reuse follows the field context | +| 2026-11-03 | trivial | Body PAGE fields in tables use the active section number format; reflow views measure headers and footers with it before body placement | +| 2026-11-06 | trivial | An in-line picture lowered further than its own height (`w:position`) was held with its top on the baseline and its line only as deep as the picture; Word keeps the top there but lowers the line as far as the position says. A 6 pt picture lowered 30 pt now makes a 30 pt line alone and the text's ascent plus 30 pt beside text, as in Word. This closes the gap noted on 2026-11-05: all 156 synthetic lines measured then now match Word within 0.35 pt, heights and picture positions. Exact spacing keeps the line's baseline as before (`tests::lowered_pictures_and_check_boxes_take_words_line_heights`, `tests::an_inline_picture_moves_with_its_runs_position`). | +| 2026-10-31 | trivial | List labels: a level with numFmt none is an ordinary level whose own number reads as nothing: it shows its literal text (`RESPONSE:`), counts and restarts the levels below it, stays empty in legal numbering, and an empty label still tabs the text to the indent, as in Word (#4985) | +| 2026-11-06 | trivial | Superscript and subscript text: Word for Mac sets it at 0.65 of the run's size rounded to the half point (from digit advances in its PDF export, base sizes 8–36 pt: 8 → 5, 9 → 6, 10 → 6.5, 11 → 7, 12 → 8, 13 → 8.5, 14 → 9, 16 → 10.5, 20 → 13, 24 → 15.5, 36 → 23.5). WordCraft used 0.65 exactly (11 pt → 7.15), so lines with superscripts came out up to 0.5 pt wider and some broke a word early; the `cargo xtask word-compare` superscript and author-line probes in Arial go from 95–97% of lines with Word's breaks to 100%. `doc::resolve::tests::raised_and_lowered_text_is_sized_to_the_half_point`, `layout::tests::superscript_digits_advance_at_the_half_point_size` | +| 2026-11-06 | trivial | Line numbers are laid out with the document's "Line Number" character style over its defaults, as Word draws them, not in a fixed 10 pt grey (`layout::tests::line_numbers_follow_the_line_number_style`) | +| 2026-11-07 | trivial | A floating anchor after a manual page/column break counts visible content on the far side of the same wrapped row. Marker-only cover anchors retain their previous-page rule. Synthetic picture spacing, placement and history controls; no new native Word measurement. Estimates unchanged. | +| 2026-11-05 | trivial | PR #4545: eligible cell floats retain in-bounds offsets and touch the outer cell edge only on overflow, ignoring wrap distances for object placement. Front-of-text, turned-cell and outside-cell opt-outs remain. Synthetic geometry controls; native front/behind-text parity remains unqualified. | +| 2026-11-05 | trivial | With multiple spacing a line of only in-line pictures is as tall as they reach, raised or lowered, and never less than its font's height (a list label's font counting too): a picture shorter than the font keeps the font's ascent and descent, as noted for ODT documents below; a taller one ends at the line's bottom with no descent under it. The spacing adds its share of the font's height, not of a lowered picture's. A legacy check box sizes its line as text of its size. Measured in Word with Arial at 10 and 20 pt, single, 1.15, 1.25 and 1.5 spacing, 156 synthetic lines (`tests::lowered_pictures_and_check_boxes_take_words_line_heights`). Known gap: a picture lowered further than its own height is limited to that height where Word's line keeps growing. | +| 2026-11-04 | trivial | PR #4609: relative REF keeps context already displayed by the own or a needed ancestor label; six synthetic legal-template cases and separate-list context follow the Word for Windows measurements reported by @pakiat in PR discussion. Existing unknown-switch/cache boundaries and readiness estimates unchanged; no new native Word run. | +| 2026-10-28 | trivial | Shared MATH construction records reuse variants and assembly data without changing glyph mappings or existing limits (#3630); readiness estimates unchanged | +| 2026-10-29 | trivial | Page drawing indexes text-box warp lookups per paragraph (#3614); requested offsets only, bounded prefix traversal, original Linux display and persistence controls; readiness estimates unchanged | +| 2026-10-31 | trivial | A floating object anchored right after a page break inside a paragraph, before text, is drawn on the new page, as in Word; only a cover page's anchors, with nothing taking room after them, stay on the page before (#4262) | +| 2026-10-31 | trivial | On a later page of a long paragraph, a float anchored on a line moved to a later page by footnotes or widow control is drawn on that page; one whose own wrap pushes its line on stays with the text wrapping around it (#4250, `layout::tests::a_float_anchored_on_a_line_a_footnote_pushes_on_is_drawn_on_the_next_page` and the two after it) | +| 2026-10-31 | trivial | A floating object anchored in a line of a long paragraph on a later page is drawn on that page, positioned from where the paragraph continues, as in Word; a shape dropped on such a page stays there (#4250) | +| 2026-11-04 | trivial | Output counts a locked SEQ and not one in a tracked deletion, as Word does; readiness estimates unchanged | +| 2026-11-01 | trivial | SEQ fields in text boxes are numbered where their boxes are anchored, in output and after F9, and a REF finds a bookmark in a text box | +| 2026-11-01 | trivial | SEQ, STYLEREF and REF fields show fresh results in output; readiness estimates unchanged | +| 2026-10-29 | trivial | Print Markup balloon anchor discovery walks paragraph objects once (#3614); readiness estimates unchanged | +| 2026-11-03 | trivial | A decimal tab scans the text after it once, not once per cluster. Separate from the #3412 word-measurement fix | +| 2026-10-30 | trivial | Layout work bounds for hostile documents (#3867): header-row repeats budgeted per layout and counting canvas members; picture-outline decode budget charged for cached outlines too, so cold and warm layouts wrap alike; linked-box chains keep exact widths up to a work cap, not 16 widths; `gridAfter` bounded | +| 2026-10-29 | trivial | A missing font is drawn in an installed metric twin before any other substitute (`fonts::word::METRIC_TWINS`, also what the missing-font warning calls metric-compatible): Arial for Helvetica on Windows, Arial for Liberation Sans on a Mac, Tinos before macOS Times for Times New Roman, Cousine before Menlo for Courier New. Documents in fonts with no installed twin lay out as before | +| 2026-11-02 | trivial | Honor page break before at a continuous section's mid-page top (#5287); its later-column case remains unmeasured in Word. Readiness unchanged. | +| 2026-11-03 | trivial | A line breaks after a hyphen before a slash and a letter ("Dataprotection-" / "/Secrecyviolation"), not before a slash and a digit ("fitness-/1589" stays whole, as in Word), so auto-fit table columns no longer widen to the whole compound (#3408) | +| 2026-11-03 | trivial | A section's closing paragraph with a hidden mark and only an in-line picture (or a note reference) is not an empty hidden mark: the picture keeps its room, and a continuous section after it starts below it, not over it; not observed in Word (#5288) | +| 2026-11-03 | trivial | A row of a nested table marked Can't Split isn't split with its outer row: the outer row moves on whole when that row comes first in it, and otherwise splits above it (inferred); on a fresh page a nested row taller than the room still splits (docxide-pdf `nested-first-row-*-cant1`) | +| 2026-11-03 | trivial | No line break between a full stop and an opening parenthesis: `2023.(Example` wraps whole at the space before, as in the docxide-pdf `dot-open-token*` Word references | +| 2026-11-03 | trivial | Before Word 2013 layout a floating table moved below another keeps its own left edge, also when its first cell has no left margin (the mode was read from that margin being zero); readiness estimates unchanged | +| 2026-11-03 | trivial | An empty paragraph after a document's leading floating table takes no space before, as Word's PDFs of docxide-pdf's `leading-empty-before-float` cases show (the paragraph beside the table); below a full-width one it loses it too, untested; paragraphs with text, later pages and columns keep it (`layout::tests::float_top`) | | 2026-11-01 | trivial | Columns: the line between them runs from the section's top on the page to the bottom of its tallest column; a continuous section mid-page gets its line (#5178) | | 2026-10-31 | trivial | A table row that would leave a cell empty on a page that already holds something (its inline picture or first line runs past the room) moves on whole instead of leaving the other cells' text beside the empty cell; an at-least row grown by its picture no longer splits off the picture (#4272) | | 2026-11-01 | trivial | A cell aligned to the middle or bottom of a row split across pages is aligned within the part left on the page when its text fits there, and starts at the top of the cell otherwise, as measured in Word | @@ -285,6 +345,9 @@ layout suite are pending; this is not a new Word/native-IME acceptance claim. | 2026-10-31 | trivial | A list level above that hasn't counted yet takes its first number at the first deeper item, as measured in Word (1.1, 1.2, then 2.; 10.1–10.4, then 11.), whether or not the deeper level's text shows it | | 2026-11-01 | trivial | #5088: paragraph side borders lie outside the text; top and bottom reach the corners; shading fills to the outer edges (#5036) | | 2026-11-01 | trivial | #2485: Port header Margin body-boundary placement to current modules; use the existing text-height floor for inline Margin extents and correct historical control labels. Source checks only; primary qualification pending. | +| 2026-11-01 | trivial | #3915: preserve guarded whole-line ordinary-tab alignment with current main. Existing controls retained; source checks only, primary qualification pending. | +| 2026-10-25 | trivial | Justified and distributed lines no longer stretch the spaces before a line's first character: Thai official letters indent paragraphs with ~20 spaces, and their first line moved right by up to the line's slack (86 pt in a measured case). Measured in Word with synthetic documents: left, `both`, `distribute` and `thaiDistribute` put the first character at the same place, for Thai and Latin text, at the paragraph start, after a line break and after a tab. A distributed line no longer counts the space it wrapped at, or the manual line break it ends with, so its text reaches the margin as in Word | +| 2026-11-01 | trivial | #2437: Preserve finite paragraph-border flow extents and terminal-break keep preflight with current-main changes. Recursive terminal-successor lookahead remains outside scope. Source checks only; primary qualification pending. | | 2026-10-30 | trivial | Keep with next: a kept heading before a three-line paragraph under widow/orphan control needs room for all three lines, since that paragraph can only move over whole; with room for two, the heading goes to the next page with it instead of staying alone at the bottom, as in Word for Mac 16.93. `layout::tests::keep_with_next_carries_the_heading_when_a_three_line_paragraph_moves_whole` | | 2026-10-28 | trivial | Connector object lookups retain the typed column-selection inputs on current main (#3631); readiness estimates unchanged | | 2026-10-27 | trivial | Connector rerouting indexes laid-out object positions once per batch, preserving page hints, first-match order and same-page glue; synthetic equivalence, geometry and scaling regressions (#3631); routing policy and readiness estimates unchanged | @@ -292,6 +355,8 @@ layout suite are pending; this is not a new Word/native-IME acceptance claim. | 2026-10-25 | trivial | Field results take the `\* DollarText`, `\* Hex` and `\* ArabicDash` switches in table formulas and in the page-number, SEQ, PAGEREF and count fields (#4226); readiness estimates unchanged | | 2026-10-25 | trivial | Header-cell pins and header-table obstacles share the rendered body-top override (#2485); model positioning and overlap controls, no new native comparison. | | 2026-10-19 | trivial | Header body-boundary adjustment applies only to the Margin anchor. TopMargin and InsideMargin keep their declared extent; synthetic alignment countercontrols are prepared, not yet executed. | +| 2026-10-29 | trivial | Port #3915 to split layout modules: ordinary LTR tab groups follow paragraph alignment. Positional tabs, lists, RTL and display math retain their alignment paths. Source port only. | +| 2026-10-29 | trivial | Port #2437 to split layout modules: finite border extents and terminal-break keep preflight. Recursive keep lookahead remains outside scope. Source port only. | | 2026-10-25 | trivial | Arabic list labels: `arabicAlpha` and `arabicAbjad` draw the 28 Arabic letters (alphabetical and abjad order), doubling past the last letter; Hebrew, Hindi, Thai and Vietnamese still show decimal (`doc::section::tests::arabic_letters_count_in_both_orders`) | | 2026-10-24 | trivial | Preserve grapheme edit/wrap boundaries across independently drawn font/style pieces; original emoji regression retained, new mixed-style/bundled-font LTR/bidi controls pending managed validation | | 2026-10-24 | trivial | Exact-spacing table contact uses the specified line height in row selection and word skipping; large/small mark regressions in modes 11/12/14/15 (#3977); shape estimates unchanged | @@ -301,7 +366,9 @@ layout suite are pending; this is not a new Word/native-IME acceptance claim. | 2026-10-22 | trivial | Layout lookups linear in clipped cells, authors, sections, header paragraphs and bidi offsets (#3692, #3706) | | 2026-10-22 | trivial | Layout work bounds for hostile documents: linked-box chain widths, repeated header items, `gridAfter`, picture decodes (#3692) | | 2026-10-22 | trivial | Hostile fonts (#3692): hint-reliant fonts with huge hinting zones are drawn unhinted, and a face draws its later glyphs unhinted once at least three of its hinted draws took over 50 ms and those are at least 1/16 of its hinted draws; a colour glyph's gradient stops and clip paths share one budget | +| 2026-10-24 | trivial | A click just outside a floating table, within 2pt of a cell whose text is turned, goes to the text beside or after the table instead of that cell (#4181) | | 2026-10-22 | trivial | Group connector rerouting preserves displayed free and unresolved endpoints under nonuniform scaling while resolved ends keep their connection-site path; degenerate dimensions and unrepresentable fallback display spans are guarded; synthetic model/engine coverage only, readiness estimates unchanged | +| 2026-10-21 | trivial | 行頭禁則 (JIS X 4051 §4): the paragraph's kinsoku also forbids a line starting with a small kana (ぁ…ヶ, the katakana phonetic extensions ㇰ…ㇿ, the halfwidth small kana ァ…ッ) or the prolonged sound mark ー/ー, at ordinary break opportunities, as JIS X 4051 §4 specifies (inferred from the standard and synthetic tests, not checked in Word); the emergency break for a line too narrow for any of the prohibited characters or ordinary break opportunities is unchanged and can still start with one; kinsoku off and word wrap off are unchanged | | 2026-10-21 | trivial | A word with no break opportunity in it, laid out beside a floating object, no longer lays out quadratically: every word is measured once, before the line is broken (#3412) | | 2026-10-23 | trivial | An empty paragraph whose mark is hidden is laid out as nothing, like a deleted one: no room, no list number (still counted, as in Word) and no shading, in the body and in table cells, headers and text boxes (#3982) | | 2026-10-25 | trivial | A bookmark, comment anchor or other zero-width marker is no line-break opportunity: a word that doesn't fit after one no longer leaves a blank line, and one inside a word no longer splits it (#4193) | @@ -313,6 +380,8 @@ layout suite are pending; this is not a new Word/native-IME acceptance claim. | 2026-10-23 | trivial | Continuous sections running off a page go onto the next; empty marks after a section mark take a line until the page is full, measured in Word (#3907) | | 2026-10-27 | trivial | Empty marks past the page bottom draw nothing, not even a list label; an empty mark after a text paragraph closing a section stays quiet and, like any mark taking no room, draws no bullet (#3907 review) | | 2026-10-27 | trivial | A kept-together paragraph in a continuous section is measured against the next page's body, so a tall different first-page header no longer splits one that fits on page 2 (#3907 CodeRabbit) | +| 2026-10-27 | trivial | 2026-10-27 · #4533 review: numeric REF updates lazily index body bookmarks once per update, retaining the first body bookmark for duplicate names. Unsupported switches and ordinary REF/PAGEREF behavior are unchanged; a synthetic 64-reference regression covers repeated updates and duplicate names. Estimates unchanged. | +| 2026-10-27 | trivial | 2026-10-27 · #4533: numeric REF fields use paragraph list numbers for no/full/relative context, reusing bounded numbering. Shared context already embedded in a level label is removed; merged-away cells do not count. Unsupported separator/text/position switches and ambiguous contexts or delimiter-free joins retain cached results. Synthetic OOXML regressions; no native Word or real-document validation, estimates unchanged. | | 2026-10-20 | trivial | A click below a floating table, outside its cells, goes to the paragraph beside or after it instead of a cell of its last row, as checked in Word (#2038) | | 2026-10-19 | trivial | A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, starts the next line with its text instead of ending the line (a TOC entry's page number keeps its leader); a left tab still past the right indent there takes no room (#1840) | | 2026-10-19 | trivial | Justified lines (compatibility mode 15) shrink their spaces to fit one more word by at most a quarter of the spaces' width (was a fifth) and by at most 0.355 of that word's own width with the space before it. Measured in Word for Mac with synthetic justified paragraphs: words of 2.7 to 80 pt, spaces of 3.3 and 6.7 pt, only justified text, last lines included, never in modes 12 and 14. A real paper's justified abstract now breaks like Word on all 23 lines (3 before); on 180 real-world papers, page counts matching Word went from 139 to 142, none further | @@ -323,8 +392,10 @@ layout suite are pending; this is not a new Word/native-IME acceptance claim. | 2026-10-15 | trivial | A float placed above its anchor paragraph (fixed on the page, or moved up from it) has the text of the paragraphs above the anchor on its page wrap around it, as in Word, instead of running behind it (#2048) | | 2026-10-20 | trivial | A picture cropped to a sliver of its source (under 5% of an axis) is drawn at the size the file gives, on screen and in PDF, bitmap or metafile, and Tight/Through wrapping follows the part drawn; it was widened to 5%, so a header bar that is 2.7% of a page-sized WMF came out half as tall and the text box over it fell below it (#1899) | | 2026-10-19 | trivial | An object dragged near the bottom of a page lands where it is dropped: its paragraph's place is measured with the object already there, not at the paragraph's top, where it could push the paragraph onto the next page (#3169) | +| 2026-10-20 | trivial | Apple's Times and Courier (one em tall) take Times New Roman's and Courier New's single line spacing, as Word for Mac lays them out (measured at 11 and 20 pt on synthetic documents); Helvetica and Symbol lines are also taller in Word than their own metrics, rule not yet known | | 2026-10-18 | trivial | A word after a slash (" /word") wraps whole instead of splitting between two letters (#2963) | | 2026-10-19 | trivial | #2964: a centred or end-aligned list label after a leading page break uses its text line's alignment. Synthetic LTR/RTL numbered/bulleted controls and the issue's DOCX export; broader pagination gaps and readiness estimates unchanged | +| 2026-10-16 | trivial | Split-cell content retains its resolved top margin and border band on continuation pages, matching original Word Mac16.113.2 controls. Synthetic regressions cover margins, borders, line spacing and image frames. | | 2026-10-15 | trivial | An at-least table row with less room than its minimum on a page that holds something starts the next page whole, as checked in Word (#1742); the taller-than-a-page case (it then splits from the top of that page) and repeated header rows (they go with it) follow the issue and synthetic tests, not a Word check | | 2026-10-16 | trivial | Table row keep-next uses the first paragraph of the first cell, including inherited flags. Kept row chains start on a fresh page when the following row cannot start below them. Synthetic Word export covers mixed-cell flags, multiple paragraphs and kept prefixes before oversized followers. | | 2026-10-16 | trivial | Include table-cell headings in regenerated TOCs with full target paths | @@ -449,9 +520,18 @@ layout suite are pending; this is not a new Word/native-IME acceptance claim. | 2026-10-10 | major | First version: layout and pagination checklist with evidence from `crates/layout`, PRs and issues | | 2026-10-16 | trivial | OpenType ligatures follow `w14:ligatures` (none, standard, contextual, historical, discretional and their combinations); without it WordCraft's default stays | | 2026-10-21 | trivial | Superscript and subscript lines: Word for Mac sizes them at the full font size and leaves out the raise or drop (an 11pt subscript beside 11pt Arial keeps the 12.675pt line; a line of 24pt subscript is as tall as plain 24pt text); a `w:position` raise or lowering still grows the line. WordCraft added the drop to the line and sized the run at its shrunk size. On a private corpus of 181 Word documents, 26 change: 52 more paragraphs start on Word's page (9 documents better, 4 worse by 1–2 paragraphs, all with substituted fonts or already a page off), page counts unchanged. `layout::tests::superscript_and_subscript_lines_are_as_tall_as_full_size_text` | +| 2026-11-04 | trivial | ODT documents: a line holding only in-line pictures keeps its font's height, as in Word documents; the setting that made it as tall as the pictures is gone ([odf-interpretation.md](odf-interpretation.md)). `Settings::odf` still applies the standard's padding and a file's `TabsRelativeToIndent` | +| 2026-11-02 | trivial | ODT documents (`Settings::odf`, an `OdfLayout`): a paragraph's padding without a border takes room in every ODT document (XSL's box model, which the standard refers to); a line holding only in-line pictures is as tall as they are only when the ODF interpretation profile says so (LibreOffice's; WordCraft's own keeps the font's height; see [odf-interpretation.md](odf-interpretation.md)). | +| 2026-11-02 | trivial | For ODT documents (`Settings::odf_layout`), LibreOffice's layout: a paragraph's padding on a side without a border takes room (added to its spacing above or below, or its indent), as measured in LibreOffice; Word drops it, so other documents are unchanged (`ResolvedPara::padding`, `tests::padding_without_a_border_takes_room_in_odt_documents`) | +| 2026-11-02 | trivial | For ODT documents, LibreOffice's layout: a line holding only in-line pictures is as tall as they are, without its font's ascent and descent (`Settings::odf_layout`, set when an ODT opens; Word keeps the font's, so other documents are unchanged). Measured in LibreOffice: a 3.6 pt rule's line is 3.6 pt; WordCraft's had been 15.5 pt (`tests::a_line_of_only_pictures_fits_them_in_odt_documents`) | +| 2026-11-02 | trivial | Beyond Word, for ODT documents: a table's own space above and below (`TableProps::space_before`/`space_after`) moves the text around it, and a header (footer) taller than its margin keeps its spacing between it and the body (`SectionProps::header_gap`/`footer_gap`; Word keeps none, so DOCX documents are unchanged) (`tests::a_tables_own_space_above_and_below_moves_the_text`, `tests::body_starts_right_below_a_tall_header`) | +| 2026-11-02 | trivial | A page break before the paragraph in a table's first row moves the whole table to the next page, as in Word (it was ignored); emphasis marks (Font › Emphasis mark) are drawn over or under each character and make the line taller | Maintenance on 2026-10-12 retains current tracked-deletion, endnote, footer-total, text-box and balloon layout while supplying explicit cell identity at every box call. The native Word probes above are historical; this rebase has no new native or other-platform measurement. Repeated table-cell control, 12 October 2026: four same-style contextual paragraphs with 6 pt before/after and exactly 24 pt lines retain zero extra gap at every boundary. The body control uses the same fixture. This is an original specification-based regression; no new native Word table comparison was run. + +> 2026-10-29 · Port #3915 to split layout modules: ordinary LTR tab groups follow paragraph alignment. Positional tabs, lists, RTL and display math retain their alignment paths. Source port only; no test execution or new native measurements. +> 2026-10-29 · Port #2437 to split layout modules: finite border extents and terminal-break keep preflight. Recursive keep lookahead remains outside scope. Source port only; no test execution or new native measurements. diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 5137aba02c..64b934a50e 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,6 +1,6 @@ # Localization parity with Microsoft Word -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-03 · **Change:** minor (Arabic `ar` interface: craft-i18n catalog, mirrored shell, font fallback, #1195; 28 languages); previously trivial (Language packs: language-packs-2 is published and pinned: 75 packs, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch and Swedish (Sweden, Finland)); previously trivial (Language packs: language-packs-1 is published and pinned, 61 packs; the language requests it covers); previously minor (Language packs: languages beyond English install their spelling dictionary and hyphenation as a pack from File › Options › Language or the missing-pack bar; the default build embeds English Language data only) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** trivial (Arabic: the Home tab's Styles gallery reads from the right, its arrows at the left (#5566); readiness unchanged); previously trivial (table sort and formulas read the Panamanian balboa's `B/.` around a number (`B/. 1,250.50`, `1,250.50 B/.`), as Word does, matched only at the ends of the text so `1/.5` stays a fraction); previously trivial (Arabic: the dialogs of the mirrored Arabic interface read right to left: label-and-field rows, tables (list columns, the Models table), tile galleries and the Add/Remove arrows follow the reading direction, through one `rtl::Table` helper that draws exactly as before in English; no ranked gap closed, readiness estimates unchanged); previously minor (Options › Language redesign: Your languages, Add a language…, Set as default; the Dictionaries folder moved from Proofing); previously trivial (Language packs: the missing-pack bar works on a fresh install and counts the caret's language); previously trivial (Language lists: every installed and available Language pack's language can be chosen in Set Proofing Language, installed ones in Review › Language and the status bar; craft-i18n.rev at 9d6d54d: region names and the Language (Region) template in 35 locales, craft-i18n#145); previously trivial (craft-i18n.rev at cde4900: rows for Options › Language, the missing-pack bar and 28 Language pack language names in 35 locales, craft-i18n#136); previously trivial (craft-proof pin: French elision suggestions first, ca-ES-valencia reads the ca-valencia pack); previously minor (Arabic `ar` interface: craft-i18n catalog, mirrored shell, font fallback, #1195; 28 languages); previously trivial (Language packs: language-packs-2 is published and pinned: 75 packs, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch and Swedish (Sweden, Finland)); previously trivial (Language packs: language-packs-1 is published and pinned, 61 packs; the language requests it covers); previously minor (Language packs: languages beyond English install their spelling dictionary and hyphenation as a pack from File › Options › Language or the missing-pack bar; the default build embeds English Language data only) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 Interface languages, script support and proofing per language. How translation works (adding a language, the embedded catalogs): `crates/ui-egui/src/i18n.rs`. The catalogs, their format and @@ -44,8 +44,7 @@ native-speaker review (human). - Pending PRs: Norwegian Bokmål (#208) and Nynorsk (#210), Hebrew with RTL (#20). Arabic UI landed (#1195). - **Proofing: English, Polish, Portuguese, Italian, Russian, Czech, Indonesian and Spanish**, chosen per run from its language (`w:lang`, resolved through the styles; Review › Language and the status bar set it: a short list, plus Set Proofing - Language… for any of 38 languages and Set As Default for the document and future blank documents). Languages without proofing tools get - the styles; Review › Language and the status bar set it). Languages without proofing tools get + Language… for every built-in language and every installed or available Language pack language, and Set As Default for the document and future blank documents). Languages without proofing tools get no spelling or grammar marks (as in Word without the language's tools) instead of being flagged as English. Detail in [Proofing per language](#proofing-per-language). - Document scripts: shaping via HarfRust (HarfBuzz port) for every script; bidi (UAX #9) and Arabic @@ -63,8 +62,8 @@ shared items below. | Simplified Chinese (Mandarin) | zh-hans | 929 entries; 98% of extracted, ~95% of visible | most; newer panes English | CJK ✅, IME ✅; Windows UI font fixed (#248); interface font chain covers every catalog character, installed CJK font after the embedded ones when it doesn't, PingFang found on macOS 12 (#486); font list by Chinese names (宋体, 微软雅黑, #505); word count counts each Han ideograph and kana as a word, not punctuation (#4547); no vertical text | no | partial | 3–5 | | Spanish | es | ~930; 98% / ~95% | most | Latin ✅ | no | partial | 1–2 | | Hindi | hi | 0 | ❌ | Devanagari shaping via HarfRust, untested; no hyphenation | no | none | 4–6 | -| Arabic | ar | ~2,730 entries (craft-i18n `locales/ar/wordcraft.tsv`); 98% / ~95% | most; newer panes English | shaping, joining, lam-alef, bidi ✅ (#207); mirrored UI ✅ (#1195); Arabic UI font fallback; no kashida; no proofing | no | partial | 2–4 (review + kashida/proofing elsewhere) | -| French | fr | 2,615 entries (complete catalog) | all | Latin ✅ | no | partial (no proofing) | 1–2 (proofing) | +| Arabic | ar | ~2,730 entries (craft-i18n `locales/ar/wordcraft.tsv`); 98% / ~95% | most; newer panes English | shaping, joining, lam-alef, bidi ✅ (#207); letters join across a change of formatting and past hidden or deleted text ✅ (#4093); mirrored UI ✅ (#1195; dialogs, tables and galleries read right to left); Arabic UI font fallback; no kashida; no proofing | no | partial | 2–4 (review + kashida/proofing elsewhere) | +| French | fr | 2,615 entries (complete catalog) | all | Latin ✅ | no | partial (spelling and suggestions from the French Language pack, elided forms first: `Jadore` → `J'adore`; no grammar marks) | 1–2 (grammar) | | Portuguese | pt-br (pt-PT none) | ~930; 98% / ~95% (pt-BR) | most | Latin ✅ | no | partial | 2–4 (pt-BR finish + pt-PT) | | Indonesian | id | 0 | ❌ | Latin ✅ | no | none | 3–4 | | Japanese | ja | ~930; 98% / ~95% | most | CJK ✅, IME ✅; ruby (Phonetic Guide) over its base text, kept by HTML export/import (#1681); word count counts each Han ideograph and kana as a word, not punctuation (#4547); no vertical text or document grid | no | partial | 3–5 | @@ -130,9 +129,9 @@ Set Proofing Language › Set As Default keeps the chosen language in user prefe | Language | Spelling | Suggestions | Grammar | Hyphenation | |---|---|---|---|---| -| English: American (`en-US`, other regions, text with no language), British spelling (`en-GB`, `en-AU`, `en-NZ`, `en-IE`, `en-ZA`, `en-IN`…), Canadian (`en-CA`) | SCOWL 2026 (`rel-2026.02.25`, size 60) Hunspell dictionaries, one per English: en-US, en-GB `-ise` (also the other British-spelling Englishes) and en-CA, embedded from craft-i18n `language-data/` and read by the affix engine (ordinals such as `21st` and `112th` by `COMPOUNDRULE`). A word is right when the English's own dictionary or our supplement (`en-extra.txt`) knows it (never because another English's does: `colourblind` is wrong in en-US), unless our list of ~280 American/British pairs (craft-i18n [`language-data/en-us/en-variants.txt`](https://github.com/storytold/craft-i18n/blob/main/language-data/en-us/en-variants.txt)) marks it as the other dialect's: each English flags the other dialect's spellings (`colour` in en-US; `color`, `center`, `analyze` in en-GB; `organise` in en-CA), British English accepts `-ize` and `-ise` (Oxford spelling, as Word does; SCOWL's en-GB `-ise` alone would flag `organize`), and a dialect's form of a known word is right even if the list lacks it (`realisation`). Text with no language takes any English's word. An English Hunspell dictionary in File › Options › Proofing › Dictionaries folder comes first (the document's own English); without the SCOWL files, an installed Hunspell English, then the Moby word list (public domain, ~165k words) built into craft-proof. No system dictionary needed | the dialect's own spelling first (`colour` → `color`), then the dialect's SCOWL dictionary's suggestions (its TRY/REP tables, one typo, a stem scan; a missing space only between two words of 3+ letters, last), in the dialect's spelling | repeated word, `a`/`an`, sentence capital, space before punctuation, double space | Moby dictionary, our Liang patterns, heuristic | +| English: American (`en-US`, other regions, text with no language), British spelling (`en-GB`, `en-AU`, `en-NZ`, `en-IE`, `en-ZA`, `en-IN`…), Canadian (`en-CA`) | SCOWL 2026 (`rel-2026.02.25`, size 60) Hunspell dictionaries, one per English: en-US, en-GB `-ise` (also the other British-spelling Englishes) and en-CA, embedded from craft-i18n `language-data/` and read by the affix engine (ordinals such as `21st` and `112th` by `COMPOUNDRULE`). A word is right when the English's own dictionary or our supplement (`en-extra.txt`) knows it (never because another English's does: `colourblind` is wrong in en-US), unless our list of ~280 American/British pairs (craft-i18n [`language-data/en-us/en-variants.txt`](https://github.com/storytold/craft-i18n/blob/main/language-data/en-us/en-variants.txt)) marks it as the other dialect's: each English flags the other dialect's spellings (`colour` in en-US; `color`, `center`, `analyze` in en-GB; `organise` in en-CA), British English accepts `-ize` and `-ise` (Oxford spelling, as Word does; SCOWL's en-GB `-ise` alone would flag `organize`), and a dialect's form of a known word is right even if the list lacks it (`realisation`). Text with no language takes any English's word. An English Hunspell dictionary in File › Options › Language › Dictionaries folder comes first (the document's own English); without the SCOWL files, an installed Hunspell English, then the Moby word list (public domain, ~165k words) built into craft-proof. No system dictionary needed | the dialect's own spelling first (`colour` → `color`), then the dialect's SCOWL dictionary's suggestions (its TRY/REP tables, one typo, a stem scan; a missing space only between two words of 3+ letters, last), in the dialect's spelling | repeated word, `a`/`an`, sentence capital, space before punctuation, double space | Moby dictionary, our Liang patterns, heuristic | | Russian (`ru`) | A Russian Hunspell dictionary installed on the system (`ru_RU` from the OS, a package manager, LibreOffice's `dict-ru` or the `WORDCRAFT_DICTIONARIES` folder; UTF-8, KOI8-R or Windows-1251; not bundled, so no Russian spelling marks without it), read by the same affix engine; `ё` optional (`елка`/`ёлка`, `еще`/`ещё`); hyphenated words whole, then by parts (`кто-то`, `по-русски`, `кое-где`, `северо-западный`, `ИИ-консультант`); solid compounds (`высокоэластичный`), `не` with adjectives, participles and verbal nouns (not verbs), productive prefixes (`ультра-`, `эко-`) and prefixed verbs; abbreviations with endings (`ГИПа`) and camel case left alone; our supplement of ~200 modern words with their declensions (craft-i18n [`language-data/ru/ru-extra.txt`](https://github.com/storytold/craft-i18n/blob/main/language-data/ru/ru-extra.txt): `маркетплейс`, `промокод`, `интеграция`, `колеровать`) | `ё`/`е` first, then slips within letter groups (unstressed vowels, voiced and voiceless pairs, `ь`/`ъ`), the common confusions (`жы`, `чя`, `тся`/`ться`, doubled consonants, unpronounced consonants: `здраствуй` → `здравствуй`), a missing space (`незнаю` → `не знаю`; not a preposition before a verb), one typo, then a stem scan | Russian messages: repeated word, space before punctuation, double space, sentence capital (knows `т. е.`, `г.`, `руб.`, `ул.`, initials, numbers, dialogue dashes), possibly missing comma before `что`/`чтобы`/`если`/`хотя`/`поскольку`/`который` and before `потому что` (not after conjunctions and particles such as `и`, `только`, `даже`, `так`, `для того`; not after a preposition; not in `хотя бы`, `что-то`), doubled punctuation | The rules of Russian word division as code (no pattern file): a vowel on each side, two letters at least, `ь`/`ъ`/`й` kept with the letter before, a break after `ъ`, a consonant cluster divided after its first consonant | -| Polish (`pl`) | The Hunspell `pl_PL` dictionary installed on the system (OS package, Homebrew, LibreOffice, the folder set in File › Options › Proofing › Dictionaries folder, or `WORDCRAFT_DICTIONARIES`; not bundled, so no Polish spelling marks without it; the same pane shows which file each language found), read at runtime by a Hunspell-style affix engine (craft-proof [`src/affix.rs`](https://github.com/storytold/craft-libs/blob/main/crates/proof/src/affix.rs) in craft-libs); names capitalized, compounds part by part, `Kennedy'ego` | missing diacritics first (`zolw` → `żółw`), the dictionary's confusion table (`żeka` → `rzeka`, `chuśtawka` → `huśtawka`), missing space (`napewno` → `na pewno`), one typo, then a stem scan within two typos | Polish messages: repeated word, space before punctuation, double space, sentence capital (knows `np.`, `r.`, initials, ordinals, dialogue dashes), missing comma before `że`/`który`/`ponieważ`/`gdyż`/`aby`/`żeby`/`jeśli`/`jeżeli`/`gdyby`/`lecz` (not after `mimo`, `chyba`, `tak`, prepositions…), `we`/`ze` (`we wtorek`, `ze szkoły`), doubled punctuation | TeX Polish patterns (Kołodziejska, Jackowski, Ryćko; MIT option) with their 20 exception words; a Polish syllable heuristic for letters outside the alphabet | +| Polish (`pl`) | The Hunspell `pl_PL` dictionary installed on the system (OS package, Homebrew, LibreOffice, the folder set in File › Options › Language › Dictionaries folder, or `WORDCRAFT_DICTIONARIES`; not bundled, so no Polish spelling marks without it; Your languages there shows each language's proofing status, and Dictionary files the file each language found), read at runtime by a Hunspell-style affix engine (craft-proof [`src/affix.rs`](https://github.com/storytold/craft-libs/blob/main/crates/proof/src/affix.rs) in craft-libs); names capitalized, compounds part by part, `Kennedy'ego` | missing diacritics first (`zolw` → `żółw`), the dictionary's confusion table (`żeka` → `rzeka`, `chuśtawka` → `huśtawka`), missing space (`napewno` → `na pewno`), one typo, then a stem scan within two typos | Polish messages: repeated word, space before punctuation, double space, sentence capital (knows `np.`, `r.`, initials, ordinals, dialogue dashes), missing comma before `że`/`który`/`ponieważ`/`gdyż`/`aby`/`żeby`/`jeśli`/`jeżeli`/`gdyby`/`lecz` (not after `mimo`, `chyba`, `tak`, prepositions…), `we`/`ze` (`we wtorek`, `ze szkoły`), doubled punctuation | TeX Polish patterns (Kołodziejska, Jackowski, Ryćko; MIT option) with their 20 exception words; a Polish syllable heuristic for letters outside the alphabet | | Portuguese (`pt`, any region) | The Hunspell `pt_BR` dictionary installed on the system — VERO and its derivatives (same places as Polish; not bundled, LGPL/MPL), read at runtime by the same affix engine, which reads its `FLAG UTF-8`, 106 flags, continuation classes and `FORBIDDENWORD` spellings; names capitalized, compounds part by part (`guarda-roupa`, `ex-marido`) | missing accents first (`coraçao` → `coração`, `saude` → `saúde`), the dictionary's confusion table (`seje` → `seja`, `excessão` → `exceção`), missing space (`nãoé` → `não é`), one typo, then an accent-folding stem scan | Portuguese messages: repeated word (the emphatic doubles are allowed), space before punctuation, double space, sentence capital (knows `etc.`, `pág.`, `Dr.`, initials, ordinals, dialogue dashes), doubled punctuation; no comma rule — `que` opens a clause only sometimes | TeX Portuguese patterns (Rezende, Almeida, Araujo, Benevides; BSD 3-clause) with their 2 exception words | | Czech (`cs`, `cs-CZ`, `ces`, `cze`) | The system Hunspell `cs_CZ` dictionary, read at runtime (Debian/Ubuntu: `hunspell-cs`; the same system, LibreOffice and `WORDCRAFT_DICTIONARIES` search paths as Polish). No dictionary data is bundled; without an installed dictionary spelling stays off | suggestions from the loaded dictionary's MAP/REP/TRY/KEY tables, missing spaces and a stem scan; short-word splits rank after deleting an extra letter; NOSUGGEST stems and their derived forms are accepted when typed but excluded from suggestions | Czech messages (including Czech quotation marks) for repeated words, space before punctuation and double spaces only; digit-space-colon-space-digit ratios keep their spaces; no Czech-specific grammar rules | existing English fallback, as for `Other`; no Czech patterns bundled (the TeX/LibreOffice Czech patterns are GPL-2) | | Italian (`it`, any region) | The Hunspell `it_IT` dictionary installed on the system (same places as Polish and Portuguese; not bundled — the upstream file is GPL-licensed), read at runtime by the same affix engine; elided forms check the word after the apostrophe (`l'amico`, `un'idea`, `c'è`, `dov'è`, `senz'altro`), truncations keep their apostrophe (`po'`, `mo'`), hyphenated compounds part by part | missing accents first (`caffe` → `caffè`, `perche` → `perché`), the dictionary's confusion table, missing space (`perme` → `per me`), one typo, then an accent-folding stem scan | Italian messages: repeated word (emphatic doubles like `piano piano` are allowed), space before punctuation, double space, sentence capital (knows `ecc.`, `dott.`, `prof.`, initials, ordinals), doubled punctuation, `un pò` → `un po'`, `qual'è` → `qual è`, `E'` → `È`, `un'altro` → `un altro` and `un altra` → `un'altra` (gender from the ending, masculine `-ista`/`-ma`/`-cida`… left alone); these work without a dictionary; no comma rule | TeX Italian patterns (Beccari; MIT option), no exception words | @@ -170,14 +169,29 @@ pack** (its spelling dictionary, hyphenation patterns and licence texts), listed pinned pack index and installed through the font store into `/language-packs//` ([installing languages](spelling-dictionaries.md#language-packs)): -- File › Options › Language lists the installed and available packs with name, size, licence and - source, and installs or removes them (`proof.packs`, `proof.installPack`, `proof.removePack` for - agents). A pack is read at once; the lookup order is the dictionaries folder, the installed pack, +- File › Options › Language › Your languages lists English, the installed packs and the + document's languages with each one's proofing status (Built in, Installed, Your own dictionary, + System dictionary, Grammar built in, Not available yet), and installs, removes or sets the default + (Set as default); Add a language… opens a searchable list of the other packs with name, size, + licence and source (`proof.packs` with its `languages` rows, `proof.installPack`, + `proof.removePack` for agents). A pack is read at once; the lookup order is the dictionaries folder, the installed pack, then the system's Hunspell dictionaries. - A document with text in a language whose pack is available but not installed shows a bar - offering it; it never shows for a language without a pack, and closes per document. + offering it, and closes per document. Once the list of packs is known it never shows for a + language without a pack; before then (a fresh install) it offers a language with no dictionary + provisionally: Install fetches the list, then installs the pack if there is one, and the bar goes + if there isn't. The caret's typing language counts, and the spelling context menu's heading is in + the interface language. - Help › About › Language data shows the full licence texts of the embedded English data and the installed packs. +- One language list: Set Proofing Language lists the built-in languages and every installed or + available pack's language (Bulgarian, Belarusian, Spanish (Cuba)…), each once and sorted by + name; Review › Language and the status bar's menu show the short list plus the installed packs' + languages. A pack's language is stored as the tag WordCraft names (`bg-BG`, `sr-Latn-RS`, + `de-AT`, Word's `ca-ES-valencia` for Valencian), which finds that pack again, so the text is + proofed by it; a bare tag (`nl`) is the same row as its regioned one (`nl-NL`), compared by tag + (language, script, region, variant), never by the name shown. Every pack in the published + index has an English name. - language-packs-2 is published and pinned (75 packs, craft-i18n `20467b63`), adding the compounding languages (Danish, German, Dutch, Swedish, Norwegian, Hungarian, Estonian, Croatian, Persian, Esperanto); Mongolian and Thai stay hidden. Install reads it, @@ -205,7 +219,12 @@ Polish, `1.250,50` in German, `1,250.50` in English) and write formula results w separator (`crates/doc/src/locale_number.rs`). Cuban and Peruvian Spanish (`es-CU`, `es-PE`) use decimal points (`1,234.50`), matching the existing region settings and CLDR's Latin American Spanish parent locale; `cuban_and_peruvian_numbers_use_decimal_points` covers parsing and result -formatting. Interface lists (styles, fonts) still sort by code point. +formatting. Currency signs and short currency words around the number are ignored, as Word +ignores them: a single-character sign may touch the number (`$1,250`, `1 250,00 zł`, `PLN 12`) +while the Panamanian balboa's `B/.` is a word of its own (`B/. 1,250.50`, `1,250.50 B/.`, as +observed in Word; `B/.1,250.50` and `B/ 1,250.50` are not numbers). Because `B/.` carries a slash +and a full stop, it is matched only at the ends of the text, so `1/.5` and `1,250.50/2` are not +read as balboa amounts. Interface lists (styles, fonts) still sort by code point. Russian (`ru`) sorting keeps ё with е (a secondary diaeresis difference), before ж. Composed and decomposed ё and й have the same keys and index headings; the stored text is unchanged. Tests cover Russian locale aliases, case, representative words and these two canonical pairs. This is a narrow Cyrillic correction, not full Unicode normalization or CLDR collation. Ordering reference: [Unicode CLDR Russian collation chart](https://unicode.org/cldr/charts/42/collation/ru.html). @@ -256,7 +275,17 @@ WordCraft keeps 2,54 cm). | Date | Change | Summary | |---|---|---| +| 2026-11-06 | trivial | Arabic: the Home tab's Styles gallery reads from the right: Normal is the rightmost tile and the scroll arrows and More sit at the gallery's left end, as the rest of the mirrored ribbon (#5566); left to right is unchanged; regression test `the_styles_gallery_reads_from_the_right_in_a_right_to_left_interface` | +| 2026-11-05 | trivial | Arabic letters join across a change of formatting and past hidden or deleted text (#4093) | +| 2026-11-04 | trivial | Table sort and formulas read the Panamanian balboa's `B/.` around a number (`B/. 1,250.50`, `1,250.50 B/.`), as Word does; `B/.1,250.50` and `B/ 1,250.50` stay text, matching Word 16.0, and the sign is matched only at the ends of the text, so `1/.5` is unchanged | +| 2026-11-04 | trivial | craft-i18n.rev at 9d6d54d (craft-i18n#145): 69 region names and the `{language} ({region})` template (full-width in ja, ko, zh) in 35 locales, AI-assisted without native-speaker review | +| 2026-11-04 | trivial | craft-i18n.rev at cde4900 (craft-i18n#136): translated rows for Options › Language (Your languages, Add a language…, Set as default, Dictionary files), the missing-pack bar and 28 Language pack language names in 35 locales, AI-assisted without native-speaker review | +| 2026-11-03 | trivial | craft-proof pin moved to craft-libs main with #589 and #590: French suggestions offer the elided form first (`Jadore` → `J'adore` before `J adore`; English keeps plural fixes first), and Valencian (`ca-ES-valencia`) text reads the `ca-valencia` pack | +| 2026-11-03 | trivial | Arabic: dialogs read right to left: label-and-field rows, list and data tables, tile galleries and the Add/Remove arrows follow the reading direction (`rtl::Table`); the Arabic estimate stays until a native speaker reviews it | | 2026-11-03 | minor | Arabic (`ar`) interface: ~2,730 catalog rows from craft-i18n, `ar-*` locales, mirrored shell (ribbon, panes, File page, dialogs, menus), Arabic UI font fallback, document canvas independent (#1195); 28 languages; Hebrew UI still open | +| 2026-11-03 | trivial | Language lists: Set Proofing Language, Review › Language and the status bar offer the Language pack languages (Bulgarian was in none); every published pack named in English (Belarusian); Valencian is `ca-ES-valencia`; rows are matched by tag, not by the name shown | +| 2026-11-03 | trivial | Language packs (CP4.3): the missing-pack bar offers a language before the list of packs is fetched (a fresh install, or a list cached for an older pin) and gets it on Install; with downloading on, a missing or stale list is fetched once in the background; the caret's typing language counts; the spelling context menu's heading is in the interface language | +| 2026-11-03 | minor | Options › Language redesign (CP4.3): Your languages shows where each language's proofing comes from (Built in, Installed, Your own dictionary, System dictionary, Grammar built in, Not available yet); Add a language… replaces the Language packs table and Show available languages; Set as default; the Dictionaries folder (#1063) and the Dictionary files list of the file each language found moved from Options › Proofing to Options › Language | | 2026-11-03 | trivial | Language packs: language-packs-2 published and pinned, 75 packs, with Danish, German, Dutch, Swedish, Norwegian, Hungarian, Estonian, Croatian, Persian and Esperanto | | 2026-11-02 | trivial | Language packs (CP4.4): language-packs-1 published and pinned, 61 packs; Lithuanian, Romanian, Catalan, French, Greek, Slovak, Serbian and Latvian available; Dutch, German and the other compounding languages wait on craft-proof; Basque, Ukrainian and Uyghur excluded | | 2026-11-01 | minor | Language packs (CP4.3–CP4.5): install and remove a language's spelling and hyphenation from File › Options › Language or the missing-pack bar, About › Language data, the commands; the default build embeds English data only; the language requests point at their packs: Lithuanian and Romanian available once language-packs-1 is published, the others waiting on craft-proof engine support | diff --git a/docs/mcp.md b/docs/mcp.md index e3d5f3cea4..26e728fc6f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -1,5 +1,7 @@ # MCP server +> **Last updated:** 2026-10-31 · Delivery review fixes for #2596: unknown outcomes are not replayed, including image exports to a path; invalid UTF-8 returns a parse error without stopping later requests. + WordCraft speaks the [Model Context Protocol](https://modelcontextprotocol.io) over stdio, so Claude and other agents can write and edit documents. @@ -18,6 +20,22 @@ isn't open yet: tool calls return "not reachable … will retry on each call" an app's port opens (#4078), so a client that starts before WordCraft doesn't lose the server for its whole session. +## Delivery failures + +The connected bridge retries a request once if no write was attempted (for example, a failed +connection). Once sending starts, a write or flush failure can mean the app already received +the complete JSON body, even if its newline was not delivered. A lost reply has the same +uncertainty. Mutations then return an `outcome unknown` error and are never automatically +resent; inspect the document before deciding whether to repeat the operation yourself. + +Read-only inspection and in-memory `ui.render` / `ui.screenshot` calls may retry once. With a +string `path`, rendering or taking a screenshot writes a file and is not retried after an +unknown outcome. Unreadable replies are reported as errors without replaying the request. + +On stdio, an invalid UTF-8 request line returns JSON-RPC parse error `-32700`. It never reaches +the backend, and the server continues with the next line instead of substituting characters +in text or paths. + ## Scripts from the command line `wordcraft-cli run --script job.json` (`--script -` reads standard input) runs the commands in a @@ -119,13 +137,13 @@ the suite's font store (see [installing languages](spelling-dictionaries.md#lang | Command | Params | Returns | |---|---|---| -| `proof.packs` | `{"refresh"?: bool}` (fetch the pinned index again) | `{"packs": [{"locale", "name", "size", "licence", "class", "source" (upstream), "archive", "spelling", "hyphenation", "installed"}], "installed": [...], "installing": [{"locale", "done", "total"}], "refreshing", "errors": {locale: message}, "network", "available"}` | +| `proof.packs` | `{"refresh"?: bool}` (fetch the pinned index again) | `{"packs": [{"locale", "name", "size", "licence", "class", "source" (upstream), "archive", "spelling", "hyphenation", "installed"}], "languages": [{"tags", "pack", "installed", "size", "proofing" (built_in, installed, own_dictionary, system_dictionary, install, grammar_built_in, not_available), "default"}] (Options › Language › Your languages), "installed": [...], "installing": [{"locale", "done", "total"}], "refreshing", "errors": {locale: message}, "network", "available"}` | | `proof.installPack` | `{"locale": "nl"}` | `{"locale", "name", "licence", "installed": true}` (`"already": true` when it was); with `--connect`, `{"locale", "started": true}` | | `proof.removePack` | `{"locale": "nl"}` | `{"locale", "installed": false}` | None opens anything. Downloading is the font store's single consent setting: an agent can install -only while the person has turned it on in the app (File › Options › Language: Install or Show -available languages), and can never turn it on itself; otherwise `proof.installPack` fails with +only while the person has turned it on in the app (File › Options › Language: Install or Add a +language…), and can never turn it on itself; otherwise `proof.installPack` fails with *downloading is turned off*. `refresh` likewise needs it on. Every archive is checked against the sha256 in the pinned index before it is unpacked. With `--connect` the commands act on the running app's packs, and an install or a `refresh` runs in the background so the window keeps working: the @@ -134,7 +152,7 @@ command returns `"started": true` at once, and `proof.packs` shows it under `ins pack's install ends. Headless, they act on the same font store folder and return when done. The web build has no packs. -A click or key sent with `click`/`key` on Install, Show available languages or Refresh never turns +A click or key sent with `click`/`key` on Add a language…, Install or Refresh never turns downloading on either: only the person's own click does; the app shows why instead. Installing reads the pinned index of craft-i18n's language-packs-2 release (75 languages). For @@ -149,7 +167,8 @@ test source in File › Options › Language and on the bar's Install. | Tool | What it does | |---|---| | `list_commands` | every command (filter with `query`) — over 270 of them | -| `execute` | run one command: `{command: "insert.table", params: {rows: 3, cols: 4}}` | +| `execute` | run one command: `{command: "insert.table", params: {rows: 3, cols: 4}}` (an empty table; for a filled one use `insert_table`) | +| `insert_table` | insert a filled table in one call: `{values: [["Month", "Cases"], ["January", 12]], header: true, style?}` (same as `insert.spreadsheet`) | | `batch` | run several commands in order | | `new_document` | blank, sample, letter, resume, report; opens beside the open documents | | `open_document` / `save_document` | docx, doc (open only), odt, rtf, html, md, tex, txt, json; save also pdf, png | @@ -172,7 +191,7 @@ document beside the ones already open and make it the active one; their reply ca active again (`alreadyOpen`). `list_documents` lists the open documents with their ids. Tools work on the active document. `execute`, `batch`, `type_text`, `select_text`, `get_text`, -`inspect_document`, `render_page` and `save_document` also take `doc`, the id of another open +`insert_table`, `inspect_document`, `render_page` and `save_document` also take `doc`, the id of another open document: the tool works on that document and the active one stays active. ```json diff --git a/docs/odf-interpretation.md b/docs/odf-interpretation.md new file mode 100644 index 0000000000..9f3217a4e1 --- /dev/null +++ b/docs/odf-interpretation.md @@ -0,0 +1,180 @@ +# How WordCraft interprets OpenDocument files + +> **Last reviewed:** 2026-11-02 · **Last updated:** 2026-11-05 · **Change:** trivial (a document's language: kept on any save, and stated when written from the model); previously major (no more settings: one choice for each case the standard leaves open); previously trivial (what is written as read: unchanged paragraphs with drawings, comments, changes or marks too); previously minor (the two presets are Microsoft Word style and LibreOffice style; CLI values listed one by one); previously minor (deviations from the standard listed; ODF 1.2 → 1.3 checked); previously major (new: the ODF interpretation profile and the list of every case) + +OpenDocument (ODF 1.3, OASIS) leaves some of a document's look to the application. Part 3 §16.2 +says that when no style sets a property and the standard gives no default, "an +implementation-dependent value is used". So a file can look different in WordCraft, LibreOffice, +Google Docs and ONLYOFFICE without anyone being wrong. This page lists every such case WordCraft +knows of, so none gets lost. + +## The rule + +1. **What the standard defines is law.** WordCraft follows it. That includes `fo:` properties, + which the standard defines by referring to XSL 1.0, for their meaning. Whether such a reference + also brings XSL's initial value as the default the standard doesn't say; where an application's + choice differs from XSL's (page margins), the case is listed below, with XSL's value as + WordCraft's. +2. **What the standard leaves open, WordCraft decides once.** Each case listed below has one + choice, the one WordCraft makes for its own and Word documents, and no setting. LibreOffice's + choice (and Collabora's, which shares its engine) is listed beside it, measured black-box in + LibreOffice 24 where it isn't documented, because a file made there can look different here. +3. **A value the file states is the file's.** WordCraft's choices fill in only what the file (its + styles, defaults and `settings.xml`) leaves unsaid. Three cases are not missing values but + stated ones whose meaning the standard leaves open: how a header's stated height and spacing + combine, what a stated width of 0 draws at, and a frame position stated against something the + standard doesn't define for its anchor. They are marked *(meaning)* below. + `formats::odt::tests_more::unstated` checks that stated values are kept. +4. **A deviation from the standard is made only out of necessity**: where the files in + circulation contradict it and following it would damage every such file. Each one is listed + under "Deviations from the standard, out of necessity" below, with the standard's rule, what + WordCraft does instead and why; WordCraft never writes the deviating form. + +## Cases the standard leaves open + +| Case | Standard | What WordCraft does | What LibreOffice does | +|---|---|---|---| +| Page margins a page layout doesn't state | §20.206–20.209 refer to XSL §7.10 (initial value 0); whether that default comes with the reference is not said | 0 (XSL's initial value) | 2 cm (its own files always state theirs; some of its templates don't) | +| Height of a header or footer whose style states none | §20.212.2 `fo:min-height`: no default | 0 (as tall as its text) | 0.5 cm | +| *(meaning)* Whether a header's stated minimum height includes its stated spacing from the body | §20.212.2, §20.207: not said | no: spacing comes after the height | yes | +| A header taller than its height with `style:dynamic-spacing` unstated | §20.264: no default | off: the spacing is kept (on, with no height stated, would always drop the spacing the file states) | off | +| Where paragraph tab stops, default ones too, are measured from when `settings.xml` doesn't say | §19.512.3 `style:position` doesn't say; §19.861 covers only indexes | the margin (as Word; ONLYOFFICE's files mean this too) | the paragraph's left indent (its `TabsRelativeToIndent` default): explicit stops, the default stops every interval and the hanging indent's stop all move with the indent (measured) | +| Gap between columns when `style:columns` states none | §19.233 `fo:column-gap`: no default (and explicitly not XSL's) | 0.5 in (Word's) | 0 | +| A drawing shape's fill colour when no style gives one | §20.119 `draw:fill-color`: no default | `#156082` (WordCraft's shape blue) | `#729FCF` | +| A drawing shape's line colour when no style gives one | §20.408 `svg:stroke-color`: no default | `#0E405A` | `#3465A4` | +| A shape's line width when unstated, and *(meaning)* what a stated width of 0 (a hairline) draws at | §20.410 `svg:stroke-width`: no default | 0.25 pt | 0.5 pt | +| *(meaning)* A page-anchored frame positioned against a paragraph or character | §20.299, §20.398 Table 23: combination not defined | the page's text area | the page's edge | +| *(meaning)* An in-line frame positioned against a paragraph or page | §20.398 Table 23: combination not defined | stands on the baseline | positioned against the baseline (raised by its offset) | +| Height of a line holding only in-line pictures | no line-height algorithm in the standard | as tall as its text would be too | as tall as the pictures | +| How the space between two paragraphs adds up when the document doesn't say | not defined (`fo:margin-top`/`-bottom` refer to XSL's margins; whether XSL's space resolution, which keeps the larger, comes with them is not said); LibreOffice's `AddParaTableSpacing` setting says when present (false: the larger) | the larger of the two (as Word) | their sum | +| Widow and orphan control when neither the default paragraph style, Standard nor the paragraph's style states `fo:widows`/`fo:orphans` | §20.312, §20.244 refer to XSL's widows and orphans (initial value 2); whether that default comes with the reference is not said | on: 2 lines (XSL's initial value, and Word's) | off (a first or last line can stand alone at a page's edge) | +| *(meaning)* Whether a columned section's columns end balanced when nothing follows it on the page, and when it doesn't say | §20.428 `text:dont-balance-text-columns`: no default, and its value descriptions contradict its name (WordCraft reads the name; so does LibreOffice) | as Word: only when text follows on the same page | balanced | + +## Law: what the standard defines and WordCraft follows + +| Case | Rule | Note | +|---|---|---| +| Paragraph padding on a side without a border | `fo:padding` (§20.217) is XSL's box model: padding takes room whether or not there is a border | Word ignores padding without a border. ODF documents don't. | +| A frame's `style:run-through` when unstated | §20.351: `foreground` | | +| `style:dynamic-spacing="true"/"false"` when stated | §20.264 | WordCraft writes `false` when a header or footer has spacing, so every reader keeps it. | + +## Other cases open in the standard + +These are documented so they aren't mistaken for law: + +| Case | Standard | What WordCraft does | +|---|---|---| +| Paper size when no page layout states one | not defined | the region's paper (Letter in the US, A4 elsewhere), as for new documents | +| `style:wrap` unstated on a frame | §20.400: no default | text wraps on both sides (LibreOffice too) | +| A drawing shape's `draw:fill` / `draw:stroke` unstated | §20.118, §20.167: no default | solid (LibreOffice too); a text frame's are none; the colours are listed above | +| A document's default font and size when no default style gives them | not defined | WordCraft's defaults | +| A document's language when neither its default style nor Standard states one | `fo:language`: no default | none: WordCraft proofs it in the editing language and writes none, and each reader uses its own default | + +## How WordCraft writes ODF + +What nobody edited is written back as it was read, so something WordCraft doesn't model survives +a save that doesn't touch it: + +- a paragraph or table WordCraft hasn't changed keeps its own markup, with what it names (its + automatic styles, common styles, font faces, and the package files and folders they refer to); +- while no style or list definition changed, the file's own style definitions are written; +- while the page setup didn't change, its page layouts and master pages, and each section starts + with the master page it started with; +- named sections around unedited paragraphs, the document properties WordCraft doesn't model, + the declarations opening the text and the document's scripts. + +Paragraphs and tables holding drawings, comments, tracked changes, notes or marks are written as +read too while those are unchanged; paragraphs tied together (a comment, change or mark reaching +into another, linked text boxes) are kept as a group. What is edited is written from the model, as +are the cases listed under "Left" in [odt-element-audit.md](odt-element-audit.md). +`odt::tests_more::lossless` saves samples without edits and fails on anything lost. + +Files are saved as ODF 1.3, whatever version they were read as (as LibreOffice does). The changes +from ODF 1.2 (ODF 1.3 Part 3, Appendix G, with their OASIS issues) were checked: none gives a +value written for 1.2 another meaning, apart from a narrow rule on line caps +(OFFICE-3742: a line style's `svg:stroke-linecap` now wins over its dash's `draw:style`), which +matches how LibreOffice drew them. A few give defaults ODF 1.2 left unsaid (`text:anchor-type` +paragraph, `style:run-through` foreground, `number:forced-exponent-sign` true), again as +LibreOffice did. Markup kept from an older file is brought to 1.3 where its producers' meaning +differs: gradient and hatch angles, a deviation from the standard described below. + +What WordCraft writes from its model, it writes so that every reader takes it the same way. It +states what the standard leaves open instead of relying on any application's default: + +- header and footer heights, with `style:dynamic-spacing="false"` when there is spacing; +- a frame's placement as an explicit position against the page or paragraph; +- in-line pictures standing on the baseline; +- drawings not held in the text's area (`style:flow-with-text="false"`, §20.267 gives no default); +- tab stops measured as the file it was opened from measured them (`TabsRelativeToIndent` in + `settings.xml`), from the margin for WordCraft's own documents; +- widow and orphan control, on or off, in the default paragraph style; +- the document's language, in the default paragraph style, when it has one. + +## Deviations from the standard, out of necessity + +WordCraft follows the standard wherever it says something. These are the exceptions: places +where the files in circulation contradict the standard, and following it would damage every +such file. Each is kept as narrow as possible, and WordCraft never writes the deviating form. + +| Case | Standard | What WordCraft does, and why | +|---|---|---| +| A gradient's, transparency gradient's or hatch's angle without a unit (`draw:angle`, §19.112; `draw:rotation`, §19.209) in a file older than ODF 1.3 | §18.3.1 (since ODF 1.2): an angle without a unit is in degrees, so `300` is 300° | Read as tenths of a degree (`300` is 30°). LibreOffice and OpenOffice wrote these angles in tenths in every file before ODF 1.3 and still read them so (observed: the same `draw:angle="300"` draws at 30° in an ODF 1.2 file and at 300° in an ODF 1.3 one). Read by the standard, the gradients of every older LibreOffice document would turn the wrong way. Files declaring ODF 1.3 or later are read by the standard. WordCraft writes these angles with a unit (`30deg`), which every reader takes the same way, and markup it keeps from an older file is given that unit. (`strokes::legacy_angles`) | + +## Known differences between WordCraft's and LibreOffice's layout of the same file + +Found by saving WordCraft's own documents as ODT and opening them in LibreOffice. These aren't +choices the file can state: + +- **Footers.** Word, and WordCraft for its own documents, places a footer's text so it ends at the + footer's distance from the bottom of the page. ODF places it at the top of the footer area. A + one-line footer in a 1 inch bottom margin sits about 20 pt higher in LibreOffice. Matching it + would need the footer's text height when writing, and would depend on how a footer's height and + spacing combine, which is one of the cases above. +- **Proportional line spacing.** Both draw the same distance from line to line. Word puts the + extra space of a multiple (say 1.15) above the text, LibreOffice below it. Where the font size + changes (a heading after body text) the two differ by a few points. +- **Leader dots** in a table of contents start right after the text in LibreOffice and after a + small gap in WordCraft. +- **Line breaks after a slash.** LibreOffice breaks a long path after a `/`; WordCraft, as Word, + keeps the text after a slash with it and breaks such a word where it must. The standard + doesn't define line breaking. +- **Objects that may not overlap text** (`style:wrap="none"` with several on one paragraph): + LibreOffice moves them down by its own rules (`draw:wrap-influence-on-position`). + +## Not implemented + +LibreOffice refreshes fixed dates and fills in the user's sender fields when it opens a template +(`.ott`) to make a new document. That is application behaviour, not something the file defines. +WordCraft opens a template as it is. + +## Other applications + +Google Docs and ONLYOFFICE files were checked for cases they rely on (November 2026, nine files +from public bug reports and ONLYOFFICE's converter test snapshots): + +- **Google Docs** exports through a LibreOffice build (its generator reads `LibreOfficeDev/6.0`). + It states its page size and margins, writes `TabsRelativeToIndent=false`, and its default + graphic style states LibreOffice's colours. Its headers are empty styles with no content. + Nothing in these files depends on the cases above more than LibreOffice's own files do. +- **ONLYOFFICE** states page size and margins only. It has no header styles and no default + graphic style. It writes tab stops with no `TabsRelativeToIndent` and means "from the margin" + (its documents come from Word's model), which is WordCraft's choice too. + +## Revision history + +| Date | Change | +|---|---| +| 2026-11-05 | A document's language is read from its default style or Standard and written back from the model. It was lost when a style or list definition changed (numbering, a new style), and readers then showed the document in their own default language. Styles written from the model no longer say English for a document that isn't. A language's script (`fo:script`) is kept with it, and a style with no parent takes the default style's language when Standard's differs. | +| 2026-11-04 | The settings removed: File › Options › Advanced › OpenDocument files, `file.options` `odf`, `WORDCRAFT_ODF`, the LibreOffice style and custom values. WordCraft makes one choice for each case the standard leaves open, the one the default made, so nothing changes for a document opened with the default. What a file states is still followed, its `TabsRelativeToIndent` and `AddParaTableSpacing` among it. LibreOffice's choices stay listed beside WordCraft's. | +| 2026-11-04 | How WordCraft writes ODF: unchanged paragraphs and tables with drawings, comments, tracked changes, notes or marks are written as read too (the text said from the model); what is edited, and the cases left in the element audit, from the model. | +| 2026-11-04 | The two presets are the two styles a document can be shown in: Microsoft Word style (`word`, the default; `wordcraft`, its earlier id, still taken) and LibreOffice style (`libreoffice`). The CLI's values listed one by one. | +| 2026-11-03 | Deviations from the standard listed: unitless gradient and hatch angles in files older than ODF 1.3 are read as tenths of a degree, as their producers wrote them, out of necessity (in ODF 1.3 files, degrees, as the standard says). The ODF 1.2 → 1.3 changes checked. | +| 2026-11-03 | More written as read (tables, pages, sections, properties, declarations); files saved as ODF 1.3 with older markup brought to 1.3's meaning; drawings state `style:flow-with-text`. | +| 2026-11-03 | Unedited content written as read (see How WordCraft writes ODF). | +| 2026-11-03 | Tabs measured from the indent: default stops count from the indent too (measured in LibreOffice), in WordCraft's layout, and a file measuring tabs so is written back so (it was written from the margin, moving LibreOffice's default stops). | +| 2026-11-03 | Widow and orphan control a file doesn't state (`widowControl`): WordCraft as XSL's initial value, LibreOffice off. WordCraft writes it on its default style either way. | +| 2026-11-03 | Known layout differences listed. | +| 2026-11-03 | Paragraph spacing (`sumParagraphSpacing`); a file's `AddParaTableSpacing` is followed, and WordCraft writes it. WordCraft's `settings.xml` now declares the `ooo` namespace, without which LibreOffice ignored all of its settings. | +| 2026-11-03 | Section column balancing (`balanceSectionColumns`); §20.428's contradiction recorded. WordCraft writes `text:dont-balance-text-columns` on every columned section. | +| 2026-11-02 | Unstated page margins are a setting (`pageMargin`: WordCraft 0, XSL's initial value; LibreOffice 2 cm), not law: the standard refers to XSL's margins without saying whether XSL's default comes too. | +| 2026-11-02 | First version: the profile, the open cases, law cases, writer choices, Google Docs and ONLYOFFICE findings. Stated values are never replaced by a preset; the cases about the meaning of stated values are marked. | diff --git a/docs/odt-element-audit.md b/docs/odt-element-audit.md new file mode 100644 index 0000000000..cf8d1c9bfa --- /dev/null +++ b/docs/odt-element-audit.md @@ -0,0 +1,117 @@ +# ODT element audit + +> **Last reviewed:** 2026-11-04 · **Last updated:** 2026-11-04 · **Change:** trivial (paragraphs tied together kept as read as groups); previously trivial (paragraphs with charts kept as read); previously trivial (sections in table cells and at empty paragraphs kept); previously trivial (password, number, time and grid form controls kept); previously minor (first version: every element of the ODF 1.3 schema against two corpora and a generated sample of each element never seen) + +Every element the ODF 1.3 schema (OASIS, Part 3, RELAX NG) defines, checked against what WordCraft's ODT reader and writer do with it. The question for each: does a file holding it open, and does a save without edits keep it? (See [file-format-parity.md](file-format-parity.md) for what WordCraft models; markup it doesn't model is written back as read while unedited: [odf-interpretation.md](odf-interpretation.md).) + +## Method + +1. **The schema**: its 596 element names, by namespace. +2. **Two corpora** (kept locally, not in the repository): 133 documents (LibreOffice's templates, bug-tracker and converter files, documents made for the checks) and 232 from the ODF Toolkit's and Calligra's test data, made by Microsoft Office, OpenOffice.org, StarOffice, LibreOffice, Calligra/KOffice, Lotus Symphony and others. Each is opened and saved by WordCraft, both copies are rendered by LibreOffice and compared page by page and by text, and a loss check lists every element, attribute and value the saved file has fewer of. +3. **Elements no file held**: a small document of our own for each one a text document can hold, opened and saved by WordCraft without edits and with an edit, each saved copy checked well-formed and opened in LibreOffice. + +## Namespaces + +| Namespace | Elements | Seen in a file | Note | +|---|---|---|---| +| `text:` | 174 | 124 | | +| `table:` | 98 | 11 | most are a spreadsheet's (ranges, pivot tables, database ranges); a text document's tables use few | +| `draw:` | 44 | 27 | | +| `style:` | 43 | 42 | | +| `office:` | 28 | 23 | | +| `form:` | 30 | 13 | | +| `number:` | 27 | 18 | | +| `svg:` | 10 | 2 | | +| `dc:` | 6 | 6 | | +| `meta:` | 15 | 14 | | +| `config:` | 5 | 5 | settings.xml, kept as read | +| `script:` | 1 | 1 | | +| `math:` | 1 | 1 | MathML, in formula objects | +| `xforms:` | 1 | 0 | | +| `chart:` | 25 | 18 | charts, read from their own objects | +| `dr3d:` | 6 | 0 | 3D scenes, kept as read with their paragraph | +| `presentation:` | 20 | 6 | presentations (a text document holds none) | +| `anim:` | 12 | 0 | presentations | +| `db:` | 50 | 0 | databases only | + +## Elements no file held, a text document can + +Each in a document of our own: it opens, saves without edits keeping it, and saves with an edit; every saved copy is well-formed and LibreOffice opens it. + +| Element | Unedited save | +|---|---| +| `draw:contour-path` | kept | +| `draw:glue-point` | kept | +| `draw:image-map` | kept | +| `draw:plugin` | kept | +| `form:connection-resource` | kept | +| `form:grid` | kept (as read, with its columns; LibreOffice opens the saved file, though its PDF export of a grid control fails whenever a document has automatic styles, ours or its own) | +| `form:list-value` | kept (the sample held none; a list box's values are kept with the form) | +| `form:password` | kept (as read) | +| `number:boolean-style` | kept | +| `number:embedded-text` | kept | +| `number:era` | kept | +| `number:fill-character` | kept | +| `number:fraction` | kept | +| `number:percentage-style` | kept | +| `number:quarter` | kept | +| `number:week-of-year` | kept | +| `style:region-center` | kept | +| `text:alphabetical-index-auto-mark-file` | kept with its index (as read) | +| `text:author-initials` | kept | +| `text:creation-time` | kept | +| `text:drop-down` | kept | +| `text:editing-cycles` | kept | +| `text:editing-duration` | kept | +| `text:expression` | kept | +| `text:hidden-paragraph` | kept | +| `text:linenumbering-separator` | kept | +| `text:meta-field` | kept | +| `text:modification-time` | kept | +| `text:note-continuation-notice-forward` | kept | +| `text:object-index` | kept | +| `text:page-variable-get` | kept | +| `text:page-variable-set` | kept | +| `text:print-time` | kept | +| `text:printed-by` | kept | +| `text:sender-country` | kept | +| `text:sender-initials` | kept | +| `text:sender-phone-private` | kept | +| `text:sender-title` | kept | +| `text:sort-key` | kept | +| `text:table-formula` | kept | +| `text:table-index` | kept | +| `text:toc-mark-start` | kept | +| `text:toc-mark` | kept | +| `text:user-field-input` | kept | +| `text:user-index-mark-start` | kept | +| `text:user-index-mark` | kept | +| `text:user-index` | kept | + +## Found, fixed + +The check found these, each fixed with a test (see [file-format-parity.md](file-format-parity.md), 2026-11-03 and 2026-11-04): + +- A file the package held without a media type (another application's, LibreOffice's empty accelerator configuration) was written without its manifest entry, and LibreOffice refused the saved file. +- A section hidden with `text:display="none"` showed its text once written without the section. +- A reference mark was written as a bookmark only, so references to it found nothing. +- Lists lost what a paragraph's markup can't say (a label followed by a space, picture bullets, an unnumbered header): unedited lists are now kept as read. +- Styles of different families, and list styles, sharing a name overwrote each other among the definitions kept. +- A form's data source (`form:connection-resource`) was taken for a control; index marks over text, plugins and floating frames weren't kept. +- Password, number, time and grid form controls (ODF 1.3 §13.5), of kinds WordCraft doesn't model, were dropped; they are kept as read, in their place in the text, as buttons and image controls were. + +## Left + +- **A paragraph showing a form control**: written from the model, which keeps what WordCraft models of it. +- **Calligra's page sequence** (`text:page-sequence`, a layout of fixed pages) and **numbered paragraphs** (`text:numbered-paragraph`): read as text, written from the model. +- **Soft page breaks between paragraphs** (a layout hint LibreOffice recomputes) and **unused automatic styles**: not written. + +## Revision history + +| Date | Change | What | +|---|---|---| +| 2026-11-04 | minor | First version | +| 2026-11-04 | trivial | Password, number, time and grid form controls kept | +| 2026-11-04 | trivial | Sections in table cells and at empty paragraphs kept | +| 2026-11-04 | trivial | Paragraphs with charts kept as read | +| 2026-11-04 | trivial | Paragraphs tied together (a comment, a change or a mark reaching into another, linked text boxes) kept as read as groups | diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 5708be0658..998d62e09c 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -2,7 +2,7 @@ Generated by `cargo xtask parity` (`wordcraft-cli parity --markdown`): the word-processor feature catalog (`crates/engine/src/catalog.rs`) compared with the live command registry. -**505 of 520 catalog features have commands (97.1%).** +**508 of 520 catalog features have commands (97.7%).** | Tab | Live | Total | |---|---|---| @@ -17,7 +17,7 @@ Generated by `cargo xtask parity` (`wordcraft-cli parity --markdown`): the word- | References | 25 | 25 | | Mailings | 23 | 23 | | Review | 29 | 31 | -| View | 26 | 29 | +| View | 29 | 29 | | Read Mode | 2 | 3 | | Developer | 11 | 11 | | Table Design | 8 | 8 | @@ -56,12 +56,6 @@ Generated by `cargo xtask parity` (`wordcraft-cli parity --markdown`): the word- - Language › Translate (`review.translate`) - Protect › Block Authors (`review.blockAuthors`) -### View - -- Window › Arrange All (`view.arrangeAll`) -- Window › View Side by Side (`view.sideBySide`) -- Window › Synchronous Scrolling (`view.syncScroll`) - ### Read Mode - View › Layout (`view.readLayout`) diff --git a/docs/roadmap.md b/docs/roadmap.md index f53c06bae0..5910d99703 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # WordCraft roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-03 · **Change:** minor (M15: Arabic mirrored UI #1195; 28 UI languages; Hebrew UI and native IME acceptance remain open); previously trivial (HTML import keeps preformatted lines with CR, CRLF or LF input newlines (#4810); numeric character references retain their separate meaning; readiness estimates unchanged; previously trivial: egui 0.37 migration: 27 interface languages remain pinned by `craft-i18n.rev` (9205108…), and the input-method handling has synthetic regressions while managed CI passed and native acceptance (#155–#164) remains open; previously trivial: M6: Manage Sources imports Word's `Sources.xml`, #2640; previously minor: Czech proofing review fixes; previously minor: Portuguese proofing; previously minor: Polish interface and Polish proofing; previously trivial: M7: formatting revisions landed, #41; previously trivial: M5: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: alpha gate checked: six core workflows pass; previously major: milestones moved here from ROADMAP.md; Current focus set from the re-measured gaps) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-03 · **Change:** minor (#3693: additional Delete Previous Sentence command and shortcut; Word-parity estimates unchanged); previously minor (M15: Arabic mirrored UI #1195; 28 UI languages; Hebrew UI and native IME acceptance remain open); previously trivial (HTML import keeps preformatted lines with CR, CRLF or LF input newlines (#4810); numeric character references retain their separate meaning; readiness estimates unchanged; previously trivial: egui 0.37 migration: 27 interface languages remain pinned by `craft-i18n.rev` (9205108…), and the input-method handling has synthetic regressions while managed CI passed and native acceptance (#155–#164) remains open; previously trivial: M6: Manage Sources imports Word's `Sources.xml`, #2640; previously minor: Czech proofing review fixes; previously minor: Portuguese proofing; previously minor: Polish interface and Polish proofing; previously trivial: M7: formatting revisions landed, #41; previously trivial: M5: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: alpha gate checked: six core workflows pass; previously major: milestones moved here from ROADMAP.md; Current focus set from the re-measured gaps) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 Forward-looking plan. The summary is [`ROADMAP.md`](../ROADMAP.md); the ranked work list is [`gaps.md`](gaps.md); the numbers are in [`target-app-parity.md`](target-app-parity.md). Hours are @@ -49,13 +49,13 @@ partial rows are fidelity gaps (beta work), not broken workflows. WordCraft stay |---|---|---|---| | M0 | Skeleton and vertical slice (model, layout, render, engine, Word-style UI, CLI, MCP, web) | done | — | | M1 | DOCX I/O | done (first version); real-world corpus not started; charts/SmartArt/OLE dropped | 45–75 h | -| M2 | Home tab | done except Paste Special, Clipboard pane, Style Inspector, Manage Styles, Asian typography (PRs open for four) | 5–10 h | +| M2 | Home tab | done except Paste Special, Clipboard pane, Style Inspector, Manage Styles, Asian typography (PRs open for four); additional editing command Delete Previous Sentence (#3693), outside the Word-parity count | 5–10 h | | M3 | Insert tab | mostly done; equations done (#191), icons done (#309); charts, SmartArt, 3D, screenshot, online media missing | 50–80 h | | M4 | Layout and Design tabs | done except column balancing, group | 6–10 h | | M5 | Tables | done (row splitting, floating tables, style formatting); custom table styles (#256); Draw Table and Eraser (#303) | 6–10 h | | M6 | References | first version done (TOC fields, cross-references, Zotero); footnote continuation missing; all 12 bibliography styles (#383); bibliography sources import from Word's `Sources.xml` (#2640) | 15–25 h | | M7 | Review | done (balloons, paragraph-mark revisions, formatting revisions #41); move tracking, multilingual proofing missing | 35–60 h | -| M8 | View | mostly done; window commands missing | 3–5 h | +| M8 | View | mostly done; persistent screen paper presets added (#3398); window commands missing | 3–5 h | | M9 | Mailings | done (first version); Excel/Outlook data sources and email merge missing | 6–10 h | | M10 | File/Backstage | mostly done; native printing, Options depth missing | 12–20 h | | M11 | Draw and objects | text wrap, text boxes, canvas handles, rotation (#332), ink pens and eraser (#307), contour wrap (#354), lasso, Add Pen, Ink to Shape and Ink Replay (#395) done; Ink to Math, grouping missing | 35–55 h | @@ -74,7 +74,10 @@ languages, screen-reader access, ecosystem decisions (VBA, add-ins, cloud), an i | Date | Change | Summary | |---|---|---| +| 2026-11-03 | trivial | DOCX text-frame anchor locks survive JSON and two save/reopen cycles, including position and size edits | | 2026-11-03 | minor | M15: Arabic mirrored interface (#1195); 28 UI languages from craft-i18n; Hebrew UI, native-speaker review and native IME acceptance (#155–#164) remain open | +| 2026-10-31 | minor | #3398: persistent screen-only green, cream and gray paper presets, with document backgrounds and export colors retained. Read Mode None follows the screen preset; Sepia/Inverse retain priority. | +| 2026-10-31 | minor | #3693: Delete Previous Sentence command and keyboard dispatch, with sentence/paragraph/cell, selection, undo and tracking regressions. Additional WordCraft behavior; Word-parity estimates unchanged. | | 2026-10-29 | trivial | HTML import keeps preformatted lines with CR, CRLF or LF input newlines (#4810); numeric character references retain their separate meaning; readiness estimates unchanged. | | 2026-10-25 | trivial | egui 0.37 migration: 27 interface languages remain pinned by `craft-i18n.rev` (9205108…); input-method surrounding-delete and commit handling has synthetic regressions only, with managed CI passing; native acceptance (#155–#164) and native-speaker review remain open | | 2026-10-18 | trivial | M6: Manage Sources imports Word's `Sources.xml` (#2640) | diff --git a/docs/spelling-dictionaries.md b/docs/spelling-dictionaries.md index 596e7e6ecb..0d05619406 100644 --- a/docs/spelling-dictionaries.md +++ b/docs/spelling-dictionaries.md @@ -1,6 +1,6 @@ # Installing languages and spelling dictionaries -> **Last reviewed:** 2026-10-16 · **Last updated:** 2026-11-03 · **Change:** trivial (Language packs: language-packs-2 is published and pinned: 75 packs, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch and Swedish (Sweden, Finland); Mongolian and Thai aren't packs yet); previously trivial (Language packs: the first set, language-packs-1, is published and pinned: 61 languages, and which aren't packs yet); previously minor (Language packs: install a language's spelling and hyphenation from File › Options › Language, or from the bar a document in that language shows; they are searched after the dictionaries folder and before the system's dictionaries; previously trivial: the Flatpak's own dictionaries folder; previously trivial: WordCraft's own dictionaries folder is searched on macOS and Linux too, as on Windows, so a dictionary dropped there works without a setting; previously minor: ISO 8859-9 Turkish dictionaries are read, #3692; previously minor: Spanish: `es_ES`, `es_MX`, `es_419` and `es_UY` with their fallbacks, #3360, #3553; previously trivial: every Hunspell language shows (no dictionary), not only Polish and Portuguese, and Indonesian is listed, #3150; previously trivial: ISO 8859-1 dictionaries are read, #2824) +> **Last reviewed:** 2026-10-16 · **Last updated:** 2026-11-03 · **Change:** trivial (Language packs are installed from Your languages and Add a language…; the Dictionaries folder is in Options › Language); previously trivial (Language packs: the missing-pack bar works on a fresh install and counts the caret's language); previously trivial (Language packs: language-packs-2 is published and pinned: 75 packs, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch and Swedish (Sweden, Finland); Mongolian and Thai aren't packs yet); previously trivial (Language packs: the first set, language-packs-1, is published and pinned: 61 languages, and which aren't packs yet); previously minor (Language packs: install a language's spelling and hyphenation from File › Options › Language, or from the bar a document in that language shows; they are searched after the dictionaries folder and before the system's dictionaries; previously trivial: the Flatpak's own dictionaries folder; previously trivial: WordCraft's own dictionaries folder is searched on macOS and Linux too, as on Windows, so a dictionary dropped there works without a setting; previously minor: ISO 8859-9 Turkish dictionaries are read, #3692; previously minor: Spanish: `es_ES`, `es_MX`, `es_419` and `es_UY` with their fallbacks, #3360, #3553; previously trivial: every Hunspell language shows (no dictionary), not only Polish and Portuguese, and Indonesian is listed, #3150; previously trivial: ISO 8859-1 dictionaries are read, #2824) English spelling works out of the box. Polish, Russian, Portuguese, Czech, Italian, Croatian, Turkish, Indonesian and Spanish spelling use a standard **Hunspell** dictionary (an `.aff` and a `.dic` file) that @@ -11,7 +11,7 @@ language with **(no dictionary)**, for example *Português (Brasil) (no dictiona If a dictionary is installed but can't be read (an unsupported `SET` encoding, a file over the size limit, a parse error), the language isn't checked either, and the status bar shows **(dictionary unreadable)** instead. Its tooltip gives the `.dic` file and the reason, and -**File › Options › Proofing** lists the same reason next to the file. +**File › Options › Language** (Dictionary files) lists the same reason next to the file. Install a dictionary once, restart WordCraft, and the language is checked as you type. @@ -27,14 +27,23 @@ built in; every other language is a pack. > split Thai text, which has no spaces, into words). Basque, > Ukrainian and Uyghur aren't packs: their data's licence doesn't allow it, or isn't clear. -- **File › Options › Language › Language packs** lists the packs, each with its size, its licence - and a link to where it comes from. Click **Install** next to a language; **Remove** takes it out - again. The first time, click **Show available languages** to get the list. +- **File › Options › Language › Your languages** lists English, the languages of the open + document and every installed pack, each with where its proofing comes from (*Built in*, + *Installed*, *Your own dictionary*, *System dictionary*, *Grammar built in*, *Not available yet*). + **Install** gets a document language's pack; **Remove** takes an installed one out; **Set as + default** makes it the language of new blank documents (the open document is left as it is). + **Add a language…** opens a list of the other packs: type *dutch*, *nederlands* or *nl* to + search, see each pack's size, licence and a link to where it comes from, and click **Install**. - When a document has text in a language whose pack isn't installed, a bar under the ribbon says *Dutch proofing isn't installed.* with an **Install** button showing the download size. ✕ hides - it for that document. It never shows for a language that has no pack. + it for that document. Once WordCraft has the list of packs, the bar shows only for a language + that has a pack. Before the list has been fetched (a fresh install, or the list of an older + WordCraft), it can't know, so it shows for a language that has no dictionary, with **Install** + alone: clicking it gets the list, then the pack if there is one (if not, the bar goes). With + downloading on, WordCraft fetches a missing or out-of-date list by itself once. Choosing a + language with nothing selected counts too. - Installing needs **downloading** on: the same single setting as WordCraft's font downloads - (the font store). Clicking Install, Show available languages or Refresh turns it on; nothing is + (the font store). Clicking Add a language…, Install or Refresh turns it on; nothing is downloaded before. Each pack is checked against the sha256 in WordCraft's pinned list before it is used. - Text in that language is checked and hyphenated as soon as the pack is installed: no restart. @@ -87,9 +96,10 @@ Turkish `tr_TR` dictionaries ISO 8859-9). The first folder holding a matching pair wins: -1. The folder set in **File › Options › Proofing › Dictionaries folder**. This is the easiest +1. The folder set in **File › Options › Language › Dictionaries folder**. This is the easiest way on every system, and it works for an app started from the Start menu, Finder or the Dock. - The same pane lists the dictionary file each language found. + Your languages marks each language it supplies *Your own dictionary*, and the **Dictionary + files** list under it shows the file each language found. 2. The folder in the `WORDCRAFT_DICTIONARIES` environment variable, and WordCraft's own `dictionaries` folder (the first row of each system below). 3. An installed [Language pack](#language-packs) for the language. @@ -166,7 +176,7 @@ from the LibreOffice repository (for example `it_IT/it_IT.aff`; the Spanish ones - Restart WordCraft. The status bar no longer says **(no dictionary)**, and a misspelled word such as `impramir` is underlined, with `imprimir` among its suggestions. -- **File › Options › Proofing** lists the file each language found. +- **File › Options › Language** (Dictionary files) lists the file each language found. - From the command line: ```sh @@ -183,6 +193,8 @@ Never commit dictionary files to this repository: they stay on the user's system | Date | Change | Summary | |---|---|---| +| 2026-11-03 | trivial | Language packs (CP4.3): the missing-pack bar offers a language before the list is fetched and gets the list, then the pack, on Install; a missing or stale list is fetched once while downloading is on; the caret's typing language counts | +| 2026-11-03 | trivial | Language packs: install from Your languages or Add a language… in Options › Language; the Dictionaries folder is in Options › Language, not Proofing | | 2026-11-03 | trivial | Language packs: language-packs-2 is published and pinned (75 languages, adding the compounding languages); Mongolian and Thai aren't packs yet, and why | | 2026-11-02 | trivial | Language packs: language-packs-1 is published and pinned (61 languages); which languages aren't packs yet and why (CP4.4) | | 2026-11-02 | trivial | The Flatpak's own dictionaries folder (`~/.var/app/ai.storyteller.wordcraft/data/wordcraft/dictionaries`); the host's folders are outside its sandbox | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 994b240c2e..f3e7b1b15e 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # WordCraft parity with Microsoft Word -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-29 · **Change:** trivial (Tables row: Table Properties applies to the selected rows, columns and cells, #4857; no percentage change); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (Insert Table of Figures lists any caption label, #3013; previously trivial: Performance row: typing no longer starts render threads on every repaint, #3027; previously trivial: shapes inserted in a row are all kept, #2019; previously trivial: East Asian typography: `w:eastAsianLayout` kept on save, not laid out; previously trivial: Ink to Shape recognises arrows; previously trivial: Windows Magnifier follows the caret onto a new line, #1119; previously trivial: table border drags with Ctrl and Alt, from the left edge and of selected cells, #711; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: all 12 bibliography styles, #383; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; replaces the parity tables that lived in ROADMAP.md) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** trivial (Equations: `\int` + Space leaves ∫ waiting for its limits, `_a^b` then Space builds them, and the operand typed next goes inside, observed in Word for Windows on #4938, #4917; no percentage change; previously trivial: Tables row: Table Properties applies to the selected rows, columns and cells, #4857; no percentage change); previously trivial (Tables row: tables nest 18 deep at most, so a .json save reads back, #3618); previously trivial (Tables row: Table Properties applies to the selected rows, columns and cells, #4857; no percentage change); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (Insert Table of Figures lists any caption label, #3013; previously trivial: Performance row: typing no longer starts render threads on every repaint, #3027; previously trivial: shapes inserted in a row are all kept, #2019; previously trivial: East Asian typography: `w:eastAsianLayout` kept on save, not laid out; previously trivial: Ink to Shape recognises arrows; previously trivial: Windows Magnifier follows the caret onto a new line, #1119; previously trivial: table border drags with Ctrl and Alt, from the left edge and of selected cells, #711; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: all 12 bibliography styles, #383; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; replaces the parity tables that lived in ROADMAP.md) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 The authoritative assessment of how close WordCraft is to Microsoft Word. [`ROADMAP.md`](../ROADMAP.md) summarizes it; [`gaps.md`](gaps.md) itemizes every shortfall; the deep checklists are @@ -62,7 +62,7 @@ full parity for the area. | Character and paragraph formatting | 11 | 82% | 85% | 8–12 | Nearly every property, Font/Paragraph dialogs, character border, Phonetic Guide (#288), Enclose Characters (#297). Kerning for fonts in the Font dialog. Missing: Asian Typography, ligature/stylistic-set options in the Font dialog's Advanced tab. | | Styles and themes | 8 | 74% | 75% | 8–12 | Gallery, pane, create/modify, style sets, themes. Style Inspector landed (#236). Missing: Manage Styles (#270 open), style separators, linked-style edge cases; Word ships 11 Quick Style sets plus dozens of themes, we ship our own smaller set. | | Lists | 6 | 78% | 75% | 5–8 | Bullets, numbering, multilevel, restart, `w:lvlOverride` levels (#134), Word's list AutoFormat and Enter/Backspace behaviour. Missing: Define New Multilevel List dialog depth, list styles, legal numbering edge cases. | -| Tables | 8 | 76% | 72% | 10–16 | Merge/split, styles (cell text takes style formatting, #104), custom table styles saved in the .docx (#256), Word 2013 edge, floating tables, rows split across pages, sort, formula, cell gridlines (#243), Draw Table and Eraser (#303), tables nested 24 deep at most, as the .docx reader and writer keep them (#1596; Word has no limit). Cell Margins opens an editable dialog initialized from table defaults and preserves unchanged values (#1960). Missing: splitting or erasing around vertically merged cells, nested-table polish. Dragging column and row borders and the resize handle on the page (#217) and the column and row markers on the rulers (#700) landed, with Word's Ctrl, Alt, left-edge and selected-cells drags (#711), and so did selecting columns, rows and cells, the "+" insert buttons, the move handle and double-click AutoFit on the page, Select Column, and drags and Shift+arrows over cells selecting whole cells; right-clicking a cell offers the table's commands, following the selection as in Word (Delete Cells, Rows, Columns or Table, Merge and Split Cells, Distribute, AutoFit, Text Direction, Insert Caption…, Table Properties…); cell text direction landed (#245). | +| Tables | 8 | 76% | 72% | 10–16 | Merge/split, styles (cell text takes style formatting, #104), custom table styles saved in the .docx (#256), Word 2013 edge, floating tables, rows split across pages, sort, formula, cell gridlines (#243), Draw Table and Eraser (#303), tables nested 18 deep at most, so a .json save or AutoRecover snapshot reads back even with rich content in the deepest cell (#1596, #3618; the .docx reader and writer keep 24; Word has no limit). Cell Margins opens an editable dialog initialized from table defaults and preserves unchanged values (#1960). Missing: splitting or erasing around vertically merged cells, nested-table polish. Dragging column and row borders and the resize handle on the page (#217) and the column and row markers on the rulers (#700) landed, with Word's Ctrl, Alt, left-edge and selected-cells drags (#711), and so did selecting columns, rows and cells, the "+" insert buttons, the move handle and double-click AutoFit on the page, Select Column, and drags and Shift+arrows over cells selecting whole cells; right-clicking a cell offers the table's commands, following the selection as in Word (Delete Cells, Rows, Columns or Table, Merge and Split Cells, Distribute, AutoFit, Text Direction, Insert Caption…, Table Properties…); cell text direction landed (#245). | | Page layout and sections | 7 | 70% | 72% | 12–20 | Margins, size, columns, breaks, page borders, line numbers, vertical alignment, drop caps, hyphenation. Columns don't balance; RTL sections missing. Vertical sections (tbRl/btLr) landed (#491). Detail: [layout-parity.md](layout-parity.md). | | Headers, footers, page numbers, fields | 5 | 70% | 70% | 8–12 | First/even/odd, link to previous, TOC as an updatable field (#52), cross-references to real bookmarks (#227). Field coverage is a subset of Word's ~90 field codes; Field dialog missing. | | Footnotes and endnotes | 3 | 60% | 60% | 3–5 | Placed and editable, numbers from Word files (#103); long notes continue onto the next page under the continuation separator (#352). Footnote and Endnote dialog with options per section: below text, end of section, number format, start at, restart each section or page, custom mark, convert (#385). | @@ -73,9 +73,9 @@ full parity for the area. | Pictures, shapes, text boxes, WordArt | 6 | 60% | 60% | 20–30 | Insert, crop, recolour, styles, floating placement like Word (#136), wrap (square/top-bottom/behind/front), text boxes edit and overflow (#46), VML text boxes (#242), free rotation and flips with a rotation handle (#332), WordArt: text fill (solid, gradient, none), outline, shadow, glow and reflection with our own styles, and Transform warps along arch, circle, wave, slant, inflate/deflate, chevron and triangle (other presets kept and drawn flat), connectors (straight, elbow, curved, arrowheads) glued to shapes' connection sites and re-routed when those move (#416). Missing: tight/through contour wrap, rotated text-box text, group (#267 open), shape effects, WordArt 3-D/bevel and editing text in its bent form, connector routing around shapes, Drawing Canvas, Icons, online pictures, screenshot. | | Mailings | 2 | 70% | 70% | 6–10 | Mail merge from CSV, fields, rules (IF, SKIPIF, NEXT, NEXTIF, evaluated alike in preview and merge), fields in headers/footers (one section per letter), preview, envelopes, labels. Select Recipients takes a typed list, CSV (#247) or a sheet of an Excel (.xlsx/.xlsm) or OpenDocument (.ods) workbook, with Select Table to pick the sheet (#334); no Outlook/Contacts/Access data sources, no email merge. | | Pictures, shapes, text boxes, WordArt | 6 | 60% | 60% | 20–30 | Insert, crop, recolour, styles, floating placement like Word (#136), wrap (square/top-bottom/behind/front), text boxes edit and overflow (#46), VML text boxes (#242), free rotation and flips with a rotation handle (#332), text-box text direction (90°, 270°, stacked), Align Text and linked text boxes (#369), Icons: an original icon library drawn in code with a searchable picker, inserted as pictures and recoloured with Icon Color (#309), Drawing Canvas with Fit/Expand/Scale and DOCX `wpc:wpc` (#344; members edited by command, not yet dragged inside the canvas; the canvas rotates and flips as a whole). Missing: tight/through contour wrap, text in a freely rotated text box, group (#267 open), shape effects, WordArt, connectors, online pictures, screenshot. | -| Equations | 1 | 75% | 20% (with Draw) | 4–8 | OMML read/write, OpenType MATH layout, in-place editor with an Equation tab (#191). Missing: line breaking of long display equations, ink equations. | +| Equations | 1 | 75% | 20% (with Draw) | 4–8 | OMML read/write, OpenType MATH layout, in-place editor with an Equation tab (#191); typed `\int`, `\sum`… + Space wait for their limits (`_a^b`), any character that can't continue `\name` corrects it (`\int_0^1`), and an operator built without an operand takes the caret into it, as observed in Word for Windows on #4938 (#4917, `equation::tests::an_autocorrected_operator_waits_for_its_limits`). Missing: line breaking of long display equations, ink equations. | | Charts, SmartArt, Draw/ink, 3D models, icons | 4 | 3% | (20% with equations) | 70–110 | Icons landed (#309; an original library drawn in code). Draw: pens, pencil, highlighter, stroke eraser and Hide Ink (#307), ink saved as DrawingML freeforms; Lasso Select (move, recolour, delete), Add Pen gallery, Ink to Shape (line, arrow, rectangle, ellipse, triangle, polygon) and Ink Replay (#395); Ink to Math, pressure and Word's own InkML missing; charts: Insert › Chart makes column, bar (clustered and stacked), line, area, pie, doughnut and scatter charts with Chart Design (change type, Edit Data grid, title, legend, data labels) and saves them as real chart parts (#409); charts from Word are drawn (#292) and kept on save (#319) but stay read-only; SmartArt is drawn and kept (#292, #319); Insert › SmartArt (#497) creates and edits list, process, cycle, hierarchy, pyramid, radial, matrix and Venn graphics with our own layouts, a Text Pane and the SmartArt Design tab, saved as diagram parts with the drawing; SmartArt from other programs stays read-only. | -| View (modes, zoom, panes, windows) | 3 | 72% | 70% | 6–10 | Print/web/draft/read/focus, dark page (#194), pages side by side when zoomed out (#251), navigation pane; Outline view with the Outlining tab: levels, promote/demote, moving with collapsed content, expand/collapse, Show Level, first line only, text formatting (#493). Missing: View Side by Side, Synchronous Scrolling, Arrange All, Switch Windows, Master Document, Immersive Reader depth. | +| View (modes, zoom, panes, windows) | 3 | 72% | 70% | 6–10 | Print/web/draft/read/focus, dark page (#194), pages side by side when zoomed out (#251), navigation pane; Outline view with the Outlining tab: levels, promote/demote, moving with collapsed content, expand/collapse, Show Level, first line only, text formatting (#493). Switch Windows, Arrange All, View Side by Side and Synchronous Scrolling across the native windows (#322). Missing: Split, Master Document, Immersive Reader depth. | | Backstage, printing, options | 3 | 58% | 55% | 12–20 | New/Home pages (#254), save prompts (#151), web printing via the browser (#209). Desktop printing still goes through PDF; Options has a fraction of Word's panes. | | Right-to-left and complex scripts | 1 | 50% | 55% | 15–25 | UAX #9, Arabic shaping, RTL paragraphs (#207). No RTL sections/tables, kashida justification or mirrored UI; open bug reports (#215, #211, #199, #66, #63, #48, #19) need re-testing against #207. | | East Asian typography | 1 | 25% | not rated | 13–22 | IME input works (winit fixes pending, #155–#164). Vertical text in sections, text boxes and cells with upright ideographs (#491; no `vert` glyph alternates). Ruby/Phonetic Guide with DOCX round trip (#288); document grid (lines per page, characters per line, #391). Two lines in one and horizontal in vertical (`w:eastAsianLayout`) are kept on save but not laid out. No enclose characters, Asian line-break options. | @@ -253,6 +253,9 @@ can be used without committing Word output. | Date | Change | Summary | |---|---|---| +| 2026-10-26 | trivial | View › Window across the native windows (#322): View catalog 26/29 → 29/29; View row text only, percentages unchanged | +| 2026-10-30 | trivial | Equations: `\int`, `\sum` and the other n-ary operators typed with AutoCorrect wait for their limits: `_x^y` then Space gives the operator its limits, Space alone builds it without, and the operand typed next goes inside it; any character that can't continue `\name` corrects it (`\int_0^1`); observed in Word for Windows on #4938 (#4917); no percentage change | +| 2026-10-30 | trivial | Tables row: tables nest 18 deep at most, so a `.json` save or AutoRecover snapshot reads back, rich content in the deepest cell included (it was 24, which a `.json` save could not reopen); the .docx reader and writer still keep 24 (#3618); no percentage change | | 2026-10-29 | trivial | Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880). Filtered/sorted order, product geometry and single-label mode retained; readiness estimates unchanged. | | 2026-10-18 | trivial | References: Insert Table of Figures dialog; a table of figures lists any caption label (`TOC \c`), without label and number (`\a`), without page numbers (`\n`) or with them after the text (`\p`); Word's switch order is recognised and the leader kept on update (#3013); no percentage change | | 2026-10-15 | trivial | Pictures, shapes, text boxes: Insert › Shapes adds the new shape beside the selection, as Word draws it, so a second shape no longer replaces the first (still selected after its insert) and selected text stays; a picture still replaces a selected picture, as in Word (#2019) | diff --git a/docs/testing.md b/docs/testing.md new file mode 100644 index 0000000000..4b166bfaa4 --- /dev/null +++ b/docs/testing.md @@ -0,0 +1,28 @@ +# Layout test fonts + +Layout unit tests use only the 13 font files already pinned under `assets/fonts/`: Source Sans 3, +Source Serif 4, Inter and JetBrains Mono, with their bundled styles. Family listings also include +legacy style names such as Inter Medium. They do not load installed fonts, user font preferences, +or the optional `CRAFT_FONTS_DIR` input. No download or extra font checkout is required. + +Every layout unit test starts with `crate::test_fonts();`, before constructing its fixture or +resolving a font. This initializes the process-wide database once, including when a single test is +run by name. The `wordcraft-fonts/test-support` development feature exposes the initializer; +enabling the feature alone has no effect. Initialization fails if an application database already +exists, rather than replacing a database whose faces may be in the shaping or math caches. +Other test binaries and application builds keep their normal font discovery behavior. + +Uninstalled requested families use the normal substitution lists, restricted to this fixed set. +In particular, the default Aptos request resolves to Source Sans 3. These fonts are not Calibri +metric substitutes: Word measurements remain reference behavior, while fixture dimensions must +account for the pinned font's metrics. Do not recalibrate a fixture from the same layout behavior +it is meant to test. When changing a pagination fixture, check that undoing its original layout +fix still makes the regression test fail. + +The fixed set does not cover every script or include an OpenType math font. Tests with an +existing unavailable-script guard still take that guard. Additional script or math font fixtures +belong in `storytold/craft-fonts`, with a reproducible test input before enabling them here. + +Run the suite with `cargo test -p wordcraft-layout`. The isolated font initialization regression +runs with `cargo test -p wordcraft-fonts --features test-support --test fixed_test_fonts`. +`cargo xtask ci` also runs it through the layout crate's development dependency. diff --git a/docs/typing-parity.md b/docs/typing-parity.md index 58e20f242e..6ad5a1a3e6 100644 --- a/docs/typing-parity.md +++ b/docs/typing-parity.md @@ -1,6 +1,6 @@ # Typing parity with Word -> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-01 · **Change:** minor (English spelling by dialect from SCOWL 2026, CP2; previously trivial: Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (highlight at a caret leaves the word alone, #4086); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial: tests and notes for the border-line, table, tab-indent and wide-space rules; previously trivial: `*Bold* and _italic_ as real formatting` in AutoFormat As You Type; previously trivial: highlight target includes selected paragraph marks, #4085; previously trivial: full-target highlight check beyond 10,000 runs, #4085; previously trivial: queued IME replacements are rejected before mutation after their marked composition loses its body/equation target; previously trivial: the transactional equation delete proves its commit with the engine revision; previously trivial: a refused byte-counted equation deletion drops only the immediately adjacent stale replacement, so a later direct commit still applies; previously trivial: a tracked own-insertion shifts the rest of a two-sided IME deletion; previously trivial: AutoCorrect/AutoFormat classification compares the actual paragraph; previously trivial: a replaced body starts a new input-method context and interrupts the composition; a quote the engine leaves as typed is the input method's own change; equation `DeleteSurrounding` erases counted characters; previously trivial: AutoCorrect finds the word after a no-break space or an ideographic space; previously trivial: a command that changes nothing is not an edit: no undo step, no unsaved changes, no relayout, and the redo stack survives it; previously trivial: while an input method composes, the caret and its candidate window sit at the input method's cursor inside the composition; previously trivial: Ctrl+Tab types a tab in a table cell, #3137; previously trivial: List AutoFormat triggers in front of an already-written paragraph, not only a fresh empty one, checked in Word for Windows, #3352; previously trivial: AltGr types its characters without opening KeyTips on Linux, #2388; previously trivial: Delete on whole selected cells leaves one empty paragraph in each, with the cell's last paragraph's formatting; nested tables go too, #2802; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: a text box that keeps the keyboard no longer resets the input method every frame, #2986; previously trivial: a slash opening a word travels whole to the next line, #2963; previously trivial: typing over a selection takes the first selected character's formatting, also when the selection was made right to left, #2879; previously trivial: Turkish and Azerbaijani case mapping in AutoCorrect, #1923; previously trivial: smart quotes in Hebrew pinned: logical order, ” in acronyms as in Word, #1670; previously trivial: Backspace on a selected table, rows or columns deletes them, Delete clears them, #1844; previously trivial: typed text takes its direction from its own letters, #1543; previously trivial: an input method's request to erase text around the caret is honoured, so web typing in Cyrillic and other non-Latin text no longer repeats, #1480; previously trivial: `-->` AutoCorrect replacement, #2223; previously trivial: a heading-list preset keeps Heading styles and makes other paragraphs Heading 1, as in Word, #1793; previously trivial: numbered headings: a heading-linked Multilevel List numbers new headings by their style; numbering keeps a heading a heading, #1793; previously trivial: reversing an automatic capital adds an exception, #1857; previously trivial: smart quotes open after guillemets and low quotes and nest; previously trivial: Enter on an empty list item numbered by its paragraph style moves it up a level, #2143; previously trivial: Backspace after a section break and Delete before it remove the break, also on the last paragraph, #2127; previously trivial: a table inserted in right-to-left text is right to left, so Tab moves left, #2634; previously trivial: Shift+Delete cuts the selection on every platform, #1669; previously trivial: Select All then Delete removes a table the document starts with, #1198; previously trivial: Alt+numpad character codes, #961; previously trivial: Down and Up from a line start beside a table go into it, #1007; previously trivial: sample-text formulas on Enter, #1067; previously trivial: Track Changes: Accept All after a tracked delete from a paragraph end keeps the next paragraph; Reject All after typing into an empty paragraph keeps it (#864); previously minor: Correct TWo INitial CApitals, cAPS LOCK and table-cell capitals, #544; previously trivial: complex-script caret and Backspace, #604; Move Paragraph Up/Down, Promote/Demote, Go Back and Alt+X keys, #343; the body IME deletion maps signed placeholder growth/shrink, keeps control markers outside the range and scopes its undo join to the matching replacement) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-04 · **Change:** minor (#3693: additional Delete Previous Sentence command and shortcut; Word-parity estimates unchanged); previously trivial (Ctrl+K on a selection retypes it with a changed Text to display); previously trivial (equation `\int` + Space waits for its limits, `_x^y` then Space builds them and typing goes into the operand, and any character that can't continue `\name` corrects it, observed in Word for Windows on #4938, #4917); previously minor (English spelling by dialect from SCOWL 2026, CP2; previously trivial: a tracked heading or border-line AutoFormat replaces another author's formatting change; previously trivial: Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (highlight at a caret leaves the word alone, #4086); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial: tests and notes for the border-line, table, tab-indent and wide-space rules; previously trivial: `*Bold* and _italic_ as real formatting` in AutoFormat As You Type; previously trivial: highlight target includes selected paragraph marks, #4085; previously trivial: full-target highlight check beyond 10,000 runs, #4085; previously trivial: queued IME replacements are rejected before mutation after their marked composition loses its body/equation target; previously trivial: the transactional equation delete proves its commit with the engine revision; previously trivial: a refused byte-counted equation deletion drops only the immediately adjacent stale replacement, so a later direct commit still applies; previously trivial: a tracked own-insertion shifts the rest of a two-sided IME deletion; previously trivial: AutoCorrect/AutoFormat classification compares the actual paragraph; previously trivial: a replaced body starts a new input-method context and interrupts the composition; a quote the engine leaves as typed is the input method's own change; equation `DeleteSurrounding` erases counted characters; previously trivial: AutoCorrect finds the word after a no-break space or an ideographic space; previously trivial: a command that changes nothing is not an edit: no undo step, no unsaved changes, no relayout, and the redo stack survives it; previously trivial: while an input method composes, the caret and its candidate window sit at the input method's cursor inside the composition; previously trivial: Ctrl+Tab types a tab in a table cell, #3137; previously trivial: List AutoFormat triggers in front of an already-written paragraph, not only a fresh empty one, checked in Word for Windows, #3352; previously trivial: AltGr types its characters without opening KeyTips on Linux, #2388; previously trivial: Delete on whole selected cells leaves one empty paragraph in each, with the cell's last paragraph's formatting; nested tables go too, #2802; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: a text box that keeps the keyboard no longer resets the input method every frame, #2986; previously trivial: a slash opening a word travels whole to the next line, #2963; previously trivial: typing over a selection takes the first selected character's formatting, also when the selection was made right to left, #2879; previously trivial: Turkish and Azerbaijani case mapping in AutoCorrect, #1923; previously trivial: smart quotes in Hebrew pinned: logical order, ” in acronyms as in Word, #1670; previously trivial: Backspace on a selected table, rows or columns deletes them, Delete clears them, #1844; previously trivial: typed text takes its direction from its own letters, #1543; previously trivial: an input method's request to erase text around the caret is honoured, so web typing in Cyrillic and other non-Latin text no longer repeats, #1480; previously trivial: `-->` AutoCorrect replacement, #2223; previously trivial: a heading-list preset keeps Heading styles and makes other paragraphs Heading 1, as in Word, #1793; previously trivial: numbered headings: a heading-linked Multilevel List numbers new headings by their style; numbering keeps a heading a heading, #1793; previously trivial: reversing an automatic capital adds an exception, #1857; previously trivial: smart quotes open after guillemets and low quotes and nest; previously trivial: Enter on an empty list item numbered by its paragraph style moves it up a level, #2143; previously trivial: Backspace after a section break and Delete before it remove the break, also on the last paragraph, #2127; previously trivial: a table inserted in right-to-left text is right to left, so Tab moves left, #2634; previously trivial: Shift+Delete cuts the selection on every platform, #1669; previously trivial: Select All then Delete removes a table the document starts with, #1198; previously trivial: Alt+numpad character codes, #961; previously trivial: Down and Up from a line start beside a table go into it, #1007; previously trivial: sample-text formulas on Enter, #1067; previously trivial: Track Changes: Accept All after a tracked delete from a paragraph end keeps the next paragraph; Reject All after typing into an empty paragraph keeps it (#864); previously minor: Correct TWo INitial CApitals, cAPS LOCK and table-cell capitals, #544; previously trivial: complex-script caret and Backspace, #604; Move Paragraph Up/Down, Promote/Demote, Go Back and Alt+X keys, #343; the body IME deletion maps signed placeholder growth/shrink, keeps control markers outside the range and scopes its undo join to the matching replacement) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 What Word does when you type, observed black-box (same keystrokes typed into Word and WordCraft, results read back paragraph by paragraph) and pinned by tests in @@ -8,6 +8,29 @@ WordCraft, results read back paragraph by paragraph) and pinned by tests in tests together. Line breaking and pagination are in [`layout-parity.md`](layout-parity.md); the overall picture is in [`target-app-parity.md`](target-app-parity.md). +## Additional editing command: Delete Previous Sentence (#3693) + +`text.deleteSentenceBack` is a WordCraft extension requested for Ctrl+Shift+Backspace +(Cmd+Shift+Backspace on macOS), not an observed Word default. It deletes from the caret +back to the start of its sentence; at the start of a sentence it deletes the previous +sentence, including its trailing spaces. It uses the same boundaries as Select Sentence +(`.`, `!`, `?` and following spaces), not a new language-specific sentence segmenter. +An existing selection is deleted normally. At the start of a paragraph or table cell it +does nothing: paragraph marks and cell boundaries are preserved. Deletion uses the normal +undo, tracked-changes and protection paths. The shortcut can be reassigned in Customize Keyboard. + +Evidence: `crates/engine/src/tests/typing.rs::delete_previous_sentence_respects_caret_boundaries_and_unicode`, +`delete_previous_sentence_keeps_paragraph_boundaries_and_deletes_selections`, +`delete_previous_sentence_tracks_changes_and_respects_read_only`, +`delete_previous_sentence_does_not_cross_a_table_cell_boundary`, and +`crates/ui-egui/src/keys/tests.rs::delete_previous_sentence_shortcut_dispatches_and_can_be_reassigned`. + +## Finding smart-quoted text (#5388) + +Ordinary Find and Replace treat a keyboard apostrophe (`'`) as a straight or typographic single quote (`‘`, `’`), so a search for `Tau'va` finds `Tau’va` typed with smart quotes. Partial queries, case options and whole-word matching still apply. Wildcards, regular expressions, literal searches (`special: false`) and numeric character codes such as `^u39` remain exact. A curly-quote query also stays exact, and the modifier-letter apostrophe `ʼ` is distinct. Replacement `^&` keeps the original matched spelling. This behavior is covered by original engine and CLI/MCP controls; no fresh Word or native desktop comparison is claimed. + + + ## Highlight shortcut (#4085) On Windows/Linux, Ctrl+Alt+H toggles the last chosen highlighter colour (yellow in a @@ -108,6 +131,7 @@ formatting of the text before the cursor. Not yet compared side by side in Word. | Backspace at a paragraph start / Delete at a paragraph end (tracking on) | the paragraph mark is marked deleted (still shown); the caret moves before it (Backspace) or past it (Delete). Accept joins the paragraphs, Reject keeps them. A mark you inserted yourself is just removed | `tracked_enter_and_backspace_track_the_paragraph_mark`, `tests::tracked_backspace_and_delete_mark_a_paragraph_break_deleted` | | Delete a range from the end of one paragraph into a later one (tracking on) | the paragraph marks and text in the range are tracked deletions. Accept All removes exactly those, so the paragraph after the range stays a paragraph of its own; Reject All restores everything. Typing into an empty paragraph and rejecting leaves that paragraph | `tests::accept_all_after_a_tracked_delete_from_a_paragraph_end_keeps_the_next_paragraph`, `tests::reject_all_after_typing_into_an_empty_paragraph_keeps_the_paragraph` | | Backspace just after a section break / Delete just before it | the break goes and the two paragraphs join; the text before it takes the following section's page setup (Word's documented behaviour: a break holds the setup of the section before it); headers and footers the following section showed by linking to the previous one stay. Delete at the end of the last paragraph removes a break on its mark too, with no paragraph to join (with Track Changes on it still does nothing there). Undo brings the break back. Breaks read from a .docx and breaks inserted here alike (#2127) | `backspace_and_delete_remove_a_section_break`, `delete_removes_a_section_break_on_the_last_paragraph` | +| Accept All / Reject All of a paragraph left empty, whose mark carries a section break (tracking on, or a Compare result) | the paragraph goes whole and its section joins the following one, as when the break is deleted; the next paragraph keeps its own style and numbering, as for an empty paragraph without a break (#5667) | `resolving_away_an_empty_paragraph_with_a_section_break_keeps_the_next_paragraphs_properties` | | Select All, then Delete or Backspace | the whole document goes, tables included, also when it starts with a table; one empty paragraph is left | `select_all_then_delete_removes_tables` | | Backspace / Delete with a whole table selected (Select Table, or every cell dragged over) | Backspace removes the table, like Delete Table (one undo step; with tracking on its text is marked deleted and the structure stays); the caret goes to the paragraph after it. Delete clears the cells and keeps the table (each cell as below). A nested table goes on its own and leaves the cell's paragraph; a table that was the only block leaves one empty paragraph | `backspace_with_the_whole_table_selected_removes_the_table`, `delete_with_the_whole_table_selected_clears_the_cells_and_keeps_the_table`, `backspace_on_a_selected_nested_table_removes_only_it`, `backspace_on_a_selected_table_that_is_the_only_block_leaves_an_empty_paragraph`, `tracked_backspace_on_a_selected_table_marks_its_text_deleted_like_delete_table` | | Backspace / Delete with a table and the paragraph before or after it selected | both remove the table, whatever end the selection starts in; the text around joins. Any table the selection covers whole goes, at any nesting level | `delete_or_backspace_with_the_table_and_the_paragraph_after_selected_removes_the_table`, `delete_or_backspace_with_the_paragraph_before_and_the_table_selected_removes_the_table` | @@ -135,7 +159,7 @@ Windows/Linux keys are given first, macOS second. | Shift+F5 | Go Back: the caret cycles through the last four places edited, most recent first | `shift_f5_goes_back_through_the_last_edits` | | Alt+X (no macOS default) | the hex code before the caret (up to six digits, `U+` optional) or the selected code becomes its character; otherwise the character before the caret becomes its code (`é` ↔ `00E9`); one undo step | `alt_x_toggles_between_a_character_and_its_code` | | Shift+Backspace / Shift+Delete | Shift+Backspace erases like Backspace (#707). Shift+Delete cuts the selection to the clipboard and does nothing without one (Word for Windows, observed 2026-10-14). Windows delivers Shift+Delete as a Cut; macOS and Linux deliver the key, which did nothing (#1669) | `shift_delete_cuts_the_selection_and_shift_backspace_erases` | -| Alt+numpad code (Windows and Linux; not macOS) | hold Alt, type a decimal code, release Alt: the character appears at the caret as typed text (one undo step). With a leading 0 the code is the ANSI code page — Windows-1252 by default (`0233` → é, `0128` → €); without one, 1–255 is the OEM code page — 437 by default and in US English (`233` → Θ, `1` → ☺, `7` → •), 850 for Western European locales and English outside the US (`155` → ø; `233` is Ú there, per the CP850 mapping file — é is `130` in both). On Windows the system locale picks both pages (`text.typeCode` `ansi`/`oem`): Central European 1250/852 (Polish `0185` and `165` → ą), Cyrillic 1251/866, Greek 1253/737, Turkish 1254/857, and for codes up to 255 the character Windows composes itself replaces ours (it knows every code page, double-byte ones too); Linux keeps 1252 and 437/850. Above 255, with or without the 0, the Unicode character with that decimal value (`8364` → €). Control characters, 0, unassigned bytes and values past Unicode type nothing; auto-repeat of a held digit adds nothing, and switching windows drops a half-typed code. Word counts only keypad digits; egui reports keypad and top-row digits alike, so top-row digits with Alt alone compose codes too. An Alt code never opens KeyTips | `alt_numpad_codes_map_like_word_on_windows`, `alt_numpad_code_types_one_character`, ui-egui `alt_numpad_code_types_its_character_without_keytips` | +| Alt+numpad code (Windows and Linux; not macOS) | hold Alt, type a decimal code, release Alt: the character appears at the caret as typed text (one undo step). With a leading 0 the code is the ANSI code page — Windows-1252 by default (`0233` → é, `0128` → €); without one, 1–255 is the OEM code page — 437 by default and in US English (`233` → Θ, `1` → ☺, `7` → •), 850 for Western European locales and English outside the US (`155` → ø; `233` is Ú there, per the CP850 mapping file — é is `130` in both). On Windows the system locale picks both pages (`text.typeCode` `ansi`/`oem`): Central European 1250/852 (Polish `0185` and `165` → ą), Cyrillic 1251/866, Greek 1253/737, Turkish 1254/857, and for codes up to 255 the character Windows composes itself replaces ours (it knows every code page, double-byte ones too); Linux keeps 1252 and 437/850. Above 255, with or without the 0, the Unicode character with that decimal value (`8364` → €). Control characters, 0, unassigned bytes and values past Unicode type nothing; auto-repeat of a held digit adds nothing, and switching windows drops a half-typed code. Word counts only keypad digits; egui reports keypad and top-row digits alike, so top-row digits with Alt alone compose codes too. An Alt code never opens KeyTips. A text box (Find what, a dialog's field, the ribbon's boxes) takes the same codes: its character, not the digits (#4403) | `alt_numpad_codes_map_like_word_on_windows`, `alt_numpad_code_types_one_character`, ui-egui `alt_numpad_code_types_its_character_without_keytips`, `alt_code_types_its_character_in_a_text_box` | | AltGr (Right Alt on Polish, German, Czech… layouts) | AltGr+letter types the layout's character (AltGr+S → ś, AltGr+L → ł) and a bare AltGr tap does nothing; neither opens KeyTips. On Linux AltGr is the Right Alt key with Level 3 Shift, not Alt, so its modifiers event no longer reads as Alt let go (#2388); on Windows it is Ctrl+Alt. Right Alt on a layout without AltGr (US) is Alt and opens KeyTips like Left Alt | ui-egui `altgr_types_its_characters_without_keytips` | | Shift+Right (⇧→) at the end of a cell's text | the whole cell is selected first (its end-of-cell mark); the next Shift+Right selects the next cell with it. In an empty cell the first press selects the cell | `shift_right_at_the_end_of_a_cell_selects_the_cell_first` | @@ -222,13 +246,22 @@ no-break space, a figure space or an ideographic space (`autocorrect_finds_the_w isn't linked; typing inside it is. Linking a whole paragraph doesn't link its mark, so the paragraphs Enter makes from it aren't links (#413; `a_link_covers_only_its_own_text`, `typing_at_either_end_of_a_link_is_not_linked`). +- Ctrl+K on selected text with a changed Text to display retypes the selection with that text, + keeping its formatting (tracked with Track Changes on), and links it. The same text, text with + a line break (typed or selected), a selection over several paragraphs, one holding a picture + or field, or one inside a field's result keeps its text and is only linked, as Word shows + `<>` there (WordCraft's rule for those; not compared live) + (`a_link_on_a_selection_shows_the_text_to_display`, `a_link_over_two_paragraphs_keeps_their_text`, + `a_retyped_link_text_is_tracked`, `a_link_keeps_a_selection_it_cannot_retype`). - A field covers only its own result: text typed or pasted with the caret just after a field (a Zotero citation at the end of a paragraph, the caret put there with a click) goes after the field, not into its result (#898; `typing_after_a_citation_goes_outside_its_field`). - With Track Changes on, the border-line and table AutoFormats below mark the characters deleted, so Reject All brings them back; characters the same author inserted are removed. The border is a tracked formatting change, at the top of a story too - (`a_tracked_border_line_is_a_deletion_and_a_formatting_change`); the table is inserted + (`a_tracked_border_line_is_a_deletion_and_a_formatting_change`), and at the top it replaces + another author's earlier formatting change on the paragraph + (`a_tracked_border_line_at_the_top_supersedes_another_authors_formatting`); the table is inserted untracked, as Insert › Table inserts one (`a_tracked_table_line_keeps_its_characters_as_a_deletion`). A line holding a tracked deletion stays as it is, so Enter after the deleted characters is a plain Enter. This is @@ -246,18 +279,27 @@ no-break space, a figure space or an ideographic space (`autocorrect_finds_the_w (single, double, dotted, thick, wave, triple) (`border_line_autoformat`). ⌘Z right after brings the characters back and removes the border; the Enter stays (one undo step) ¹ (`undo_right_after_a_border_line_brings_the_characters_back`). -- Built-in Heading styles (`tools.autocorrect {"headingStyles": true}`, off by default): Enter +- Built-in Heading styles (`tools.autocorrect {"headingStyles": true}`, off by default, + `built_in_heading_styles_are_off_by_default`): Enter twice after a line of five or fewer words that does not end with punctuation makes the line Heading 1; one or two tabs before it make it Heading 2 or 3, and the tabs are removed ¹ (`two_enters_after_a_short_line_make_it_a_heading`). The rest is WordCraft's own rule: the line is a Normal paragraph of the main text (not in a list, a table, a header or a text box) - and ends in a letter or digit; the caret stays in the empty paragraph after the heading; ⌘Z + with no outline level, and ends in a letter or digit + (`a_line_that_is_not_a_short_line_of_body_text_stays_as_it_is`); the caret stays in the + empty paragraph after the heading; ⌘Z right after brings back the tabs and the Normal style, and the second Enter stays (`undo_right_after_a_heading_autoformat_keeps_the_enter`); with Track Changes on, the tabs are marked deleted (or removed, when the same author inserted them) and the style change is a tracked formatting change, and a line holding a tracked deletion stays as it is - (`a_tracked_heading_autoformat_can_be_rejected`); a heading style locked by formatting - restrictions is not applied (`a_locked_heading_style_is_not_applied_as_you_type`). + (`a_tracked_heading_autoformat_can_be_rejected`); the formatting change is this author's and + replaces another author's earlier formatting change on the line, so rejecting it brings back + the line as that author left it + (`a_tracked_heading_autoformat_supersedes_another_authors_formatting`); a heading style + locked by formatting restrictions is not applied + (`a_locked_heading_style_is_not_applied_as_you_type`); in a read-only document, Enter in an + editable region right after a protected short line breaks the paragraph and leaves that line + as it is (`enter_in_an_editable_region_after_a_protected_short_line_breaks_the_paragraph`). - `+---+------+` Enter (plus signs around runs of hyphens, the whole paragraph) → a one-row table across the text width, each column as wide as its share of the hyphens; the caret goes into the first cell. ⌘Z right after brings the characters back. More than 63 columns stay @@ -301,6 +343,16 @@ no-break space, a figure space or an ideographic space (`autocorrect_finds_the_w Croatian, Bosnian and Serbian `i` is kept only when the text is tagged with that language: those interfaces don't set an editing language yet. Per-language lists for other languages aren't there yet (#735). +- In an equation, `\int` + Space (or `\sum`, `\prod`… + Space) gives the operator and waits for + its limits: `_x^y` then Space builds it with them, Space alone builds it without, and what is + typed next goes into its operand. `\name` is also corrected by any character that can't + continue it (`\int_0^1`, `\alpha+` gives `α+`), which keeps that character and builds nothing + up yet; a letter or digit leaves it as typed (`\alpha1`). Observed in Word for Windows + (Microsoft 365, build 16.0.20326, default Math AutoCorrect) on PR #4938. Not observed in Word + yet, so WordCraft's own choices: Enter or an arrow key builds the operator without going into + its operand, and an operator ending another one's operand (`∫∫`) takes what is typed next + (#4917; `equation::tests::an_autocorrected_operator_waits_for_its_limits`, + `a_math_name_is_corrected_by_any_character_that_cannot_continue_it`). ¹ From Word's documented AutoFormat and AutoCorrect options; not yet keystroke-compared with Word. @@ -345,6 +397,12 @@ the caret's paragraph, and drops it once the caret is anywhere else or the word (`crates/engine/src/session.rs`), so a caret move without an edit lays only that paragraph out again. +With File › Options › Proofing › Ignore web and file addresses on (the default), a web or e-mail +address is not marked, also when the space before it is a no-break space, a narrow no-break space +(U+202F), a figure space (U+2007) or an ideographic space. With the option off, the words in the +address are checked (`address_after_a_wide_space_is_an_internet_token`, in craft-libs' +`crates/proof/src/lib.rs`). + ## Editing options (File › Options › Advanced) | Keys / setting | Result | Test | @@ -543,14 +601,32 @@ command is one Undo step and still obeys editing protection and the 1–1638 pt limits. Original-fixture engine and Linux CLI/headless UI save/reopen checks cover this correction; native Windows interaction and Microsoft Word remain untested. +## Empty paragraph removal + +Deleting a paragraph mark whose preceding paragraph was already empty preserves the +following paragraph's paragraph properties and mark formatting. Existing inline runs +remain intact. Delete, Backspace and selected marks share the model operation; joining +two originally non-empty paragraphs retains the first paragraph's properties. Synthetic +regressions cover body, header and cell containers, sections, outline/TOC membership, +DOCX and Undo/Redo (Leaf #152). No new Word or native UI comparison was run. + ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-11-04 | trivial | Ctrl+K on a selection: a changed Text to display replaces the selected text before it is linked | +| 2026-11-07 | trivial | Removing an already-empty paragraph preserves the following paragraph properties, mark and inline formatting. Delete, Backspace, selected marks, outline/TOC, DOCX and Undo/Redo have synthetic coverage (Leaf #152); no new Word or native acceptance run. | +| 2026-10-30 | trivial | Equations: `\int` + Space waits for its limits; `_x^y` then Space builds them, Space alone builds the operator without, typing goes into its operand, and Enter or an arrow key builds it without going into the operand (#4917). Review: any character that can't continue `\name` corrects it (`\int_0^1`, `\alpha+`), and `∫∫` takes the operand into the inner operator; the Word rows are now observed in Word for Windows on #4938, Enter, arrows and `∫∫` are not | +| 2026-11-06 | trivial | Track Changes: resolving away an empty paragraph with a section break removes it whole; the next paragraph keeps its style (#5667) | +| 2026-11-03 | trivial | Alt+numpad codes type their character in text boxes too (Find what, dialog fields), not the digits or nothing (#4403) | +| 2026-11-03 | trivial | Find smart-quoted text with a keyboard apostrophe (#5388); exact search modes and replacement spelling preserved. | | 2026-11-01 | minor | English spelling by dialect from SCOWL 2026: typed British, Canadian and Australian text, modern words and ordinals pinned (#40, #520, #1281, #1045; CP2) | +| 2026-10-31 | minor | #3693: Delete Previous Sentence command and keyboard dispatch, with sentence/paragraph/cell, selection, undo and tracking regressions. Additional WordCraft behavior; Word-parity estimates unchanged. | | 2026-10-29 | trivial | Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged | | 2026-10-28 | trivial | Highlighting at a caret leaves the word alone and sets the colour for what is typed next (#4086). | | 2026-10-28 | trivial | Arabic Backspace removes one combining mark and keeps its base letter (#4757); stored mark order, caret/forward-Delete and other-script behavior retained; original synthetic command/history/protection/save-reopen checks, no native Word comparison; readiness estimates unchanged | +| 2026-10-27 | trivial | Backspace after a floating shape's anchor at a paragraph start joins paragraphs and keeps the shape (#4592) | +| 2026-10-25 | trivial | AutoFormat: a tracked heading, and a tracked border line at the top of a story, replace another author's formatting change on the paragraph instead of keeping it | | 2026-10-25 | trivial | Tests and notes: border lines with formatting markup off, after the author's own formatting change and in a locked content control; Reject All keeps a `+---+` table; Tab in a table cell with tab indents on; Backspace before an indented paragraph with them off; narrow no-break and figure spaces before an AutoCorrect word; a no-break space typed after a word listed as a known gap | | 2026-10-25 | trivial | Highlight decisions include fully selected paragraph marks in whole cells and ordinary ranges, including empty paragraphs; partial text columns exclude unselected marks (#4085). | | 2026-10-25 | trivial | Highlight toggle checks the full target beyond 10,000 runs without collecting resolved formatting; mixed and inherited tails and Undo/Redo covered (#4085). | @@ -615,5 +691,3 @@ this correction; native Windows interaction and Microsoft Word remain untested. | 2026-10-10 | minor | Track Changes rows: tracked Enter, Backspace and Delete on paragraph marks (#244) | | 2026-10-10 | major | First version: lists, AutoCorrect and AutoFormat as you type, observed against Word (#204) | | 2026-10-15 | trivial | Text direction: typed and inserted text takes its direction from its own letters, not the caret's run; spaces typed into reopened Hebrew draw in the Latin font until reopened (#1543) | - -| 2026-10-27 | trivial | Backspace after a floating shape's anchor at a paragraph start joins paragraphs and keeps the shape (#4592) | \ No newline at end of file diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 83ca991303..440f3c09fe 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,8 @@ # UI parity with Microsoft Word -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-03 · **Change:** trivial (a long comment's card and balloon stop at ten lines, #3382); previously minor (Arabic mirrored interface: ribbon, panes, File page, dialogs, menus; document canvas independent, #1195); previously trivial (Alt, F badges the Backstage pages; Alt, F, P and V open Print, #4960); previously trivial (View › Macros opens a Macros dialog with Run, Delete and Record, #4327); previously trivial (aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (Table Properties: row, column and cell settings apply to the selected rows, columns and cells; mixed row check boxes, #4857); previously trivial (Insert › Shapes shows the basic shapes as a grid of drawn icon tiles, #4349); previously trivial (File › Options › Proofing › AutoCorrect Options opens with no document open, #4585); previously trivial (the Shading buttons show the last picked colour, #4412); previously trivial (a blank User Name in File › Options stays blank after a restart, #4368); previously trivial (window size falls back to the screen rectangle when the reported inner size is invalid; equation symbol tooltips no longer repeat a missing glyph's name); previously trivial (window titles and suggested file names omit NUL characters, #3634); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (Custom Document Properties dialog from File › Info › Properties › Advanced Properties…, #2982; previously trivial: View › Window › New Window opens another window on the document, each with its own caret and view; previously trivial: mail merge: First Record, Last Record and a record number box in Preview Results; Finish & Merge asks which records to merge or print, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: read only and comments-only protection grey out edits; previously trivial: the Font dialog previews "NaN" or "inf" in the Size box at 12 pt, #3663; previously trivial: File › Options disables the User name field while Restrict Editing is active; previously trivial: while editing a header or footer, a click in the other one edits it there without scrolling; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Insert Table of Figures dialog: any caption label, #3013; previously trivial: Home › Underline drop-down shows its lines, #2738; previously trivial: the text context menu includes the formatting mini toolbar, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: the scrollbar page tip stays on one line as the page number grows, #3341; previously trivial: File › Home and New: templates and recent documents are buttons named for screen readers, #3176; previously trivial: forms protection greys out the Developer tab's control buttons and Properties; previously trivial: AltGr doesn't open KeyTips, #2388; previously trivial: closing the header or footer puts the caret back where it was in the body, #3331; previously trivial: Format Page Numbers dialog: number format and Continue from previous section / Start at, #1113; previously trivial: inline pictures drag to a dashed insertion cursor and stay inline, #2233, #2234; previously trivial: Save Changes prompt: a text file saved over itself closes, #2376; previously trivial: the equation being edited is framed as in Word: an outline as tall as its line, a grip, an options strip that opens its menu, and its current argument shaded; previously trivial: the table handles show while the caret is in the table, #2428; previously trivial: legacy menu keys, #1697; previously trivial: Shape Fill › Gradient and the Format Shape pane, #1500; previously trivial: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: the text pointer over the page is drawn black or white on Windows, #1746; previously trivial: a click in the header/footer band from the body no longer scrolls to the body text, #2103; previously trivial: File › Recover follows the app theme, #3243; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: dragging the vertical scrollbar names the page at the top of the window, #2551; previously trivial: Add Font imports every selected font file, #1789); previously trivial (File › Close keeps the window, #1712; previously trivial: the Spike: Ctrl+F3 and Ctrl+Shift+F3; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: the tab strip never draws tabs over Comments / Editing / Share, #2026; previously trivial: Columns on selected text, #2024; previously trivial: Different First Page headers reachable from page 1, #2826; previously trivial: a copied equation also goes in the clipboard's MathML formats, #1297; previously trivial: Read Mode keeps the keyboard, shows whole columns and keeps text clear of the page-turn bar, #1772); previously trivial: font list entries of tall-ascent fonts sit in their row, not cut off, #2570); previously trivial: Split Cells and Convert Text to Table dialogs follow Word's merged-cell limits and Initial column width, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout text fills the window width, #1876; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717)); previously trivial: comment balloons readable in the dark theme, #2045; previously trivial: Recently Used Fonts section at the top of the font list, #2068; previously trivial: web preferences kept between visits, #2132; previously trivial: dialog close control: a Windows-style box at the title bar's right end, the whole box clickable, red on hover, #1885); previously trivial (Modify Table Style formats every table style part, #714); previously trivial: a click on the ribbon chrome hands the keyboard to the page in the same frame, #1093 follow-up; previously trivial: Page Setup vertical alignment, #1320; previously trivial: the app opens on the Home tab every launch, as in Word; previously trivial: no document behind the Start screen, #1129; previously trivial: equation pictures share a few textures, #1002; previously trivial: selection bar in the left margin, #856; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously major: first version; ribbon, dialogs, shortcuts and on-canvas interaction measured from `crates/ui-egui` and the command registry) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** trivial (the window moves by its title bar behind a modal dialog, as in Word for Mac, #5124); previously trivial (pointer zoom stretches page rasters until it stops); previously trivial (dark-theme interface text on Linux and the BSDs no longer looks semi-bold); previously trivial (the document's scroll bars show wherever the pointer is, not only at the window's edge, #5746); previously trivial (Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged; previously trivial: Custom Document Properties dialog from File › Info › Properties › Advanced Properties…, #2982; previously trivial: View › Window › New Window opens another window on the document, each with its own caret and view; previously trivial: mail merge: First Record, Last Record and a record number box in Preview Results; Finish & Merge asks which records to merge or print, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: read only and comments-only protection grey out edits; previously trivial: the Font dialog previews "NaN" or "inf" in the Size box at 12 pt, #3663; previously trivial: File › Options disables the User name field while Restrict Editing is active; previously trivial: while editing a header or footer, a click in the other one edits it there without scrolling; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Insert Table of Figures dialog: any caption label, #3013; previously trivial: Home › Underline drop-down shows its lines, #2738; previously trivial: the text context menu includes the formatting mini toolbar, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: the scrollbar page tip stays on one line as the page number grows, #3341; previously trivial: File › Home and New: templates and recent documents are buttons named for screen readers, #3176; previously trivial: forms protection greys out the Developer tab's control buttons and Properties; previously trivial: AltGr doesn't open KeyTips, #2388; previously trivial: closing the header or footer puts the caret back where it was in the body, #3331; previously trivial: Format Page Numbers dialog: number format and Continue from previous section / Start at, #1113; previously trivial: inline pictures drag to a dashed insertion cursor and stay inline, #2233, #2234; previously trivial: Save Changes prompt: a text file saved over itself closes, #2376; previously trivial: the equation being edited is framed as in Word: an outline as tall as its line, a grip, an options strip that opens its menu, and its current argument shaded; previously trivial: the table handles show while the caret is in the table, #2428; previously trivial: legacy menu keys, #1697; previously trivial: Shape Fill › Gradient and the Format Shape pane, #1500; previously trivial: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: the text pointer over the page is drawn black or white on Windows, #1746; previously trivial: a click in the header/footer band from the body no longer scrolls to the body text, #2103; previously trivial: File › Recover follows the app theme, #3243; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: dragging the vertical scrollbar names the page at the top of the window, #2551; previously trivial: Add Font imports every selected font file, #1789); previously trivial (dragging an In Line with Text object shows a bold insertion cursor, as in Word, instead of a faint dashed one, #4195); previously trivial (the shapes, pictures and text boxes inside a Drawing Canvas are picked, moved and resized on their own, #2637); previously trivial (Shape Format › Size shows the interface unit and takes any typed unit, #4196); previously trivial (over a turned picture, shape or text box the resize arrows turn with it, #3932); previously trivial (the status bar's count is words by default and can be characters with or without spaces, chosen from its right-click menu or File › Options › Display and kept between runs, #2797); previously trivial (Linux display server setting in File › Options › Advanced, #2184); previously trivial (dialogs are modal except Find and Replace, Symbol, Mark Index Entry, Cross-reference and Insert Merge Field, and a press beside one shakes it, #3859); previously trivial (showing the Format Shape pane leaves a gradient angle above 359.9° as it is, #3955); previously trivial (Return on File › Print prints, as Word's default Print button does); previously trivial (N-up and booklet printing, #641; readiness unchanged); previously trivial (missing fonts flagged in the font box and status bar, read from what layout drew; metric-compatible substitutes and symbol fonts not flagged); previously minor (Options › Language redesign: Your languages, Add a language…, Set as default; the Dictionaries folder moved from Proofing); previously trivial (a long comment's card and balloon stop at ten lines, #3382); previously minor (Arabic mirrored interface: ribbon, panes, File page, dialogs, menus; document canvas independent, #1195); previously trivial (Alt, F badges the Backstage pages; Alt, F, P and V open Print, #4960); previously trivial (View › Macros opens a Macros dialog with Run, Delete and Record, #4327); previously trivial (aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (Table Properties: row, column and cell settings apply to the selected rows, columns and cells; mixed row check boxes, #4857); previously trivial (Insert › Shapes shows the basic shapes as a grid of drawn icon tiles, #4349); previously trivial (File › Options › Proofing › AutoCorrect Options opens with no document open, #4585); previously trivial (the Shading buttons show the last picked colour, #4412); previously trivial (a blank User Name in File › Options stays blank after a restart, #4368); previously trivial (window size falls back to the screen rectangle when the reported inner size is invalid; equation symbol tooltips no longer repeat a missing glyph's name); previously trivial (window titles and suggested file names omit NUL characters, #3634); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (Custom Document Properties dialog from File › Info › Properties › Advanced Properties…, #2982; previously trivial: View › Window › New Window opens another window on the document, each with its own caret and view; previously trivial: mail merge: First Record, Last Record and a record number box in Preview Results; Finish & Merge asks which records to merge or print, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: read only and comments-only protection grey out edits; previously trivial: the Font dialog previews "NaN" or "inf" in the Size box at 12 pt, #3663; previously trivial: File › Options disables the User name field while Restrict Editing is active; previously trivial: while editing a header or footer, a click in the other one edits it there without scrolling; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Insert Table of Figures dialog: any caption label, #3013; previously trivial: Home › Underline drop-down shows its lines, #2738; previously trivial: the text context menu includes the formatting mini toolbar, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: the scrollbar page tip stays on one line as the page number grows, #3341; previously trivial: File › Home and New: templates and recent documents are buttons named for screen readers, #3176; previously trivial: forms protection greys out the Developer tab's control buttons and Properties; previously trivial: AltGr doesn't open KeyTips, #2388; previously trivial: closing the header or footer puts the caret back where it was in the body, #3331; previously trivial: Format Page Numbers dialog: number format and Continue from previous section / Start at, #1113; previously trivial: inline pictures drag to a dashed insertion cursor and stay inline, #2233, #2234; previously trivial: Save Changes prompt: a text file saved over itself closes, #2376; previously trivial: the equation being edited is framed as in Word: an outline as tall as its line, a grip, an options strip that opens its menu, and its current argument shaded; previously trivial: the table handles show while the caret is in the table, #2428; previously trivial: legacy menu keys, #1697; previously trivial: Shape Fill › Gradient and the Format Shape pane, #1500; previously trivial: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: the text pointer over the page is drawn black or white on Windows, #1746; previously trivial: a click in the header/footer band from the body no longer scrolls to the body text, #2103; previously trivial: File › Recover follows the app theme, #3243; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: dragging the vertical scrollbar names the page at the top of the window, #2551; previously trivial: Add Font imports every selected font file, #1789); previously trivial (File › Close keeps the window, #1712; previously trivial: the Spike: Ctrl+F3 and Ctrl+Shift+F3; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: the tab strip never draws tabs over Comments / Editing / Share, #2026; previously trivial: Columns on selected text, #2024; previously trivial: Different First Page headers reachable from page 1, #2826; previously trivial: a copied equation also goes in the clipboard's MathML formats, #1297; previously trivial: Read Mode keeps the keyboard, shows whole columns and keeps text clear of the page-turn bar, #1772); previously trivial: font list entries of tall-ascent fonts sit in their row, not cut off, #2570); previously trivial: Split Cells and Convert Text to Table dialogs follow Word's merged-cell limits and Initial column width, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout text fills the window width, #1876; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717)); previously trivial: comment balloons readable in the dark theme, #2045; previously trivial: Recently Used Fonts section at the top of the font list, #2068; previously trivial: web preferences kept between visits, #2132; previously trivial: dialog close control: a Windows-style box at the title bar's right end, the whole box clickable, red on hover, #1885); previously trivial (Modify Table Style formats every table style part, #714); previously trivial: a click on the ribbon chrome hands the keyboard to the page in the same frame, #1093 follow-up; previously trivial: Page Setup vertical alignment, #1320; previously trivial: the app opens on the Home tab every launch, as in Word; previously trivial: no document behind the Start screen, #1129; previously trivial: equation pictures share a few textures, #1002; previously trivial: selection bar in the left margin, #856; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously major: first version; ribbon, dialogs, shortcuts and on-canvas interaction measured from `crates/ui-egui` and the command registry) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 + +> **Page Setup update:** 2026-11-07 · Page Setup number boxes keep long input inside the field, including accepted margin values after focus leaves (#5650); accepted ranges and readiness estimates are unchanged. Recovery discovery no longer interrupts an explicitly created or opened document. Older copies remain in File › Recover, whose buttons use the interface palette. See [local recovery](recovery.md). @@ -17,12 +19,14 @@ Document title opens Rename Document; the account badge opens Options › Genera | Ribbon tabs and groups | All Word tabs including contextual Table Design/Layout, Picture Format, Shape Format, Header & Footer, Equation, Outlining (Outline view, #493); ribbon overflow (#43, #129). Draw tab: Select, Eraser, Pen, Pencil, Highlighter with colour and thickness (#307); Lasso (drag to move, Delete, recolour), Add Pen gallery (right-click to remove), Ink to Shape (lines, arrows, rectangles, ellipses, polygons), Ink Replay with play/pause/rewind/forward bar (#395); missing: Ink to Math. The app opens on Home every launch, as in Word: the active tab is not restored between runs, but going File and back to the editor returns to the tab that was showing, contextual tabs included. Home › Font: the font box lists Recently Used Fonts (the fonts applied from the box, the mini toolbar or the Font dialog, most recent first, ten at most, kept between runs) above All Fonts, as in Word; the sections show while nothing is typed, including after a no-match query is cleared in a scrollable list (#2068). With Filling in forms enforced (Restrict Editing), the Developer tab's content-control buttons and Properties grey out, their tooltips saying why, as in Word. Read only and comments-only protection without an exception the author may edit grey out every edit, their tooltips saying why, and tracked-changes protection greys out Accept, Reject and Track Changes; what decides it is cached per document revision, so the ribbon doesn't walk the document on every frame | Same plus Draw | 85% | (Draw in features) | | Keytips (Alt / F10) | Ribbon badges (#43), Backstage page badges after Alt, F (H, N, O, I, S, A, P, E, C, T; P and V open Print, #4960) and numbered Quick Access Toolbar badges in the user's button order (#620; none while the toolbar is hidden, #1945); File › Options › Advanced › Display switch saved per user (`ui.keytips`); Alt leaves macOS Option typing alone, and AltGr leaves typing alone on Linux and Windows (#2388); legacy menu keys (#1697; not on macOS): 18 Word 2003 sequences Word for Windows still takes, as observed there (Alt, V, U Full Screen View; V, P/W/O/N views; V, D/L/Z; E, L/F/E/G; I, S; I, P, F; O, F/P; T, W; A, I, T), hidden, with a hint under the tab row (under the slim bar in Focus and Full Screen View); an unknown letter is ignored, Esc cancels; Alt, I, B left out (no Break dialog) | ✅ | 85% | 1–2 | | Mini-toolbar on selection and text context menu | ✅ (#43, two rows #535; Recently Used Fonts in its font box #2068; the text context menu includes the same toolbar at a caret or selection, #2959) | ✅ | 80% | 1–2 | -| Colour drop-downs: theme/standard colours, Recent Colors, More Colors… → Colors dialog (Standard honeycomb, Custom hue/saturation field with lightness, RGB/HSL and hex) | ✅ Font Color (ribbon, mini toolbar, Font dialog), Shading, Page Color, Shape Fill/Outline/Glow, pen colours, dialog colour fields (#606); Shape Fill › Gradient: Light and Dark Variations of the shape's colour, More Gradients… (#1500); no eyedropper | ✅ | 90% | 1 | +| Colour drop-downs: theme/standard colours, Recent Colors, More Colors… → Colors dialog (Standard honeycomb, Custom hue/saturation field with lightness, RGB/HSL and hex) | ✅ Font Color (ribbon, mini toolbar, Font dialog), Shading (text selected within part of one paragraph is shaded itself; a caret, whole paragraphs or several paragraphs keep paragraph shading, as in Word, #4685), Page Color, Shape Fill/Outline/Glow, pen colours, dialog colour fields (#606); Shape Fill › Gradient: Light and Dark Variations of the shape's colour, More Gradients… (#1500); no eyedropper | ✅ | 90% | 1 | +| Keytips (Alt / F10) | Ribbon badges (#43) and numbered Quick Access Toolbar badges in the user's button order (#620; none while the toolbar is hidden, #1945); File › Options › Advanced › Display switch saved per user (`ui.keytips`); Alt leaves macOS Option typing alone, and AltGr leaves typing alone on Linux and Windows (#2388); legacy menu keys (#1697; not on macOS): 18 Word 2003 sequences Word for Windows still takes, as observed there (Alt, V, U Full Screen View; V, P/W/O/N views; V, D/L/Z; E, L/F/E/G; I, S; I, P, F; O, F/P; T, W; A, I, T), hidden, with a hint under the tab row (under the slim bar in Focus and Full Screen View); an unknown letter is ignored, Esc cancels; Alt, I, B left out (no Break dialog) | ✅ | 85% | 1–2 | +| Mini-toolbar on selection and text context menu | ✅ (#43, two rows #535; hovering a formatting button previews it on the selected text, #4664; Recently Used Fonts in its font box #2068; the text context menu includes the same toolbar at a caret or selection, #2959) | ✅ | 80% | 1–2 | | Quick Access Toolbar | AutoSave, then the user's commands (Save, Undo, Redo by default); add, remove and reorder from its … menu (common commands, More Commands…), right-click on any ribbon button, or Customize Ribbon; saved per user (#379, #376). Undo's ▾ list: recent steps newest first, hover highlights the steps a click undoes ("Undo 3 Actions"), one click undoes them all (#701; `edit.undoTo`, `edit.undoHistory`). Its menu ends with Hide Quick Access Toolbar, which takes it out of the title bar; Show Quick Access Toolbar on the ribbon's right-click menu, or in Customize Ribbon › Quick Access Toolbar, brings it back; kept between runs; `ui.quickAccessToolbar` for scripts (#1945). Not shown below the ribbon | customizable | 92% | 0.5 | | Customize Ribbon / Customize Keyboard | Customize Keyboard (#368): categories, a command's keys, press a combination to see which command uses it, Assign / Remove / Reset All; custom keys override built-ins, removed built-ins do nothing, saved per user; `tools.customizeKeyboard` for agents. Customize Ribbon (#379): show, hide and reorder tabs, custom tabs and custom groups (on any tab) holding any commands, rename, remove, Reset; right-click on the ribbon; saved per user; `tools.customizeRibbon` for agents. Built-in tabs can't be renamed; no import/export file; filter-as-you-type command search in all three pickers (#1845) | ✅ | 85% | 1–2 | | Keyboard shortcuts | **137** commands bound in `CommandSpec::key`, 156 key combinations (measured on Linux/Windows); styles, spacing, symbols, fields, views, mail merge (#330); field keys Alt+F9, Shift+F9, Ctrl+Shift+F9, Ctrl+F11, Ctrl+Shift+F11, F11, Shift+F11 (#339); Alt+Shift+arrows (move paragraphs, promote/demote), Shift+F5 Go Back and Alt+X (#343); Outline view: Alt+Shift+Plus/Minus expand/collapse, Alt+Shift+1–9 and Alt+Shift+A Show Level (#493). Missing: en dash on the numeric keypad | ~250 default shortcuts | ~70% | 2–4 | | Modal dialogs | **54** (`Dialog` enum: Font, Enclose Characters, Paragraph, Tabs, Borders and Shading, Find, Go To, Insert Table, Table Properties, Page Setup, Link, Bookmark, Word Count, Zoom, Watermark, New Style, Modify Style, Manage Styles, Table Style (every part: font, borders, shading, cell alignment, #714), Commands, Icons, Templates and Add-ins, Organizer, Compare and Combine, AutoCorrect Options, Paste Special, About, Save Changes, Password, Encrypt with Password, Define New Multilevel List, Track Changes Options; Columns, Symbol with Special Characters, Field (#321); Field code (#339); mail merge Recipients, Insert Merge Field, Find Recipient, Rules, Match Fields, Check for Errors; Caption with New Label and Numbering, Index, Mark Index Entry, Custom Table of Contents with Options and TOC styles, Source Manager, Create/Edit Source (#402); Line Numbers, Hyphenation with Manual Hyphenation, Language, Envelopes, Labels (#407)) plus panes and menus for the rest | ~100 (Options panes…) | ~45% | 11–19 | -| Task panes (Navigation, Styles, Comments, Reviewing, Format Picture/Shape, Thesaurus, Accessibility, Clipboard, Selection) | Navigation, Styles, Comments (balloons and cards read in both themes, #2045), Thesaurus, Restrict Editing, Accessibility (grouped findings, jump-to, fixes) and Alt Text (#386), Read Aloud, Zotero; Style Inspector (#236); Clipboard pane (#264); Format Shape (#1500: Fill only: no fill, solid colour and transparency, gradient presets, type, direction, angle, stops bar, per-stop colour, position and transparency, rotate with shape; opened from Shape Fill › Gradient › More Gradients… and right-click › Format Shape…; drags preview live and undo in one step; no Line, Effects or Layout sections, no Format Picture) open | all | 70% | 4–6 | +| Task panes (Navigation, Styles, Comments, Reviewing, Format Picture/Shape, Thesaurus, Accessibility, Clipboard, Selection) | Navigation, Styles, Comments (balloons and cards read in both themes, #2045), Thesaurus, Restrict Editing, Accessibility (grouped findings, jump-to, fixes) and Alt Text (#386), Read Aloud, Zotero; Style Inspector (#236); Clipboard pane (#264); Format Shape (#1500: Fill only: no fill, solid colour and transparency, gradient presets, type, direction, angle, stops bar, per-stop colour, position and transparency, rotate with shape; opened from Shape Fill › Gradient › More Gradients… and right-click › Format Shape…; drags preview live and undo in one step; showing it leaves an angle the Angle field can't set, such as 359.95°, as it is, #3955; no Line, Effects or Layout sections, no Format Picture) open | all | 70% | 4–6 | | Keyboard shortcuts | **137** commands bound in `CommandSpec::key`, 156 key combinations (measured on Linux/Windows); styles, spacing, symbols, fields, views, mail merge (#330); field keys Alt+F9, Shift+F9, Ctrl+Shift+F9, Ctrl+F11, Ctrl+Shift+F11, F11, Shift+F11 (#339); Alt+Shift+arrows (move paragraphs, promote/demote), Shift+F5 Go Back and Alt+X (#343); Outline view: Alt+Shift+Plus/Minus expand/collapse, Alt+Shift+1–9 and Alt+Shift+A Show Level (#493); Alt+Q to "Tell me" command search (#819, not on macOS). Missing: en dash on the numeric keypad | ~250 default shortcuts | ~70% | 2–4 | | Modal dialogs | **54** (`Dialog` enum: Font, Enclose Characters, Paragraph, Tabs, Borders and Shading, Find, Go To, Insert Table, Table Properties, Page Setup, Link, Bookmark, Word Count, Zoom, Watermark, New Style, Modify Style, Manage Styles, Table Style, Commands, Icons, Templates and Add-ins, Organizer, Compare and Combine, AutoCorrect Options, Paste Special, About, Save Changes, Password, Encrypt with Password, Define New Multilevel List, Track Changes Options; Columns, Symbol with Special Characters, Field (#321); Field code (#339); mail merge Recipients, Insert Merge Field, Find Recipient, Rules, Match Fields, Check for Errors; Caption with New Label and Numbering, Index, Mark Index Entry, Custom Table of Contents with Options and TOC styles, Source Manager, Create/Edit Source (#402); Line Numbers, Hyphenation with Manual Hyphenation, Language, Envelopes, Labels (#407)) plus panes and menus for the rest | ~100 (Options panes…) | ~45% | 11–19 | | Modal dialogs | **55** (`Dialog` enum: Font, Enclose Characters, Paragraph, Tabs, Borders and Shading, Find, Go To, Insert Table, Table Properties, Page Setup, Link, Bookmark, Word Count, Zoom, Watermark, New Style, Modify Style, Manage Styles, Table Style, Commands, Icons, Templates and Add-ins, Organizer, Compare and Combine, AutoCorrect Options, Paste Special, About, Save Changes, Password, Encrypt with Password, Define New Multilevel List, Track Changes Options; Columns, Symbol with Special Characters, Field (#321); Field code (#339); mail merge Recipients, Insert Merge Field, Find Recipient, Rules, Match Fields, Check for Errors; Caption with New Label and Numbering, Index, Mark Index Entry, Custom Table of Contents with Options and TOC styles, Source Manager, Create/Edit Source (#402); Cross-reference (#916); Line Numbers, Hyphenation with Manual Hyphenation, Language, Envelopes, Labels (#407); Page Setup has a Paper size list and custom width and height, opened from Layout › Size › More Paper Sizes… (#1433)) plus panes and menus for the rest | ~100 (Options panes…) | ~45% | 11–19 | @@ -31,14 +35,18 @@ Document title opens Rename Document; the account badge opens Options › Genera | Modal dialogs | **56** (`Dialog` enum: Discard Recovery, Font, Enclose Characters, Paragraph, Tabs, Borders and Shading, Find, Go To, Insert Table, Table Properties, Page Setup, Link, Bookmark, Word Count, Zoom, Watermark, New Style, Modify Style, Manage Styles, Table Style, Commands, Icons, Templates and Add-ins, Organizer, Compare and Combine, AutoCorrect Options, Paste Special, About, Save Changes, Password, Encrypt with Password, Define New Multilevel List, Track Changes Options; Columns, Symbol with Special Characters, Field (#321); Field code (#339); mail merge Recipients (Filter and Sort, #778; Find in list and a merged-only view, #1576), Insert Merge Field, Find Recipient, Rules, Match Fields, Check for Errors; Caption with New Label and Numbering, Index, Mark Index Entry, Custom Table of Contents with Options and TOC styles, Source Manager, Create/Edit Source (#402); Cross-reference (#916); Line Numbers, Hyphenation with Manual Hyphenation, Language, Envelopes, Labels (#407); Page Setup has a Paper size list and custom width and height, opened from Layout › Size › More Paper Sizes… (#1433)) plus panes and menus for the rest | ~100 (Options panes…) | ~45% | 11–19 | | Task panes (Navigation, Styles, Comments, Reviewing, Format Picture/Shape, Thesaurus, Accessibility, Clipboard, Selection) | Navigation (long headings wrap onto further lines within the pane instead of expanding it, #759, #3015), Styles, Comments, Thesaurus, Restrict Editing, Accessibility (grouped findings, jump-to, fixes) and Alt Text (#386), Read Aloud, Zotero; Style Inspector (#236); Clipboard pane (#264) open | all | 70% | 4–6 | | Keyboard shortcuts | **152** commands bound in `CommandSpec::key`, 172 key combinations (counted from the registry on Linux, 2026-10-13); styles, spacing, symbols, fields, views, mail merge (#330); field keys Alt+F9, Shift+F9, Ctrl+Shift+F9, Ctrl+F11, Ctrl+Shift+F11, Shift+F11 (#339), Next Field on Alt+F1 and Alt+Shift+F1 (Word's other keys for it) since F11 went to full screen (#980; GNOME and KDE may keep Alt+F1 for their own overview or application menu, and then Next Field has no key there; Previous Field keeps Shift+F11); Alt+Shift+arrows (move paragraphs, promote/demote), Shift+F5 Go Back and Alt+X (#343); Outline view: Alt+Shift+Plus/Minus expand/collapse, Alt+Shift+1–9 and Alt+Shift+A Show Level (#493); Alt+Q to "Tell me" command search (#819, not on macOS); on macOS, Word for Mac's own keys: ⌘⇧S Save As, ⌘⌥E Insert Endnote, ⌘⌥A New Comment, ⌃H Replace, ⌘⌥R collapse the ribbon. The Spike: Ctrl+F3 cuts to it, Ctrl+Shift+F3 inserts it and empties it (⌘F3, ⌘⇧F3 on macOS). Missing: en dash on the numeric keypad Insert Hyperlink has Word's Link to: Existing File or Web Page / Place in This Document (top of the document, headings, bookmarks) (#1234). | ~250 default shortcuts | ~70% | 2–4 | -| Modal dialogs | **63** (`Dialog` enum: Discard Recovery, Font, Enclose Characters, Paragraph, Tabs, Borders and Shading, Find, Go To, Insert Table, Table Properties, Page Setup, Link, Bookmark, Word Count, Zoom, Watermark, New Style, Modify Style, Manage Styles, Table Style, Commands, Icons, Templates and Add-ins, Organizer, Custom Document Properties (File › Info › Properties › Advanced Properties › Custom, #2982), Compare and Combine, AutoCorrect Options, Paste Special, About, Save Changes, Password, Encrypt with Password, Define New Multilevel List, Track Changes Options; Columns, Symbol with Special Characters, Field (#321); Field code (#339); mail merge Recipients, Insert Merge Field, Find Recipient, Rules, Match Fields, Check for Errors; Caption with New Label and Numbering, Index, Mark Index Entry, Custom Table of Contents with Options and TOC styles, Table of Figures (#3013), Source Manager, Create/Edit Source (#402); Cross-reference (#916); Drop Cap with Position, Font, Lines to drop and Distance from text, opened from Insert › Drop Cap › Drop Cap Options… (#2601); Line Numbers, Hyphenation with Manual Hyphenation, Language, Envelopes, Labels (#407); Page Setup has a Paper size list and custom width and height, opened from Layout › Size › More Paper Sizes… (#1433); every dialog's close control is a box at the title bar's right end, the full title-bar height and 1.6× as wide, all of it clickable, red with a white ✕ on hover as a Windows caption button (#1885); Split Cells (columns, rows, merge before split; defaults follow the selection as in Word: twice its columns, its rows, Merge offered for several cells or one merged across columns; a merged cell splits into 1 to its height rows, a number that doesn't divide its height refused with a divisor message, more than its height with the range message; 1 × 1 changes nothing; parts split across columns are equal and other rows keep their grid lines) and Convert Text to Table (live column count, read-only rows; Initial column width Auto or 0 to 22 in, AutoFit to contents/window; Paragraphs/Commas/Tabs/Other "-" separators) (#2592); Size, from Picture Format › Size's launcher: height and width in the interface unit (a size typed in any unit, `300 px` too), scale of the original or the opening size, Lock aspect ratio, the original size with its pixels and Reset (#2573); Format Page Numbers, from Insert › Page Number ▸ Format Page Numbers…: the number format (1, 2, 3 / I, II, III / i, ii, iii / A, B, C / a, b, c) and Continue from previous section / Start at, #1113; Finish & Merge records (All, Current record, or From and To by record number), opened from Finish & Merge › Edit Individual Documents… and Print Documents… (#3028)) plus panes and menus for the rest | ~100 (Options panes…) | ~45% | 11–19 | +| Modal dialogs | **63** (`Dialog` enum: Discard Recovery, Font, Enclose Characters, Paragraph, Tabs, Borders and Shading, Find, Go To, Insert Table, Table Properties, Page Setup, Link, Bookmark, Word Count, Zoom, Watermark, New Style, Modify Style, Manage Styles, Table Style, Commands, Icons, Templates and Add-ins, Organizer, Custom Document Properties (File › Info › Properties › Advanced Properties › Custom, #2982), Compare and Combine, AutoCorrect Options, Paste Special, About, Save Changes, Password, Encrypt with Password, Define New Multilevel List, Track Changes Options; Columns, Symbol with Special Characters, Field (#321); Field code (#339); mail merge Recipients, Insert Merge Field, Find Recipient, Rules, Match Fields, Check for Errors; Caption with New Label and Numbering, Index, Mark Index Entry, Custom Table of Contents with Options and TOC styles, Table of Figures (#3013), Source Manager, Create/Edit Source (#402); Cross-reference (#916); Drop Cap with Position, Font, Lines to drop and Distance from text, opened from Insert › Drop Cap › Drop Cap Options… (#2601); Line Numbers, Hyphenation with Manual Hyphenation, Language, Envelopes, Labels (#407); Page Setup has a Paper size list and custom width and height, opened from Layout › Size › More Paper Sizes… (#1433); every dialog's close control is a box at the title bar's right end, the full title-bar height and 1.6× as wide, all of it clickable, red with a white ✕ on hover as a Windows caption button (#1885); Split Cells (columns, rows, merge before split; defaults follow the selection as in Word: twice its columns, its rows, Merge offered for several cells or one merged across columns; a merged cell splits into 1 to its height rows, a number that doesn't divide its height refused with a divisor message, more than its height with the range message; 1 × 1 changes nothing; parts split across columns are equal and other rows keep their grid lines) and Convert Text to Table (live column count, read-only rows; Initial column width Auto or 0 to 22 in, AutoFit to contents/window; Paragraphs/Commas/Tabs/Other "-" separators) (#2592); Size, from Picture Format › Size's launcher: height and width in the interface unit (a size typed in any unit, `300 px` too), scale of the original or the opening size, Lock aspect ratio, the original size with its pixels and Reset (#2573); Format Page Numbers, from Insert › Page Number ▸ Format Page Numbers…: the number format (1, 2, 3 / I, II, III / i, ii, iii / A, B, C / a, b, c) and Continue from previous section / Start at, #1113; Finish & Merge records (All, Current record, or From and To by record number), opened from Finish & Merge › Edit Individual Documents… and Print Documents… (#3028)) plus panes and menus for the rest; all modal except Find and Replace, Symbol, Mark Index Entry, Cross-reference and Insert Merge Field, as in Word for Mac (#3859); a press beside a modal dialog shakes it a little (with animation effects off, its border flashes); the window still moves by its title bar behind it (#5124) | ~100 (Options panes…) | ~45% | 11–19 | | Task panes (Navigation, Styles, Comments, Reviewing, Format Picture/Shape, Thesaurus, Accessibility, Clipboard, Selection) | Navigation (long headings wrap onto further lines within the pane instead of expanding it, #759, #3015), Styles, Comments (balloons and cards read in both themes, #2045), Thesaurus, Restrict Editing, Accessibility (grouped findings, jump-to, fixes) and Alt Text (#386), Read Aloud, Zotero; Style Inspector (#236); Clipboard pane (#264) open | all | 70% | 4–6 | | Context menus (right-click) | text, spelling suggestions, fields (Update Field, Edit Field…, Toggle Field Codes, #339; Update Field on a table of contents entry updates the table, #1197, and after a save and reopen, #2182); right-click selects a picture, shape or text box and offers Insert Caption… (#1230) and Wrap Text (styles, Move with Text / Fix Position on Page, #513); tables, the items following the selection as in Word (Insert, Delete › Cells, Columns, Rows or Table whatever is selected (#1198), Merge and Split Cells, Distribute, AutoFit, Text Direction, Insert Caption…, Table Properties…; no Border Styles yet) | rich per context | 65% | 2–4 | | Task panes (Navigation, Styles, Comments, Reviewing, Format Picture/Shape, Thesaurus, Accessibility, Clipboard, Selection) | Navigation (long headings wrap onto further lines within the pane instead of expanding it, #759, #3015), Styles, Comments (times in the user's own time zone, in the pane and the balloons, #2322, #2337; typed comment and reply text stays with its document, is written before Save, Export, Print, Close, New or Open, Escape discards it, and the fields are read-only where comments can't change, #1348; a long comment's card, balloon and fields stop at ten lines, the fields scrolling, #3382), Thesaurus, Restrict Editing, Accessibility (grouped findings, jump-to, fixes) and Alt Text (#386), Read Aloud, Zotero; Style Inspector (#236); Clipboard pane (#264) open | all | 70% | 4–6 | -| Backstage (Home, New, Open, Info, Save As, Print, Share, Export, Options) | Home and New separate (#254), Info properties kept (#268), Options in Word's panes with working settings (#485), Print page with preview, page range and copies (#641); launched with nothing to open, the app starts on Home (the Start screen: Blank document, templates, Recent; no document is open until one is picked or opened, so Esc or Back shows an empty window with the ribbon greyed out but for Help, #1129; File › Options works there, AutoCorrect Options included, #4585), with File › Options › General › Start-up to turn it off (#766); Info › Inspect Document finds and removes hidden text by its effective formatting (direct, character or paragraph style) in every story: body, headers, footers, notes, comments and text boxes, and lists what it couldn't reach (#1344); File › New, Open, the mailings and personal templates open their document beside the open ones, so they ask nothing; File › Close (Mod+W, Mod+F4) closes the shown document and keeps the window, showing the next open document, or no page after the last one, as Word does; the window's close button asks about each document with unsaved changes in turn, showing it, and Cancel stops the quit (#1712); each side-menu item has an icon, drawn in code (#1714); Info › Properties › Advanced Properties… opens the Custom Document Properties dialog (#2982); New lists personal templates (`.dotx`/`.dotm`) from the user templates folder under Personal, a subfolder per category, and its search covers them; a click makes an untitled document attached to the template; Save As › Save as Word Template starts in that folder; the folder is set in Options › Advanced › File locations (#2852; no thumbnails yet, no workgroup templates) | | 68% | 4–6 | +| Backstage (Home, New, Open, Info, Save As, Print, Share, Export, Options) | Home and New separate (#254), Info properties kept (#268), Options in Word's panes with working settings (#485), Print page with preview, page range and copies (#641); Return on the Print page prints, as in Word, whose ⌘P opens on Print as the default button (not while a field or list on the page has the keyboard); launched with nothing to open, the app starts on Home (the Start screen: Blank document, templates, Recent; no document is open until one is picked or opened, so Esc or Back shows an empty window with the ribbon greyed out but for Help, #1129; File › Options works there, AutoCorrect Options included, #4585), with File › Options › General › Start-up to turn it off (#766); Info › Inspect Document finds and removes hidden text by its effective formatting (direct, character or paragraph style) in every story: body, headers, footers, notes, comments and text boxes, and lists what it couldn't reach (#1344); File › New, Open, the mailings and personal templates open their document beside the open ones, so they ask nothing; File › Close (Mod+W, Mod+F4) closes the shown document and keeps the window, showing the next open document, or no page after the last one, as Word does; the window's close button asks about each document with unsaved changes in turn, showing it, and Cancel stops the quit (#1712); each side-menu item has an icon, drawn in code (#1714); Info › Properties › Advanced Properties… opens the Custom Document Properties dialog (#2982); New lists personal templates (`.dotx`/`.dotm`) from the user templates folder under Personal, a subfolder per category, and its search covers them; a click makes an untitled document attached to the template; Save As › Save as Word Template starts in that folder; the folder is set in Options › Advanced › File locations (#2852; no thumbnails yet, no workgroup templates) | | 68% | 4–6 | | Rulers: indents, tabs, margins, table columns | indents draggable (one undo, #62); tab stops: corner selector (Left/Center/Right/Decimal/Bar), click to set, drag to move, drag off to clear, per-kind markers, Alt skips the snap, one undo step per gesture, double-click opens the Tabs dialog (#320); table column and row markers drag their borders (one undo) and in a cell the indents are measured from it (#700); the numbers thin out as the page shrinks on screen (every 1, 2, 4… units, never closer than 30 px, the small ticks never closer than 4 px, the text keeps its size), give way to an indent, tab or column marker on them, and the margins get ticks only; both rulers span the caret's page at its own scale in every layout (one column, One Page, Multiple Pages) and follow the caret to another page (#1878) | ✅ | 92% | 1 | +| On-canvas objects: select, drag, resize handles, nudge | ✅ tested (#228); a picture or shape behind text can be dragged across the overlapping text (body and header/footer), whether or not it was selected first, while a click without movement still edits that text. Inside a Drawing Canvas a click picks the member under it (shape, picture or text box) on its own, its frame and handles shown inside the canvas frame; it is dragged, resized, turned and nudged inside the canvas, and Shape Format, Delete, Cut and Copy act on it alone; a click in a text box member's text puts the caret there (#2637, `objects::tests::clicking_and_dragging_inside_a_canvas_works_on_its_members`). Not yet: Shift+click on several members, dragging a member out of its canvas, drag-selecting a text box member's text, members of a turned canvas | ✅ | 75% | — | +| Rulers: indents, tabs, margins, table columns | indents draggable (one undo, #62); tab stops: corner selector (Left/Center/Right/Decimal/Bar), click to set, drag to move, drag off to clear, per-kind markers, Alt skips the snap, one undo step per gesture, double-click opens the Tabs dialog (#320); table column and row markers drag their borders (one undo) and in a cell the indents are measured from it (#700); the numbers thin out as the page shrinks on screen (every 1, 2, 4… units, never closer than 30 px, the small ticks never closer than 4 px, the text keeps its size), give way to an indent, tab or column marker on them, and the margins get ticks only; both rulers span the caret's page at its own scale in every layout (one column, One Page, Multiple Pages) and follow the caret to another page (#1878); in a section of several text columns the spaces between them are shaded like the margins (Print Layout, in the main text outside tables, with the selection in one section), an edge dragged changes the spacing (equal columns stay equal, as in Word for Mac), one undo step per drag (#5197) | ✅ | 92% | 1 | | On-canvas objects: select, drag, resize handles, nudge | ✅ tested (#228); a picture or shape behind text can be dragged across the overlapping text (body and header/footer), whether or not it was selected first, while a click without movement still edits that text | ✅ | 75% | — | | On-canvas objects: select, drag, Ctrl+drag to copy, Ctrl+Shift+drag to copy along an axis, resize handles, nudge | ✅ tested (#228, #1014); Ctrl/Command+Shift on a selected floating picture, shape or text box copies along the dominant horizontal or vertical axis, with guides only along the free axis; the original and clipboard stay, the duplicate is selected, and the drop is one undo step. Inline copies still follow the text insertion cursor (#4764). Synthetic Linux pointer/render tests only; native desktop and Word untested; an In Line with Text object drags within the text as in Word: a dashed insertion cursor follows the pointer through the text and the drop (or Ctrl+drop copy) lands there, still inline (#2233, #2234) | ✅ | 75% | — | +| Rotation handle, crop handles on canvas, alignment guides, smart guides | rotation handle (Shift: 15° steps), pictures and shapes without text stories preview their content turning while the pointer is held; release commits one `arrange.rotation` command and Escape cancels (#2277); text boxes retain a frame-only rotation preview, with text staying upright; turned frames resize along their axes (#332), and the arrow over each handle turns with the frame to the nearest of the four resize arrows (#3932); crop handles: Picture Format › Crop puts the picture in crop mode, black crop handles trim a side (a corner, two) keeping the scale and the visible part in place, the cropped-away part shows dimmed, Esc/Enter/a click outside/Crop again keep the crop, one undo step per drag (unturned pictures; no Crop to Shape, Aspect Ratio or Fill/Fit); alignment guides, our own design: a moved picture, shape or text box snaps its left, centre or right (top, middle or bottom) to the page's edges and centre, the margins and the other floating objects on the page within 6 screen points, x and y independently, turned objects by their rotated bounds, with a thin line across the page for each guide while dragging; Alt moves freely; File › Options › Advanced › Editing (`ui.alignmentGuides`) turns them off. Smart guides missing | Word for Mac 16.113.4 shows no guide lines and snaps inconsistently (to the page's left edge, not its top, right or bottom; Word check K); Word for Windows' guides not observed | 75% | 1–2 | +| On-canvas objects: select, drag, Ctrl+drag to copy, Ctrl+Shift+drag to copy along an axis, resize handles, nudge | ✅ tested (#228, #1014); Ctrl/Command+Shift on a selected floating picture, shape or text box copies along the dominant horizontal or vertical axis, with guides only along the free axis; the original and clipboard stay, the duplicate is selected, and the drop is one undo step. Inline copies still follow the text insertion cursor (#4764). Synthetic Linux pointer/render tests only; native desktop and Word untested; an In Line with Text object drags within the text as in Word: a bold insertion cursor (solid, twice the caret's width) follows the pointer through the text and the drop (or Ctrl+drop copy) lands there, still inline (#2233, #2234, #4195) | ✅ | 75% | — | | Rotation handle, crop handles on canvas, alignment guides, smart guides | rotation handle (Shift: 15° steps), pictures and shapes without text stories preview their content turning while the pointer is held; release commits one `arrange.rotation` command and Escape cancels (#2277); text boxes retain a frame-only rotation preview, with text staying upright; turned frames resize along their axes (#332); crop handles: Picture Format › Crop puts the picture in crop mode, black crop handles trim a side (a corner, two) keeping the scale and the visible part in place, the cropped-away part shows dimmed, Esc/Enter/a click outside/Crop again keep the crop, one undo step per drag (unturned pictures; no Crop to Shape, Aspect Ratio or Fill/Fit); alignment guides, our own design: a moved picture, shape or text box snaps its left, centre or right (top, middle or bottom) to the page's edges and centre, the margins and the other floating objects on the page within 6 screen points, x and y independently, turned objects by their rotated bounds, with a thin line across the page for each guide while dragging; Alt moves freely; File › Options › Advanced › Editing (`ui.alignmentGuides`) turns them off. Smart guides missing | Word for Mac 16.113.4 shows no guide lines and snaps inconsistently (to the page's left edge, not its top, right or bottom; Word check K); Word for Windows' guides not observed | 75% | 1–2 | | Tables on the page: drag column and row borders, resize handle past the bottom-right corner; select columns, rows and cells; "+" insert buttons; move handle | ✅ resize cursors, dashed guide, one undo step per drag, selection kept; Shift moves one column; Esc cancels (#217); Ctrl shares the change among the columns on the right, the left edge moves a left-aligned table's indent (a centred or right-aligned one keeps its alignment), a border of cells selected across moves only in their rows, Alt shows the column widths on the ruler (#711); double-click a column border to AutoFit it (a nested table's within the cell around it, #971); selection arrows above a column, left of a row and along a cell's left edge (a drag selects more; the cells are shaded and a column is edited cell by cell); "+" left of a row border and above a column border; move handle past the top-left corner (a click selects the table, a drag floats it where it's dropped); both handles also show while the caret is in the table, as in Word (#2428); an ordinary drag, Shift+arrows or Shift+click from one cell into another select the rectangle of whole cells between them, and into or out of a table whole rows, their cells shaded whole (#971). Missing: a single selected cell's border; The Cell Size Height and Width boxes set every selected row and column (#1242). | ✅ | 95% | 1 | | Selection: word/sentence/paragraph clicks, dragging after a double-click/triple-click/Ctrl+click extends by whole words/paragraphs/sentences (#549), Shift extend, F8 extend mode, column (Alt+drag, #237) | ✅ | ✅ | 90% | 1 | @@ -46,18 +54,23 @@ Document title opens Rename Document; the account badge opens Options › Genera | Selection: word/sentence/paragraph clicks, dragging after a double-click/triple-click/Ctrl+click extends by whole words/paragraphs/sentences (#549), Shift extend, F8 extend mode, column (Alt+drag, #237), selection bar in the left margin (click a line, double-click a paragraph, triple-click or Ctrl+click everything, drag by lines, Shift+click extends; #856) | ✅ Missing: the selection bar in the right margin for right-to-left paragraphs, beside table rows, and Word's right-pointing arrow cursor (egui has none; the plain arrow shows) | ✅ | 92% | 1 | | Headers and footers on the page: double-click the top or bottom margin to edit them, the body to leave | ✅ in Print Layout, also on a page with none yet: the header or footer that page shows is created (first page, even page or the default) and the caret put in it; one left empty is taken away again on leaving and is never saved (#960). Making one is an undo step, refused in a protected document. On a later section's page with no header anywhere it goes in the first section and shows on every section linked to it, as Word links to the previous section by default. With Different First Page (or Odd & Even) on, a double-click goes into the header that page shows even from another header being edited, and Insert › Header/Footer and Edit Header with the caret on page 1 use page 1's own (#2826). Closing it (Esc, Close Header and Footer) puts the caret back where it was in the body, as Word does, instead of on page 1 (#3331); a double-click on the body puts it where clicked. While one is being edited, a single click in the other (the footer while editing the header, or another page's own) edits that one with the caret where clicked, and the view stays put. Web Layout, Draft and Read Mode show no margins and leave it alone. A click in the margin band from the body leaves the caret and the view where they are, so double-clicking a later page's footer opens it there (#2103) | ✅ | 95% | 0.5 | | Zoom: Ctrl+scroll (only zooms; a coast or notch still gliding stops, #1743), pinch (#179), zoom buttons (#232), pages side by side when zoomed out (#251) | ✅ | ✅ | 85% | — | +| Windows (View › Window): Switch Windows, Arrange All, View Side by Side, Synchronous Scrolling (#322) across the native windows; Split is a placeholder; Wayland ignores placement and may only flash for focus | partial | ✅ | 60% | 2–4 | | Touchpad smooth/inertial scroll | ✅ (#252) | ✅ | 90% | — | | Web Layout width | Text wraps to the whole work area (window width at the current zoom, 144–20,000 pt) and re-wraps once a window resize has settled (not on every frame of a drag) or at once on a zoom, keeping the caret in view; the sheet runs edge to edge with no centred page. Draft and Outline keep their 800 pt column; headless sessions keep 800 pt (#1876) | text across the window | 95% | — | +| Document scroll bars | ✅ always drawn beside the page in the room left for them, wherever the pointer is, with a grey thumb that stands out from its track in the light and the dark theme, and more so under the pointer and while dragged; they were invisible until the pointer reached the window's right edge (#5746, `canvas::tests::the_document_scroll_bars_show_with_the_pointer_away`); hidden in Read Mode, as in Word | always shown | 90% | — | | Scrollbar drag page tip | ✅ while the vertical scrollbar is dragged, a tip beside the pointer names the page at the top of the window in the status bar's words ("Page 7 of 10"), on one line however long the number (#2551, #3341, `canvas::tests::dragging_the_scrollbar_names_the_page_at_the_top`); its look and wording not yet compared with Word's | not compared | 70% | 0.5 | +| Interface text on screen (Linux, BSD) | Drawn by egui with Inter's ttfautohint hints, which match FreeType's light autohinting: measured against headless Firefox (Inter, 18.1 and 15.2 px at 1.45x), the same rows of pixels and weight (ink within 1 %) in the light theme. The dark theme no longer looks semi-bold: egui's dark default thickened light-on-dark text (about 21 % more ink than Firefox); it now adds a light 7 % (plain coverage, Firefox's weight, looked soft on the dark tab row; chosen side by side on a 145 % desktop). Not yet: subpixel (LCD) edges | sharp interface text | 90% | — | +| Page text on screen (Linux, BSD) | Lightly hinted as FreeType's `hintslight` draws it (Firefox and other apps there): FreeType's autohinter puts baselines, x-heights and cap heights on whole pixels, nothing moves sideways, so lines break as before. Measured against headless Firefox (Arial, 21.27 px): the same rows of pixels and weight. Not yet: subpixel (LCD) edges; the interface text (egui) is hinted separately. macOS keeps its darkened unhinted text; Windows and exports are unchanged | sharp document text | 90% | 4–8 (subpixel edges) | | Web and Draft Layout rendering | Very long pages render only visible full-resolution raster tiles instead of shrinking one huge texture to the GPU size limit; nearby tiles are cached for scrolling | sharp document text | 95% | — | -| Reading Mode | Existing Read Mode ribbon button opens a read-only, viewport-column layout with animated horizontal paging, transient width/text/spacing controls, heading navigation (Navigation pane) and resize anchoring; print/export layout unchanged. The arrows, Page Up/Down and Escape work straight after entering it; only whole columns show, centred, at any width, text size or window size; the columns end above the page-turn bar (#1772); Page color: None (white, the document's page color and page picture not shown), Sepia or Inverse (a dark page with light text), as Word's View › Page Color in Read Mode, starting at None on each entry (`view.readPageColor`); Read Mode's View menu: Column Width and Page Color work, Layout is missing ([parity-checklist.md](parity-checklist.md), Read Mode 2/3) | reading-optimized view and navigation | 75% | 1–2 | -| Status bar (page x of y, words, language, view buttons, zoom slider) | ✅ (the page is the caret's while the caret is on screen, else the page at the top of the window, so scrolling updates it (#3880); the language is the caret's, by name; a click sets the proofing language, or opens Set Proofing Language… for any other) | ✅ | 85% | — | +| Reading Mode | Existing Read Mode ribbon button opens a read-only, viewport-column layout with animated horizontal paging, transient width/text/spacing controls, heading navigation (Navigation pane) and resize anchoring; print/export layout unchanged. The arrows, Page Up/Down and Escape work straight after entering it; only whole columns show, centred, at any width, text size or window size; the columns end above the page-turn bar (#1772); Page color: None (white, the document's page color and page picture not shown), Sepia or Inverse (a dark page with light text), as Word's View › Page Color in Read Mode, starting at None and kept between Read Mode entries, documents and runs (`view.readPageColor`); ink, object drag previews and table drag arrows drawn over the pages follow it; Read Mode's View menu: Column Width and Page Color work, Layout is missing ([parity-checklist.md](parity-checklist.md), Read Mode 2/3) | reading-optimized view and navigation | 75% | 1–2 | +| Status bar (page x of y, words, language, view buttons, zoom slider) | ✅ (the page is the caret's while the caret is on screen, else the page at the top of the window, so scrolling updates it (#3880); the language is the caret's, by name; a click sets the proofing language, or opens Set Proofing Language… for any other). The count at the right is what it shows in Word: words (default), characters (with spaces) or characters (no spaces), chosen from a right-click menu on it or File › Options › Display (Status bar count, `ui.statusCount`), kept between runs; a selection shows "selected of total" as the Word Count dialog counts them (#2797) | ✅ | 90% | — | | Caret motion: keys and typing glide the caret to its new place (100 ms, `cubic-bezier(0, 0, 0, 1)`), the blink fades (530 ms on and off, 100 ms fades); clicks and scripted moves don't glide. File › Options › Advanced › Animation (`ui.caretAnimation`) turns it off. The caret is black or white by contrast with what lies under it (paper, page colour, dark page, shading, highlight), never by the UI theme (#299). On Windows, whose inverting I-beam pointer stays white over the page, the pointer there is drawn the same way: black on light paper, white on dark (#1746) | ✅ as measured from Word for Windows (`caret_glide.rs`); zoom levels other than 100%, modifier keys and off-screen moves not measured | ✅ on Windows; Word for Mac not measured | 90% | 1–2 | | Interface themes (light, dark, system #249, follows OS changes live #311), dark page separate from the interface theme (#194, #312); on a dark page highlights and character shading are dimmed, keeping their hue, so the text on them stays readable; coloured text below 4.5:1 on them is drawn white, and underlines and strikethroughs follow the same rule (#1252); Interface Theme as a searchable View command (light/dark/system, toggle without a value, #1861) | ✅ | ✅ | 90% | — | | Interface size (File › Options › General: Auto, which keeps the system display scale and shows the size it draws at, or an absolute 75–300 %, so "100%" is one screen pixel per point; `ui.interfaceSize`) (#475, #822). A size from before #822 (on top of the display scale) becomes the absolute size it drew at. On the web the browser's zoom is part of the display scale, so a chosen size cancels browser zoom (Ctrl+plus/minus no longer resize the interface); Auto follows it | ✅ | system display scaling only | 100% | — | | Animation effects (File › Options › Accessibility: Use system setting, On, Off; `ui.animations`). Off: a wheel notch scrolls at once; Ctrl+wheel zooms in whole steps, each drawn finished in its own frame (a notch at once; touchpad pinches and high-resolution wheels in steps of about 10% rather than gliding); menus, buttons and the scroll to the caret neither fade nor glide | ✅ "Use system setting" reads Windows (Animation effects), macOS (Reduce motion), the Linux/BSD desktops (settings portal: the cross-desktop reduced-motion preference, GNOME's switch, KDE's animation speed; the GTK and KDE settings files where no portal answers) and browsers (`prefers-reduced-motion`), and follows a change while running. Run on Windows and against a stand-in portal on Linux; not yet tried on a Mac or a real GNOME or KDE session | not compared | 90% | 0.5–1 | | Focus and Full Screen (#1678, #980) | View › Focus fills the screen with the document on black, with a slim bar whose "⋯" drops the ribbon over the page; Full Screen View (`view.fullScreenView`, any key in Customize Keyboard) shows the pages alone with Search at the top; the two turn each other off. View › Window › Full Screen (`view.fullScreen`, F11, ⌃⌘F on macOS) fills the screen with the whole window, ribbon and all. Esc leaves Focus or Full Screen View, then Full Screen, once nothing nearer takes it; leaving gives back the earlier window size; the window manager's or macOS's own full screen keeps them in step. Ctrl+F1 (⌘⌥R on macOS) collapses or expands the ribbon; a shortcut of your own on Ctrl+F1 wins. Web: Full Screen off (the browser's own F11); Focus and Full Screen View hide the chrome only | Focus, Toggle Full Screen View (Alt, V, U, #1697), Word for Mac's View › Enter Full Screen, ⌘⌥R to collapse or expand the ribbon (Ctrl+F1 on Windows) | 85% | 0.5 | | File dialogs (Open, Save As, Export, Insert Picture) | system dialog, without blocking the window (#94), its Save As type list naming every format with the document's own first (#1399); Linux/BSD without a file chooser portal or zenity: WordCraft's own browser, also File › Open › Browse in WordCraft… (#576) | system dialog | 95% | — | +| Linux display server (File › Options › Advanced: Automatic, Wayland, X11 (XWayland); `ui.displayServer`, #2184), kept in `ui.json` and applied at the next launch. `WORDCRAFT_WAYLAND` overrides it (`0`, `false`, `no` or `off` for X11, any other value for Wayland), and a choice that isn't available falls back to the other instead of failing to start; the log's `display:` line says which ran and why | ✅ Linux and the BSDs only; the choice is unit-tested, not yet tried on a real GNOME or KDE session | no equivalent (no Word for Linux) | 100% | 0 | | Platform conventions (macOS menus/traffic lights #255, Windows title bar, Linux CSD on Wayland #78) | partial | native | 70% | 3–5 | | Screen readers (VoiceOver, Narrator, Orca) | AccessKit on; the document canvas describes paragraphs, headings (level), list items, tables, links, pictures (alt text) and the caret and selection, for the pages on screen (#488); the ribbon's font name and size boxes, and the dropdown arrows beside them, say what they are (#3172); Windows Magnifier follows the caret, also onto an empty line after Enter or Shift+Enter (#1119); File › Home and New's templates and recent documents are buttons named by their caption or file name, with the path when two file names are the same (#3176); not yet tried with real screen readers | full | 50% | 5–8 | | Right-to-left (mirrored) interface | ✅ Arabic (`ar`): shell, ribbon, panes, File page, dialogs and menus mirror; document canvas stays independent (#1195). Hebrew UI still open (#20) | ✅ (Arabic, Hebrew Word) | 50% | Hebrew UI + remaining chrome edges | @@ -68,6 +81,23 @@ Save Changes exposes the document-specific question as an alert-dialog name and The Language dialog reads effective character formatting, including document defaults, paragraph styles and character styles. Accepting it unchanged keeps inherited language and no-proof choices (#2717); explicit direct formatting still takes precedence. Other proofing and Windows-specific reports remain separate. +The `table.sort` command requires an explicit `column` to be a non-negative JSON integer naming a column in the table, indexed from 0 (#5531). Omitting it still sorts by column 0. Invalid selectors return an error before changing rows or history; the Sort dialog and collation rules are unchanged. + +## Screen paper colors (#3398) + +File › Options › General › Screen paper color selects Document background (the default), +Soft green, Warm cream or Soft gray. The selection persists in user preferences, not in a document. +It changes blank paper in editing views and in Read Mode's None color; a document's explicit +page color or background picture remains visible while editing. Read Mode's explicit Sepia and +Inverse colors override the preference. Choosing a tint turns off Dark page; enabling Dark page +later takes precedence in editing views until it is turned off again (Read Mode ignores it). Printing, PDF/image exports and saved +DOCX background styling are unaffected. This is a WordCraft extension (`view.paperColor`), not +an increase in the Microsoft Word parity score. + +Evidence: engine `screen_paper_color_is_a_persistent_preference_not_document_formatting`, +canvas `screen_paper_color_changes_raster_and_cache_without_changing_export_paper`, and +options `screen_paper_color_options_round_trip_and_work_without_a_document` tests. + ## Find and Replace: regular expressions (#4177) With **Regular expressions** on (Search Options), Replace with expands capture groups: `$1`…`$n`, `${n}`, `${name}` and `$name` (the longest run of letters, digits and `_`), `$0` / `${0}` (the whole match), and `\1`…`\9` as in wildcard Replace; `$$` is a dollar sign, `\t` a tab, `\\` a backslash, `\$` and `\^` a `$` or `^` as typed, and `\n` a paragraph mark, which splits the paragraph as `^p` does (Replace All stays one undo step). Word's `^&`, `^p`, `^t`, `^c` and the other `^` codes work there too (with Special characters off, only the `^` codes are taken literally). A group that doesn't exist, didn't take part in the match or is out of range expands to nothing; a `$` that starts no group, an unclosed `${`, and other `\` escapes stay as written. Plain and wildcard Replace are unchanged. Word has no regular-expression mode; this follows the Rust `regex` crate's Replace syntax. @@ -78,23 +108,49 @@ Find selects the Results tab, including when it prefills selected text. Editing Footnote and endnote editing keeps body and note text at normal opacity, on light and dark pages. Headers and footers still dim outside their editing context (#2545). +Protected typing at editable-region boundaries (#3614) walks consecutive permission starts or ends without repeated paragraph-prefix counts or ID-vector searches. Existing author matching, start-before-end movement, typing and Enter behavior, refusals and saved content remain unchanged. Native desktop behavior has not been newly tested. Aligned copy drags keep their locked document coordinate when middle-button scrolling moves the page, and Ctrl/Command+Shift can start on a secondary selected object. Plain Ctrl and Shift clicks keep their existing selection behavior (#4764). Labels → New Document with “One label per recipient” includes all filtered/sorted recipients across product-sized sheets (#4880). The last sheet keeps unused labels blank. Fixed text and Single label still produce one sheet. Native Windows interaction and comparison with Microsoft Word remain unverified; this change does not add Update Labels or change Finish & Merge templates. +File > Print offers 2, 4, 6, 9 or 16 logical pages per physical sheet side and left/right-bound booklets (#641). Preview and print PDF share the sheet plan, selected pages, parity, copy padding and markup geometry. Custom-range changes reset the preview to the first sheet; Print Markup invalidates preview layout and textures. Native jobs omit link annotations as required by upstream #4734, while saved print PDFs keep their remapped links. Native printing submits copies to the spooler without multiplying them in the PDF. Ordinary PDF export remains single-page by default. Translations are reviewed separately in craft-i18n#38. Physical-printer qualification and driver-specific options remain unverified. + ## Spelling and grammar correction Review › Spelling & Grammar, Home › Editor and F7 open a right-side Proofing task pane. Black-box observation of Word for Windows on 2026-10-26 established the arrangement: issue category, dictionary explanation, sentence context with the issue underlined, a bordered stack of suggestion cards, then Ignore Once, Ignore All and Add to Dictionary links. Clicking a suggestion applies it and advances. The pane uses WordCraft's existing title/docking/close host and its own icons and palette; no Microsoft assets are copied. The suggestion menu exposes supported manual replacement and AutoCorrect actions; Word's synonyms, spelling-out and Change All are not implemented here. No pixel-identical claim is made until the rendered comparison is inspected. Right-click and Shift+F10 keep the compact suggestions menu. The pane is shared by all proofing languages; it adds no dictionary or grammar rule. See [spelling-review.md](spelling-review.md) for scope, observation and verification. +Page Setup's margin, paper-size and document-grid number boxes scroll long text inside the field instead of enlarging the dialog (#5650). Readiness estimates unchanged. Accepted long margin values also stay inside the field after focus leaves; their accepted range, units and parsing are unchanged. + ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-11-07 | trivial | Page Setup also bounds the unfocused margin display after a long numeric paste; the accepted value is retained (#5650). | +| 2026-11-06 | trivial | The document's scroll bars are always drawn, in the room beside the page left for them, with a grey thumb that stands out from its track in both themes; they were invisible until the pointer reached the window's right edge, so without a mouse wheel nothing showed how to reach page 2 (#5746) | +| 2026-11-05 | trivial | Page Setup's margin, paper-size and document-grid number boxes scroll long text inside the field instead of enlarging the dialog (#5650). Readiness estimates unchanged. | +| 2026-10-28 | trivial | Home › Paragraph › Shading: text selected within part of one paragraph is shaded itself, as in Word, so No Color removes text shading imported from a file (#4685) | +| 2026-11-03 | trivial | Search ("Tell me"): a click on the title bar's Search box, or Alt+Q, types into that box itself, as in Word, with the suggestions and results (commands, then Find in the document) dropping down under it; Enter runs the first, Escape or a click elsewhere closes it. It used to open a second box in a Search Commands dialog, which is still what shows where the box isn't drawn (#5398) | +| 2026-10-31 | trivial | Font menus (ribbon, mini toolbar, Font and other dialogs): entries are drawn from at most four shared textures written in place, as the Equation tab's pictures are (#1002), instead of a texture per font; on Windows (DirectX 12) they showed on black strips in light mode and white or red ones in dark mode (#5105) | +| 2026-11-02 | trivial | A picture, shape or text box with a link shows its address on hover and Ctrl/⌘+click follows it, in line or floating, instead of starting a copy (#5267) | +| 2026-10-17 | trivial | Drawing Canvas members are selected with a click and dragged, resized, turned, nudged, formatted, deleted and copied on their own inside the canvas; a click in a text box member's text puts the caret there (#2637) | +| 2026-11-05 | trivial | On-canvas objects: dragging an In Line with Text picture, shape or text box shows a bold, solid insertion cursor, twice the caret's width, as in Word; the dashed one was hard to see (#4195) | +| 2026-10-28 | trivial | Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged. | +| 2026-11-01 | trivial | Rulers: the spaces between text columns are shaded on the horizontal ruler (Print Layout, in the main text outside tables, with the selection in one section); dragging an edge changes the spacing; equal columns stay equal, as in Word for Mac (#5197) | +| 2026-10-31 | trivial | Behind a modal dialog the window still moves by its title bar, as in Word for Mac, where WordCraft draws the title bar itself; a drag on the dialog where it reaches over the title bar moves only the dialog (#5124) | +| 2026-10-31 | trivial | Dialogs are modal (#3859): while one is open, clicks on the ribbon, File or the page, typing and shortcuts do nothing, as in Word. Find and Replace, Symbol, Mark Index Entry, Cross-reference and Insert Merge Field stay modeless, as in Word for Mac. A press beside a modal dialog shakes it a little, or flashes its border with animation effects off, so it is clear why nothing behind it reacts | +| 2026-10-17 | trivial | Copy and Cut put RTF beside the text and HTML on the system clipboard, for programs that read RTF rather than HTML (Windows "Rich Text Format", macOS `public.rtf`, Wayland `text/rtf`; an X11 copy stays text and HTML, since arboard owns the selection there; a copy of only pictures or shapes carries no HTML or RTF, so pasting it back keeps every detail); Paste reads another program's RTF on macOS and X11 too, as on Windows and Wayland | +| 2026-11-04 | trivial | Table Sort rejects malformed or nonexistent explicit columns before mutation; valid columns, the omitted-column default and history are retained (#5531). Readiness estimates unchanged. | | 2026-11-03 | trivial | Comments: a long comment's card, balloon and fields stop at ten lines; the fields scroll, and a balloon that isn't selected shows the first ten lines of the comment and of each reply (#3382) | +| 2026-11-03 | trivial | Over a turned picture, shape or text box, the pointer on a resize handle shows the arrow along which that handle resizes: turned 90°, the handle now at the top shows an up-down arrow (it showed left-right), turned 45° the middle handles show diagonal ones; also while the handle is dragged (#3932) | +| 2026-11-03 | trivial | Shape Format › Size: the width and height show the interface unit and take a size typed in any unit (`3 cm`, `300 px`), applied once typed (Enter, Tab or a click elsewhere; Esc cancels), each side on its own, as Picture Format › Size does; in both, a field clicked and left without typing no longer resizes the object by the rounding of the size it shows (#4196) | | 2026-11-03 | minor | Arabic mirrored interface: title bar, ribbon, panes, File page, dialogs and menus run from the right; document canvas stays independent (#1195); Hebrew UI still open | +| 2026-10-31 | minor | #3398: persistent screen-only green, cream and gray paper presets, with document backgrounds and export colors retained. Read Mode None follows the screen preset; Sepia/Inverse retain priority. | +| 2026-11-03 | minor | File › Options › Language: Your languages (English variants in use, installed Language packs, the document's languages) with each one's proofing status, Install, Remove and Set as default; Add a language… opens a searchable picker (dutch, nederlands, nl) sorted by name; the Dictionaries folder and the Dictionary files list moved here from Proofing, which has no Dictionaries section any more (CP4.3) | +| 2026-10-28 | trivial | Fonts that aren't installed are flagged: the font box (ribbon, mini toolbar, both Font dialog boxes) shows a warning mark whose hover note names the font drawn instead; the status bar says "N fonts not installed" and lists them with the faces drawn instead (the first 20, then how many more), with Add Font…. The list comes from layout (`ParaLayout::substituted`), so it covers exactly the text shown, in every story, list labels and East Asian and complex-script text included, and a missing roman font drawn in Cambria counts. Metric-compatible substitutes (Carlito for Calibri, Caladea for Cambria, Liberation for Arial, Times New Roman and Courier New, the Palatino look-alikes) aren't flagged, since line breaks don't move, nor symbol fonts drawn as their Unicode equivalents (Word's bullets); headers and footers count only in views that show them, chart and SmartArt labels not yet; the font box reads the same list, so for text already shown the two agree, and it also warns for a missing font no text shows yet when the box shows a font to come: at a collapsed caret, the font the next letter will be typed in, and in the Font dialog, the fonts OK applies (the Asian text font too, over Latin text); Missing Fonts (`font.missing`, from command search or agents; it says what it found in the status line) and `format.state.fontShownAs` for agents | | 2026-10-31 | trivial | Keytips: Alt, F badges the Backstage pages with Word's letters and the letter opens the page; Alt, F, P and Alt, F, V open Print; the badges end with the Backstage (#4960) | +| 2026-10-30 | trivial | Read Mode keeps the selected Page color between entries, documents and runs. The color does not change document formatting. | | 2026-10-31 | trivial | View › Macros opens a Macros dialog (also Alt+F8 and command search): the macros of this session listed with Run, Delete and Record, which reads Stop Recording while a recording runs; the button did nothing before, as `tools.macros` without a macro to run, define or delete only returned the list (#4327) | | 2026-10-31 | trivial | Synchronize the existing Proofing pane with main `eecbb8f`; preserve explicit-position lookup, implicit selection, navigation, undo and per-window state; fresh exact-SHA hosted validation pending, readiness unchanged | | 2026-10-30 | trivial | Synchronize the existing Proofing pane and navigation/selection/undo regressions with main `3b7f7ed`; new-SHA validation pending, readiness unchanged | @@ -108,10 +164,14 @@ Right-click and Shift+F10 keep the compact suggestions menu. The pane is shared | 2026-10-29 | trivial | Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880). Filtered/sorted order, product geometry and single-label mode retained; readiness estimates unchanged. | | 2026-10-26 | trivial | Layout › Arrange › Group stays on while a group is selected, so Ungroup in its menu can be reached; it was greyed out because one object has nothing to group (#4229) | | 2026-10-27 | trivial | Port the existing Proofing pane and navigation/selection regressions to extracted engine/UI modules on main `436d444`; preserve compact context menus; new-SHA validation pending, readiness unchanged | +| 2026-10-27 | trivial | File › Print: Return prints, as Word's Print dialog does with Print as its default button; a field or list on the page that has the keyboard keeps Return | | 2026-10-26 | minor | Word-observed Proofing task pane uses shared review commands; clicking a suggestion corrects and advances; context, suggestion cards and ignore/dictionary links follow the Windows reference; inspected previews prompted a full-width context and scrollable three-card list; exact selected spelling takes priority over overlapping grammar, with command/pane regressions and integration workflow paths; readiness estimates unchanged | +| 2026-11-01 | trivial | N-up and booklet print imposition (#641): integrate current print-job link handling (#4734), preserve markup preview and sheet/copy planning; readiness estimates unchanged. | +| 2026-10-28 | trivial | Mini toolbar: after a click a button shows no preview until the pointer leaves it, and coming back previews the undo (Bold over bold text shows it unbolded); the alignment buttons of the bar and the Home and Layout ribbons follow the paragraph a selection covers, not the next one it ends at; picking from a font or size list closes it, and the recent fonts reorder the next time it opens; the font list and the colour menus mark the choice in effect, apart from the one hovered, and a family listed under Recently Used Fonts is marked there only; the page holds its scroll position while a preview is shown; while the pointer is on Bold, Italic, Underline, Strikethrough, Grow, Shrink or an alignment button, or on an entry of the font, size, highlight or font colour lists, the page shows that command run on the selection, laid out on a copy, so the document, undo history and selection do not change; moving to another button updates it, leaving the bar restores the page, a click applies the command as before (#4664) | | 2026-10-22 | trivial | View › Window › New Window opens another window on the document, focused and cascaded; two windows on one document are titled `Name:1` and `Name:2` (one window: the plain name). Each window keeps its own selection, scroll position, zoom, view mode, ruler and panes; the text, undo history, unsaved state and file are the document's, so an edit or Undo in either window shows in both, and a caret in text the other window deleted moves to the nearest place left. Closing one of a document's windows asks nothing; closing its last asks about unsaved changes, and quitting asks once per document. Switch Windows lists every window. The web app keeps one window | | 2026-10-22 | trivial | One native window per open document on the desktop (the web app keeps one window): New and Open open the document in a window of its own, focused and cascaded from the last; Open replaces an untouched blank document in its window and brings an already-open file's window forward; each window keeps its own ribbon tab, File page, dialogs, panes and composition; View › Window › Switch Windows lists the windows and brings the chosen one forward; File › Close and the window's close button close the window (asking about unsaved changes) and the window focused before comes forward, while the last window stays open with no document; quitting asks Save / Don't Save / Cancel about each document in its own window | | 2026-10-22 | trivial | Several open documents in one window (one window per document comes next): View › Window › Switch Windows lists the open documents, the shown one marked and unsaved ones dotted, and shows the one chosen, with its own scroll position, zoom, comment drafts and AutoSave file; File › New, Open, Envelopes, Labels, Finish & Merge and personal templates open beside the open documents without asking about unsaved changes; File › Close shows the next open document; the window's close button asks Save / Don't Save / Cancel about each document with unsaved changes, showing it, and Cancel keeps the app open. Untitled documents are numbered (Document2) in the interface language | +| 2026-10-25 | trivial | Read Mode: the Page color is kept from one entry to the next; ink, object drag previews and table drag arrows follow it instead of Switch Modes | | 2026-10-25 | trivial | Custom Document Properties dialog: File › Info › Properties › Advanced Properties… opens it; the document's custom properties listed with Add, Modify and Delete over a name/value form (text properties only; Word's number/date/yes-no types not offered), OK one undoable `file.properties` step, Cancel discards; modal dialogs 62 → 63 (#2982) | | 2026-10-25 | trivial | Text Highlight Color shows the remembered colour on the ribbon and mini-toolbar buttons; No Color leaves the pen without a misleading yellow bar (#4087) | | 2026-10-24 | trivial | Read Mode: a Page color menu (None, Sepia, Inverse) beside Line spacing; the columns are drawn on white, sepia or a dark page, in place of the document's page color (`view.readPageColor`) | @@ -119,9 +179,12 @@ Right-click and Shift+F10 keep the compact suggestions menu. The pane is shared | 2026-10-24 | trivial | Review › Accept and Reject menus: Accept and Move to Next and Reject and Move to Next resolve the change at the caret and select the next one (`review.accept` / `review.reject` `{"next": true}`); Accept All Changes and Stop Tracking and Reject All Changes and Stop Tracking also turn Track Changes off, in one undo step (`review.acceptAll` / `review.rejectAll` `{"stopTracking": true}`) | | 2026-10-24 | trivial | Find and Replace, Regular expressions: Replace with expands `$1`, `${n}`, `${name}`, `$0`, `\1`…`\9`, `$$`, `\n` (splits the paragraph) and `\t`; missing or out-of-range groups expand to nothing (#4177) | | 2026-10-23 | trivial | Insert › Table: hovering the grid shows the table on the page, at the caret, as Word's Live Preview does; it follows the pointer and is laid out on a copy, so the document and Undo change only when a square is clicked (#3931) | +| 2026-10-19 | trivial | Linux display server setting in File › Options › Advanced (Automatic, Wayland, X11), applied at the next launch; `WORDCRAFT_WAYLAND` still overrides it, `0` now asking for X11 (#2184) | +| 2026-10-19 | trivial | Status bar count (#2797): the count at the bar's right shows words (default), characters (with spaces) or characters (no spaces), chosen from a right-click menu on it or File › Options › Display › Status bar (`ui.statusCount`), kept between runs; a selection shows "selected of total" in the chosen unit, counted exactly as the Word Count dialog counts them, whose numbers and meaning are unchanged | | 2026-10-23 | trivial | Comment times: the Comments pane and the balloons show each comment's and reply's time in the user's time zone, under its author, as Word does. The file keeps UTC (`w16cex:dateUtc` when Word wrote one), a time without a zone shows as written, and the web app asks the browser for the zone (#2322, #2337) | | 2026-10-22 | trivial | Mail merge: First Record, Last Record, a record number box, and record choices for Edit Individual Documents and Print Documents (#3028) | | 2026-10-23 | trivial | Mini toolbar: in a right-to-left paragraph the alignment buttons mark the alignment as seen on the page, as the ribbon does, so a start-aligned paragraph lights Align Right instead of Align Left; the buttons already set the alignment as seen on the page (#3579) | +| 2026-10-23 | trivial | Showing the Format Shape pane no longer rewrites a linear gradient angle between 359.9° and 360° (359.95° became 359.9°, with an undo step); the Angle field shows the value as it is (#3955) | | 2026-10-22 | trivial | While editing a header, a single click in the footer (or the reverse, or another page's own header) edits that one with the caret where clicked; the click was placed in the header being edited, and the view scrolled back to it, so a double-click on the footer rarely landed | | 2026-10-18 | trivial | Explicit New/Open is not interrupted by startup recovery discovery; older copies stay available and Recover follows the interface theme. | | 2026-10-19 | trivial | Insert Table of Figures opens a Table of Figures dialog: caption label (Figure, Table, Equation, the user's own and those the document's captions use), Include label and number, page numbers, right margin and tab leader, with a preview; the ribbon button, KeyTip and command search reach it (#3013) | @@ -138,6 +201,9 @@ Right-click and Shift+F10 keep the compact suggestions menu. The pane is shared | 2026-10-20 | trivial | The scrollbar page tip stays on one line: it broke into two or three lines ("Page 10 of" / "40") as the page number grew during a drag (#3341) | | 2026-10-19 | trivial | Format Page Numbers (Insert › Header & Footer › Page Number ▸ Format Page Numbers…, #1113): the dialog sets the number format (1, 2, 3 / I, II, III / i, ii, iii / A, B, C / a, b, c) and whether the pages number on from the section before or start at a number; the ribbon item did nothing before (a plain command call that also cleared the section's start), and `layout.pageNumberFormat` keeps the start when `start` is left out and takes null to continue | | 2026-10-16 | trivial | KeyTips: AltGr (Right Alt with Level 3 Shift on Linux) is not an Alt tap, held or tapped, so AltGr+letter types instead of reaching the badges (#2388) | +| 2026-10-19 | trivial | Ctrl/⌘+wheel and pinch zoom stretch each page's last raster while the zoom moves and render it once it stops (or past 1.5x): frames during a zoom cost 0–1 ms instead of 11–15 ms on a 4K screen at 145 % | +| 2026-10-19 | trivial | Dark-theme interface text on Linux and the BSDs no longer looks semi-bold: about 7 % heavier than light-theme text instead of egui's 21 % (chosen side by side); light-theme interface text measured to match Firefox already | +| 2026-10-19 | trivial | Page text on Linux and the BSDs is hinted like FreeType's `hintslight`: as sharp as in Firefox, same weight, same line breaks | | 2026-10-15 | trivial | Three-column header/footer table preset and automatic screen-only cell guides while editing (#2197) | | 2026-10-18 | trivial | Long navigation headings wrap onto further lines inside the pane instead of ending in an ellipsis; the row grows with the text and the pane still resizes (#759, #3015) | | 2026-10-18 | trivial | Font list starts at its first row after clearing a no-match query; recent heading remains visible (#2068) | @@ -306,6 +372,7 @@ Right-click and Shift+F10 keep the compact suggestions menu. The pane is shared | 2026-10-11 | trivial | Interface size setting in File › Options › General (80–200 %), kept between runs and applied on top of the system's display scale; `ui.interfaceSize` for agents (#475) | | 2026-10-11 | trivial | Font list ends with Add Font… (TTF, OTF, TTC, WOFF, WOFF2; also by dropping the file); added fonts are listed at once and kept between runs (#582) | | 2026-10-11 | trivial | Font box (ribbon and mini toolbar): typing lists the matching fonts (prefix first, then any part of the name); Up/Down, Enter or a click picks one, Escape cancels (#359) | +| 2026-10-26 | trivial | View › Window across the native windows: Switch Windows, Arrange All, View Side by Side, Synchronous Scrolling (#322) | | 2026-10-11 | trivial | Templates and Add-ins (template path, Attach…, automatically update document styles) and Organizer (copy styles from another file, delete, rename) dialogs (#377); styles update from the template only when the user asks (OK with the box ticked, or Update Styles), never on open; the three Modal dialogs rows merged into one | | 2026-10-11 | trivial | Field codes (#339): View › Field Codes (Alt+F9), Toggle Field Codes (Shift+F9), a field-code popup (double-click, right-click › Edit Field…; Ctrl+F9 opens the Field dialog), unlink/lock/unlock and next/previous field keys; field items in the context menu | | 2026-10-10 | trivial | Tabs dialog (Paragraph › Tabs…, double-click a ruler tab) and Borders and Shading with Borders, Page Border and Shading tabs (#320) | diff --git a/packaging/freebsd/package.sh b/packaging/freebsd/package.sh index d4cdde71f3..a6fda10641 100755 --- a/packaging/freebsd/package.sh +++ b/packaging/freebsd/package.sh @@ -55,7 +55,7 @@ esac # Only binaries for this machine run here (the --version check at the end); a FreeBSD target built # on another OS never does. HOST_ARCH="$(release_arch "$(uname -m)" 2>/dev/null)" || HOST_ARCH="$(uname -m)" -if [ -n "${CARGO_BUILD_TARGET:-}" ] && [ "$(uname -s)" != FreeBSD ]; then +if [[ -n "${CARGO_BUILD_TARGET:-}" ]] && [[ "$(uname -s)" != FreeBSD ]]; then HOST_ARCH="$(uname -s) $HOST_ARCH" fi BASENAME="wordcraft-$VERSION-freebsd-$ARCH" @@ -96,12 +96,12 @@ mkdir -p "$DIST" tar -C "$WORK" -czf "$DIST/$BASENAME.tar.gz" "$BASENAME" echo "wrote $DIST/$BASENAME.tar.gz" -if [ -z "${CARGO_BUILD_TARGET:-}" ] && [ "$ARCH" = "$HOST_ARCH" ]; then +if [[ -z "${CARGO_BUILD_TARGET:-}" ]] && [[ "$ARCH" = "$HOST_ARCH" ]]; then "$STAGE/bin/wordcraft-cli" --version else # They cannot run here, so check what they are instead: executables, not libraries or objects. # An older file(1) calls a PIE a shared object; its interpreter still marks it as a program. - want="$ARCH"; [ "$ARCH" != x86_64 ] || want=x86-64 + want="$ARCH"; [[ "$ARCH" != x86_64 ]] || want=x86-64 for b in "$STAGE"/bin/*; do case "$(file -b "$b")" in ELF*" executable, "*"$want"*FreeBSD* | ELF*"$want"*FreeBSD*interpreter*) ;; diff --git a/packaging/linux/flatpak/ai.storyteller.wordcraft.yml b/packaging/linux/flatpak/ai.storyteller.wordcraft.yml index 109d9ee1c5..9ce3934aef 100644 --- a/packaging/linux/flatpak/ai.storyteller.wordcraft.yml +++ b/packaging/linux/flatpak/ai.storyteller.wordcraft.yml @@ -126,6 +126,6 @@ modules: # the two equal). - type: git url: https://github.com/storytold/craft-i18n - commit: 20467b63558f04fe075e83aaea501bd10f7fa684 + commit: 1e515422afdda2f317af430c1f9d68a5f83935b4 dest: craft-i18n - cargo-sources.json diff --git a/packaging/linux/nfpm.yaml b/packaging/linux/nfpm.yaml index bf75ccc1eb..6bf39eef46 100644 --- a/packaging/linux/nfpm.yaml +++ b/packaging/linux/nfpm.yaml @@ -24,7 +24,8 @@ description: |- # The binaries link only glibc and libgcc_s directly. Windowing (X11/Wayland, xkbcommon) and the # GPU (Vulkan, EGL/GL) are loaded at runtime, so they are dependencies/recommendations here -# rather than ELF NEEDED entries. +# rather than ELF NEEDED entries. Read Aloud speaks through espeak-ng (or Speech Dispatcher), a +# program it starts, so that is a recommendation too. overrides: deb: depends: @@ -41,10 +42,16 @@ overrides: - libxrandr2 - mesa-vulkan-drivers - xdg-desktop-portal + - espeak-ng | speech-dispatcher rpm: + # Library sonames rather than package names, so the same requirements resolve on Fedora/RHEL + # and openSUSE (which has no libxkbcommon, vulkan-loader or libglvnd-egl package). depends: - - libxkbcommon - - (vulkan-loader or libglvnd-egl) + - libc.so.6()(64bit) + - libm.so.6(GLIBC_2.35)(64bit) + - libgcc_s.so.1()(64bit) + - libxkbcommon.so.0()(64bit) + - (libvulkan.so.1()(64bit) or libEGL.so.1()(64bit)) recommends: - libwayland-client - libX11 @@ -53,6 +60,7 @@ overrides: - libXrandr - mesa-vulkan-drivers - xdg-desktop-portal + - espeak-ng contents: - src: ${STAGE}/usr/bin/wordcraft @@ -61,8 +69,20 @@ contents: - src: ${STAGE}/usr/bin/wordcraft-cli dst: /usr/bin/wordcraft-cli file_info: { mode: 0755 } - - src: ${STAGE}/usr/share/ - dst: /usr/share/ + # Named one by one rather than as a tree of /usr/share: a tree would also own shared directories + # such as /usr/share/mime, which openSUSE's filesystem package owns with other modes, and RPM + # refuses to install a package that conflicts with it. + - src: ${STAGE}/usr/share/applications/ai.storyteller.wordcraft.desktop + dst: /usr/share/applications/ai.storyteller.wordcraft.desktop + - src: ${STAGE}/usr/share/mime/packages/ai.storyteller.wordcraft.xml + dst: /usr/share/mime/packages/ai.storyteller.wordcraft.xml + - src: ${STAGE}/usr/share/metainfo/ai.storyteller.wordcraft.metainfo.xml + dst: /usr/share/metainfo/ai.storyteller.wordcraft.metainfo.xml + - src: ${STAGE}/usr/share/icons/hicolor/ + dst: /usr/share/icons/hicolor/ + type: tree + - src: ${STAGE}/usr/share/doc/wordcraft/ + dst: /usr/share/doc/wordcraft/ type: tree scripts: diff --git a/packaging/web/README.md b/packaging/web/README.md index 7868b95078..5a56fdb184 100644 --- a/packaging/web/README.md +++ b/packaging/web/README.md @@ -73,6 +73,104 @@ Local test: `python3 -m http.server 8765` inside the folder, then open http://lo downloads) are blocked. - Don't send `X-Frame-Options: DENY` or a `frame-ancestors` CSP that excludes the embedding page. +## The parent bridge (`?host=parent`) + +A page framing WordCraft in a **same-origin** iframe can add `?host=parent` to the iframe's URL +(`https://example.com/wordcraft/?host=parent`) and have WordCraft hand its files over instead of +downloading them. The two sides talk `postMessage` with plain window messages that carry a `type`: + +| Message | Direction | Fields | +|---|---|---| +| `wordcraft:ready` | app → page | `version`, `appVersion`: the app is running and listening; send a file now | +| `wordcraft:open` | page → app | `name`, `bytes` (an `ArrayBuffer` or `Uint8Array`): open like File › Open | +| `wordcraft:save` | app → page | `name`, `saveAs`, `bytes` (a transferred `ArrayBuffer`): every file the app would otherwise download (Save, Save As, Export as PDF, Export Page as PNG). The page stores it and reports failures itself. `saveAs` says whether the file becomes the document's file: `false` after Save (the page's own file, written under its name) and for exports that are only copies (PDF, Markdown, plain text); `true` after Save As and for exports to a format that keeps everything (.docx, .odt, .rtf), after which the next Save carries that name with `false` | +| `wordcraft:dirty` | app → page | `dirty`: unsaved changes appeared or went away | +| `wordcraft:failed` | app → page | `error`: the app couldn't start (no WebGPU or WebGL2, for example) | + +In host mode the app opens no sample document, so the framing page should send the file to edit +and guard leaving the page while changes are unsaved. `&author=` on the iframe's URL names the +user for the comments and tracked changes the app creates. Opening `?host=parent` outside an +iframe gives the normal app with downloads. + +## Same-document host mode (no iframe) + +A host application can also run WordCraft from its own document: it loads the wasm-bindgen module +itself and gives WordCraft one of its own canvases, so there is no iframe and no `?host=parent`. +It opts in with `data-host="page"` on that canvas — the exact value `page` — and the canvas keeps +the id the app looks up (`id="wordcraft_canvas"`). + +```html + +``` + +The page and the app then talk with DOM `CustomEvent`s on the canvas instead of `postMessage`. +The app dispatches the same messages it would post to a parent — `wordcraft:ready`, +`wordcraft:save`, `wordcraft:dirty`, `wordcraft:failed` — with the message fields (without the +`type`) as the event's `detail`, and it opens a document when the page dispatches a +`wordcraft:open` event with `detail: { name, bytes }`. Events do not bubble, so listen on the +canvas itself (two editors on one page can't hear each other). + +Add the listeners before `init`: the app announces itself with `wordcraft:ready` while `init` is +still running, and a file sent in reply would otherwise be missed. + +```js +import init from "./wordcraft-web-.js"; // the wasm-bindgen glue shipped with the app + +const canvas = document.getElementById("wordcraft_canvas"); + +canvas.addEventListener("wordcraft:ready", async () => { + // The app is listening; hand it a document now, if you have one. + const bytes = await documentBytes(); // an ArrayBuffer or Uint8Array + canvas.dispatchEvent(new CustomEvent("wordcraft:open", { + detail: { name: "Report.docx", bytes }, + })); +}); + +// Every file WordCraft would otherwise download (Save, Save As, Export as PDF) arrives here. +canvas.addEventListener("wordcraft:save", (event) => { + const { name, saveAs, bytes } = event.detail; // bytes is an ArrayBuffer + // Store the file under `name`; `saveAs` says whether it becomes the document's file. + // Report your own errors. + storeFile(name, bytes, saveAs); +}); +canvas.addEventListener("wordcraft:dirty", (event) => { + unsaved = event.detail.dirty; // warn before leaving, as you like +}); +canvas.addEventListener("wordcraft:failed", (event) => { + showError(event.detail.error); // the app couldn't start +}); + +await init({ module_or_path: "./wordcraft-web-_bg.wasm" }); +``` + +- Saves are not downloads in this mode: the `bytes` in `wordcraft:save` hold the saved document, + and the host decides where the file goes. +- `?author=` on the page's URL still names the user for new comments and tracked changes. +- An unframed page that uses `?host=parent` keeps the normal app with downloads. + `data-host="page"` turns this mode on only when `?host=parent` is absent: if `?host=parent` is + present it takes precedence, so a same-origin framed page uses the parent bridge, while an + unframed or cross-origin page gets no bridge and keeps normal downloads. + +The messages and both transports are the shared contract of [`craft-web-host`](https://github.com/storytold/craft-libs/tree/main/crates/web-host) (storytold/craft-libs#420), the same for every Craft app: its README lists every message, including `saved`, with the compatibility notes. In `wordcraft:ready`, `version` is the contract's (`"1"`) and `appVersion` is this app's release. WordCraft reads bytes, so a host sends `bytes`, not a `File`. + +### Trust and limits + +- **Who is trusted.** In page host mode the page and WordCraft share one document, so any script on the page can drive the app: open files in it and receive what it saves. Use this mode only for a page you control. The iframe mode (`?host=parent`) answers only the parent window, on the page's own origin. +- **Files from the host are untrusted input.** An opened file goes through the same reading as one picked with File ▸ Open or dropped on the window, with the same format limits; before it is copied into the app's memory, its size is checked against the host open limit (512 MiB) and a larger file is refused, and a name is cut to 255 characters. +- **The event and message names are the interface.** `wordcraft:ready`, `wordcraft:open`, `wordcraft:save`, `wordcraft:dirty` and `wordcraft:failed`, and the fields they carry (the same as the `?host=parent` messages), stay stable; changing one is a breaking change. + +### Driving it from the page (`window.wordcraft`) + +Every WordCraft web build puts `window.wordcraft` on the page, from [`craft-web-api`](https://github.com/storytold/craft-libs/tree/main/crates/web-api) (storytold/craft-libs#413), the same shape in every Craft app. `wordcraft.request(method, params)` calls any method of the control channel the desktop app serves (`docs/control-protocol.md`), and `execute(command, params)`, `commands()`, `docInspect(params)`, `uiInspect(params)` and `screenshot(params)` are shortcuts for the common ones. Each returns a Promise that resolves with the method's result and rejects with an `Error`; a call the app does not answer within 30 seconds rejects. WordCraft's control requests cannot be withdrawn, so a call that times out in the page still runs when the app reaches it, as it does for a desktop client. + +```js +const doc = await wordcraft.docInspect(); // a summary of the open document +await wordcraft.execute("text.insert", { text: "Hello" }); +const { data } = await wordcraft.screenshot(); // the canvas as PNG (base64) +``` + +The API is there in every mode, with or without a host. Opening a file, handing a saved or exported file to the page, the file name and the unsaved flag stay with the host messages above. + ## Renderer selection and fallback flags WordCraft renders with wgpu. It uses **WebGPU** when the browser has it and falls back to diff --git a/sonar-project.properties b/sonar-project.properties index 6e78dc7f7c..bf4496425f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,2 +1,9 @@ sonar.projectKey=storytold_wordcraft sonar.organization=storytold + +# S4790 (weak hash): SHA-1 is a start-key and "SHA1/1K" checksum algorithm that ODF package +# encryption (ODF 1.3 Part 2 §4.16) names, and older office suites wrote it. It is needed to open +# those files, not chosen for new security: WordCraft writes a SHA-256 start key and checksum. +sonar.issue.ignore.multicriteria=odt_sha1 +sonar.issue.ignore.multicriteria.odt_sha1.ruleKey=rust:S4790 +sonar.issue.ignore.multicriteria.odt_sha1.resourceKey=crates/formats/src/odt/crypt.rs diff --git a/xtask/src/assets.rs b/xtask/src/assets.rs index e962f6ef57..4c10c8e8ed 100644 --- a/xtask/src/assets.rs +++ b/xtask/src/assets.rs @@ -73,8 +73,10 @@ mod tests { fn a_failed_file_listing_fails_the_check() { // #1364: outside a git checkout `git ls-files` fails, and its empty output read as "no // files" passed the check. - let dir = std::env::temp_dir().join(format!("wordcraft-xtask-assets-{}", std::process::id())); - std::fs::create_dir_all(&dir).unwrap(); + // Created exclusively under a name no one can predict: an existing folder or link there would be someone else's. + let nanos = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map_or(0, |d| d.subsec_nanos()); + let dir = std::env::temp_dir().join(format!("wordcraft-xtask-assets-{}-{nanos}", std::process::id())); + std::fs::create_dir(&dir).unwrap(); std::fs::write(dir.join("ATTRIBUTION.md"), "").unwrap(); let inside_git = Command::new("git").current_dir(&dir).args(["rev-parse", "--git-dir"]).output().is_ok_and(|o| o.status.success()); let result = run(&dir); diff --git a/xtask/src/stats.rs b/xtask/src/stats.rs index f40b1300ac..8abfea4e58 100644 --- a/xtask/src/stats.rs +++ b/xtask/src/stats.rs @@ -18,12 +18,14 @@ fn walk(dir: &Path, c: &mut Counts) { let p = e.path(); let name = e.file_name(); let name = name.to_string_lossy(); - if p.is_dir() { + // A symlink is never followed: several links to an ancestor would multiply the walk. + if e.file_type().is_ok_and(|t| t.is_dir()) { // Nested fuzz workspaces and build output are not part of the crate. if name != "target" && name != "fuzz" && !name.starts_with('.') { walk(&p, c); } } else if name.ends_with(".rs") + && e.file_type().is_ok_and(|t| t.is_file()) && let Ok(s) = std::fs::read_to_string(&p) { c.files += 1; @@ -108,11 +110,25 @@ pub fn run(_root: &Path, exact: bool) -> Result<(), String> { #[cfg(test)] mod tests { - use super::count_tests; + use super::{Counts, count_tests, walk}; #[test] fn counts_attributes_and_proptest_blocks() { let src = "#[test]\nfn a() {}\n// #[test] commented\n #[test]\nfn b() {}\nproptest! {\n}\n"; assert_eq!(count_tests(src), (2, 1)); } + + #[cfg(unix)] + #[test] + fn a_walk_does_not_follow_directory_links() { + let nanos = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map_or(0, |d| d.subsec_nanos()); + let dir = std::env::temp_dir().join(format!("wordcraft-xtask-stats-{}-{nanos}", std::process::id())); + std::fs::create_dir(&dir).unwrap(); + std::fs::write(dir.join("a.rs"), "#[test]\n").unwrap(); + std::os::unix::fs::symlink(&dir, dir.join("loop")).unwrap(); + let mut c = Counts::default(); + walk(&dir, &mut c); + let _ = std::fs::remove_dir_all(&dir); + assert_eq!((c.files, c.tests), (1, 1)); + } }