From e16d3f5a67a31154797b4d56cdc6ed142ee2a7cf Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 28 Feb 2024 11:06:54 +0100 Subject: Externalize assets (#3515) --- tests/fuzz/Cargo.toml | 1 + tests/fuzz/src/compile.rs | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/fuzz') 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, book: Prehashed, @@ -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()), -- cgit v1.2.3