Skip to content

Commit 63625ad

Browse files
committed
【测试】修复名称
相关:#1
1 parent 957c472 commit 63625ad

10 files changed

Lines changed: 146 additions & 85 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,13 @@ jobs:
5959
# 运行构建脚本
6060
bash build.bash
6161
62-
# 验证输出文件
63-
if [ ! -f "output/xibo.psfu.gz" ]; then
64-
echo "错误:字体文件生成失败"
65-
exit 1
66-
fi
67-
68-
# 显示文件信息
69-
ls -la output/xibo.psfu.gz
70-
7162
- name: 创建 GitHub Release
7263
if: steps.version-check.outputs.version != '0'
7364
uses: ncipollo/release-action@v1
7465
with:
7566
generateReleaseNotes: true
7667
tag: "v${{ steps.version-check.outputs.version }}"
77-
artifacts: "output/xibo.psfu.gz,output/xibo.psf,output/xibo.txt"
68+
artifacts: "output/*"
7869

7970
- name: 删除标签(如果失败)
8071
if: (cancelled() || failure()) && steps.push-tag.outputs.tag_name != ''

.github/workflows/test_build.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ jobs:
3333
# 运行构建脚本
3434
bash build.bash
3535
36-
# 验证输出文件
37-
if [ ! -f "output/xibo.psfu.gz" ]; then
38-
echo "错误:字体文件生成失败"
39-
exit 1
40-
fi
41-
42-
# 显示文件信息
43-
ls -la output/xibo.psfu.gz
44-
4536
- name: Upload artifact
4637
if: (cancelled() || failure() || success())
4738
uses: actions/upload-artifact@v4

.github/workflows/test_release.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@ jobs:
5959
# 运行构建脚本
6060
bash build.bash
6161
62-
# 验证输出文件
63-
if [ ! -f "output/xibo.psfu.gz" ]; then
64-
echo "错误:字体文件生成失败"
65-
exit 1
66-
fi
67-
68-
# 显示文件信息
69-
ls -la output/xibo.psfu.gz
70-
7162
- name: Upload artifact
7263
if: (cancelled() || failure() || success())
7364
uses: actions/upload-artifact@v4
@@ -82,7 +73,7 @@ jobs:
8273
# with:
8374
# generateReleaseNotes: true
8475
# tag: "v${{ steps.version-check.outputs.version }}"
85-
# artifacts: "output/xibo.psfu.gz"
76+
# artifacts: "output/*"
8677

8778
# - name: 删除标签(如果失败)
8879
# if: (cancelled() || failure()) && steps.push-tag.outputs.tag_name != ''

README.en.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
> ENGLISH | [简体中文](README.md)
44
5-
## font-xibo
5+
## font-cengluan(层峦字体)
66

7-
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/).
7+
cengluan 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/).
88

