Jump to content

Chinese font


madhu

Recommended Posts

The process is the same as for any other font. Just make sure that you enable unicode support in the configuration file and don't forget to ensure that your source files use an encoding that can hold/represent Chinese characters as well (ideally also utf-8).

These two articles contain all the information required:

Let us know if you have any further questions.

Link to comment
Share on other sites

  • 3 years later...

Trying to use Google Noto Sans SC (Simplified Chinese) font.
Downloaded the OTF and (import_ttf)  converted to DAT using mcufont.exe 16 bw.
But bwfont_export terminates with a partially complete .c file.

?

Separately mcufont terminates when generating large, say 200, font sizes, and doesn't produce a usable DAT file.

?

 

Link to comment
Share on other sites

I will look for another Simplified Chinese font (definitely TTF) and try with that.

Regarding large font size ... if you try DejaVuSans-Bold you will see that you can't generate a size >150 ... mcufont just exits (with no error reported).

Also, if you do manage to generate a large font ... e.g. Anton-Regular at size=182 (the largest that produces a DAT file) you will find that the gU8 font->line_height field is "267, /* line height */", which isn't working well because the field was too small!

?

 

Link to comment
Share on other sites

Yes. A font that large (tall) is likely to not work. Given that most embedded displays are 320x240 or smaller it is not unexpected that a line height of 267 would be considered invalid. That means a single line of text won't fit on most displays. Given the aspect ratio of most fonts you would be struggling to fit 3 characters width wise as well.

I know displays are getting larger and you obviously have a use case for such a large font, but I am not surprised it fails at this size. We will have a look to see if we can fix this but that won't be quick due to our other workloads.

Alternatives,

1. You can try editing the produced c file and manually adjusting the line height down to 255 (the largest value currently supported).

2. Fix the font problem in ugfx and the encoder and submit them as patches to ugfx. We would greatly appreciate them.

Link to comment
Share on other sites

MCUFONT

Regarding large font size ... if you try DejaVuSans-Bold you will see that you can't generate a size >150 ... mcufont just exits (with no error reported).

I happen to want to display a few very large digits on my embedded display - thus the need to generate large sizes.

So, I did some VisualStudio debugging for 'import_ttf DejaVuSans-Bold.ttf 144 bw'. It turns out that 'mcufont::rlefont::init_dictionary(*f);' (in main.cc/cmd_import_ttf) uses huge amounts of RAM and eventually throws std::bad_alloc ex, which being uncaught exits with no error message!

Unhandled exception at 0x767Fxxxx in mcufont.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x00F9xxxx.

Recompiling with 32-bit /3GB or in 64-bit avoids the problem - but an error message would have been helpful.

--

line_height

I will look into making the changes required to gU8 font->line_height ... to g16.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...