Skip to content

Commit

Permalink
fonts: streamline some output messages
Browse files Browse the repository at this point in the history
  • Loading branch information
larpon committed Nov 23, 2024
1 parent f9b7a26 commit a57a20b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/draw2d.text.b.v
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions lib/fonts.b.v
Original file line number Diff line number Diff line change
Expand Up @@ -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()}')
}
}

Expand Down

0 comments on commit a57a20b

Please sign in to comment.