Infinality font rendering enhancements and Java font rendering improvements in the Fedora Linux environment

Source: Internet
Author: User
Tags gtk website server

Fedora Linux Desktop Environment default font rendering engine FreeType and font Configuration tool Fontconfig is not optimized for compiling and setting, font rendering effect is poor. The desktop font rendering of some Linux distributions looks good, even to the effect of Apple's Mac OS X system, in effect making changes to the FreeType font rendering engine. To do this, we can implement infinality-based font rendering by installing Infinality's revised FreeType and fontconfig packages. Infinality is a solution to improve font rendering for mainstream Linux operating systems such as Fedora, including re-optimizing compiled FreeType libraries, fontconfig configuration packages, and more. The original Infinality website has not been updated for a long time, but now there are new developers on GitHub who continue to develop infinality and provide a packaged repo software source for Fedora 23/24. The new Infinality website (in fact the new author's blog) is https://danielrenninghoff.com and can visit its website to learn more about Infinality's current development and future plans for developers. The following describes the Infinality installation configuration method on Fedora 24:

1, install the infinality repo software source, use the following command:

Install http://rpm.danielrenninghoff.com/infinality/fedora/$ (rpm-e%fedora)/noarch/ infinality-ultimate-repo-$ (rpm-e%fedora) -1.noarch.rpm

2. Install the related optimized font rendering engine library via Infinality's software source, using the following command:

Install --allowerasing cairo-infinality-ultimate fontconfig-infinality-ultimate Freetype-infinality-ultimate

Note that the--allowerasing parameter of the DNF is used here, indicating that the Infinality font rendering engine library you have installed is conflicting with the system's default installed library, and the--allowerasing parameter allows DNF to uninstall the corresponding conflicting old library and install the new INFI Nality Library.

3. Install infinality-Optimized fonts. Infinality specifically provides a set of optimized fonts that will work well with the Infinality font rendering engine. This set of fonts includes CJK fonts, with the hinting fine-tuning information built in, using the following command:

Install --allowerasing ibfonts-meta-base ibfonts-meta-extended-lt ibfonts-meta-extended

Note that this will automatically install a number of related font packs.

4, delete the VL Gothic and Naver-nanumgothic (the name may not be spelled, but roughly so) Japanese fonts. Because the infinality default fontconfig configuration will increase the priority of Japanese font in front of the Chinese font, which will cause many programs, especially Java programs in the default Chinese language display using Japanese fonts, resulting in the appearance of ugly and box (small number of Japanese characters, resulting in incomplete Chinese display). So the simplest way is to delete the two default installed Japanese fonts, using the following command:

# DNF Remove Vlgothic-fonts naver-nanumgothic-fonts

It is important to note that the Infinality official website server may be slow to access, resulting in DNF installation package error, you can try several times until the installation is successful. After installation, two directories can be found in the/usr/share/doc directory: Freetype-infinality-ultimate and fontconfig-infinality-ultimate. Both directories have Readme and other readme files that describe in more detail the relevant configuration methods for the infinality optimized compilation of font rendering engine libraries. According to its documentation, we need to do the following:

CP /usr/share/doc/freetype-infinality-ultimate/infinality-settings-generic/etc/profile.d/ Infinality-settings-generic. SH  cp /usr/share/doc/freetype-infinality-ultimate/infinality-settings. sh /etc/x11/xinit/chmod a+x/etc/x11/xinit/xinitrc.d/infinality-settings. SH

The above two are the key font rendering effect profiles, the specific configuration instructions can open these two files look inside the description. Generally, a more appropriate configuration is to set the xft.hinting in the xft_settings variable of line 74th in the/etc/profile.d/infinality-settings-generic.sh file to 1, Xft.hintstyle is set to Hintslight, the Use_style of line No. 715 is set to Infinality (author recommended settings). Set the infinality_ft of line 35th in the/etc/x11/xinit/xinitrc.d/infinality-settings.sh file to Ultimate3 (author recommended settings).

For Java programs, font rendering is always worse than system-native font rendering in Linux environments. The main reason is that Oracle's official Java built a private font rendering engine, unable to use the system's FreeType and Fontconfig configuration, and rendering effect is poor, and Microsoft ClearType similar rendering effect. OpenJDK uses the FreeType font rendering engine, but the default is not to read the system fontconfig configuration, and the font rendering settings are fixed, and similar to the Microsoft ClearType effect, so it is not ideal. The best way to do this is to make the necessary changes to the OpenJDK source code so that it can use the system FreeType font rendering engine while being able to read the current system fontconfig configuration and flexibly adjust the FreeType font-trimming effect in Java. If it is difficult to compile OpenJDK, Infinality has provided a packaged OpenJDK package for FreeType and Fontconfig optimization (currently based on OpenJDK 8u92 version code), so you can directly To download the installation from the Infinality software source, use the following command:
# DNF Install--allowerasingjava-1.8.0-openjdk-infinality-ultimate java-1.8.0-openjdk-infinality-ultimate-headless Java-1.8.0-openjdk-infinality-ultimate-devel
The first two packages are the necessary packages for the OpenJDK JRE, and the last package is the necessary package for the OpenJDK JDK (if used for Java development). Note that you do not install the Java-1.8.0-openjdk-infinality-ultimate-accessibility package because this package is an interface provided by OPENJDK for Gtk+/gnome ATK components, and ATK has been deprecated , if Java-1.8.0-openjdk-infinality-ultimate-accessibility is installed, it can cause errors in running many large Java Swing programs (especially when Swing uses GTK + local themes). Infinality optimized OpenJDK after installation, its specific location and the system of multiple Java How to switch the current environment variables, you can refer to the Linux Alternatives Command and its usage instructions, Alternatives command is dedicated to the Linux is designed for simultaneous installation of multiple software with the same name but with different versions, such as the installation of different versions of Java (JDK or JRE) in the system and the ability to use alternatives for the current version of the switch operation.

After installing the infinality-optimized Java, running the Java Swing program will find that the font rendering in swing is fully consistent with the system native font rendering and can follow the system native font rendering adjustments.

Infinality font rendering enhancements and Java font rendering improvements in the Fedora Linux environment

Related Article

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.