Cabbage Logo
Back to Cabbage Site

Cabbage show box-symbol when use chinese

I got a problem in Cabbage, show box-symbol when use chinese, like the picture, how to solve the problem, thinks!Snipaste_2023-08-18_10-44-06

I’m not entirely sure, but you can try using a custom font that supports Chinese characters? You can use the typeface() identifier with you form declaration. Have a look at the docs. I suspect that the default font used by cabbage didn’t support Chinese characters…

thanks for your advices~

Can you let us know if it works? Thanks :blush:

Hello, thank you for your suggestion. This method is useful. I didn’t understand how to use this before, thinking it was necessary to modify the configuration file, but I couldn’t find it in the configuration file. It wasn’t until today that I searched for typeface() again on the forum that I knew how to operate it.

The current situation is that Chinese can be displayed in the component, but the editor still cannot display Chinese. How can I modify the font in the editor? (I learned from the forum that the beta version seems to have added this feature, but it doesn’t seem like the Windows version is available)

Thank you again for your suggestion.

You can grab one of the more recent successful builds to test this.It was added some time ago. i hope this works. It will only show those fonts which are installed, which i guess should be enough in your case. Let me know if it works :+1:

Hello, I have tried version 2.9.112 (which is the latest test version available for Windows), and the editor can display Chinese, but there were other issues.

  1. If I choose the simsun font(or other chinese fonts), I can input English normally, but after inputting Chinese, the cursor position appears to be incorrect.

  2. If fonts such as Arial and Yahei are selected(Or even switch back to the default font), not only will the cursor position be disordered, but input and deletion of English will also be disordered.

  3. After enabling the auto-completion function, it will be impossible to input Chinese normally due to the appearance of the completion pop-up window.

I think it may be that the cursor calculation is wrong, because the cursor will appear in the middle of the Chinese character. Perhaps the editor takes the length of a Chinese character as the length of a letter, when in fact a Chinese character should be the length of two letters.

Thank you for your suggestion and work.

The editor currently only supports monospaced text. I think it’s also best to change font and restart. If you have any problems getting the default font to work again, remove the Cabbage settings file. If you’re on Mac, it’s in the Cabbage folder inside the Application Support folder, and on Windows it’s in Roaming. I do plan to switch over to the VS Code editor at some point in the future, and then you should no longer have any issues with any fonts :slight_smile: