Jump to content
madhu

Chinese font

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.

Share this post


Link to post
Share on other sites

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.

😞

 

Share this post


Link to post
Share on other sites

Hi,

The font converter engine supports TTF and BDF font files. I think the font converter should reject other files but maybe that's not the case and it can't process at some point. The online font converter definitely checks for the proper file extension.

Share this post


Link to post
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!

😞

 

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...