gg: don't call `os.is_file()` on Android (the font is part of the APK there) (#6475)

pull/6478/head
spaceface777 2020-09-25 12:06:20 +02:00 committed by GitHub
parent abc98c273c
commit ae48b709ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -105,7 +105,10 @@ fn gg_init_sokol_window(user_data voidptr) {
// fb_h := sapp.height() // fb_h := sapp.height()
// println('g.scale=$g.scale is_high_dpi=$is_high_dpi fb_w=$fb_w fb_h=$fb_h') // 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.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() // t := time.ticks()
g.ft = new_ft({ g.ft = new_ft({
font_path: g.config.font_path font_path: g.config.font_path