diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 12a860e9..28bd17c7 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -4,7 +4,7 @@ Every asset PdfCraft includes, bundles or uses to build its published material, with its author, source and licence. The policy is in [AGENTS.md](AGENTS.md) §1. The machine-readable list, with SHA-256 hashes, is [ATTRIBUTION.toml](ATTRIBUTION.toml). Licence texts are kept beside the assets and summarised in [NOTICE](NOTICE). -## In this repository (262) +## In this repository (264) | Asset | Title | Author | Licence | Source | Used for | |---|---|---|---|---|---| @@ -232,6 +232,8 @@ Every asset PdfCraft includes, bundles or uses to build its published material, | `assets/app-icon/pdfcraft-1024.png` | PdfCraft app icon, 1024 px on Apple's icon grid | PdfCraft contributors (drawn by the project owner in ArtCraft; vectorised with craftrules vectorize_tile.py) | MIT OR Apache-2.0 | Contributor-original (see assets/app-icon/README.md) | Runtime window/Dock icon on macOS (apps/pdfcraft/src/main.rs) | | `assets/app-icon/pdfcraft.icns` | PdfCraft app icon (macOS .icns) | PdfCraft contributors (drawn by the project owner in ArtCraft; vectorised with craftrules vectorize_tile.py) | MIT OR Apache-2.0 | Contributor-original (see assets/app-icon/README.md) | macOS app bundle icon | | `assets/app-icon/pdfcraft.ico` | PdfCraft app icon (Windows .ico, 16-256 px) | PdfCraft contributors (drawn by the project owner in ArtCraft; vectorised with craftrules vectorize_tile.py) | MIT OR Apache-2.0 | Contributor-original (see assets/app-icon/README.md) | Embedded in pdfcraft.exe by apps/pdfcraft/build.rs (Explorer, taskbar, Start menu, Alt-Tab) | +| `assets/app-icon/pdfcraft-document.svg` | PdfCraft PDF document icon (master vector) | Lucide Icons and Contributors (document outline); PdfCraft contributors (PDF badge, lettering and composition) | ISC AND (MIT OR Apache-2.0) | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/file-text.svg); contributor-original composition (assets/app-icon/README.md) | Master artwork for the Windows PDF file type icon; rendered by packaging/icons.sh, without fonts or external images | +| `assets/app-icon/pdfcraft-document.ico` | PdfCraft PDF document icon (Windows .ico, 16-256 px) | Lucide Icons and Contributors (document outline); PdfCraft contributors (PDF badge, lettering and composition) | ISC AND (MIT OR Apache-2.0) | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/file-text.svg); contributor-original composition (assets/app-icon/README.md) | Embedded in pdfcraft.exe as resource 2; the Windows installer uses it for PdfCraft.Document and Applications/pdfcraft.exe PDF file associations | | `assets/app-icon/hicolor/16x16/apps/ai.storyteller.pdfcraft.png` | PdfCraft app icon, 16 px | PdfCraft contributors (drawn by the project owner in ArtCraft; vectorised with craftrules vectorize_tile.py) | MIT OR Apache-2.0 | Contributor-original (see assets/app-icon/README.md) | Linux hicolor theme icon (packaging/linux/ai.storyteller.pdfcraft.desktop) | | `assets/app-icon/hicolor/24x24/apps/ai.storyteller.pdfcraft.png` | PdfCraft app icon, 24 px | PdfCraft contributors (drawn by the project owner in ArtCraft; vectorised with craftrules vectorize_tile.py) | MIT OR Apache-2.0 | Contributor-original (see assets/app-icon/README.md) | Linux hicolor theme icon (packaging/linux/ai.storyteller.pdfcraft.desktop) | | `assets/app-icon/hicolor/32x32/apps/ai.storyteller.pdfcraft.png` | PdfCraft app icon, 32 px | PdfCraft contributors (drawn by the project owner in ArtCraft; vectorised with craftrules vectorize_tile.py) | MIT OR Apache-2.0 | Contributor-original (see assets/app-icon/README.md) | Linux hicolor theme icon (packaging/linux/ai.storyteller.pdfcraft.desktop) | diff --git a/ATTRIBUTION.toml b/ATTRIBUTION.toml index b7df46ac..e28d1527 100644 --- a/ATTRIBUTION.toml +++ b/ATTRIBUTION.toml @@ -2808,6 +2808,28 @@ kind = "icon" usage = "Embedded in pdfcraft.exe by apps/pdfcraft/build.rs (Explorer, taskbar, Start menu, Alt-Tab)" sha256 = "56daaaae9ae5389794909570885809adf5e1d9183bef2d9669ed2f9bba3ed6f5" +[[asset]] +path = "assets/app-icon/pdfcraft-document.svg" +title = "PdfCraft PDF document icon (master vector)" +author = "Lucide Icons and Contributors (document outline); PdfCraft contributors (PDF badge, lettering and composition)" +source = "https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/file-text.svg); contributor-original composition (assets/app-icon/README.md)" +licence = "ISC AND (MIT OR Apache-2.0)" +licence_file = "assets/app-icon/LICENSE-document.txt" +kind = "icon" +usage = "Master artwork for the Windows PDF file type icon; rendered by packaging/icons.sh, without fonts or external images" +sha256 = "8da8278c2b89362be0a960879d453ff879d7544d6d58e47d5389574e8dfff77b" + +[[asset]] +path = "assets/app-icon/pdfcraft-document.ico" +title = "PdfCraft PDF document icon (Windows .ico, 16-256 px)" +author = "Lucide Icons and Contributors (document outline); PdfCraft contributors (PDF badge, lettering and composition)" +source = "https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/file-text.svg); contributor-original composition (assets/app-icon/README.md)" +licence = "ISC AND (MIT OR Apache-2.0)" +licence_file = "assets/app-icon/LICENSE-document.txt" +kind = "icon" +usage = "Embedded in pdfcraft.exe as resource 2; the Windows installer uses it for PdfCraft.Document and Applications/pdfcraft.exe PDF file associations" +sha256 = "ba3f9128b368fc6d17d376cf62dbdbc22455451c5c8c4779210d7a2a7409b9e6" + [[asset]] path = "assets/app-icon/hicolor/16x16/apps/ai.storyteller.pdfcraft.png" title = "PdfCraft app icon, 16 px" diff --git a/NOTICE b/NOTICE index 62e047ec..72184779 100644 --- a/NOTICE +++ b/NOTICE @@ -13,6 +13,10 @@ This product bundles third-party material under its own licenses, listed below. list (author, source, license) is in ATTRIBUTION.md. - Lucide icons (assets/icons/*.svg) — ISC License. See assets/icons/LICENSE-lucide.txt. + The Windows PDF file icon (assets/app-icon/pdfcraft-document.svg and .ico) adapts Lucide's + file-text outline and combines it with contributor-original artwork. See + assets/app-icon/LICENSE-document.txt (ISC AND (MIT OR Apache-2.0)), packaged as + LICENSE-document.txt beside the Windows executables. - Inter typeface (assets/fonts/Inter-*.ttf) — SIL Open Font License 1.1. See assets/fonts/OFL-Inter.txt. - JetBrains Mono typeface (assets/fonts/JetBrainsMono-*.ttf) — SIL Open Font License 1.1. See assets/fonts/OFL-JetBrainsMono.txt. - Dancing Script typeface (assets/fonts/DancingScript.ttf), Copyright 2016 The Dancing Script Project Authors — SIL Open Font License 1.1 (Reserved Font Name "Dancing Script"). See assets/fonts/OFL-DancingScript.txt. diff --git a/apps/pdfcraft/build.rs b/apps/pdfcraft/build.rs index 2f61ed5c..35d519d9 100644 --- a/apps/pdfcraft/build.rs +++ b/apps/pdfcraft/build.rs @@ -1,5 +1,6 @@ //! Windows only: embed the app icon and version info (VERSIONINFO) into `pdfcraft.exe`, so it -//! shows in Explorer, the taskbar, the Start menu and Alt-Tab. +//! shows in Explorer, the taskbar, the Start menu and Alt-Tab. A separate PDF document icon +//! uses resource ID 2; the installer references it as `pdfcraft.exe,-2`. //! //! On every other target this does nothing. A missing resource compiler is a warning, so a //! cross-compile from macOS or Linux still links, unless `PDFCRAFT_REQUIRE_WINRES=1` turns it @@ -11,6 +12,7 @@ mod windows_manifest; fn main() { println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=../../assets/app-icon/pdfcraft.ico"); + println!("cargo:rerun-if-changed=../../assets/app-icon/pdfcraft-document.ico"); println!("cargo:rerun-if-changed=src/windows_manifest.rs"); println!("cargo:rerun-if-env-changed=PDFCRAFT_REQUIRE_WINRES"); if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") { @@ -18,6 +20,7 @@ fn main() { } let mut res = winresource::WindowsResource::new(); res.set_icon("../../assets/app-icon/pdfcraft.ico") + .set_icon_with_id("../../assets/app-icon/pdfcraft-document.ico", "2") .set_manifest(windows_manifest::WINDOWS_MANIFEST) .set("ProductName", "PdfCraft") .set("FileDescription", "PdfCraft PDF workbench") diff --git a/assets/app-icon/LICENSE-document.txt b/assets/app-icon/LICENSE-document.txt new file mode 100644 index 00000000..74b44ae1 --- /dev/null +++ b/assets/app-icon/LICENSE-document.txt @@ -0,0 +1,31 @@ +PdfCraft PDF document icon (pdfcraft-document.svg and pdfcraft-document.ico). +SPDX-License-Identifier: ISC AND (MIT OR Apache-2.0) + +The document outline and fold are adapted from Lucide file-text (lucide-static 1.49.0): +https://github.com/lucide-icons/lucide +The original is kept in assets/icons/file-text.svg. + +ISC License + +Copyright (c) 2026 Lucide Icons and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +The badge, outlined PDF lettering, colours and composition are original work +by the PdfCraft contributors. Copyright (c) 2026 PdfCraft contributors. +Licensed under either the MIT License or the Apache License, Version 2.0, +at your option. Full texts are LICENSE-MIT and LICENSE-APACHE at the +repository root, and beside this file in Windows distributions. + +The icon uses no typeface or external image. Regenerate the ICO with +packaging/icons.sh; every asset and its SHA-256 is recorded in ATTRIBUTION.toml. diff --git a/assets/app-icon/README.md b/assets/app-icon/README.md index 64eb9a30..10fb2d4c 100644 --- a/assets/app-icon/README.md +++ b/assets/app-icon/README.md @@ -33,6 +33,8 @@ Licence: [LICENSE.txt](LICENSE.txt) (`MIT OR Apache-2.0`, like the repo). | `pdfcraft-1024.png` | 1024 px on Apple's grid; also the runtime Dock icon on macOS | | `pdfcraft.icns` | macOS icon (16–1024 px) | | `pdfcraft.ico` | Windows icon (16–256 px), embedded in `pdfcraft.exe` by `apps/pdfcraft/build.rs` | +| `pdfcraft-document.svg` | Windows PDF file icon master: a Lucide document outline, green badge and outlined PDF lettering; no font dependency | +| `pdfcraft-document.ico` | Windows PDF file icon (16–256 px), embedded as resource 2 in `pdfcraft.exe` | | `hicolor/x/apps/ai.storyteller.pdfcraft.png` | Linux hicolor theme, 16–512 px; the 256 px one is the runtime icon on Windows and Linux | | `hicolor/scalable/apps/ai.storyteller.pdfcraft.svg` | Linux scalable icon (copy of the master) | @@ -40,6 +42,12 @@ Where it shows: `apps/pdfcraft/src/main.rs` sets the window icon (Dock, taskbar, Wayland app id `ai.storyteller.pdfcraft`; `packaging/linux/ai.storyteller.pdfcraft.desktop` names the hicolor icon. +Windows PDF files use resource 2 (`"pdfcraft.exe",-2`) when PdfCraft is chosen as the default +reader; the app keeps resource 1. The document outline is adapted from Lucide `file-text` +1.49.0 (ISC); its badge and outlined lettering are original (`MIT OR Apache-2.0`), covered by +[LICENSE-document.txt](LICENSE-document.txt). Both icons are embedded, requiring no runtime +sidecar. This provides a file type icon; first-page thumbnails still need a thumbnail provider. + ## Regenerate ```sh diff --git a/assets/app-icon/pdfcraft-document.ico b/assets/app-icon/pdfcraft-document.ico new file mode 100644 index 00000000..79967a80 Binary files /dev/null and b/assets/app-icon/pdfcraft-document.ico differ diff --git a/assets/app-icon/pdfcraft-document.svg b/assets/app-icon/pdfcraft-document.svg new file mode 100644 index 00000000..603a7401 --- /dev/null +++ b/assets/app-icon/pdfcraft-document.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/packaging/icons.sh b/packaging/icons.sh index e8b2c996..da8228ff 100755 --- a/packaging/icons.sh +++ b/packaging/icons.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash -# Regenerate every app icon from assets/app-icon/pdfcraft.svg (the master vector). +# Regenerate the app icons from assets/app-icon/pdfcraft.svg and the Windows PDF file icon +# from assets/app-icon/pdfcraft-document.svg. Both are master vectors. # # Needs: resvg (brew install resvg / cargo install resvg) and python3 (stdlib only, for the .ico). # On macOS, iconutil also writes the .icns. The outputs are committed, so building and packaging @@ -39,13 +40,15 @@ done mkdir -p "$DIR/hicolor/scalable/apps" cp "$SVG" "$DIR/hicolor/scalable/apps/$ID.svg" -# Windows .ico: PNG-compressed entries, 16-256 px. -ICO_PNGS=() -for s in 16 20 24 32 40 48 64 128 256; do - render "$SVG" "$s" "$TMP/ico-$s.png" - ICO_PNGS+=("$TMP/ico-$s.png") -done -python3 - "$DIR/pdfcraft.ico" "${ICO_PNGS[@]}" <<'PY' +# Windows .ico: PNG-compressed entries, 16-256 px. The document icon has its own resource +# in pdfcraft.exe; the app icon remains the first/default icon. +for name in pdfcraft pdfcraft-document; do + ICO_PNGS=() + for s in 16 20 24 32 40 48 64 128 256; do + render "$DIR/$name.svg" "$s" "$TMP/$name-$s.png" + ICO_PNGS+=("$TMP/$name-$s.png") + done + python3 - "$DIR/$name.ico" "${ICO_PNGS[@]}" <<'PY' import struct, sys out, pngs = sys.argv[1], sys.argv[2:] blobs = [open(p, "rb").read() for p in pngs] @@ -58,6 +61,7 @@ for b in blobs: offset += len(b) open(out, "wb").write(head + entries + data) PY +done # macOS .icns. if command -v iconutil >/dev/null; then diff --git a/packaging/windows/package.ps1 b/packaging/windows/package.ps1 index c556652d..524280b9 100644 --- a/packaging/windows/package.ps1 +++ b/packaging/windows/package.ps1 @@ -87,6 +87,12 @@ $Stage = Join-Path $TargetDir "windows-package\$Arch" Remove-Item -Recurse -Force $Stage -ErrorAction SilentlyContinue New-Item -ItemType Directory -Force -Path $Stage | Out-Null Copy-Item (Join-Path $Bin 'pdfcraft.exe'), (Join-Path $Bin 'pdfcraft-cli.exe') $Stage +# The document icon embeds Lucide artwork: carry its ISC notice and the project licences +# beside the binaries in both distributions. +foreach ($f in 'LICENSE-MIT', 'LICENSE-APACHE', 'NOTICE') { + Copy-Item (Join-Path $Root $f) $Stage +} +Copy-Item (Join-Path $Root 'assets\app-icon\LICENSE-document.txt') $Stage & (Join-Path $PSScriptRoot 'sign.ps1') (Join-Path $Stage 'pdfcraft.exe') (Join-Path $Stage 'pdfcraft-cli.exe') @@ -122,6 +128,9 @@ $Portable = Join-Path $TargetDir "windows-package\pdfcraft-$Version-windows-$Arc Remove-Item -Recurse -Force $Portable -ErrorAction SilentlyContinue New-Item -ItemType Directory -Force -Path $Portable | Out-Null Copy-Item (Join-Path $Stage '*.exe') $Portable +foreach ($f in 'NOTICE', 'LICENSE-document.txt') { + Copy-Item (Join-Path $Stage $f) $Portable +} Copy-Item -Recurse $Models (Join-Path $Portable 'models') foreach ($f in 'README.md', 'LICENSE', 'LICENSE-MIT', 'LICENSE-APACHE') { $p = Join-Path $Root $f diff --git a/packaging/windows/pdfcraft.wxs b/packaging/windows/pdfcraft.wxs index 200800af..11d2e39a 100644 --- a/packaging/windows/pdfcraft.wxs +++ b/packaging/windows/pdfcraft.wxs @@ -70,10 +70,13 @@ PdfCraft entry to pick was the advertised Start Menu shortcut, which Windows can't run as a file handler ("This app can't run on your PC"). --> - + + + @@ -136,6 +139,19 @@ + + + + + + + + + + + + +