summaryrefslogtreecommitdiffstats
path: root/wgpu/src/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-04-19 01:19:56 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-05-02 01:02:13 +0200
commit33b5a900197e2798a393d6d9a0834039666eddbb (patch)
treeb4ce1f77dc50d3733a2c9252d57674c3592a0c3c /wgpu/src/text.rs
parent57a276e16539d6aeca0619e0c5e36d0b1c1b5ef9 (diff)
downloadiced-33b5a900197e2798a393d6d9a0834039666eddbb.tar.gz
iced-33b5a900197e2798a393d6d9a0834039666eddbb.tar.bz2
iced-33b5a900197e2798a393d6d9a0834039666eddbb.zip
Make basic text shaping the default shaping strategy
Diffstat (limited to 'wgpu/src/text.rs')
-rw-r--r--wgpu/src/text.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs
index f01e0b42..f433a5b6 100644
--- a/wgpu/src/text.rs
+++ b/wgpu/src/text.rs
@@ -83,6 +83,7 @@ impl Pipeline {
height: (section.bounds.height * scale_factor)
.ceil(),
},
+ advanced_shape: section.advanced_shape,
},
);
@@ -213,6 +214,7 @@ impl Pipeline {
size: f32,
font: Font,
bounds: Size,
+ advanced_shape: bool,
) -> (f32, f32) {
let mut measurement_cache = self.measurement_cache.borrow_mut();
@@ -223,6 +225,7 @@ impl Pipeline {
size,
font,
bounds,
+ advanced_shape,
},
);
@@ -244,6 +247,7 @@ impl Pipeline {
bounds: Size,
point: Point,
_nearest_only: bool,
+ advanced_shape: bool,
) -> Option<Hit> {
let mut measurement_cache = self.measurement_cache.borrow_mut();
@@ -254,6 +258,7 @@ impl Pipeline {
size,
font,
bounds,
+ advanced_shape,
},
);
@@ -364,6 +369,7 @@ impl Cache {
.family(to_family(key.font.family))
.weight(to_weight(key.font.weight))
.stretch(to_stretch(key.font.stretch)),
+ !key.advanced_shape,
);
let _ = entry.insert(buffer);
@@ -388,6 +394,7 @@ struct Key<'a> {
size: f32,
font: Font,
bounds: Size,
+ advanced_shape: bool,
}
type KeyHash = u64;