From da1f5d0c6f0b577f3b7d173394bc254660dcaead Mon Sep 17 00:00:00 2001 From: PJ568 Date: Wed, 11 Dec 2024 14:49:35 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=87=E6=A1=A3=E3=80=91=E8=87=AA?= =?UTF-8?q?=E8=BF=B0=E6=B7=BB=E5=8A=A0=E8=8B=B1=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/README.md b/README.md index 0a5459d..d550f5d 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ ## font-xibo +
+
+ xibo 是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 [cjktty](https://github.com/zhmars/cjktty-patches) 等内核补丁且不安装 [kmscon](http://www.freedesktop.org/wiki/Software/kmscon)、[fbterm](https://salsa.debian.org/debian/fbterm) 或 [zhcon](https://zhcon.sourceforge.net/) 等第三方软件的环境下提供 TTY 中文显示。 本项目的灵感来源自 [syllazh](https://github.com/oldherl/syllazh/) 字体。 @@ -57,3 +60,65 @@ xibo 是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 [c ## 做出贡献 请参照[贡献指北](CONTRIBUTING.md)。 + +
+
+ +Xibo is a Chinese TTY font designed for Linux, aiming to provide Chinese display in TTY without installing kernel patches such as [cjktty](https://github.com/zhmars/cjktty-patches) or third-party software like [kmscon](http://www.freedesktop.org/wiki/Software/kmscon), [fbterm](https://salsa.debian.org/debian/fbterm), or [zhcon](https://zhcon.sourceforge.net/). + +The inspiration for this project comes from the [syllazh](https://github.com/oldherl/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: + + ```shellscript + git clone https://github.com/PJ-568/font-xibo.git + cd font-xibo + ``` + +2. Install dependencies: + + ```shellscript + pip install -r requirements.txt + ``` + +3. Build the font: + + ```shellscript + 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 + +The script files `build.bash` and `build_font_from_bdf.py` in this repository are licensed under the [GNU GENERAL PUBLIC LICENSE Version 3](LICENSE). +All reference files in the `original/reference/` directory are licensed under the [Unlicense](original/reference/LICENSE). +The generated font files in this project are licensed under the [Free Chinese Font License and GNU GENERAL PUBLIC LICENSE Version 2](FONT-LICENSE). + +## Contributing + +Refer to the [Contribution Guide](CONTRIBUTING.md). + +
+