Change rbf font for Chinese

Started by seed93, July 19, 2016, 10:41:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

seed93

I want to translate ML to Chinese but failed. I knew I need a Chinese rbf font and I got one from www.tecdee.com. This website has been discussed before because of its commercial use.

This rbf font is over 200kb and has over 6k characters. I use bmp_printf for debug. When it loads font in rbf_font.c by font_by_name, it is stucked in rbf_font_load, more specificaly in
line:204 font_read(fd, (unsigned char*)f->cTable, f->charCount*f->hdr.charSize);

I got a debug info before return bytes_read in font_read, but got nothing out of font_read. Then the camera doesn't show menu any more, using delete button or menu button, and will go wrong when taking a pic.

Hope anyone can give some help.

http://pan.baidu.com/s/1miMvIvI
This is a Chinese version for 60D downloaded from www.tecdee.com

a1ex

You may find it easier to debug it in QEMU - it emulates the 60D GUI very well, and you can use GDB or IDA to debug it much like you would do for a PC program.

seed93

Thank you for you kindness and quik reply. I tried in QEMU and it is much easier. However I found it was hard to adapt for Chinese.

1. Chinese has thousands of chars and it will explode the memory.
2. RBF font doesn't support for Chinese codepage.
3. Your code assumes every character can be indexed by a char type in [0,255], but Chinese needs wchar.

As conclusion, only languages which have less than 256 characters can be used.
Tell me if I am wrong. Thank you.

a1ex

That's correct - the changes needed to fix these issues are nontrivial.