From 423fee81d4f65857dc2e8bf8d7169fe924efb9da Mon Sep 17 00:00:00 2001 From: Felix Zwettler Date: Sun, 4 Feb 2024 11:27:50 +0100 Subject: [PATCH 1/4] Bump versions of pango, cairo, svg crates --- piet-cairo/Cargo.toml | 6 +++--- piet-cairo/src/lib.rs | 2 +- piet-common/Cargo.toml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/piet-cairo/Cargo.toml b/piet-cairo/Cargo.toml index bbb82bd6..4774ed4b 100644 --- a/piet-cairo/Cargo.toml +++ b/piet-cairo/Cargo.toml @@ -13,9 +13,9 @@ categories = ["rendering::graphics-api"] [dependencies] piet = { version = "=0.6.2", path = "../piet" } -cairo-rs = { version = "0.18.0", default-features = false } # We don't need glib -pango = { version = "0.18.0", features = ["v1_44"] } -pangocairo = "0.18.0" +cairo-rs = { version = "0.19.0", default-features = false } # We don't need glib +pango = { version = "0.19.0", features = ["v1_44"] } +pangocairo = "0.19.0" unicode-segmentation = "1.10.0" xi-unicode = "0.3.0" diff --git a/piet-cairo/src/lib.rs b/piet-cairo/src/lib.rs index 583a37fd..7635d9f2 100644 --- a/piet-cairo/src/lib.rs +++ b/piet-cairo/src/lib.rs @@ -172,7 +172,7 @@ impl<'a> RenderContext for CairoRenderContext<'a> { let pos = pos.into(); let offset = layout.pango_offset(); self.ctx.move_to(pos.x - offset.x, pos.y - offset.y); - pangocairo::show_layout(self.ctx, layout.pango_layout()); + pangocairo::functions::show_layout(self.ctx, layout.pango_layout()); } fn save(&mut self) -> Result<(), Error> { diff --git a/piet-common/Cargo.toml b/piet-common/Cargo.toml index 50904e4b..8c88decb 100644 --- a/piet-common/Cargo.toml +++ b/piet-common/Cargo.toml @@ -40,8 +40,8 @@ png = { version = "0.17.7", optional = true } [target.'cfg(any(target_os="linux", target_os="openbsd", target_os="freebsd", target_os="netbsd"))'.dependencies] piet-cairo = { version = "=0.6.2", path = "../piet-cairo" } -cairo-rs = { version = "0.18.0", default_features = false } -cairo-sys-rs = { version = "0.18.0" } +cairo-rs = { version = "0.19.0", default_features = false } +cairo-sys-rs = { version = "0.19.0" } [target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies] piet-coregraphics = { version = "=0.6.2", path = "../piet-coregraphics" } From f1858a80f37c6cb6ee06b80e43b3620d4e50e2bd Mon Sep 17 00:00:00 2001 From: Felix Zwettler Date: Sun, 4 Feb 2024 11:36:56 +0100 Subject: [PATCH 2/4] satisfy clippy --- piet-web/src/text.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piet-web/src/text.rs b/piet-web/src/text.rs index 7a315b5a..6fbcccc6 100644 --- a/piet-web/src/text.rs +++ b/piet-web/src/text.rs @@ -235,7 +235,7 @@ impl TextLayout for WebTextLayout { // this assumes that all heights/baselines are the same. // Uses line bounding box to do hit testpoint, but with coordinates starting at 0.0 at // first baseline - let first_baseline = self.line_metrics.get(0).map(|l| l.baseline).unwrap_or(0.0); + let first_baseline = self.line_metrics.first().map(|l| l.baseline).unwrap_or(0.0); // check out of bounds above top // out of bounds on bottom during iteration From 001d565938f28ba8d145ff7a6182beb07055ab18 Mon Sep 17 00:00:00 2001 From: Felix Zwettler Date: Sun, 4 Feb 2024 11:40:03 +0100 Subject: [PATCH 3/4] remove unused imports in piet-direct2d --- piet-direct2d/src/text.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/piet-direct2d/src/text.rs b/piet-direct2d/src/text.rs index 5f744eae..3ed3b1d3 100644 --- a/piet-direct2d/src/text.rs +++ b/piet-direct2d/src/text.rs @@ -9,7 +9,6 @@ use std::ops::{Range, RangeBounds}; use std::rc::Rc; use std::sync::Arc; -pub use d2d::{D2DDevice, D2DFactory, DeviceContext as D2DDeviceContext}; pub use dwrite::DwriteFactory; use dwrote::{CustomFontCollectionLoaderImpl, FontCollection, FontFile}; use winapi::um::d2d1::D2D1_DRAW_TEXT_OPTIONS_NONE; From d8802760a3ff8fc79902d17d45dbee4a21a5c083 Mon Sep 17 00:00:00 2001 From: Felix Zwettler Date: Sun, 4 Feb 2024 12:05:15 +0100 Subject: [PATCH 4/4] remove another unused import in piet-direct2d --- piet-direct2d/src/text.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/piet-direct2d/src/text.rs b/piet-direct2d/src/text.rs index 3ed3b1d3..e513af1c 100644 --- a/piet-direct2d/src/text.rs +++ b/piet-direct2d/src/text.rs @@ -22,7 +22,6 @@ use piet::{ }; use crate::conv; -use crate::d2d; use crate::dwrite::{self, TextFormat, Utf16Range}; use crate::D2DRenderContext;