Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fontique: Make icu_properties optional #72

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion fontique/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ workspace = true
default = ["system"]
std = ["skrifa/std", "peniko/std", "dep:memmap2"]
libm = ["skrifa/libm", "peniko/libm", "dep:core_maths"]
icu_properties = ["dep:icu_properties"]
# Enables support for system font backends
system = ["std"]

Expand All @@ -26,7 +27,7 @@ smallvec = "1.13.2"
memmap2 = { version = "0.9.4", optional = true }
unicode-script = { version = "0.5.6", optional = true }
core_maths = { version = "0.1.0", optional = true }
icu_properties = "1.4.1"
icu_properties = { version = "1.4.1", optional = true }
icu_locid = "1.4.0"
hashbrown = "0.14.5"

Expand Down
2 changes: 2 additions & 0 deletions fontique/src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ impl Script {
}

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

#[cfg(feature = "icu-properties")]
impl From<icu_properties::Script> for Script {
fn from(value: icu_properties::Script) -> Self {
Self(
Expand Down