- A panic while a held run's output is applied ends the run, so the
documents go back to their state before it, and ending a held run
drops the output handed in for it.
- The worker loads a plug-in with the limits the page sends with the
run, so its memory limit applies.
- A worker that is ready only after the run's deadline is not sent the
run, with or without a dialog open.
- A run that holds the documents and fails while a dialog is open ends
at once and frees them.
- A plug-in command's dialog that automation confirms runs the command
on the page and returns its result.
- A plug-in file opened or dropped on the web whose worker check fails
is reported in the Can't open dialog, not only in the status bar.
- The web README lists connect-src among the CSP directives the app
needs.
A check whose module fails in the worker now ends at once while a dialog
is open, a run holds the documents or a script runs: its worker is
terminated and the status bar says why. Only a checked install waits.
packaging/web/README.md lists everything a Content Security Policy must
allow: the inline start-up script Trunk writes into index.html,
'wasm-unsafe-eval' for WebAssembly, and the plug-in worker.
- A run that holds the documents applies its output only through the
command and params it was started with, and one that ends without
changing a document keeps that document's revision, so another worker
run on it still applies.
- Clipboard imports are refused while a run holds the documents, and
recovery copies wait until the run ends.
- A command call waiting under a dialog no longer keeps a run past its
time budget, and a run whose document changed stops while a dialog is
open too.
- A checked install waits for the run that holds the documents, and the
progress window shows that run first.
- While a script runs, worker runs still get their requests, Cancel and
their time budgets still end them, and no new worker run starts.
- Command call arguments and answers travel in blobs of their own, so
they nest as deep as a JSON parse allows; the worker protocol is 2.
- docs/plugins.md and packaging/web/README.md scope the off-page runs,
document the first ui.installPlugin reply, the start-up time in the
budget, and the CSP fallback through child-src.
On the web, a plug-in being installed ran its start function and
vc_manifest on the page, and a filter ran on the page for its whole
budget, so a slow or looping module froze the tab for up to a minute
(five for a heavy filter), and Cancel could not stop it.
- A second wasm, apps/vectorcraft-plugin-worker, is built by Trunk as a
worker (data-type="worker" with data-loader-shim in index.html). The
page starts one worker for each check and each run, and terminates it
on Cancel, when the document or the plug-in changes, and 5 s past the
run's time budget, also while a dialog is open. Each worker's inbox
holds its latest progress report and at most 8 other messages.
- crates/plugins/src/worker.rs holds the messages and the worker's
side. Runs can pause at each vc_call (Plugin::begin_run and
resume_run), which the desktop's synchronous calls now use too.
- Install Plug-in... and File > Open check a module in a worker first;
the page then loads it with Plugin::load_checked, which runs none of
its code.
- A filter that calls commands sends each call to the page. The session
holds the run's undo step open and refuses other edits with "a
plug-in is running: cancel it or wait for it to finish" until the run
ends; the progress window shows at once with Cancel only.
- On the web every filter and plug-in command started from the menus
or their dialogs runs in a worker, and the dialogs have no Preview.
A plug-in command applies as itself, one undo step named after it.
Commands that automation runs directly still run where they are
called and return their result.
- packaging/web: the worker files carry no hash, so the sample cache
rules make only the hashed app files immutable.
SonarCloud flags every bare [ conditional in bash scripts under packaging/ as a reliability smell (rule S7688). Convert the flagged [ ... ] tests to [[ ... ]]: safer word-splitting and no glob surprises, same semantics for these string and file tests.
Replace the Trunk post_build hook packaging/web/copy-fonts.sh with `cargo xtask web-fonts` (xtask/src/web_fonts.rs), so the web build only needs trunk, the wasm32 target and cargo, with no POSIX shell, and works the same on Windows.
The new task reuses crates/text/build/web_fonts.rs for list parsing and URLs, so build.rs and the copier can't disagree on fonts/<sha16>/<file>. It still does nothing without CRAFT_FONTS_DIR, checks each file's SHA-256 against the manifest, and copies the licence next to each face. A listed face that an older craft-fonts checkout lacks is now skipped with a warning, as build.rs does, instead of failing the build. A relative CRAFT_FONTS_DIR is resolved from the workspace root.
Update the references in Trunk.toml, fonts.rs, build.rs, craft_fonts.rs and web-fonts.txt, and document the web build's requirements in docs/development.md. Add tests for the copy, a hash mismatch and the no-op case.
Signed-off-by: Ahmed Moussa <moussa.ahmed95@gmail.com>
Desktop builds made with CRAFT_FONTS_DIR now load craft-fonts' 12 Arabic families into the document font database. Noto Sans Arabic comes first and is the fallback for Arabic text. Cairo, Tajawal, Almarai, IBM Plex Sans Arabic, Noto Kufi Arabic, Amiri, Alexandria, Fustat, Reem Kufi, Aref Ruqaa and Gulzar can be picked by name from the font menus.
The web build doesn't embed these fonts because they would make the wasm too large. It fetches them from beside the wasm instead:
- crates/text/web-fonts.txt lists each face as startup or background.
- build.rs turns that list into vectorcraft_text::WEB_FONTS, with each face's URL (fonts/<sha16>/<file>) and SRI hash taken from the craft-fonts manifest.
- packaging/web/copy-fonts.sh, a Trunk post_build hook, copies the font files and their OFL licences there.
- apps/vectorcraft-web/src/fonts.rs fetches Noto Sans Arabic before the app starts, so Arabic text never shows as boxes. It loads the other faces in the background and logs `web font …` for any that fail.
Because fonts can now arrive after startup, the Type tool's layout cache also checks the font database's generation, so text lays out again when new fonts arrive.
_headers and .htaccess serve fonts/* as font/ttf and cache it as immutable. packaging/web/README.md and docs/development.md explain the fonts folder, and ROADMAP.md lists the Arabic typefaces under Type. Also adds Ahmed Moussa to contributors/people.toml.
Signed-off-by: Ahmed Moussa <moussa.ahmed95@gmail.com>
Drop the file types and wording carried over from the sibling raster
editor: the macOS exported type now declares .vectorcraft/.drawcraft
(was .pcraft) and the raster imported types (large raster documents, QOI)
are gone; the dev bundle's PDF type is "PDF Document"; Linux categories and
keywords say vector graphics (no trademark keyword), the AppStream
description and screenshot show VectorCraft, and the deb/rpm, MSI and web
embedding descriptions say vector illustration app. File associations stay
as they are. An xtask test rejects raster-editor wording in packaging/.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>