层峦(cengluan)是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 cjktty 等内核补丁且不安装 kmscon、fbterm 或 zhcon 等第三方软件的环境下提供 TTY 中文显示。

PJ568 4384db4c91 【新增,字符集】扩展字符集并更新版本至 0.2.0 1 an în urmă
.github 1c3eb8c683 【新增,配置】添加 GitHub Actions 自动发布工作流和英文文档 1 an în urmă
assets ab7f25912e 【初始】 2 ani în urmă
original 4384db4c91 【新增,字符集】扩展字符集并更新版本至 0.2.0 1 an în urmă
scripts 1c3eb8c683 【新增,配置】添加 GitHub Actions 自动发布工作流和英文文档 1 an în urmă
.gitignore 4384db4c91 【新增,字符集】扩展字符集并更新版本至 0.2.0 1 an în urmă
CONTRIBUTING.md ab7f25912e 【初始】 2 ani în urmă
FONT-LICENSE ab7f25912e 【初始】 2 ani în urmă
LICENSE ab7f25912e 【初始】 2 ani în urmă
README.en.md 8ebb16c234 【文档,自述】更新许可证说明以明确 pinyin_hanzi 文件的授权 1 an în urmă
README.md 8ebb16c234 【文档,自述】更新许可证说明以明确 pinyin_hanzi 文件的授权 1 an în urmă
VERSION 4384db4c91 【新增,字符集】扩展字符集并更新版本至 0.2.0 1 an în urmă
build.bash 1c3eb8c683 【新增,配置】添加 GitHub Actions 自动发布工作流和英文文档 1 an în urmă
build_font_from_bdf.py 1c3eb8c683 【新增,配置】添加 GitHub Actions 自动发布工作流和英文文档 1 an în urmă
requirements.txt ab7f25912e 【初始】 2 ani în urmă

README.en.md

Demo

简体中文 | ENGLISH

font-xibo

Xibo is a Chinese TTY font designed for Linux, aiming to provide Chinese display in TTY without installing kernel patches such as cjktty or third-party software like kmscon, fbterm, or zhcon.

The inspiration for this project comes from the syllazh font.

Phonetic Characters

When using this font, you may notice that characters with similar pronunciations are displayed as the same character. For example, any of the characters "用永勇拥擁涌湧咏詠蛹雍踊庸踴泳" 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 a maximum of 512 glyphs. However, a single glyph can map to multiple Unicode code points. Therefore, Xibo maps all characters with the same pronunciation (ignoring tones) to the same glyph, allowing for Chinese character display within the limited number of glyphs.

Building the Font

  1. Clone the repository:

    git clone https://github.com/PJ-568/font-xibo.git
    cd font-xibo
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Build the font:

    bash build.bash
    

During the build process, the script will install psftools, which is used to generate the font.

After building, a PSF2 font file named xibo.psfu.gz will be generated in the output/ directory.

Using the Font

Ensure that the version of the setfont command is 2.6rc1 or higher. Versions prior to 2.6rc1 do not support fonts larger than 65535 (approximately 64KB). After 2.6rc1, the limit has been relaxed to 4194304 (approximately 4MB).

Run setfont -V to check the version.

Place xibo.psfu.gz in the consolefonts directory (located at /usr/share/consolefonts/ on Debian and /usr/share/kbd/consolefonts/ on Arch Linux), then execute setfont xibo to change the font or setfont -d xibo to switch to a double-sized font.

License

Thanks to the WenQuanYi team for providing the WenQuanYi Bitmap Song v1.0.0-RC1 Hero font.

The script files build.bash and build_font_from_bdf.py in this repository are licensed under the GNU GENERAL PUBLIC LICENSE Version 3. original/references/pinyin_hanzi is licensed under GNU Lesser General Public License (LGPL) 2.1. Other reference files in the original/references/ directory are licensed under the Unlicense. The generated font files in this project are licensed under the Free Chinese Font License and GNU GENERAL PUBLIC LICENSE Version 2.

Contributing

Refer to the Contribution Guide.