From aecd4c777cc5724b12b8dd9c0a3bcad0f425660a Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 31 Oct 2023 16:16:33 +0100 Subject: [PATCH 1/4] Bump `fontdb` to `0.16` We were getting duplicate `ttf-parser` dependencies because of `rustybuzz` releasing its `ttf-parser 0.20` upgrade out of sync with `fontdb 0.16`, whose update just got published. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index b04f5fa..ed57a57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ repository = "https://github.com/pop-os/cosmic-text" rust-version = "1.65" [dependencies] -fontdb = { version = "0.15.0", default-features = false } +fontdb = { version = "0.16.0", default-features = false } libm = "0.2.8" log = "0.4.20" rustybuzz = { version = "0.11.0", default-features = false, features = ["libm"] } From ed67add28a09cab342e8537ef2e061fd175aa2ad Mon Sep 17 00:00:00 2001 From: hz Date: Sat, 4 Nov 2023 14:31:18 +0100 Subject: [PATCH 2/4] Don't use Emoji fonts as monospace fallback --- src/font/fallback/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/font/fallback/mod.rs b/src/font/fallback/mod.rs index 4cf4382..845cf5d 100644 --- a/src/font/fallback/mod.rs +++ b/src/font/fallback/mod.rs @@ -130,10 +130,14 @@ impl<'a> Iterator for FontFallbackIter<'a> { } // Set a monospace fallback if Monospace family is not found if self.default_families[self.default_i - 1] == &Family::Monospace - && self.font_system.db().face(*id).map(|f| f.monospaced) == Some(true) && monospace_fallback.is_none() { - monospace_fallback = Some(id); + if let Some(face_info) = self.font_system.db().face(*id) { + // Don't use emoji fonts as Monospace + if face_info.monospaced && !face_info.post_script_name.contains("Emoji") { + monospace_fallback = Some(id); + } + } } } // If default family is Monospace fallback to first monospaced font From 2c987b6c96bdb44b2d240ce9852c074fec13a19e Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 31 Oct 2023 16:21:48 +0100 Subject: [PATCH 3/4] deny: Disallow duplicate dependency versions again Partially reverts 587bb5c98ff4ce0a5aa123b72c40d6fa3fffb335. --- deny.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deny.toml b/deny.toml index d62f5a4..8552094 100644 --- a/deny.toml +++ b/deny.toml @@ -179,7 +179,7 @@ registries = [ # https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html [bans] # Lint level for when multiple versions of the same crate are detected -multiple-versions = "warn" +multiple-versions = "deny" # Lint level for when a crate version requirement is `*` wildcards = "allow" # The graph highlighting used when creating dotgraphs for crates From d242307b6dbb0d44ac6dace55ac16cbb7108cdd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20=C3=96dmark?= Date: Thu, 16 Nov 2023 21:47:41 +0100 Subject: [PATCH 4/4] refresh the attrs more often in basic shaping, or colors are not updated correctly --- src/shape.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shape.rs b/src/shape.rs index 53cba57..a1a16b8 100644 --- a/src/shape.rs +++ b/src/shape.rs @@ -345,6 +345,7 @@ fn shape_skip( .map(|(i, codepoint)| { let glyph_id = charmap.map(codepoint); let x_advance = glyph_metrics.advance_width(glyph_id); + let attrs = attrs_list.get_span(i); ShapeGlyph { start: i,