gg: try 3 different fonts in system_font_path on MacOS

pull/6469/head
Delyan Angelov 2020-09-24 17:09:03 +03:00
parent 1f21bc4b49
commit dbce01792c
1 changed files with 6 additions and 2 deletions

View File

@ -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')