From ae48b709ed8a69b38f52729d942a8764ea47d0be Mon Sep 17 00:00:00 2001 From: spaceface777 Date: Fri, 25 Sep 2020 12:06:20 +0200 Subject: [PATCH] gg: don't call `os.is_file()` on Android (the font is part of the APK there) (#6475) --- vlib/gg/gg.v | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vlib/gg/gg.v b/vlib/gg/gg.v index a9dd2cae6b..ac06724801 100644 --- a/vlib/gg/gg.v +++ b/vlib/gg/gg.v @@ -105,7 +105,10 @@ fn gg_init_sokol_window(user_data voidptr) { // fb_h := sapp.height() // println('g.scale=$g.scale is_high_dpi=$is_high_dpi fb_w=$fb_w fb_h=$fb_h') // if g.config.init_text { - if g.config.font_path != '' && os.is_file( g.config.font_path ) { + + // `os.is_file()` won't work on Android if the font file is embedded into the APK + exists := $if !android { os.is_file(g.config.font_path) } $else { true } + if g.config.font_path != '' && exists { // t := time.ticks() g.ft = new_ft({ font_path: g.config.font_path