gg: fix system_font_path (#12533)

pull/12539/head
kahsa 2021-11-22 02:12:15 +09:00 committed by GitHub
parent 243e66a106
commit 480f3876ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -76,14 +76,13 @@ pub fn system_font_path() string {
} }
} }
} }
mut fm := os.execute('fc-match -v -s -b') mut fm := os.execute("fc-match --format='%{file}\n' -s")
if fm.exit_code == 0 { if fm.exit_code == 0 {
lines := fm.output.split('\n') lines := fm.output.split('\n')
for l in lines { for l in lines {
if l.contains('file:') && !l.contains('.ttc') { if !l.contains('.ttc') {
font := l.find_between('"', '"') debug_font_println('Using font "$l"')
debug_font_println('Using font "$font"') return l
return font
} }
} }
} else { } else {