Step by step learning to develop software in Chinese-directly hitting VB (1)

Source: Internet
Author: User
Learn to develop software in Chinese step by step ---- directly hitting VB (1)
A Tao, a new starting point of the Chinese-based studio
(1)

I. Overview:

As we all know, the localization of vbprograms is a headache. Now the Chinese technology for VC and Delphi programs is quite mature and complete, but it is difficult to perfect a VB program. First of all, the strings to be Chinese in the vbprogram are very scattered and unordered, and contain a lot of Unicode characters. Currently, no tool can easily process it. Of course, this problem can still be solved. Strings can still be written in Chinese, but it is only a bit of trouble. The biggest headache is how to modify the font and font size of the Chinese character string. You can imagine how ugly it would be if a large block of Chinese text is in the English font 8!

Since the last century, I have been studying the Chinese language. There have been basically no technical articles on the localization of vbprograms, and the problem of how to normalize and modify fonts has never been solved, it is truly a "difficult Century. I used to seek help from many programming experts for this purpose, but there was no result. Maybe VB is a bad programming tool. Why did the Experts use it. No way, I had to install a vb50 on my own, hoping to find some solutions.

I thought it would take a lot of time to solve this problem, but it actually took some time ...... In two days, the font problem has been basically solved. I don't know whether the problem is too good or too simple. It's a little dramatic that the problem of the century has been solved, of course, it is hard to understand why no one has solved this problem for a long time?

Ii. Some statements:

Go back to the topic. Since it was solved within two days, naturally I cannot guarantee the absolute reliability and adaptability of this method. So let's first declare something:

1. The research tool I used is vb50, and the research programs are also compiled by vb50. Therefore, whether my method can be fully applied to programs compiled by vb60 or other versions of VB remains to be verified. However, I think the basic things should be generic, but the names of some related files may change. I will explain them in the following sections.

2. This Article only discusses how to modify the font name and font size. I will explain how to normalize strings in detail in future articles, this article does not cover.

3. The tool I used to modify the font is ultraedit 5.0. We recommend that you use it as well, because there is no more convenient tool. Of course, please note that its version is 5.0, and other versions of ultraedit are not recommended to you.

4. In line with the purpose of being sufficient, this article describes in detail all the problems I can think of in the process of modifying the font. I did not carefully study other projects that do not need to be changed, if you are a programming expert and want to compile a VB-based tool, contact me for further research.

5 ,...... I can't think of it anymore. Let's talk and think about it ......

Iii. Classification of strings:

According to my analysis, from the perspective of font classification, I think there are usually two types of strings in a program compiled by VB. One is a string that clearly defines the font name and font size, and the other is a string that does not define the font name and font size. Two types of strings may exist in a vbprogram at the same time, or only one of them may exist.

From the Chinese perspective, both types of strings can be Chinese and font modified. Of course, the first type of modification is easier. For strings without font definitions, it will be a little more troublesome. Next I will talk about it separately.

4. A font string has been defined:

If a character string has clearly defined the font, it will be much easier to modify. In the vbprogram, characters indicating the font name and font size are usually followed by each defined string. Therefore, if you haven't found any font characters near the end of a string, the character string is not clearly defined :-)

Let's see:



We now see a string "Welcome to Chinese Studio, a new starting point ". Not far behind it, it is the font symbol defined for it. I have already expressed it in blue. Now let me explain the meaning of the six arrows above:

(1): language family. "00" indicates the Spanish language, and "86" indicates the gb_2312 language. We need to modify this item in Chinese, that is, change it to "86 ".

(2): font. "00" indicates a common font, and "02" indicates italic. This item can be left unchanged to maintain the same style as the original one.

(3): font. "90 01" indicates a normal font, and "BC 02" indicates a bold font. This item can also be left unchanged.

(4): font size. This is one of the most important items we need to pay attention to. It is the place where you need to change the font size. It consists of three bytes, as shown in "44 42 01 ". For the specific representation of the font size, see:


Font Size Code Font Size Code Font Size Code Font Size Code
2 E4 57 00 12 C0 D4 01 28 FC 3B 04 No. 3 3C 67 02
3 30 75 00 14 A4 2C 02 36 40 7E 05 John F0 49 02
4 7c 92 00 15 F0 49 02 48 00 53 07 4th A4 2C 02
5 14 CD 00 16 3C 67 02 72 80 FC 0a John C0 D4 01
6 60 EA 00 18 20 BF 02 Initial number A0 68 06 5th 28 9A 01
7 AC 07 01 19 6c DC 02 Xiaochu 40 7E 05 5th 90 5f 01
8 44 42 01 20 04 17 03 No. 1 64 01 04 6th F8 24 01
9 90 5f 01 22 9C 51 03 Xiaoyi 80 A9 03 John AC 07 01
10 DC 7C 01 24 80 A9 03 2 9C 51 03 7th 14 CD 00
11 74 B7 01 26 64 01 04 Xiao'er 20 BF 02 October 8 14 CD 00


(5): The Length Value of the font name. It indicates the length (number of characters) of the font name. This is a hexadecimal value and cannot be modified!

(6): the font name. Generally, the "Arial" font is used in the VB program in English, while what we need in Chinese is, so we can change it to or another Chinese font name. It should be noted that the length of the Chinese font name cannot be greater than the length of the English font name. What should I do if the Chinese font name is shorter than the English font name? Replace "00", OK? Of course, you can also use "20" to replace it, but in some cases, it cannot produce font effects such as bold. Therefore, you should replace it with "00" without errors.

Also, do not modify the characters after the font name. Therefore, you must make it clear when you change the name to a Chinese character. Do not overwrite the characters after the name.

Someone asked, how can I find these characters that indicate that the fonts are scattered? In fact, it is very simple. You can first find the font name and then go back and forth to find out all these font characters. Of course, you should pay attention to whether each font symbol is separated by "00.

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.