Skip to content

Commit a103f18

Browse files
fontique: Make icu_properties optional (#72)
This doesn't seem like everyone using `fontique` will need this (or already have it in their dependency graph). I left this in `default` since that's the current behavior, but I think there's a good case for not doing so.
1 parent 8e10403 commit a103f18

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

fontique/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ workspace = true
1616
default = ["system"]
1717
std = ["skrifa/std", "peniko/std", "dep:memmap2"]
1818
libm = ["skrifa/libm", "peniko/libm", "dep:core_maths"]
19+
icu_properties = ["dep:icu_properties"]
1920
# Enables support for system font backends
2021
system = ["std"]
2122

@@ -26,7 +27,7 @@ smallvec = "1.13.2"
2627
memmap2 = { version = "0.9.4", optional = true }
2728
unicode-script = { version = "0.5.6", optional = true }
2829
core_maths = { version = "0.1.0", optional = true }
29-
icu_properties = "1.4.1"
30+
icu_properties = { version = "1.4.1", optional = true }
3031
icu_locid = "1.4.0"
3132
hashbrown = "0.14.5"
3233

fontique/src/script.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ impl Script {
2424
}
2525

2626
/// Returns the associated [`icu_properties::Script`] value.
27+
#[cfg(feature = "icu-properties")]
2728
pub fn icu_script(self) -> Option<icu_properties::Script> {
2829
let mapper = icu_properties::Script::name_to_enum_mapper();
2930
let s = core::str::from_utf8(&self.0).ok()?;
@@ -67,6 +68,7 @@ impl From<&str> for Script {
6768
}
6869
}
6970

71+
#[cfg(feature = "icu-properties")]
7072
impl From<icu_properties::Script> for Script {
7173
fn from(value: icu_properties::Script) -> Self {
7274
Self(

0 commit comments

Comments
 (0)