Repository navigation
Conversation
…Œ œ Ÿ ...) (storytold#546) pdfcraft_fonts::win_ansi, edit's is_win_ansi_char and the xtask demo encoder each carried a hand-written subset of WinAnsiEncoding's 0x80-0x9F row (quotes, dashes, euro, trademark) and left out Š š Ž ž Œ œ Ÿ ƒ † ‡ ˆ ˜ ‰ ‹ ›. Text editing therefore treated š/ž as non-WinAnsi and sent them to the Type3 fallback font (or refused them without craft-fonts), and every other generator (forms, annotations, OCR layer, redaction overlay, signatures, create) wrote them as '?'. win_ansi now goes through a new win_ansi_byte, which reads the 0x80-0x9F codes from the same ISO 32000-2 Annex D table the text extractor decodes with, and is_win_ansi_char reuses it. xtask doesn't depend on pdfcraft-fonts, so its demo encoder gets the full row with a pointer to the shared table. č/ć are not in WinAnsi and still use the fallback. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
PowerPoint users add QR codes through the QR4Office add-in; DeckCraft had nothing. Insert > QR Code opens a dialog for the link or text and the error correction level, and insert.qrCode draws the code as a group: a white square with the quiet zone and the dark modules as one vector path (a rectangle per run), so it stays sharp at any size and in PPTX and PDF. A URL also becomes the group's click link in a show, and the text goes into the alt text. Uses the qrcode crate (MIT/Apache-2.0) without its image feature. Co-authored-by: Cursor <cursoragent@cursor.com>
5382be5 to
602d82e
Compare
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: Insert gains QR codes for a link or any text. The lock gains qrcode 0.14.1 (without its image feature; the application draws the modules itself) and a comment in Cargo.toml ties it to #154. qrcode is a small, widely used crate with no further dependencies, which makes it a reasonable choice; the maintainers still approve every new dependency. The text length must be bounded (QR has a maximum capacity and the encoder returns an error beyond it, which must be shown), the quiet zone must be kept for scanners, and the inserted code should be a vector drawing so that it scales when printed. A test that encodes a known string and compares the module matrix is the proof. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
Summary
insert.qrCodecommand{text, rect?, level?, link?}(also available to CLI and MCP) inserts a "QR Code N" group. The group holds a white square that includes the quiet zone, plus the dark modules as one vector path with a rectangle per run. The code stays sharp at any size and survives PPTX and PDF as ordinary shapes.http(s)://,mailto:), it also becomes the group's click link in a show. The text goes into the alt text either way.qrcode0.14 (MIT/Apache-2.0) withdefault-features = false, so no image crate comes with it. It's a code dependency, not an asset.Closes #154
Test plan
qr_path_draws_the_finder_patterns: the size (version 3 plus the quiet zone), the top-left finder run, and oversized input refusedinsert_qr_code_adds_a_linked_group: a group with two children and unique ids, a URL becomes the link and plain text doesn't, empty or oversized text is refused, undo works, and the code survives a PPTX round triphttps://github.com/storytold/deckcraft/issues/154cargo xtask ci