Просмотр исходного кода

【更改】将项目名称更新为 font-cengluan

更新了所有相关文件中的项目名称和品牌标识,包括:

- README 文档中的项目描述与使用说明
- 构建脚本中生成的文件名前缀
- 版权声明中的保留字体名称
- 工作流配置中的产物路径引用

此举标志着项目的正式更名,"层峦字体"成为新的项目代号。
PJ568 1 год назад
Родитель
Сommit
1dd6bf0b77
9 измененных файлов с 54 добавлено и 68 удалено
  1. 1 10
      .github/workflows/release.yml
  2. 0 9
      .github/workflows/test_build.yml
  3. 1 10
      .github/workflows/test_release.yml
  4. 10 10
      README.en.md
  5. 10 10
      README.md
  6. 1 1
      SIL-LICENSE
  7. 1 1
      VERSION
  8. 20 16
      build.bash
  9. 10 1
      build_font_from_bdf.py

+ 1 - 10
.github/workflows/release.yml

@@ -59,22 +59,13 @@ jobs:
           # 运行构建脚本
           bash build.bash
 
-          # 验证输出文件
-          if [ ! -f "output/xibo.psfu.gz" ]; then
-            echo "错误:字体文件生成失败"
-            exit 1
-          fi
-
-          # 显示文件信息
-          ls -la output/xibo.psfu.gz
-
       - name: 创建 GitHub Release
         if: steps.version-check.outputs.version != '0'
         uses: ncipollo/release-action@v1
         with:
           generateReleaseNotes: true
           tag: "v${{ steps.version-check.outputs.version }}"
-          artifacts: "output/xibo.psfu.gz,output/xibo.psf,output/xibo.txt"
+          artifacts: "output/*"
 
       - name: 删除标签(如果失败)
         if: (cancelled() || failure()) && steps.push-tag.outputs.tag_name != ''

+ 0 - 9
.github/workflows/test_build.yml

@@ -33,15 +33,6 @@ jobs:
           # 运行构建脚本
           bash build.bash
 
-          # 验证输出文件
-          if [ ! -f "output/xibo.psfu.gz" ]; then
-            echo "错误:字体文件生成失败"
-            exit 1
-          fi
-
-          # 显示文件信息
-          ls -la output/xibo.psfu.gz
-
       - name: Upload artifact
         if: (cancelled() || failure() || success())
         uses: actions/upload-artifact@v4

+ 1 - 10
.github/workflows/test_release.yml

@@ -59,15 +59,6 @@ jobs:
           # 运行构建脚本
           bash build.bash
 
-          # 验证输出文件
-          if [ ! -f "output/xibo.psfu.gz" ]; then
-            echo "错误:字体文件生成失败"
-            exit 1
-          fi
-
-          # 显示文件信息
-          ls -la output/xibo.psfu.gz
-
       - name: Upload artifact
         if: (cancelled() || failure() || success())
         uses: actions/upload-artifact@v4
@@ -82,7 +73,7 @@ jobs:
       #   with:
       #     generateReleaseNotes: true
       #     tag: "v${{ steps.version-check.outputs.version }}"
-      #     artifacts: "output/xibo.psfu.gz"
+      #     artifacts: "output/*"
 
       # - name: 删除标签(如果失败)
       #   if: (cancelled() || failure()) && steps.push-tag.outputs.tag_name != ''

+ 10 - 10
README.en.md

@@ -2,9 +2,9 @@
 
 > ENGLISH | [简体中文](README.md)
 
-## font-xibo
+## font-cengluan(层峦字体)
 
