diff --git a/Cargo.lock b/Cargo.lock index 416b4fe3..15bce3ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1500,9 +1500,9 @@ dependencies = [ [[package]] name = "harfrust" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0431e8e389aa0f1e72bb9d1c2db8957a1a7a3580e8ed97db819c14837aac9b3e" +checksum = "efe038305638d3279db5b026bda1e45eb709cf9cf2b40545100640fbcc579c90" dependencies = [ "bitflags 2.11.0", "bytemuck", diff --git a/Cargo.toml b/Cargo.toml index 19a0df81..1723d492 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ repository = "https://github.com/linebender/parley" accesskit = "0.24.0" bytemuck = { version = "1.25.0", default-features = false } fontique = { version = "0.9.0", default-features = false, path = "fontique" } -harfrust = { version = "0.7.0", default-features = false } +harfrust = { version = "0.8.0", default-features = false } hashbrown = { version = "0.17.0", default-features = false, features = [ "default-hasher", "raw-entry", diff --git a/parley/src/shape/mod.rs b/parley/src/shape/mod.rs index dbaad3dd..f2c1b339 100644 --- a/parley/src/shape/mod.rs +++ b/parley/src/shape/mod.rs @@ -7,6 +7,7 @@ use alloc::vec::Vec; use core::mem; use core::ops::RangeInclusive; +use harfrust::ShapeOptions; use super::layout::Layout; use super::resolve::{ResolveContext, Resolved, ResolvedStyle}; @@ -413,7 +414,6 @@ fn shape_item<'a, B: Brush>( let harf_shaper = shaper_data .shaper(&font_ref) .instance(Some(instance)) - .point_size(Some(item.size)) .build(); let shaper_plan = scx.shape_plan_cache.entry( cache::ShapePlanKey::new( @@ -462,7 +462,13 @@ fn shape_item<'a, B: Brush>( buffer.set_language(lang); } - let glyph_buffer = harf_shaper.shape_with_plan(shaper_plan, buffer, &scx.features); + let glyph_buffer = harf_shaper.shape( + buffer, + ShapeOptions::new() + .plan(Some(shaper_plan)) + .features(&scx.features) + .point_size(Some(item.size)), + ); // Extract relevant CharInfo slice for this segment let char_start = char_range.start + item_text[..segment_start_offset].chars().count();