ui
ui copied to clipboard
Japanese fonts are garbled
vlang version: 0.1.28 219ecd1
I tried "users" app of https://github.com/vlang/ui#running-the-examples . The window came up fine.
Then I typed みみなし
in the first text box, but it showed up like the screenshot.

I'm new to V and OpenGL, so I didn't know what else to research, but please let me know if there's anything else I should be looking into.
v ui uses Alpha-numeric font set as default, but in ui/ui.v , ui kit font refers VUI_FONT env var.
$ grep VUI *.v
ui.v: env_font := os.getenv('VUI_FONT')
so, set VUI_FONT like as follow ;
$ VUI_FONT='/System/Library/Fonts/ヒラギノ角ゴシック W3.ttc' v run users.v
or
$ v users.v
$ VUI_FONT='/System/Library/Fonts/ヒラギノ角ゴシック W3.ttc' ./users
(for Mac, Japanese font)
But, newer v ui version 0.0.4 (congratulations !) uses new graphics handling method (sokol ?), so, sample codes cannot run 'v run users.v' with newer Mac Xcode, unfortunately.
for newer Xcode user, type as follows ;
$ v -cflags ' -Xlinker -U -Xlinker _objc_loadClassref ' users.v
$ VUI_FONT='/System/Library/Fonts/ヒラギノ角ゴシック W3.ttc' ./users
cf. cannot run sokol/fonts.v in Mac OS Mojave ... #5069 https://github.com/vlang/v/issues/5069
in 0.0.4, all widgets are working in progress, so cannot enter texts in currently.
@GaraSharp I've just fixed text input, will push soon ;)
I've just fixed text input, will push soon ;)
Great works, Thanks !