summaryrefslogtreecommitdiff
path: root/tests/fuzz
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 /tests/fuzz
parent5036c5acebebe12cbf14338f5413514251d83d1e (diff)
Externalize assets (#3515)
Diffstat (limited to 'tests/fuzz')
-rw-r--r--tests/fuzz/Cargo.toml1
-rw-r--r--tests/fuzz/src/compile.rs5
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/fuzz/Cargo.toml b/tests/fuzz/Cargo.toml
index 1b9e6b26..ddad37d6 100644
--- a/tests/fuzz/Cargo.toml
+++ b/tests/fuzz/Cargo.toml
@@ -9,6 +9,7 @@ cargo-fuzz = true
[dependencies]
typst = { workspace = true }
+typst-assets = { workspace = true, features = ["fonts"] }
typst-render = { workspace = true }
typst-syntax = { workspace = true }
comemo = { workspace = true }
diff --git a/tests/fuzz/src/compile.rs b/tests/fuzz/src/compile.rs
index 883b9ea3..2d445bf5 100644
--- a/tests/fuzz/src/compile.rs
+++ b/tests/fuzz/src/compile.rs
@@ -10,8 +10,6 @@ use typst::text::{Font, FontBook};
use typst::visualize::Color;
use typst::{Library, World};
-const FONT: &[u8] = include_bytes!("../../../assets/fonts/LinLibertine_R.ttf");
-
struct FuzzWorld {
library: Prehashed<Library>,
book: Prehashed<FontBook>,
@@ -21,7 +19,8 @@ struct FuzzWorld {
impl FuzzWorld {
fn new(text: &str) -> Self {
- let font = Font::new(FONT.into(), 0).unwrap();
+ let data = typst_assets::fonts().next().unwrap();
+ let font = Font::new(Bytes::from_static(data), 0).unwrap();
let book = FontBook::from_fonts([&font]);
Self {
library: Prehashed::new(Library::default()),