diff options
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. |