summaryrefslogtreecommitdiff
path: root/crates/typst-pdf
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-02-28 11:06:54 +0100
committerGitHub <noreply@github.com>2024-02-28 10:06:54 +0000
commite16d3f5a67a31154797b4d56cdc6ed142ee2a7cf (patch)
tree31dcd2243c2b51bac62fe19e7e60efe5f6289281 /crates/typst-pdf
parent5036c5acebebe12cbf14338f5413514251d83d1e (diff)
Externalize assets (#3515)
Diffstat (limited to 'crates/typst-pdf')
-rw-r--r--crates/typst-pdf/Cargo.toml1
-rw-r--r--crates/typst-pdf/src/color.rs6
-rw-r--r--crates/typst-pdf/src/icc/sGrey-v4.iccbin360 -> 0 bytes
-rw-r--r--crates/typst-pdf/src/icc/sRGB-v4.iccbin480 -> 0 bytes
-rw-r--r--crates/typst-pdf/src/oklab.ps (renamed from crates/typst-pdf/src/postscript/oklab.ps)0
5 files changed, 4 insertions, 3 deletions
diff --git a/crates/typst-pdf/Cargo.toml b/crates/typst-pdf/Cargo.toml
index 3dcddbb0..dd71b61e 100644
--- a/crates/typst-pdf/Cargo.toml
+++ b/crates/typst-pdf/Cargo.toml
@@ -17,6 +17,7 @@ bench = false
[dependencies]
typst = { workspace = true }
+typst-assets = { workspace = true }
typst-macros = { workspace = true }
typst-timing = { workspace = true }
base64 = { workspace = true }
diff --git a/crates/typst-pdf/src/color.rs b/crates/typst-pdf/src/color.rs
index f0d483cf..4c35d9a2 100644
--- a/crates/typst-pdf/src/color.rs
+++ b/crates/typst-pdf/src/color.rs
@@ -19,13 +19,13 @@ const OKLAB_B: Name<'static> = Name(b"B");
// The ICC profiles.
static SRGB_ICC_DEFLATED: Lazy<Vec<u8>> =
- Lazy::new(|| deflate(include_bytes!("icc/sRGB-v4.icc")));
+ Lazy::new(|| deflate(typst_assets::icc::S_RGB_V4));
static GRAY_ICC_DEFLATED: Lazy<Vec<u8>> =
- Lazy::new(|| deflate(include_bytes!("icc/sGrey-v4.icc")));
+ Lazy::new(|| deflate(typst_assets::icc::S_GREY_V4));
// The PostScript functions for color spaces.
static OKLAB_DEFLATED: Lazy<Vec<u8>> =
- Lazy::new(|| deflate(minify(include_str!("postscript/oklab.ps")).as_bytes()));
+ Lazy::new(|| deflate(minify(include_str!("oklab.ps")).as_bytes()));
/// The color spaces present in the PDF document
#[derive(Default)]
diff --git a/crates/typst-pdf/src/icc/sGrey-v4.icc b/crates/typst-pdf/src/icc/sGrey-v4.icc
deleted file mode 100644
index 2187b678..00000000
--- a/crates/typst-pdf/src/icc/sGrey-v4.icc
+++ /dev/null
Binary files differ
diff --git a/crates/typst-pdf/src/icc/sRGB-v4.icc b/crates/typst-pdf/src/icc/sRGB-v4.icc
deleted file mode 100644
index d9f3c055..00000000
--- a/crates/typst-pdf/src/icc/sRGB-v4.icc
+++ /dev/null
Binary files differ
diff --git a/crates/typst-pdf/src/postscript/oklab.ps b/crates/typst-pdf/src/oklab.ps
index e766bbd8..e766bbd8 100644
--- a/crates/typst-pdf/src/postscript/oklab.ps
+++ b/crates/typst-pdf/src/oklab.ps