Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I let nanogui support Chinese characters? #162

Open
jhyvictory opened this issue Mar 24, 2024 · 1 comment
Open

How can I let nanogui support Chinese characters? #162

jhyvictory opened this issue Mar 24, 2024 · 1 comment

Comments

@jhyvictory
Copy link

I changed the button's text to Chinese characters, such as "按钮". However the button appeared with no characters on it.
Then I copied some font ttf files to the the resource folder of nanogui, rebuilt it, the button still had no characters on it.
How can I let nanogui support Chinese characters?

@jhyvictory
Copy link
Author

Seem no one cares about what is happening here.
I inherit the Theme class to MyTheme, and read a new font file through nvgCreateFont function. Then apply MyTheme to the Window. Finally I can show a label with Chinese font by defining it with the font parameter. However, other widgets like Button don't have that parameter and the font used is fixed in code of drawing a button. I changed the fixed font of drawing a button while I really dont want to. It seems that nanogui cannot support Chinese font in a pretty way without reproduce its code...a pity!
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant