felixmariotto / three-mesh-ui

⏹ Make VR user interfaces for Three.js
https://felixmariotto.github.io/three-mesh-ui/#basic_setup
MIT License
1.26k stars 134 forks source link

I get an error when I use Chinese #229

Closed aile1997 closed 1 year ago

aile1997 commented 1 year ago

I changed a json font library and still got an error image

swingingtom commented 1 year ago

Hello @aile1997 , If you can share a sandbox it will help. Thanks

aile1997 commented 1 year ago

https://codesandbox.io/s/react-three-mesh-ui-forked-88c6r4

aile1997 commented 1 year ago

Do not change the json font. If the font is in Chinese, an error is reported. After changing the font library, another error is reported ,Maybe my json file is wrong. May I ask what tool you used to convert the .ttf file

swingingtom commented 1 year ago

We usually use https://msdf-bmfont.donmccurdy.com/

But other tools such as command lines were already reported as being valid.

If you check the json file for the impacted character, can you notice some missing or invalid properties ?

swingingtom commented 1 year ago

@aile1997 What I can see with your sandbox is that json and png do not match.

Json file doesn't look to be in msdf format. Png is png for Roboto, not for PangMenZhengDao.

If you go on this site https://msdf-bmfont.donmccurdy.com/ upload PangMenZhengDao ttf, and then write all the characters you will need, you will have both json and png matching the proper msdf format