From a57a20b6730c8e4338253c690b4b9b01ac1487bc Mon Sep 17 00:00:00 2001 From: lmp Date: Sat, 23 Nov 2024 17:46:26 +0100 Subject: [PATCH] fonts: streamline some output messages --- lib/draw2d.text.b.v | 1 + lib/fonts.b.v | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/draw2d.text.b.v b/lib/draw2d.text.b.v index 64974b8..7070a67 100644 --- a/lib/draw2d.text.b.v +++ b/lib/draw2d.text.b.v @@ -198,6 +198,7 @@ pub fn (t Draw2DText) draw() { font_context.set_spacing(5.0) */ + // println('Drawing "${t.text}" with font "${t.font}"') if t.font != defaults.font.name { font_id := fc.fonts[t.font] font_context.set_font(font_id) diff --git a/lib/fonts.b.v b/lib/fonts.b.v index 1730381..709a525 100644 --- a/lib/fonts.b.v +++ b/lib/fonts.b.v @@ -71,16 +71,16 @@ pub fn (mut fs Fonts) new_context(config FontsConfig) !&FontContext { mut preload := config.preload.clone() $if wasm32_emscripten { // NOTE: #flag --embed-file @VMODROOT/fonts@/fonts // #flag --embed-file @VMODROOT/examples/assets@/ - preload['default'] = 'fonts/Allerta/Allerta-Regular.ttf' + preload[defaults.font.name] = 'fonts/Allerta/Allerta-Regular.ttf' } $else { mut default_font := $embed_file('../assets/fonts/Allerta/Allerta-Regular.ttf') fs.font_data[defaults.font.name] = default_font.to_bytes() - fs.shy.log.gdebug(@STRUCT, 'loaded default: "${default_font.path}"') + fs.shy.log.gdebug(@STRUCT, 'loaded "${defaults.font.name}": "${default_font.path}"') } for font_name, font_path in preload { fs.load_font(font_name, font_path) or { - s.log.gerror(@STRUCT, ' pre-loading "${font_name}" failed: ${err.msg()}') + s.log.gerror(@STRUCT, 'pre-loading "${font_name}" failed: ${err.msg()}') } }