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

tools: format most examples and tutorials, add them to v test-cleancode (#9826)

This commit is contained in:
Lukas Neubert
2021-04-20 16:16:35 +02:00
committed by GitHub
parent dff50686d6
commit 16e79bc3ca
38 changed files with 471 additions and 433 deletions

View File

@ -48,7 +48,8 @@ fn init(mut state AppState) {
// or use DroidSerif-Regular.ttf
if bytes := os.read_bytes(os.resource_abs_path('../assets/fonts/RobotoMono-Regular.ttf')) {
println('loaded font: $bytes.len')
state.font_normal = C.fonsAddFontMem(state.fons, 'sans', bytes.data, bytes.len, false)
state.font_normal = C.fonsAddFontMem(state.fons, 'sans', bytes.data, bytes.len,
false)
}
}
@ -101,7 +102,8 @@ fn (state &AppState) render_font() {
C.fonsSetSize(state.fons, 20.0)
C.fonsSetFont(state.fons, state.font_normal)
C.fonsSetColor(state.fons, blue)
C.fonsDrawText(state.fons, dx, dy, c'Now is the time for all good men to come to the aid of the party.', C.NULL)
C.fonsDrawText(state.fons, dx, dy, c'Now is the time for all good men to come to the aid of the party.',
C.NULL)
dx = 300
dy = 350
C.fonsSetAlign(state.fons, C.FONS_ALIGN_LEFT | C.FONS_ALIGN_BASELINE)