Repository navigation
M4: PNG, PDF, SVG and text clipboard formats in and out (M4.57) - #88
Merged
Merged
Conversation
Copy and Cut also offer other apps a PNG of the copied objects, a PDF
with On Copy: PDF, and plain text when every copied object is type
(clipboard.flavours; clipboard.exportPng {scale?}, exportPdf,
exportText). Paste outside text editing takes what another app copied:
SVG, then PDF (clipboard.importPdf), then plain text as point text
(clipboard.importText), then a bitmap embedded at the view centre
(clipboard.importImage {dataBase64, mime?, center?}); pasting our own
copy keeps the lossless internal clipboard, and Cmd+V pastes a bitmap
that comes with no text. Services gains system_clipboard
(SystemClipboard: write, holds_ours, read, has): on Windows every
format at once, on macOS and Linux one (the text, else the PNG); the
web keeps SVG text only. With When pasting text: Keep Plain Text, text
the Type tool copied pastes without its formatting.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of M4 (Files). Copy offers PNG, PDF, SVG and plain text to other apps, and Paste takes SVG, PDF, text and bitmaps from them, as Illustrator does.
copyAsPdfpreference, without the embedded editing data;copyAsSvgis on;image/svg+xml), whencopyAsSvgis on.pasteTextFormatting: "plain", text the Type tool copied pastes without its formatting.cmd/clipboard/flavours.rs):clipboard.exportPng {scale?},clipboard.exportPdf,clipboard.exportText;clipboard.flavours, which lists what Copy offers;clipboard.importImage {dataBase64, mime?, center?},clipboard.importText {text, center?}andclipboard.importPdf {dataBase64, page?, password?, center?}.SystemClipboardservice trait (ui-egui/src/sysclip.rs) with desktop backends (apps/vectorcraft/src/clipboard.rs).clipboard-win, which writes every format at once plus an opaque bitmap. It was already a transitive dependency througharboard, under the Boost Software License 1.0, which is permissive.arboardwithimage-data.docs/mcp.mdhas a "Clipboard formats" section, anddocs/control-protocol.mdis updated.Known limits:
Checks
Rebased onto
a560f74(#79).cargo xtask cipasses all 7 steps (fmt, clippy, test, assets, brands, layers, wasm): 2,274 tests, 0 failed.mainstill exists (2,251 → 2,269), none changed;UI_COMMANDS, menu entries and MCP tools are unchanged.🤖 Generated with Claude Code