summaryrefslogtreecommitdiff
path: root/library/src
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2023-06-20 12:11:20 -0400
committerGitHub <noreply@github.com>2023-06-20 18:11:20 +0200
commitc0c03812d08bc833b8a2477c594d762f43a0c95b (patch)
tree7ecf451953b39779b2580dfcb7b2e8def108ff47 /library/src
parent57d4b8b75175c2fb169ab24ae683f580bcd42c99 (diff)
Move assets/data to library/assets (#1515)
So these assets lives inside the typst-library crate and doesn't break `cargo vendor`
Diffstat (limited to 'library/src')
-rw-r--r--library/src/layout/par.rs8
-rw-r--r--library/src/text/raw.rs5
2 files changed, 6 insertions, 7 deletions
diff --git a/library/src/layout/par.rs b/library/src/layout/par.rs
index 2d0944ce..6170a34d 100644
--- a/library/src/layout/par.rs
+++ b/library/src/layout/par.rs
@@ -1016,23 +1016,23 @@ fn linebreak_optimized<'a>(vt: &Vt, p: &'a Preparation<'a>, width: Abs) -> Vec<L
///
/// ```sh
/// icu4x-datagen --locales full --keys-for-bin target/debug/typst \
-/// --format blob --out assets/data/icudata.postcard --overwrite
+/// --format blob --out library/assets/icudata.postcard --overwrite
/// ```
///
/// Install icu4x-datagen with `cargo install icu4x-datagen`.
-static ICU_DATA: &[u8] = include_bytes!("../../../assets/data/icudata.postcard");
+static ICU_DATA: &[u8] = include_bytes!("../../assets/icudata.postcard");
/// Generated by the following command:
///
/// ```sh
/// icu4x-datagen --locales zh ja --keys segmenter/line@1 --format blob \
-/// --out assets/data/cj_linebreak_data.postcard --overwrite
+/// --out library/assets/cj_linebreak_data.postcard --overwrite
/// ```
///
/// The used icu4x-datagen should be patched by
/// https://github.com/peng1999/icu4x/commit/b9beb6cbf633d61fc3d7983e5baf7f4449fbfae5
static CJ_LINEBREAK_DATA: &[u8] =
- include_bytes!("../../../assets/data/cj_linebreak_data.postcard");
+ include_bytes!("../../assets/cj_linebreak_data.postcard");
/// The general line break segmenter.
static SEGMENTER: Lazy<LineSegmenter> = Lazy::new(|| {
diff --git a/library/src/text/raw.rs b/library/src/text/raw.rs
index 747a75d1..1cb3cab1 100644
--- a/library/src/text/raw.rs
+++ b/library/src/text/raw.rs
@@ -343,9 +343,8 @@ fn to_syn(RgbaColor { r, g, b, a }: RgbaColor) -> synt::Color {
/// syntaxes/02_Extra/VimHelp.sublime-syntax
/// syntaxes/02_Extra/cmd-help/syntaxes/cmd-help.sublime-syntax
/// ```
-static SYNTAXES: Lazy<syntect::parsing::SyntaxSet> = Lazy::new(|| {
- syntect::dumps::from_binary(include_bytes!("../../../assets/data/syntect.bin"))
-});
+static SYNTAXES: Lazy<syntect::parsing::SyntaxSet> =
+ Lazy::new(|| syntect::dumps::from_binary(include_bytes!("../../assets/syntect.bin")));
/// The default theme used for syntax highlighting.
pub static THEME: Lazy<synt::Theme> = Lazy::new(|| synt::Theme {