Set the font in netbeans 6.0 in JRE

Source: Internet
Author: User
Tags netbeans
Some of our Chinese Java developers have pointed out that netbeans's font is ugly. It is not difficult to find out the cause after a detailed analysis: netbeans Code The editor and output window are displayed in the monospaced font, while monospaced represents the same width font and should be displayed. Program Source code . Monospaced is a logical font that maps to different physical fonts in different languages and operating systems. Generally, the English operating system maps the monospaced font to Courier New. This font is very beautiful and suitable for displaying source code. It is the default font for displaying source code in eclipse, Microsoft Visual Studio, and other ides, it is also the default font for displaying source code on many technical websites, blogs, or forums.

The problem lies here. In general Chinese operating systems, monospaced fonts are mapped to. Although. Since monospaced is mapped to, before netbeans is installed without any configuration, the fonts in the editor and output window are both, and the English display is ugly.

The document I read today shows that the JRE Font ing can be configured. In short, you can create a fongconfig. properties file under JRE/lib to configure a Custom font ing relationship. Of course, you do not need to create a font configuration file from scratch. You only need to copy a font configuration template file and then make some changes. The procedure is as follows:

1. Copy the fontconfig. properties. SRC file in the jdk_home/JRE/lib directory and put it in the directory.

2. edit the file fontconfig. properties and find the following line:

Sequence. monospaced. GBK = chinese-ms936, alphabetic, dingbats, symbol

It can be found that because the Chinese monospaced font default search order is the first use of chinese-ms936, the results of the English is to display. Correction is very simple, you only need to change the order of chinese-ms936 and alphabetic can be:

Sequence. monospaced. GBK = alphabetic, chinese-ms936, dingbats, symbol

3. After saving the file and starting netbeans, you will find that the fonts in the netbeans editor and output window are changed to Courier New, which looks great. If you have changed the default font, you can change it back to the default monospaced and check whether the result is as expected.
Note that the above method is not only for the English version of netbeans, but also for the Chinese version of netbeans. It works for any swing application.

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.