Skip to content

Commit 480f387

Browse files
author
kahsa
authored
gg: fix system_font_path (#12533)
1 parent 243e66a commit 480f387

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

vlib/gg/text_rendering.v

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,13 @@ pub fn system_font_path() string {
7676
}
7777
}
7878
}
79-
mut fm := os.execute('fc-match -v -s -b')
79+
mut fm := os.execute("fc-match --format='%{file}\n' -s")
8080
if fm.exit_code == 0 {
8181
lines := fm.output.split('\n')
8282
for l in lines {
83-
if l.contains('file:') && !l.contains('.ttc') {
84-
font := l.find_between('"', '"')
85-
debug_font_println('Using font "$font"')
86-
return font
83+
if !l.contains('.ttc') {
84+
debug_font_println('Using font "$l"')
85+
return l
8786
}
8887
}
8988
} else {

0 commit comments

Comments
 (0)