How Linux system renders Chrome browser fonts

  
                

Under the Linux system, the font of the Chrome browser can be rendered, which makes the font of Chrome look more beautiful, and the Linux font rendering is quite promising relative to the half-hanger of Windows. This article will introduce how the Linux system renders the fonts of the Chrome browser.

Chrome's font rendering dependent on two things: Linux operating system settings, and font rendering Chrome Web font rendering their control.

In the Fedora 22 GNOME 3.16 environment, using gnome-tweak-tool to set the font rendering tweak to none, anti-aliasing to Rgba, but no effect on Chrome, Chrome still uses "completely" fine-tuning The pattern is font rendered, which causes many Chinese fonts to display ugly. The reason is that Chrome reads the fontconfig configuration of the Linux system. By default, the font global hint is not configured in the system fontconfig, so we only need to create a local.conf in the /etc/fonts directory and write the following content. :

<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <match target="font"> <edit name="autohint" mode="assign"> <bool>false</bool> </edit> <edit name="hinting" mode="assign"> < Bool>false</bool> </edit> <edit name="hintstyle" mode="assign"> <const>none</const> </edit> </match> < /fontconfig>
After saving, you can find that all programs in the system can follow this setting. The font rendering is fine-tuned and the Chinese font rendering will look very good. Next, install the Stylish plugin in Chrome to create a style that works for all sites, with a scope of "<;all", as follows:

body * {

font-family: “ Source Han Sans CN” ! Important;

}

pre, code, kbd, samp, var {

font-family: “Monospace”, “Source Han Sans CN” ! Important;

}

This ensures that Chrome's access to any website takes this style.

The above is how the Linux system renders the fonts of the Chrome browser, so that users can set the Chrome browser to look better or their favorite fonts.

Copyright © Windows knowledge All Rights Reserved