From db4874b39135404e714cffeae405205d825cb729 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Sat, 12 Mar 2022 14:15:17 +0100 Subject: [PATCH] Start with a larger glyph cache size from the get go This eliminates the startup warning ```2022-03-12T13:07:34.975288Z WARN wgpu_glyph: Increasing glyph texture size (256, 256) -> (512, 512). Consider building with `.initial_cache_size((512, 512))` to avoid resizing``` Signed-off-by: Daniel Egger --- src/graphics/config_ui.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/graphics/config_ui.rs b/src/graphics/config_ui.rs index e9db82e04..60f72f6bc 100644 --- a/src/graphics/config_ui.rs +++ b/src/graphics/config_ui.rs @@ -23,8 +23,9 @@ impl ConfigUi { ) -> Result { let font = FontArc::try_from_slice(include_bytes!("fonts/B612-Bold.ttf"))?; - let glyph_brush = - GlyphBrushBuilder::using_font(font).build(device, color_format); + let glyph_brush = GlyphBrushBuilder::using_font(font) + .initial_cache_size((512, 512)) + .build(device, color_format); let mut texts = HashMap::new(); for element in Element::elements() {