Repository navigation
Update ICU4X to 2.4, remove now-unneeded CJ_SEGMENTER - #9003
Manishearth wants to merge 1 commit into
Conversation
|
Someone should also remove the asset from |
|
It looks like the tests disagree with you. The CJ segmenter patch changes the properties of U+201C Note that I'm just saying that this PR introduces a regression at present. Links to icu4x issues:
UpdateIf we switch to the neo segmenter, then the above two tests pass. It even resolves #6774. However, another three tests fail:
Code to switch to the neo segmenterdiff --git a/Cargo.toml b/Cargo.toml
index ea6ffbf9b..b0a836d15 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -71,7 +71,7 @@ hypher = "0.1.8"
icu_collator = { version = "2.4.0" }
icu_properties = { version = "2.4.0" }
icu_provider = { version = "2.4.0", features = ["sync"] }
-icu_segmenter = { version = "2.4.0" }
+icu_segmenter = { version = "2.4.0", features = ["unstable"] }
image = { version = "0.25.5", default-features = false, features = ["png", "jpeg", "gif", "webp"] }
indexmap = { version = "2", features = ["serde", "rayon"] }
infer = { version = "0.19.0", default-features = false }
diff --git a/crates/typst-layout/src/inline/linebreak.rs b/crates/typst-layout/src/inline/linebreak.rs
index 148a00b6c..6acbd4aa7 100644
--- a/crates/typst-layout/src/inline/linebreak.rs
+++ b/crates/typst-layout/src/inline/linebreak.rs
@@ -35,7 +35,7 @@ const BOUND_EPS: f64 = 1e-3;
/// The general line break segmenter.
static SEGMENTER: LazyLock<LineSegmenterBorrowed> =
- LazyLock::new(|| LineSegmenter::new_lstm(LineBreakOptions::default()));
+ LazyLock::new(|| LineSegmenter::new_neo_for_non_complex_scripts(LineBreakOptions::default()));
/// The Unicode line break properties for each code point.
const LINEBREAK_DATA: CodePointMapDataBorrowed<LineBreak> = |
|
Aha, I see the problem. The updated ICU4X APIs are still on the old engine, ICU4X 2.4 has Unless you're okay using unstable APIs. |



Fixes #9002