ENGLISH | 简体中文
cengluan is a Chinese TTY font designed for Linux, aiming to provide Chinese display in TTY without installing kernel patches like cjktty, nor third-party software such as kmscon, fbterm, or zhcon.
This project is inspired by the syllazh font.
When using this font, you may notice that Chinese characters with similar pronunciations are displayed as the same character. For example: any character from "用永勇拥擁涌湧咏詠蛹雍踊庸踴泳" will be uniformly displayed as "用".
This is because fonts on Linux TTY are generally changed using the setfont tool from the kbd package, which supports up to 512 glyphs, but a single glyph can be mapped to multiple Unicode code points. Therefore, font-cengluan maps all Chinese characters with the same syllable (ignoring tones) to the same glyph, enabling Chinese display with a limited number of glyphs.
This font also optimizes the mapping of commonly used graphic symbols in terminals to make it more suitable for terminal use. Some examples:
-
Original symbols:
┌───┬───┐ │ │ │ ├───┼───┤ │ │ │ └───┴───┘ -
Before optimization:
????????? ? ? ? ????????? ? ? ? ?????????(Cannot be displayed properly)
-
After optimization:
r---T---7 | | | ├---+---┤ | | | L---┴---JHere,
┌is mapped to the letterr,┬toT,┘toJ, etc. Such mappings maximize display improvement while minimizing the use of additional glyphs (:-D).
In conventional text display scenarios:
- Full-width characters (such as Chinese characters and symbols in GB2312) have a display width of two units (occupying two character positions) and a height of one character row (occupying one line height);
- Half-width characters (such as English letters, Arabic numerals, and ASCII punctuation) have a display width of one unit and the same height of one character row.
That is: Chinese characters and symbols in GB2312 encoding are full-width, while ASCII characters and English symbols (like commas, periods) are typically half-width.
However, PC Screen Font 2 (PSF2) is a fixed-width bitmap font format that does not support characters of different sizes (widths) within a single font. Consequently:
- If all characters are displayed with a width of one unit: full-width characters only show the left half, with the right half displayed as the 32nd character;
- If all characters are displayed with a width of two units: all half-width characters occupy two columns, but visually they are only one unit wide, resulting in large gaps between two half-width characters.
Given the high difficulty of finding or designing "tall, thin half-width monospaced Chinese character fonts" or "compatible full-width English letter fonts", font-cengluan adopts two design approaches:
-
Map all English letters, Arabic numerals, ASCII punctuation, and similar characters to full-width characters in the UTF-8 high range; the spacing between half-width characters remains slightly large.
-
Display all half-width characters with integer scaling doubled, while full-width characters are displayed at their original scaling ratio with padded blank lines above and below.
Although each full-width character is still separated on the right by a 32nd character, font-cengluan achieves a relatively balanced visual appearance overall.
In Linux TTY, the 32nd character of the default font is U+20, i.e., a space. This character is used to fill positions in the background where no character is present.
-
Clone the repository:
git clone https://github.com/PJ-568/font-cengluan.git cd font-cengluan -
Install dependencies:
pip install -r requirements.txt -
Build the font:
bash build.bashDuring the build process, the script will install
psftoolsfor font generation.
After building, a PSF2 font file named cengluan.psfu.gz will be generated in the output/ directory.
Ensure the
setfontcommand is version2.6rc1or higher. Versions before2.6rc1do not support fonts larger than 65535 bytes (≈64KB) before compression. After2.6rc1, this limit was raised to 4194304 bytes (≈4MB).Run
setfont -Vto check the version.
Place cengluan.psfu.gz into the consolefonts directory (located at /usr/share/consolefonts/ in Debian, /usr/share/kbd/consolefonts/ in Arch Linux). Then run setfont cengluan to change the font, or setfont -d cengluan to switch to double-sized font.
Thanks to oldherl for the forward-looking technical exploration project syllazh;
Thanks to TakWolf and their team for providing the fusion-pixel-font font.
The script files build.bash, build_font_from_bdf.py, and all files in scripts/ in this repository follow the GNU GENERAL PUBLIC LICENSE Version 3.
original/references/pinyin_hanzi in the original/references/ directory follows the GNU Lesser General Public License (LGPL) 2.1, while other reference files follow the Unlicense.
The font files generated by this project follow either the MIT License or the SIL OPEN FONT LICENSE Version 1.1. For original font upstream licenses, see the files under FONT-LICENSE/.
Refer to the Contribution Guide.



