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:
@ -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'
|
||||
}
|
||||
|
Reference in New Issue
Block a user