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

gg: fix running tetris and ui examples on linux

This commit is contained in:
Delyan Angelov 2020-07-28 12:12:29 +03:00
parent fa0477d558
commit 5bf3b6eda3

View File

@ -42,17 +42,17 @@ fn new_ft(c FTConfig) ?&FT{
bold_path := 'SFNS-bold.ttf'// c.font_path.replace('.ttf', '-bold.ttf') bold_path := 'SFNS-bold.ttf'// c.font_path.replace('.ttf', '-bold.ttf')
bytes_bold := os.read_bytes(bold_path) or { bytes_bold := os.read_bytes(bold_path) or {
println('failed to load font "$bold_path"') println('failed to load font "$bold_path"')
return none bytes
} }
mono_path := '/System/Library/Fonts/SFNSMono.ttf'// c.font_path.replace('.ttf', '-bold.ttf') mono_path := '/System/Library/Fonts/SFNSMono.ttf'// c.font_path.replace('.ttf', '-bold.ttf')
bytes_mono:= os.read_bytes(mono_path) or { bytes_mono:= os.read_bytes(mono_path) or {
println('failed to load font "$mono_path"') println('failed to load font "$mono_path"')
return none bytes
} }
italic_path := '/System/Library/Fonts/SFNSItalic.ttf' italic_path := '/System/Library/Fonts/SFNSItalic.ttf'
bytes_italic:= os.read_bytes(italic_path) or { bytes_italic:= os.read_bytes(italic_path) or {
println('failed to load font "$italic_path"') println('failed to load font "$italic_path"')
return none bytes
} }
fons := sfons.create(512, 512, 1) fons := sfons.create(512, 512, 1)
return &FT{ return &FT{