diff --git a/Cargo.toml b/Cargo.toml index 1e82553..7202f6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,11 +9,10 @@ documentation = "https://docs.rs/cosmic-text/latest/cosmic_text/" repository = "https://github.com/pop-os/cosmic-text" [dependencies] -fontdb = { version = "0.10.0", default-features = false } +fontdb = { version = "0.13.0", default-features = false } libm = "0.2.6" log = "0.4.17" -ouroboros = "0.15.5" -rustybuzz = { version = "0.6.0", default-features = false, features = ["libm"] } +rustybuzz = { version = "0.7.0", default-features = false, features = ["libm"] } swash = { version = "0.1.6", optional = true } syntect = { version = "5.0.0", optional = true } sys-locale = { version = "0.2.3", optional = true } diff --git a/deny.toml b/deny.toml index fda1256..04c6416 100644 --- a/deny.toml +++ b/deny.toml @@ -112,6 +112,7 @@ allow = [ "Apache-2.0", "Unicode-DFS-2016", "BSD-2-Clause", + "Zlib", #"Apache-2.0 WITH LLVM-exception", ] # List of explicitly disallowed licenses @@ -163,8 +164,8 @@ exceptions = [ # and the crate will be checked normally, which may produce warnings or errors # depending on the rest of your configuration #license-files = [ - # Each entry is a crate relative path, and the (opaque) hash of its contents - #{ path = "LICENSE", hash = 0xbd0eed23 } +# Each entry is a crate relative path, and the (opaque) hash of its contents +#{ path = "LICENSE", hash = 0xbd0eed23 } #] [licenses.private] diff --git a/src/cache.rs b/src/cache.rs index ce93b38..0da1f52 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -1,10 +1,12 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 +use crate::FontKey; + /// Key for building a glyph cache #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct CacheKey { - /// Font ID - pub font_id: fontdb::ID, + /// Font key + pub font_key: FontKey, /// Glyph ID pub glyph_id: u16, /// `f32` bits of font size @@ -17,7 +19,7 @@ pub struct CacheKey { impl CacheKey { pub fn new( - font_id: fontdb::ID, + font_key: FontKey, glyph_id: u16, font_size: f32, pos: (f32, f32), @@ -26,7 +28,7 @@ impl CacheKey { let (y, y_bin) = SubpixelBin::new(pos.1); ( Self { - font_id, + font_key, glyph_id, font_size_bits: font_size.to_bits(), x_bin, diff --git a/src/font/fallback/mod.rs b/src/font/fallback/mod.rs index 7b8fa8c..752bd02 100644 --- a/src/font/fallback/mod.rs +++ b/src/font/fallback/mod.rs @@ -1,11 +1,10 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 -use alloc::sync::Arc; #[cfg(not(feature = "std"))] use alloc::vec::Vec; use unicode_script::Script; -use crate::Font; +use crate::{Font, FontKey}; use self::platform::*; @@ -26,7 +25,8 @@ mod platform; mod platform; pub struct FontFallbackIter<'a> { - fonts: &'a [Arc>], + db: &'a fontdb::Database, + font_keys: &'a [FontKey], default_families: &'a [&'a str], default_i: usize, scripts: Vec