gg: use gg.system_font_path() as a fallback when a font can not be found

pull/7189/head
Delyan Angelov 2020-12-07 21:40:24 +02:00
parent 0efdc7bbe8
commit ed9aa873c1
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 6 additions and 1 deletions

View File

@ -128,7 +128,12 @@ fn gg_init_sokol_window(user_data voidptr) {
g.font_inited = true
} else {
if !exists {
eprintln('font file $g.config.font_path does not exist')
sfont := system_font_path()
eprintln('font file "$g.config.font_path" does not exist, the system font was used instead.')
g.ft = new_ft(font_path: sfont, custom_bold_font_path: g.config.custom_bold_font_path, scale: sapp.dpi_scale()) or {
panic(err)
}
g.font_inited = true
}
}
//