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

gg: add text rendering, keyboard event handling for JS and other fixes (#12932)

This commit is contained in:
playX
2021-12-22 13:26:52 +03:00
committed by GitHub
parent 6eb44f472a
commit 2b9f993574
12 changed files with 596 additions and 25 deletions

View File

@ -19,3 +19,17 @@ pub:
mono bool
italic bool
}
pub fn (cfg TextCfg) to_css_string() string {
mut font_style := ''
if cfg.bold {
font_style += 'bold '
}
if cfg.mono {
font_style += 'mono '
}
if cfg.italic {
font_style += 'italic '
}
return '$font_style ${cfg.size}px $cfg.family'
}