AriZuu / ttf2ugui

Simple utility to convert TTF fonts into uGUI bitmap fonts.
111 stars 53 forks source link

Support for simplified Chinese #5

Closed jianjinliao closed 3 years ago

jianjinliao commented 3 years ago

Dear AriZuu, When I use ugui, I can't support simplified Chinese. I try to use ttf2ugui to convert font, and I can't convert Chinese to C array. Do you have any good suggestions? Thank You。

AriZuu commented 3 years ago

Can you describe the problem a bit more ? Command arguments you are using and possible error message would be helpful in figuring out what might help.

jianjinliao commented 3 years ago

I'm using esp32 + esp-idf + ugui to build UI. I want to display Chinese on the screen,However, ugui does not support Chinese display,I copied a Chinese font of windows and used tt2ugui to convert C:ttf2ugui --font Chinese.ttf --dpi 140 --size 14 --dump The converted ugui. c still doesn't have a Chinese font, and there's no way to display Chinese

AriZuu commented 3 years ago

Try the --show option in ttf2ugui, ie. something like

ttf2ugui --font Chinese.ttf --size 14 --show Test

That should display an ascii art using given font (if that font is available in Windows maybe I could try it myself also).

AriZuu commented 3 years ago

I tried chinese font from here: http://www.font-club.com/dfhei1b-gb_141129.html

The --show option displays something that looks like chinese symbols, but I don't know the language show it's difficult to know if it is correct.

jianjinliao commented 3 years ago

Yes, --show the display is in Chinese.I checked that ttf2ugui.c can't convert Chinese characters, which seems to be restricted by -- minchar -- maxchar.Can you re create a branch and remove the conversion restriction?

jianjinliao commented 3 years ago

Ttf2ugui seems to convert only Latin characters and symbols.

AriZuu commented 3 years ago

What if you try something like ./ttf2ugui --font Chinese.ttf --dpi 140 --size 14 --dump --maxchar 500

ie. it is possible to specify maxchar value, default is just to dump visible ascii characters 32 - 126.

jianjinliao commented 3 years ago

Thank you for your reply. This problem has been solved.