The ucgui Chinese Character inventory is placed in the External Flash (the control is available) and the External Flash small software is written.

Source: Internet
Author: User

Recently, several fonts are used in the project. The Internal flash of stm32 is not suitable. No way! I have to look for du Niang and the experts in the help group.Eric2013,Yangyang Kan worldThank you. I learned some of their ideas.

The links found are as follows:

Http://blog.chinaunix.net/uid-361890-id-2953183.html

Http://www.openedv.com/posts/list/9736.htm;jsessionid=6B5FA51FE6BBC280B752D9B63BA57895

 

Here I mainly use crazytytArticleOn the basis of this method. Solve the problem of using Chinese characters to center controls.

In fact, my method is very simple. I can add some scalar values (xsize, ysize, byte, etc.) for each word element.

In ucgui, the value of the text height and width is not only used for modulo operation, but also used for center and text length calculation. That's why, after modifying the guiprop_dispchar (c) function, the words in the control text become very long!

 

The following is my modification method:

Put {16, 16, 2, (void gui_flash *) gui_fonthz16_flash_baseaddr },Copy 94 under itOnce.

OK. The problem is solved. Haha, is it too easy ~ This is indeed the case. It is mainly improved by standing on the shoulders of giants.

 

Some people think that there are not many ASCII codes, so there is no need to put them in external flash. So I keep it.

Below is my file:

Http://pan.baidu.com/share/link? Consumer id = 157310 & UK = 118334538

Effect:

 

Supplement:

When you set the Custom font to the default font, the control does not specify the default font for the base. To manually specifyProgramAdd the following to the beginning:Code:

1 Text_setdefaultfont (gui_default_font );2 Button_setdefaultfont (gui_default_font );3 Edit_setdefaultfont (gui_default_font );4 Listview_setdefaultfont (gui_default_font );5Framewin_setdefaultfont (gui_default_font );

Some controls are omitted. Add them as needed.

The following are four font files:

Http://pan.baidu.com/share/link? Consumer id = 157719 & UK = 118334538

Sample:

 

 

I wrote a small software when I was empty,Used to burn the font library to the outsideFlashMediumIf you also use stm32, you can also use it, but you need to make some changes. Of course, it is the flash drive. The changes are as follows:

You can change these three places.

The upper computer is written in C #, and the interface with the lower computer is RS232. The lower computer adopts Modbus protocol and the baud rate is 115200.

The following is the software. The attachment contains the source code.

The attachment is as follows:

Including the source code of the upper and lower computers.

Http://pan.baidu.com/share/link? Consumer id = 157523 & UK = 118334538

 

2013.3.12 supplement

When using the above operations, there are more or less problems when using controls. Later, I carefully studied the article "yangyang Kan world". Using this method, I can better avoid the issues such as automatic line breaks and cursor stays in the control. The application in multiedit can be perfectly solved.

In total, You need to modify the GUI. H, gui_uc_encodenone.c, and guitype. H files, and append a guicharpex. c file.The four fonts mentioned above have also been modified accordingly.

These files are included in the attachment below. For the entire transplantation process, refer to the article "yangyang Kan World. I will not go into detail here. Some improvements are also described in this article. You can directly replace the file corresponding to the GUI source file with the following attachment.

The tool for downloading the font library above may be too cumbersome and will be improved in subsequent articles, using ymodem for efficient File Transfer Protocol transfer.

Http://pan.baidu.com/share/link? Consumer id = 368205 & UK = 118334538

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.