Skip to content

Commit

Permalink
fontique: Make an explicit feature for unicode_script. (#73)
Browse files Browse the repository at this point in the history
Despite the crate name using a hyphen, the feature uses an underscore to
make it match the other Linebender crate features.
  • Loading branch information
waywardmonkeys authored Jun 6, 2024
1 parent 3268c22 commit 8f2deea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions fontique/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ default = ["system"]
std = ["skrifa/std", "peniko/std", "dep:memmap2"]
libm = ["skrifa/libm", "peniko/libm", "dep:core_maths"]
icu_properties = ["dep:icu_properties"]
unicode_script = ["dep:unicode-script"]
# Enables support for system font backends
system = ["std"]

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

/// Returns the associated [`unicode_script::Script`] value.
#[cfg(feature = "unicode-script")]
#[cfg(feature = "unicode_script")]
pub fn unicode_script(self) -> Option<unicode_script::Script> {
unicode_script::Script::from_short_name(core::str::from_utf8(&self.0).ok()?)
}
Expand Down Expand Up @@ -80,7 +80,7 @@ impl From<icu_properties::Script> for Script {
}
}

#[cfg(feature = "unicode-script")]
#[cfg(feature = "unicode_script")]
impl From<unicode_script::Script> for Script {
fn from(value: unicode_script::Script) -> Self {
Self(value.short_name().as_bytes().try_into().unwrap_or_default())
Expand Down

0 comments on commit 8f2deea

Please sign in to comment.