Windows only

This commit is contained in:
subframe7536 2023-07-28 09:40:35 +08:00
parent 03addae794
commit b8429de9f5
4 changed files with 7 additions and 35 deletions

View file

@ -145,10 +145,12 @@ compatibility & usage: in <a href="https://github.com/tonsky/FiraCode#editor-com
## Build
to patch Nerd Font, make sure `fontforge` and its Python module is installed
to patch Nerd Font, make sure `fontforge` is installed
you can adjust some config in `source/build.py`
Currently, the build script is only available on Windows. PRs for other platform are welcome!
more fine-grained options can be set at the comming V7
### Normal Build

View file

@ -74,7 +74,7 @@
<p align="center">
<img src="./img/option.png"/><br>
兼容性和使用方法: [in FiraCode README](https://github.com/tonsky/FiraCode#editor-compatibility-list)
兼容性和使用方法 <a href="https://github.com/tonsky/FiraCode#editor-compatibility-list" target="_blank">FiraCode README</a>
</p>
## 屏幕截图
@ -143,6 +143,8 @@
你可以在 `source/build.py` 调整部分设置
目前只有 Windows 平台的构建脚本,欢迎 PR
更细致的设置请等待 V7
```shell

View file

@ -7,7 +7,6 @@ from urllib.request import urlopen
from ttfautohint import ttfautohint
from enum import Enum, unique
import shutil
import platform
import json
@ -96,7 +95,7 @@ def generate_nerd_font(f: str):
[
path.join(
root,
f"generate-nerdfont.{'bat' if platform.system() == 'Windows' else 'sh'}",
f"generate-nerdfont.bat",
),
f,
config["nerd_font"]["mono"].value,

View file

@ -1,31 +0,0 @@
#!/bin/bash
font_dir="../output/ttf"
output_dir="../output/NF"
args="-l -c --careful"
if [ ! -d $font_dir ]; then
echo "Font directory does not exist: $font_dir"
exit 1
fi
font_name=$1
if [ $2 -eq 1 ]; then
args="$args -s"
fi
if [ $3 -eq 1 ]; then
font_dir=$font_dir-autohint
fi
font_path=$font_dir/$font_name.ttf
if [ ! -f $font_path ]; then
echo "Font file does not exist: $font_path"
exit 1
fi
fontforge -script ./FontPatcher/font-patcher $args --outputdir $output_dir $font_path
echo "Font patched successfully!"