mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
gg: try 3 different fonts in system_font_path on MacOS
This commit is contained in:
parent
1f21bc4b49
commit
dbce01792c
1 changed files with 6 additions and 2 deletions
|
@ -179,8 +179,12 @@ pub fn system_font_path() string {
|
||||||
mut fonts := ['Ubuntu-R.ttf', 'Arial.ttf', 'LiberationSans-Regular.ttf', 'NotoSans-Regular.ttf',
|
mut fonts := ['Ubuntu-R.ttf', 'Arial.ttf', 'LiberationSans-Regular.ttf', 'NotoSans-Regular.ttf',
|
||||||
'FreeSans.ttf', 'DejaVuSans.ttf']
|
'FreeSans.ttf', 'DejaVuSans.ttf']
|
||||||
$if macos {
|
$if macos {
|
||||||
return '/System/Library/Fonts/SFNS.ttf'
|
fonts = ['/System/Library/Fonts/SFNS.ttf', '/System/Library/Fonts/SFNSText.ttf', '/Library/Fonts/Arial.ttf']
|
||||||
//fonts = ['SFNS.ttf', 'SFNSText.ttf']
|
for font in fonts {
|
||||||
|
if os.is_file(font) {
|
||||||
|
return font
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s := os.exec('fc-list') or { panic('failed to fetch system fonts') }
|
s := os.exec('fc-list') or { panic('failed to fetch system fonts') }
|
||||||
system_fonts := s.output.split('\n')
|
system_fonts := s.output.split('\n')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue