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

fmt: intelligent line wrap for trailing struct syntax (#7309)

This commit is contained in:
Lukas Neubert
2020-12-14 05:03:17 +01:00
committed by GitHub
parent 591e523cf3
commit d59c5b01e1
6 changed files with 102 additions and 173 deletions

View File

@@ -121,18 +121,22 @@ fn gg_init_sokol_window(user_data voidptr) {
exists := $if !android { os.is_file(g.config.font_path) } $else { true }
if g.config.font_path != '' && exists {
// t := time.ticks()
g.ft = new_ft(font_path: g.config.font_path, custom_bold_font_path: g.config.custom_bold_font_path, scale: sapp.dpi_scale()) or {
panic(err)
}
g.ft = new_ft(
font_path: g.config.font_path
custom_bold_font_path: g.config.custom_bold_font_path
scale: sapp.dpi_scale()
) or { panic(err) }
// println('FT took ${time.ticks()-t} ms')
g.font_inited = true
} else {
if !exists {
sfont := system_font_path()
eprintln('font file "$g.config.font_path" does not exist, the system font was used instead.')
g.ft = new_ft(font_path: sfont, custom_bold_font_path: g.config.custom_bold_font_path, scale: sapp.dpi_scale()) or {
panic(err)
}
g.ft = new_ft(
font_path: sfont
custom_bold_font_path: g.config.custom_bold_font_path
scale: sapp.dpi_scale()
) or { panic(err) }
g.font_inited = true
}
}