forked from laishulu/Sarasa-Term-SC-Nerd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
42 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,13 @@ fonts](https://github.com/ryanoasis/nerd-fonts)字体补丁程序,然后用该 | |
fonts`合并入`Sarasa Term SC`, 再经过一些后处理,而最后形成的字体。该字体特别适合 | ||
**简体中文**用户在**终端**或者**代码编辑器**中使用。 | ||
|
||
**在 [laishulu/Sarasa-Term-SC-Nerd](https://github.com/laishulu/Sarasa-Term-SC-Nerd) 的基础上,更新了上游版本** | ||
|
||
上游版本: | ||
|
||
- Sarasa Term SC:0.40.4 | ||
- Nerd Font: 2.3.3 | ||
- Font Patcher: 3.6.1 | ||
- Sarasa Term SC:1.0.16 | ||
- Nerd Font: 3.2.1 | ||
- Font Patcher: 4.13.1 | ||
|
||
## 字体效果 | ||
|
||
|
@@ -40,16 +42,12 @@ fonts`合并入`Sarasa Term SC`, 再经过一些后处理,而最后形成的 | |
- 加入了`hdmx`表,解决了 windows 系统下的一些情况下无法严格对齐的问题。 | ||
- 修正了`OS/2`表中的`panose`和`post`表中的`isFixedPitch`,使得字体被系统认出是等 | ||
宽字体。 | ||
- 删除了 `Material` 字符集中的部分字符,避免超出字体字符数量上限 | ||
|
||
## 安装 | ||
|
||
- MacOS 用户可以直接通过 cask 安装: | ||
```sh | ||
brew tap laishulu/cask-fonts | ||
brew install --cask font-sarasa-nerd | ||
``` | ||
- 手工下载安装: | ||
- 前往 [release](https://github.com/laishulu/Sarasa-Term-SC-Nerd/releases) 下载 | ||
- 前往 [release](https://github.com/mzr1996/Sarasa-Term-SC-Nerd/releases) 下载 | ||
`sarasa-term-sc-nerd.ttc.tar.gz`。 | ||
- 将 `sarasa-term-sc-nerd.ttc.tar.gz` 解压即可得到字体文件。 | ||
|
||
|
@@ -59,20 +57,39 @@ fonts`合并入`Sarasa Term SC`, 再经过一些后处理,而最后形成的 | |
|
||
## 如何生成字体 | ||
|
||
1. 进入 `nerd font` 源码目录,以下所有操作都在此目录下进行。 | ||
2. 将本项目 `scripts` 目录下的文件(不含`script`目录自身)拷贝过去。 | ||
3. 安装`fontpatcher` | ||
**根据我的实践,在原流程基础上做了一些修改,以下流程仅针对 Ubuntu 环境,其他环境可自行调整** | ||
|
||
1. 安装依赖 | ||
```bash | ||
sudo apt install python3-fontforge fontforge | ||
``` | ||
wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FontPatcher.zip | ||
unzip FontPatcher.zip && rm -rvf FontPatcher.zip | ||
|
||
2. 下载并进入 `nerd font` 源码目录,以下所有操作都在此目录下进行。 | ||
```bash | ||
git clone --filter=blob:none [email protected]:ryanoasis/nerd-fonts.git | ||
``` | ||
|
||
3. 将本项目 `scripts` 目录下的文件(不含`script`目录自身)拷贝过去。 | ||
|
||
5. 安装 `python` 环境(建议使用 [Miniconda](https://docs.anaconda.com/miniconda/) 配置虚拟环境) | ||
``` | ||
4. 安装 `python` 环境 | ||
pip install fonttools | ||
``` | ||
brew install fontforge | ||
rm Pipfile* | ||
pipenv --site-packages --python=/Applications/FontForge.app/Contents/Frameworks/Python.framework/Versions/Current/bin/python3 | ||
pipenv install argparse fonttools | ||
|
||
6. 建立 `sarasa` 目录,下载并解压[SarasaTermSC-TTF.7z](https://github.com/be5invis/Sarasa-Gothic/releases/download/v1.0.16/SarasaTermSC-TTF-1.0.16.7z),并解压文件放入该目录中。 | ||
|
||
4. 安装`fontpatcher` | ||
``` | ||
wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FontPatcher.zip | ||
unzip FontPatcher.zip && rm -rvf FontPatcher.zip | ||
``` | ||
5. 建立 `sarasa` 目录,并将原始`Sarasa Term SC`字体文件放入该目录中。 | ||
|
||
7. 修改 `font-patcher`, 其中第一行改为 `#!/usr/bin/python3`,这是因为 `fontforge` 相关绑定安装在系统的 Python | ||
中,而不是虚拟环境的 Python 中; | ||
|
||
找到 `# Define the character ranges` 一行,这里定义了一系列附加字符集,由于数量较多,直接和 Sarasa 字体合并 | ||
会导致字符数量超出 65535 上限从而失败,因此需要根据需要删减一部分,删减方式为修改需要删减部分的 `SymStart` | ||
或者 `SymEnd`。本库中 release 的字体将 `Material` 的 `SymEnd` 改为了 `0xF1708`。 | ||
|
||
6. 运行脚本 `./build`,在 `sarasa-nerd`目录下将生成`.ttf`字体文件。同时,所有的 | ||
`.ttf`也被打包成一个`.ttc`字体合集文件。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters