diff options
author | 2020-05-27 23:09:27 +0200 | |
---|---|---|
committer | 2020-05-27 23:09:27 +0200 | |
commit | 823ea1573245b849a0696543838a7ad1d0f914d8 (patch) | |
tree | 209b1697e46399210daa573d0479986b01d6053d /wgpu/src/text.rs | |
parent | 22ced3485eb6f295faaab1e31d8d1b8d61fc422b (diff) | |
download | iced-823ea1573245b849a0696543838a7ad1d0f914d8.tar.gz iced-823ea1573245b849a0696543838a7ad1d0f914d8.tar.bz2 iced-823ea1573245b849a0696543838a7ad1d0f914d8.zip |
Update `glyph_brush` and `glow_glyph`
Diffstat (limited to 'wgpu/src/text.rs')
-rw-r--r-- | wgpu/src/text.rs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index 17d3f6dd..d65c0385 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -6,7 +6,6 @@ use std::{cell::RefCell, collections::HashMap}; pub struct Pipeline { draw_brush: RefCell<wgpu_glyph::GlyphBrush<'static, ()>>, draw_font_map: RefCell<HashMap<String, wgpu_glyph::FontId>>, - measure_brush: RefCell<glyph_brush::GlyphBrush<'static, ()>>, } @@ -52,7 +51,6 @@ impl Pipeline { Pipeline { draw_brush: RefCell::new(draw_brush), draw_font_map: RefCell::new(HashMap::new()), - measure_brush: RefCell::new(measure_brush), } } @@ -109,20 +107,6 @@ impl Pipeline { } } - pub fn space_width(&self, size: f32) -> f32 { - use wgpu_glyph::GlyphCruncher; - - let glyph_brush = self.measure_brush.borrow(); - - // TODO: Select appropriate font - let font = &glyph_brush.fonts()[0]; - - font.glyph(' ') - .scaled(wgpu_glyph::Scale { x: size, y: size }) - .h_metrics() - .advance_width - } - pub fn trim_measurement_cache(&mut self) { // TODO: We should probably use a `GlyphCalculator` for this. However, // it uses a lifetimed `GlyphCalculatorGuard` with side-effects on drop. |