1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

gg: fix system_font_path (#12533)

This commit is contained in:
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

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 {
lines := fm.output.split('\n')
for l in lines {
if l.contains('file:') && !l.contains('.ttc') {
font := l.find_between('"', '"')
debug_font_println('Using font "$font"')
return font
if !l.contains('.ttc') {
debug_font_println('Using font "$l"')
return l
}
}
} else {