能否添加中文语言

New users must post here first and let us know a little bit about yourself.
User avatar
F1RMB
Posts: 2518
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France

Re: 能否添加中文语言

Post by F1RMB » Wed Aug 10, 2022 9:18 am

Hi,

The whole Katakana has 62 glyphs (IIRC), and from what I know there is no Chinese alternative.
You can't change the font resolution.
There is also an extra step (to be implemented afterward), the header file containing all the language strings has to be encoded in a special way to be usable by the firmware.

Cheers.
---
Daniel

VK3KYY
Posts: 7478
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: 能否添加中文语言

Post by VK3KYY » Wed Aug 10, 2022 10:14 am

In theory a 12x12 font could be added for Chinese, but it would require extensive changes to the firmware to handle a different number of characters across width of the screen.

So you would need to maintain a completely different version of the firmware, which had modified files for the entire user interface, as I don't think it would be practical to have #define's to control the number of changes needed to support a font with completely different width

icz_tb
Posts: 15
Joined: Sun Jul 31, 2022 4:05 pm

Re: 能否添加中文语言

Post by icz_tb » Thu Aug 11, 2022 2:24 am

F1RMB wrote:
Wed Aug 10, 2022 9:18 am
Hi,

The whole Katakana has 62 glyphs (IIRC), and from what I know there is no Chinese alternative.
You can't change the font resolution.
There is also an extra step (to be implemented afterward), the header file containing all the language strings has to be encoded in a special way to be usable by the firmware.

Cheers.
---
Daniel
Thanks, I'm looking into how to make and use the char map table, my concern is how to store all those, or if I add char with higher res, that could take more spaces , i worry that will cause problem. maybe store into external rom is a better way. eg. generate the font map bin file, flash it using cps? this will take up external rom space and can have other impacts too.

icz_tb
Posts: 15
Joined: Sun Jul 31, 2022 4:05 pm

Re: 能否添加中文语言

Post by icz_tb » Thu Aug 11, 2022 2:25 am

VK3KYY wrote:
Wed Aug 10, 2022 10:14 am
In theory a 12x12 font could be added for Chinese, but it would require extensive changes to the firmware to handle a different number of characters across width of the screen.

So you would need to maintain a completely different version of the firmware, which had modified files for the entire user interface, as I don't think it would be practical to have #define's to control the number of changes needed to support a font with completely different width
Yea, after some further reasearch I understand what you mean, there will be many places need to be changed, but i'll see how far i can go :)

VK3KYY
Posts: 7478
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: 能否添加中文语言

Post by VK3KYY » Thu Aug 11, 2022 2:28 am

icz_tb wrote:
Thu Aug 11, 2022 2:24 am
F1RMB wrote:
Wed Aug 10, 2022 9:18 am
Hi,

The whole Katakana has 62 glyphs (IIRC), and from what I know there is no Chinese alternative.
You can't change the font resolution.
There is also an extra step (to be implemented afterward), the header file containing all the language strings has to be encoded in a special way to be usable by the firmware.

Cheers.
---
Daniel
Thanks, I'm looking into how to make and use the char map table, my concern is how to store all those, or if I add char with higher res, that could take more spaces , i worry that will cause problem. maybe store into external rom is a better way. eg. generate the font map bin file, flash it using cps? this will take up external rom space and can have other impacts too.

I don't think ROM space would be a problem, becuase the Japanese version does not include the texts for any other languages except english, so there is a saving of 10k or more because of that.

icz_tb
Posts: 15
Joined: Sun Jul 31, 2022 4:05 pm

Re: 能否添加中文语言

Post by icz_tb » Thu Aug 11, 2022 3:27 am

Thanks, this is encouraging, then i dont need to worry brick my radio :mrgreen:
Did some further test, here is how it looks like, as said yesterday ,8x8 is not good enough , but it can show some .
Test Display with Chinese
Test Display with Chinese
p1_.jpg (65.09 KiB) Viewed 1134 times
will try 12x12 next step, and think for menu display, that might cause a bit of overlap between displayed lines on the menu screen.
alternative way to get over this , is to see if can only display 2 lines of info on menu screen.
this might be an easier way to get this solved.

VK3KYY
Posts: 7478
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: 能否添加中文语言

Post by VK3KYY » Thu Aug 11, 2022 3:53 am

Its almost impossible to brick the radio because the bootloader is never modified.

icz_tb
Posts: 15
Joined: Sun Jul 31, 2022 4:05 pm

Re: 能否添加中文语言

Post by icz_tb » Fri Aug 12, 2022 1:05 am

VK3KYY wrote:
Thu Aug 11, 2022 3:53 am
Its almost impossible to brick the radio because the bootloader is never modified.
Thats good to know! my knowledge to hardware /embedded device related programming is veryvery limited..
So far I've identifed around 100 characters, however this does not cover the full string used by the system, i have strong feeling that the 255 table is not enough.
beside the adjustment of UI render part will be a chanllange for me too..

Here's what i've got with 12x16 matrix font, strang thing is the bottom part of the char seems to be missing, no clue what /where it went wrong..
pic2.jpg
pic2.jpg (49.14 KiB) Viewed 1074 times
any ideas, suggestions pls?

VK3KYY
Posts: 7478
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: 能否添加中文语言

Post by VK3KYY » Fri Aug 12, 2022 6:22 am

You have made amazing progress with this.

The reason the bottom of the character may be missing could be the Y position of each line being written to the screen

All the values for Y position of the lines of the menu are designed for the height of the English font
But I think that font is 8 x 16 (16 pixels tall), so 12 x 16 should be OK

Are you sure your font data is correct?

Also modify the menuSystem code to just draw one line to the screen and confirm that it displays OK.

You could also just change the main application file, to just write 1 line of text to the screen and do nothing else, so that you could check that the font data is OK.

If you need more than 255 characters its a bigger problem, because all the text is stored as single byte, not double byte characters.

So all the string handling won't work as there are many places where the string length is checked for 16 characters, and I don't think C natively handles double byte characters automatically.

icz_tb
Posts: 15
Joined: Sun Jul 31, 2022 4:05 pm

Re: 能否添加中文语言

Post by icz_tb » Fri Aug 12, 2022 5:00 pm

Yea,you're right abt the font, i should use square ones. changed to 16x16 then it works without problem.
displaying 2 rows of menu item works,remove /change the menu title could make it look better though.
not perfect but useable . sub-menu items still have issues, due to the font size is much bigger, display ,and option setting can be an issue..16 char is for width8 char to my understanding...
there are ways to use more than 255 chars, however maybe that is not necessary due to the 16 char limition, have some english in sub-menu seems to be an good option :lol:
Maybe that's all that i can do for now, need more time to think and check if this breaks anything elsewhere.

Comparing to such changes, i 'm more interested to see if there is any hardware mod can be made to the radios to expand it's functionaility, eg. adding RTC chips to record the time!

Thanks for all your help!
pic3.jpg
pic3.jpg (42.24 KiB) Viewed 1030 times

Post Reply