Commit Graph
33 Commits
Author SHA1 Message Date
Brandon ThomasandClaude Opus 5.5 d20b08e3af Tests: drop the units test's PNG debug hook; the PDF link test's doc says only web and mail links export
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 13:43:25 -04:00
Brandon Thomas 556048436e Merge pull request #1221 2026-10-25 13:42:06 -04:00
Dylan M. TaylorandClaude Sonnet 5.5 7d4c49051c refactor: explicit imports in engine/anim/geom/model/render/text/pdf/ogg modules (SonarCloud S2208) (#1270)
* refactor: explicit imports instead of glob imports in command and test modules (SonarCloud S2208)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix: geom extra imports

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix: drop unused imports

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix: restore explicit imports in test modules (SonarCloud S2208)

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 13:18:05 -04:00
oracola91 920925abae PDF export keeps only the links the slide show opens
A denylist can't keep up with OS protocol handlers: ms-msdt:, ms-word:
with a share path, ldap: and file:///%5C%5Chost/share still went into
exported PDFs. PDF export now writes a URL link only when safe_url
allows it, the check the slide show already uses on a click: http,
https and mailto. Links between slides are unchanged, and any other
link's text stays on the page without the link.

safe_url moves from deckcraft-anim to deckcraft-model, which both
crates use; deckcraft_anim::safe_url stays as a re-export. Local file:
and relative links are left out for now, as asked in review.
2026-10-24 13:31:06 +03:00
oracola91 274b626007 Test: every link of the unsafe-link test sits on the slide
The last links started below the 540 pt slide. They were still
exported, as zero-height annotations at the page edge, so the test
worked, but only because of that. With all 16 links on the slide the
test no longer depends on how off-page links are handled.
2026-10-24 13:27:00 +03:00
oracola91 afb52aeef3 PDF export also drops search: and search-ms: links
Windows Search's search: and search-ms: links can name a folder on
another machine through crumb=location:, and opening one connects to
that host and sends the user's NTLM credentials. They are now left out
of the PDF like the other network-share links, and the test covers both.
2026-10-24 13:27:00 +03:00
oracola91 8c4907a626 PDF export also drops smb: links
An smb://host/share link is a path to another machine too: opening it
connects to that host (macOS and Linux file managers open these links).
It is now left out of the PDF like the other network-share links, and
the test covers it.
2026-10-24 13:27:00 +03:00
oracola91 8fd1c1716f PDF export drops javascript:, vbscript:, data: and network-share links
A slide hyperlink from an untrusted deck became a PDF link whatever it
pointed at. Script and data links, and links to another machine (UNC
\\host\share, //host/share, file://host/...), are now left out of the
PDF; the text stays. On Windows, opening a network path sends the
user's NTLM credentials to that host.

Web, mail, local file: and relative links are kept. The scheme is read
the way a browser reads it: control characters dropped, leading spaces
trimmed, any case. The slide show already refuses these links
(safe_url), and cadcraft's PDF export drops script and data links.
2026-10-24 13:27:00 +03:00
5fadda5ecf chore: resolve SonarCloud maintainability issues (#1255)
* chore: resolve SonarCloud maintainability issues

* fix: address shellcheck SC2059 and fix generic cast ambiguity

* style: apply rustfmt formatting

* fix: restore compile and behaviour in Sonar refactors

- fonts: char::is_alphanumeric takes &self, so filter needs a closure
- h264: keep the mvd accumulator as i32 (prefix is usize)
- model: annotate the non-stacked range accumulators as f64
- engine: chart.options still clears the raw chart XML for upDownBars
  and quartiles; smartart goes back to the glob import (cmd! macro)
- web: keep the original viewport meta (behaviour change)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Assign positional parameters to locals in sha256 verification

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Dylan Taylor <dylan@craftmaker.dev>
2026-10-23 23:28:09 -04:00
aiongg b913c4f9d0 PDF: pin craft-pdf and krilla to craft-libs main (#1253)
* PDF: pin craft-pdf and krilla to craft-libs main (PNG decode bound)

* PDF: pin craft-pdf and krilla to craft-libs at 9f75d3dc (#254)
2026-10-23 22:37:28 -04:00
MarekSpodBiedry c4a459d1ca Cap the PDF slide raster by total pixel count (#1178) 2026-10-22 21:03:42 +02:00
Fabian 887e868a46 fix: DeckCraft upstream #845
PDF export rasterized every slide as one full-page bitmap, so the
background, master and layout graphics a deck repeats were stored once
per slide. Draw each slide as its backdrop plus the slide's own shapes;
equal backdrops become equal images and the writer stores each once.
2026-10-17 15:52:54 +02:00
skylar taylor-barrick 0cbe475f13 fix(pdf): reconcile writer with notes and handout masters (PDFW)
Preserve notes and handout master export, visible text and native parallel
compression while propagating shared font errors through each export path.
Keep the dependency check accurate for native and WASM feature resolution.

PR #708.
2026-10-14 19:44:21 -06:00
Brandon ThomasandClaude Opus 5.5 67e1ab6373 Merge PR #438 from albayazid: Model: an exhausted id space refuses growth instead of duplicating ids (#407)
Conflicts resolved onto main's newer shape, and the PR's policy applied to
every alloc_id/add_media/new_slide call site main has grown since: commands
answer bad(cmd, NO_ID_SPACE) (slide.reuse, insert.zoom, SmartArt, photo
album, review.accept, handout/notes masters, master placeholders,
background/artistic/compress pictures, transition sound, ink to shape,
paste special, file.new templates); reid/bring_media/renumber/regenerate
and compare::adopt/accept are fallible; outline import keeps what fit.
Tests use expect() on the now-Option results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 16:24:26 -04:00
Brandon ThomasandClaude Opus 5.5 8ee597216d Fix up landed PRs from review
- #178: ToUnicode ranges looked up without indexing
- #465: frame_num gaps are concealed (bounded) even when the SPS forbids them; cut streams keep playing
- #471: control request lines up to 256 MB so picture/media inserts still fit
- #473: a merge that loses its only row or column is removed, with regression tests
- #521: AutoCorrect no longer rewrites real words (cant, wont, im)
- #654: inherit_placeholder_geometry's doc comment back on its function

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 14:31:01 -04:00
Brandon Thomas 31390e5e21 Merge PR #178 from MarekSpodBiedry: PDF: map each glyph to its shaping cluster's text in ToUnicode (#164)
# Conflicts:
#	crates/pdf/src/tests.rs
2026-10-14 14:24:15 -04:00
Brandon Thomas 76bfc19dfa Merge PR #592 from NikitkaRa: Notes Page view draws master text wrapped (stacked on #583) 2026-10-14 13:30:54 -04:00
Brandon Thomas 4cd6412a3c Merge PR #583 from NikitkaRa: PDF master header/footer text wraps and keeps mixed formatting (stacked on #580)
# Conflicts:
#	crates/render/src/lib.rs
#	crates/render/src/placed.rs
2026-10-14 13:30:43 -04:00
Brandon Thomas 6f634a9809 Merge PR #580 from NikitkaRa: Notes Master slide preview; master header/footer text keeps its formatting (stacked on #577) 2026-10-14 13:30:28 -04:00
Brandon Thomas 2d8014c706 Merge PR #577 from NikitkaRa: Notes pages and PDF handouts follow their masters (stacked on #573)
# Conflicts:
#	crates/pdf/src/lib.rs
#	crates/pdf/src/tests.rs
2026-10-14 13:30:22 -04:00
Brandon Thomas 99e9774408 Merge PR #566 from NikitkaRa: Make PDF export ~2.8× faster with byte-identical output 2026-10-14 13:08:54 -04:00
skylar taylor-barrick 42fb6728fa PDFW2: use fixed-size chunks in PDF text regression 2026-10-14 00:11:33 -06:00
Nikita Rakitin ec725a4e6b Notes Page view: draw master text wrapped, as the PDF does
pdf::master_text_pieces turns the text engine's layout of the notes
master's header, date, footer and page number into per-run, per-line
pieces scaled to the page; the Notes Page view paints them in their
sizes and colours. Stacked on #583.
2026-10-14 01:10:03 +03:00
Nikita Rakitin 11e63e31e1 Lay out master header/footer text with the text engine in PDF pages
Notes pages and handouts lay out the master's header, date, footer and
page-number placeholders with deckcraft-text (render::place_master_texts),
so their text wraps in the placeholder and keeps mixed run formatting,
drawn as visible glyphs. Stacked on #580.
2026-10-14 00:44:09 +03:00
Nikita Rakitin 32fcaec293 Preview the slide in Notes Master view; print master text in its own style
Notes Master view draws the current slide inside the slide-image
placeholder. Header, date, footer and page-number text on notes pages
and handouts (PDF and the Notes Page view) uses the placeholder's
resolved font, size, weight, slant and colour, scaled with the page.
Stacked on #577.
2026-10-14 00:40:09 +03:00
Nikita Rakitin 6fcf392370 Lay out notes pages and handouts from their masters
PDF notes pages and the Notes Page view put the slide (keeping its aspect)
and the notes where the notes master's slide-image and body placeholders
are, scaled from the notes size to the paper, and print the master's
header, date, footer and page number. PDF handouts print the handout
master's. Decks without these masters keep the old layout. Stacked on #573.
2026-10-14 00:35:26 +03:00
Nikita Rakitin c52b3142c4 Make PDF export ~2.8x faster without changing its bytes
krilla compressed each slide's print-resolution artwork on the export
thread; with its rayon feature (desktop only) the deflate runs in the
background while the next slide renders. The rendered pixels are also
moved into the image instead of copied.
2026-10-14 00:13:14 +03:00
skylar taylor-barrick c536c6e905 PDFW2: adopt shared PDF writer with explicit embedding errors 2026-10-13 13:39:33 -06:00
Nikita RakitinandCursor e6920f8ebe Print: choose paper size and orientation for notes and handouts
The Print page always laid notes pages and handouts out on portrait US
Letter. It now offers Letter, A4, Legal and A3 in portrait or landscape,
as PowerPoint's Print settings do, and the preview shows the chosen
page. file.export, app.print and the MCP export tool take the same
`paper` and `orientation` params; unknown values are an error. A notes
page keeps its slide within the top half of the page, so landscape
paper still leaves room for the notes. Full-page slides still print on
slide-shaped pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-13 21:43:54 +03:00
Sazid Al Bayazid e70fce996b Model: an exhausted id space refuses growth instead of duplicating ids (#407)
alloc_id bumped next_id with saturating_add: a presentation whose
next_id reached u32::MAX (a hostile file can arrive that way;
fix_next_id imports it) handed out that same id to every new slide,
shape, layout and media - duplicate ids, ambiguous references, silent
corruption on every later insert.

alloc_id now returns Option<u32> via checked_add, and every caller
refuses: the engine's insert/duplicate/media/layout commands answer
with a clear error naming the command, paste and duplicate re-id
helpers propagate it, media addition is fallible, and a fresh slide is
Option. The pptx export's synthesized blank layout is guarded the same
way. Loading keeps such a deck viewable: repair re-ids duplicate
slides while it can, and a duplicate it cannot re-id stays as it is -
growth is refused, and only that duplicate keeps its ambiguous id.

Renumbering the loaded graph was rejected: it needs the
cross-document reference remapping that issue #406 tracks.

Tests: model exhaustion (alloc_id None, fresh media refused, a new
slide refused), engine (slide.new, shape.insert, slide.duplicate and
edit.duplicate all refuse; the document holds no duplicate ids),
format repair (an unre-id-able duplicate stays visible).
2026-10-13 21:13:25 +06:00
MarekSpodBiedry dd404af8b5 PDF: map each glyph to its shaping cluster's text in ToUnicode (#164) 2026-10-11 23:39:32 +02:00
Brandon ThomasandClaude Opus 5.5 ae9d525bce Rename SlideCraft to DeckCraft: crates, apps, binaries, app id, file extension (.deckcraft; .slidecraft files still open), packaging, docs; ROADMAP alpha and parity estimates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 01:46:40 -04:00
Brandon ThomasandClaude Opus 5.5 639957c68a PDF export: slides, notes pages and handouts with selectable text layer, links and bookmarks; Export dialog PDF options
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 00:39:54 -04:00