29
February
2024
Three ways to include characters instead of "tofu" characters for Chinese language
16:13

Three ways to include characters instead of "tofu" characters for Chinese language

29 February 2024 16:13

How to enable Chinese characters in Linux, Chrome and FireFox browsers.

Introduction

Some distributions do not display Chinese characters because they widely use the DejaVu font, which does not have Chinese characters.

For hieroglyphs, the prefix cjk was invented - China, Japan, Korea.

When using DejaVU base fonts, the site may not display correctly. The squares in place of the missing characters are often called "tofu" - similar to white bean curd cubes. Tofu is one of the most popular foods in China and Japan, and there is an irony in the designation of the square symbols. Higher quality fonts without rectangles in place of missing characters are called no-tofu.

tofu

Method No. 1: Installing the font "fonts-noto-cjk-extra"

This command will install a font with additional Unicode characters for the Cathay language

sudo apt install fonts-noto-cjk-extra

The installation of fonts-noto-cjk and fonts-noto-cjk-extra will occur - the package size is 309 MB.

Font display in Google Chrome:
chrome1

Font display in Mozilla FireFox:
firefox1

Method No. 2: Installing fonts ukai, uming, ipafont, mincho, unfonts

These fonts are of the highest quality for Chinese, Japanese and Korean characters.
The character designs are elegant.

sudo apt install fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-gothic fonts-ipafont-mincho fonts-unfonts-core

Font display in Google Chrome:
chrome2

Font display in Mozilla FireFox:
firefox2

Method #3: Installing fonts from the fonts-droid-fallback meta package

This package provides DroidSans Fallback options: Fallback and FallbackFull.

Each contains an extensive character set, including support for Western European, Eastern/Central European, Baltic, Cyrillic, Greek and Turkish. The regular Droid Sans font also supports Arabic, Simplified and Traditional Chinese, Hebrew, Japanese, Korean and Thai.

The Droid font was designed by Steve Matteson of Ascender Corporation and is designed to provide optimal on-screen text quality.
In my opinion, Droid fonts are like "poster" fonts - easily legible from a distance.

sudo apt install fonts-droid-fallback

Font display in Google Chrome:
chrome3

Font display in Mozilla FireFox:
firefox3

Which of the three options looks more interesting is up to the reader to decide.

Help on Unicode - character set

Chinese characters are from U+20000 to 3134A "UNIFIED IDEOGRAPH". Depending on the font, not all characters are present (in Chinese there are up to 100,000, the literacy standard is 2000).

Fonts

As can be seen from the table above, the most complete sets of hieroglyphs have the following fonts:

  • AR PL UKai CN
  • AR PL UMing CN
  • DroidSansFallback (WenQuanYi)
  • Noto Serif CJK SC

Considering that the Noto font (packages fonts-noto-cjk and fonts-noto-cjk-extra) installs too many fonts, it can be removed to save computer resources:

sudo apt remove fonts-noto-cjk и fonts-noto-cjk-extra

I recommend using one of the following options:

  1. Ukai

    sudo apt install fonts-arphic-ukai

  2. Uming

    sudo apt install fonts-arphic-uming

  3. Droid-fallback

    sudo apt install fonts-droid-fallback



Related publications