-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/).
+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/).
 
 The inspiration for this project comes from the [syllazh](https://github.com/oldherl/syllazh/) font.
 
@@ -13,7 +13,7 @@ The inspiration for this project comes from the [syllazh](https://github.com/old
 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.
+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.
 
 ### Terminal User Inerface Display Optimization
 
@@ -46,7 +46,7 @@ This font also optimizes the mapping of commonly used graphical symbols in termi
   Among these, `┌` is mapped to the letter `r`, `┬` is mapped to the letter `T`, `┘` is mapped to the letter `J`, etc.
   This type of mapping maximizes the improvement of display quality without occupying more glyphs (:-D).
 
-  ![btop with font-xibo](assets/btop.png)
+  ![btop with font-cengluan](assets/btop.png)
 
 ### Character Width Display Optimization
 
@@ -64,8 +64,8 @@ This leads to:
 - 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).
 
 Given the high difficulty of finding or designing "tall and narrow half-width monospace Chinese fonts" or "compatible full-width English letter fonts",
-font-xibo maps all English letters, Arabic numerals, ASCII punctuation, and other characters to full-width characters in the UTF-8 high range.
-Although each Chinese character is still separated by a [thirty-second character](#thirty-second-character), font-xibo achieves a relatively balanced visual appearance overall.
+font-cengluan maps all English letters, Arabic numerals, ASCII punctuation, and other characters to full-width characters in the UTF-8 high range.
+Although each Chinese character is still separated by a [thirty-second character](#thirty-second-character), font-cengluan achieves a relatively balanced visual appearance overall.
 
 ### Thirty-second Character
 
@@ -76,8 +76,8 @@ The thirty-second character in Linux TTY fonts defaults to `U+20`, which is a sp
 1. Clone the repository:
 
    ```shellscript
-   git clone https://github.com/PJ-568/font-xibo.git
-   cd font-xibo
+   git clone https://github.com/PJ-568/font-cengluan.git
+   cd font-cengluan
    ```
 
 2. Install dependencies:
@@ -94,7 +94,7 @@ The thirty-second character in Linux TTY fonts defaults to `U+20`, which is a sp
 
    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.
+After building, a PSF2 font file named `cengluan.psfu.gz` will be generated in the `output/` directory.
 
 ## Using the Font
 
@@ -104,7 +104,7 @@ After building, a PSF2 font file named `xibo.psfu.gz` will be generated in the `
 >
 > 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.
+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.
 
 ## License
 

+ 10 - 10
README.md

@@ -2,9 +2,9 @@
 
 > [ENGLISH](README.en.md) | 简体中文
 
-## font-xibo
+## font-cengluan(层峦 TTY 字体)
 
-xibo 是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 [cjktty](https://github.com/zhmars/cjktty-patches) 等内核补丁,
+cengluan 是一个为 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 中文显示。
 
@@ -15,7 +15,7 @@ xibo 是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 [c
 在使用本字体时,您可能注意到——读音相近的汉字会被统一显示为同一个汉字,如:“用永勇拥擁涌湧咏詠蛹雍踊庸踴泳”中的任意一个汉字会被会统一显示为“用”。
 
 这是因为 Linux TTY 上的字体一般用 kbd 软件包的 setfont 工具更换。它最多支持 512 个字形(glyph),但单个字形可以映射到多个 Unicode 码位。
-因此,xibo 将所有忽略声调的音节相同的汉字都会被映射到同一个字形上,以实现在有限字形数下的汉字显示。
+因此,font-cengluan 将所有忽略声调的音节相同的汉字都会被映射到同一个字形上,以实现在有限字形数下的汉字显示。
 
 ### 终端图形程序显示优化
 
@@ -48,7 +48,7 @@ xibo 是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 [c
   其中,`┌` 被映射为字母 `r`,`┬` 被映射为字母 `T`,`┘` 被映射为字母 `J` 等。
   此类映射在尽量不占用更多字形的情况下最大程度地改善了显示效果(:-D)。
 
-  ![font-xibo 在 btop 下的表现](assets/btop.png)
+  ![font-cengluan 在 btop 下的表现](assets/btop.png)
 
 ### 字宽显示优化
 
@@ -66,8 +66,8 @@ xibo 是一个为 Linux 设计的中文 TTY 字体,旨在在不安装诸如 [c
 - 所有字符以宽二个单位显示:所有半角字符占满两行,但视觉宽仅一单位,导致[两个半角字符间有大空隙](assets/display_old.png)。
 
 鉴于寻找和设计“瘦高半角等宽汉字等字体”或“适配的全角英文字母等字体”的高难度。
-font-xibo 将所有英文字母、阿拉伯数字、ASCII 标点符号等字映射为 UTF-8 高位的全角字符。
-虽每个汉字间仍被一个[第三十二个字符](#第三十二个字符)隔开,font-xibo 在总体视觉上达到相对平衡。
+font-cengluan 将所有英文字母、阿拉伯数字、ASCII 标点符号等字映射为 UTF-8 高位的全角字符。
+虽每个汉字间仍被一个[第三十二个字符](#第三十二个字符)隔开,font-cengluan 在总体视觉上达到相对平衡。
 
 ### 第三十二个字符
 
@@ -78,8 +78,8 @@ Linux TTY 默认第字体的三十二个字符为 `U+20`,既空格。这个字
 1. 克隆仓库:
 
    ```shellscript
-   git clone https://github.com/PJ-568/font-xibo.git
-   cd font-xibo
+   git clone https://github.com/PJ-568/font-cengluan.git
+   cd font-cengluan
    ```
 
 2. 安装依赖项:
@@ -96,7 +96,7 @@ Linux TTY 默认第字体的三十二个字符为 `U+20`,既空格。这个字
 
    在构建过程中,脚本会安装 `psftools`,用于生成字体。
 
-构建完成后,会在 `output/` 生成一个名为 `xibo.psfu.gz` 的 PSF2 字体文件。
+构建完成后,会在 `output/` 生成一个名为 `cengluan.psfu.gz` 的 PSF2 字体文件。
 
 ## 使用字体
 
@@ -106,7 +106,7 @@ Linux TTY 默认第字体的三十二个字符为 `U+20`,既空格。这个字
 >
 > 执行 `setfont -V` 以检查版本。
 
-将 `xibo.psfu.gz` 放入 `consolefonts` 目录下(在 Debian 中位于 `/usr/share/consolefonts/`、在 Arch Linux 中位于 `/usr/share/kbd/consolefonts/`),执行 `setfont xibo` 更换字体或执行 `setfont -d xibo` 切换到两倍大小的字体。
+将 `cengluan.psfu.gz` 放入 `consolefonts` 目录下(在 Debian 中位于 `/usr/share/consolefonts/`、在 Arch Linux 中位于 `/usr/share/kbd/consolefonts/`),执行 `setfont cengluan` 更换字体或执行 `setfont -d cengluan` 切换到两倍大小的字体。
 
 ## 许可协议
 

+ 1 - 1
SIL-LICENSE

@@ -1,5 +1,5 @@
 Copyright (c) 2025, PJ568 <[email protected]>,
-with Reserved Font Name "xibo".
+with Reserved Font Name "cengluan".
 
 This Font Software is licensed under the SIL Open Font License, Version 1.1.
 This license is copied below, and is also available with a FAQ at:

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.0.1
+2.0.0

+ 20 - 16
build.bash

@@ -1,6 +1,7 @@
 #!/bin/bash
 
 path=$(pwd)
+brand="cengluan"
 
 # 创建必要的目录
 mkdir -p $path/temp
@@ -12,8 +13,8 @@ wget "$download_url" -O $path/temp/font.zip
 
 # 检查下载是否成功
 if [ $? -ne 0 ]; then
-    echo "错误: 下载文件失败。"
-    exit 1
+  echo "错误: 下载文件失败。"
+  exit 1
 fi
 
 # 解压下载的压缩包到 $path/temp
@@ -21,20 +22,21 @@ unzip $path/temp/font.zip -d $path/temp
 
 # 检查解压是否成功
 if [ $? -ne 0 ]; then
-    echo "错误: 解压文件失败。"
-    exit 1
+  echo "错误: 解压文件失败。"
+  exit 1
 fi
 
 # 列出解压后的目录内容
 ls $path/temp/
 
 # 运行 Python 脚本
-python3 $path/build_font_from_bdf.py > $path/output/xibo.txt
+python3 $path/build_font_from_bdf.py "$path/temp/fusion-pixel-12px-monospaced-zh_hans.bdf" > $path/output/$brand.txt
+# python3 $path/build_font_from_bdf.py "$path/temp/fusion-pixel-12px-monospaced-zh_hant.bdf" > $path/output/$brand-zh_hant.txt
 
 # 检查脚本执行是否成功
 if [ $? -ne 0 ]; then
-    echo "错误: 运行 Python 脚本失败。"
-    exit 1
+  echo "错误: 运行 Python 脚本失败。"
+  exit 1
 fi
 
 # 下载并编译 psftools
@@ -47,24 +49,26 @@ cd $path/
 
 # 检查压缩是否成功
 if [ $? -ne 0 ]; then
-    echo "错误: 下载并编译 psftools失败。"
-    exit 1
+  echo "错误: 下载并编译 psftools失败。"
+  exit 1
 fi
 
 # 将 txt 文件转换为 psf 文件
-$path/temp/psftools-1.0.14/tools/txt2psf $path/output/xibo.txt $path/output/xibo.psf
+$path/temp/psftools-1.0.14/tools/txt2psf $path/output/$brand.txt $path/output/$brand.psf
+# $path/temp/psftools-1.0.14/tools/txt2psf $path/output/$brand-zh_hant.txt $path/output/$brand-zh_hant.psf
 
 # 检查转换是否成功
 if [ $? -ne 0 ]; then
-    echo "错误: 转换文件失败。"
-    exit 1
+  echo "错误: 转换文件失败。"
+  exit 1
 fi
 
 # 压缩 psf 文件
-gzip -c $path/output/xibo.psf > $path/output/xibo.psfu.gz
+gzip -c $path/output/$brand.psf > $path/output/$brand.psfu.gz
+# gzip -c $path/output/$brand-zh_hant.psf > $path/output/$brand-zh_hant.psfu.gz
 
 # 检查压缩是否成功
 if [ $? -ne 0 ]; then
-    echo "错误: 文件压缩失败。"
-    exit 1
-fi
+  echo "错误: 文件压缩失败。"
+  exit 1
+fi

+ 10 - 1
build_font_from_bdf.py

@@ -1,10 +1,19 @@
 #!/usr/bin/env python3
 
 # 导入所需的库
+import sys
 from bdflib import reader
 
+# 检查命令行参数
+if len(sys.argv) < 2:
+    print("错误:请提供 BDF 字体文件路径作为参数")
+    print("用法:python3 build_font_from_bdf.py <bdf 文件路径>")
+    exit(1)
+
+bdf_file_path = sys.argv[1]
+
 # 读取 BDF 格式的字体文件
-font = reader.read_bdf(open("temp/fusion-pixel-12px-monospaced-zh_hans.bdf", "rb"))
+font = reader.read_bdf(open(bdf_file_path, "rb"))
 
 # File format version; currently this must be 0.
 version = '0'