99
The inspiration for this project comes from the [syllazh](https://github.com/oldherl/syllazh/) font.
1010

@@ -13,7 +13,7 @@ The inspiration for this project comes from the [syllazh](https://github.com/old
1313
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 "用".
1414

1515
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.
16-
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.
16+
Therefore, cengluan maps all characters with the same pronunciation (ignoring tones) to the same glyph, allowing for Chinese character display within the limited number of glyphs.
1717

1818
### Terminal User Inerface Display Optimization
1919

@@ -46,7 +46,7 @@ This font also optimizes the mapping of commonly used graphical symbols in termi
4646
Among these, `` is mapped to the letter `r`, `` is mapped to the letter `T`, `` is mapped to the letter `J`, etc.
4747
This type of mapping maximizes the improvement of display quality without occupying more glyphs (:-D).
4848

49-
![btop with font-xibo](assets/btop.png)
49+
![btop with font-cengluan](assets/btop.png)
5050

5151
### Character Width Display Optimization
5252

@@ -64,8 +64,8 @@ This leads to:
6464
- If all characters are displayed with a width of two units: all half-width characters occupy two columns, but visually only have a width of one unit, resulting in [large gaps between half-width characters](assets/display_old.png).
6565

6666
Given the high difficulty of finding or designing "tall and narrow half-width monospace Chinese fonts" or "compatible full-width English letter fonts",
67-
font-xibo maps all English letters, Arabic numerals, ASCII punctuation, and other characters to full-width characters in the UTF-8 high range.
68-
Although each Chinese character is still separated by a [thirty-second character](#thirty-second-character), font-xibo achieves a relatively balanced visual appearance overall.
67+
font-cengluan maps all English letters, Arabic numerals, ASCII punctuation, and other characters to full-width characters in the UTF-8 high range.
68+
Although each Chinese character is still separated by a [thirty-second character](#thirty-second-character), font-cengluan achieves a relatively balanced visual appearance overall.
6969

7070
### Thirty-second Character
7171

@@ -76,8 +76,8 @@ The thirty-second character in Linux TTY fonts defaults to `U+20`, which is a sp
7676
1. Clone the repository:
7777

7878
```shellscript
79-
git clone https://github.com/PJ-568/font-xibo.git
80-
cd font-xibo
79+
git clone https://github.com/PJ-568/font-cengluan.git
80+
cd font-cengluan
8181
```
8282

8383
2. Install dependencies:
@@ -94,7 +94,7 @@ The thirty-second character in Linux TTY fonts defaults to `U+20`, which is a sp
9494

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

97-
After building, a PSF2 font file named `xibo.psfu.gz` will be generated in the `output/` directory.
97+
After building, a PSF2 font file named `cengluan.psfu.gz` will be generated in the `output/` directory.
9898

9999
## Using the Font
100100

@@ -104,7 +104,7 @@ After building, a PSF2 font file named `xibo.psfu.gz` will be generated in the `
104104
>
105105
> Run `setfont -V` to check the version.
106106
107-
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.
107+
Place `cengluan.psfu.gz` in the `consolefonts` directory (located at `/usr/share/consolefonts/` on Debian and `/usr/share/kbd/consolefonts/` on Arch Linux), then execute `setfont cengluan` to change the font or `setfont -d cengluan` to switch to a double-sized font.
108108

109109
## License
110110

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
> [ENGLISH](README.en.md) | 简体中文
44
5-
## font-xibo
5+
## font-cengluan(层峦 TTY 字体)
66

7-
xibo 是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 [cjktty](https://github.com/zhmars/cjktty-patches) 等内核补丁,
7+
cengluan 是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 [cjktty](https://github.com/zhmars/cjktty-patches) 等内核补丁,
88
且不安装 [kmscon](http://www.freedesktop.org/wiki/Software/kmscon)[fbterm](https://salsa.debian.org/debian/fbterm)
99
[zhcon](https://zhcon.sourceforge.net/) 等第三方软件的环境下提供 TTY 中文显示。
1010

@@ -15,7 +15,7 @@ xibo 是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 [c
1515
在使用本字体时,您可能注意到——读音相近的汉字会被统一显示为同一个汉字,如:“用永勇拥擁涌湧咏詠蛹雍踊庸踴泳”中的任意一个汉字会被会统一显示为“用”。
1616

1717
这是因为 Linux TTY 上的字体一般用 kbd 软件包的 setfont 工具更换。它最多支持 512 个字形(glyph),但单个字形可以映射到多个 Unicode 码位。
18-
因此,xibo 将所有忽略声调的音节相同的汉字都会被映射到同一个字形上,以实现在有限字形数下的汉字显示。
18+
因此,font-cengluan 将所有忽略声调的音节相同的汉字都会被映射到同一个字形上,以实现在有限字形数下的汉字显示。
1919

2020
### 终端图形程序显示优化
2121

@@ -48,7 +48,7 @@ xibo 是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 [c
4848
其中,`` 被映射为字母 `r``` 被映射为字母 `T``` 被映射为字母 `J` 等。
4949
此类映射在尽量不占用更多字形的情况下最大程度地改善了显示效果(:-D)。
5050

51-
![font-xibo 在 btop 下的表现](assets/btop.png)
51+
![font-cengluan 在 btop 下的表现](assets/btop.png)
5252

5353
### 字宽显示优化
5454

@@ -66,8 +66,8 @@ xibo 是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 [c
6666
- 所有字符以宽二个单位显示:所有半角字符占满两行,但视觉宽仅一单位,导致[两个半角字符间有大空隙](assets/display_old.png)
6767

6868
鉴于寻找和设计“瘦高半角等宽汉字等字体”或“适配的全角英文字母等字体”的高难度。
69-
font-xibo 将所有英文字母、阿拉伯数字、ASCII 标点符号等字映射为 UTF-8 高位的全角字符。
70-
虽每个汉字间仍被一个[第三十二个字符](#第三十二个字符)隔开,font-xibo 在总体视觉上达到相对平衡。
69+
font-cengluan 将所有英文字母、阿拉伯数字、ASCII 标点符号等字映射为 UTF-8 高位的全角字符。
70+
虽每个汉字间仍被一个[第三十二个字符](#第三十二个字符)隔开,font-cengluan 在总体视觉上达到相对平衡。
7171

7272
### 第三十二个字符
7373

@@ -78,8 +78,8 @@ Linux TTY 默认第字体的三十二个字符为 `U+20`,既空格。这个字
7878
1. 克隆仓库:
7979

8080
```shellscript
81-
git clone https://github.com/PJ-568/font-xibo.git
82-
cd font-xibo
81+
git clone https://github.com/PJ-568/font-cengluan.git
82+
cd font-cengluan
8383
```
8484

8585
2. 安装依赖项:
@@ -96,7 +96,7 @@ Linux TTY 默认第字体的三十二个字符为 `U+20`,既空格。这个字
9696

9797
在构建过程中,脚本会安装 `psftools`,用于生成字体。
9898

99-
构建完成后,会在 `output/` 生成一个名为 `xibo.psfu.gz` 的 PSF2 字体文件。
99+
构建完成后,会在 `output/` 生成一个名为 `cengluan.psfu.gz` 的 PSF2 字体文件。
100100

101101
## 使用字体
102102

@@ -106,7 +106,7 @@ Linux TTY 默认第字体的三十二个字符为 `U+20`,既空格。这个字
106106
>
107107
> 执行 `setfont -V` 以检查版本。
108108
109-
`xibo.psfu.gz` 放入 `consolefonts` 目录下(在 Debian 中位于 `/usr/share/consolefonts/`、在 Arch Linux 中位于 `/usr/share/kbd/consolefonts/`),执行 `setfont xibo` 更换字体或执行 `setfont -d xibo` 切换到两倍大小的字体。
109+
`cengluan.psfu.gz` 放入 `consolefonts` 目录下(在 Debian 中位于 `/usr/share/consolefonts/`、在 Arch Linux 中位于 `/usr/share/kbd/consolefonts/`),执行 `setfont cengluan` 更换字体或执行 `setfont -d cengluan` 切换到两倍大小的字体。
110110

111111
## 许可协议
112112

SIL-LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Copyright (c) 2025, PJ568 <pj568@pj568.eu.org>,
2-
with Reserved Font Name "xibo".
2+
with Reserved Font Name "cengluan".
33

44
This Font Software is licensed under the SIL Open Font License, Version 1.1.
55
This license is copied below, and is also available with a FAQ at:

build.bash

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
path=$(pwd)
4+
brand="cengluan"
45

56
# 创建必要的目录
67
mkdir -p $path/temp
@@ -12,29 +13,30 @@ wget "$download_url" -O $path/temp/font.zip
1213

1314
# 检查下载是否成功
1415
if [ $? -ne 0 ]; then
15-
echo "错误: 下载文件失败。"
16-
exit 1
16+
echo "错误: 下载文件失败。"
17+
exit 1
1718
fi
1819

1920
# 解压下载的压缩包到 $path/temp
2021
unzip $path/temp/font.zip -d $path/temp
2122

2223
# 检查解压是否成功
2324
if [ $? -ne 0 ]; then
24-
echo "错误: 解压文件失败。"
25-
exit 1
25+
echo "错误: 解压文件失败。"
26+
exit 1
2627
fi
2728

2829
# 列出解压后的目录内容
2930
ls $path/temp/
3031

3132
# 运行 Python 脚本
32-
python3 $path/build_font_from_bdf.py > $path/output/xibo.txt
33+
python3 $path/build_font_from_bdf.py "$path/temp/fusion-pixel-12px-monospaced-zh_hans.bdf" > $path/output/$brand-zh_hans.txt
34+
# python3 $path/build_font_from_bdf.py "$path/temp/fusion-pixel-12px-monospaced-zh_hant.bdf" > $path/output/$brand-zh_hant.txt
3335

3436
# 检查脚本执行是否成功
3537
if [ $? -ne 0 ]; then
36-
echo "错误: 运行 Python 脚本失败。"
37-
exit 1
38+
echo "错误: 运行 Python 脚本失败。"
39+
exit 1
3840
fi
3941

4042
# 下载并编译 psftools
@@ -47,24 +49,26 @@ cd $path/
4749

4850
# 检查压缩是否成功
4951
if [ $? -ne 0 ]; then
50-
echo "错误: 下载并编译 psftools失败。"
51-
exit 1
52+
echo "错误: 下载并编译 psftools失败。"
53+
exit 1
5254
fi
5355

5456
# 将 txt 文件转换为 psf 文件
55-
$path/temp/psftools-1.0.14/tools/txt2psf $path/output/xibo.txt $path/output/xibo.psf
57+
$path/temp/psftools-1.0.14/tools/txt2psf $path/output/$brand-zh_hans.txt $path/output/$brand-zh_hans.psf
58+
# $path/temp/psftools-1.0.14/tools/txt2psf $path/output/$brand-zh_hant.txt $path/output/$brand-zh_hant.psf
5659

5760
# 检查转换是否成功
5861
if [ $? -ne 0 ]; then
59-
echo "错误: 转换文件失败。"
60-
exit 1
62+
echo "错误: 转换文件失败。"
63+
exit 1
6164
fi
6265

6366
# 压缩 psf 文件
64-
gzip -c $path/output/xibo.psf > $path/output/xibo.psfu.gz
67+
gzip -c $path/output/$brand-zh_hans.psf > $path/output/$brand-zh_hans.psfu.gz
68+
# gzip -c $path/output/$brand-zh_hant.psf > $path/output/$brand-zh_hant.psfu.gz
6569

6670
# 检查压缩是否成功
6771
if [ $? -ne 0 ]; then
68-
echo "错误: 文件压缩失败。"
69-
exit 1
70-
fi
72+
echo "错误: 文件压缩失败。"
73+
exit 1
74+
fi

build_font_from_bdf.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
#!/usr/bin/env python3
22

33
# 导入所需的库
4+
import sys
45
from bdflib import reader
56

7+
# 检查命令行参数
8+
if len(sys.argv) < 2:
9+
print("错误:请提供 BDF 字体文件路径作为参数")
10+
print("用法:python3 build_font_from_bdf.py <bdf 文件路径>")
11+
exit(1)
12+
13+
bdf_file_path = sys.argv[1]
14+
615
# 读取 BDF 格式的字体文件
7-
font = reader.read_bdf(open("temp/fusion-pixel-12px-monospaced-zh_hans.bdf", "rb"))
16+
font = reader.read_bdf(open(bdf_file_path, "rb"))
817

918
# File format version; currently this must be 0.
1019
version = '0'

0 commit comments

Comments
 (0)