ui icon indicating copy to clipboard operation
ui copied to clipboard

Japanese fonts are garbled

Open miminashi opened this issue 4 years ago • 3 comments

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.

スクリーンショット 2020-06-29 2 32 59

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.

miminashi avatar Jun 28 '20 17:06 miminashi

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 avatar Jul 09 '20 20:07 GaraSharp

@GaraSharp I've just fixed text input, will push soon ;)

medvednikov avatar Jul 09 '20 21:07 medvednikov

I've just fixed text input, will push soon ;)

Great works, Thanks !

GaraSharp avatar Jul 10 '20 19:07 GaraSharp