-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnerdfont.bat
93 lines (74 loc) · 2.55 KB
/
nerdfont.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
:: Copyright
:: Saumyajyoti Mukherjee
:: 2024
@echo off
setlocal
SET FONTVERNUM=14
:: prerequisites in comments
:: ref https://github.com/be5invis/Iosevka/blob/main/doc/custom-build.md#building
:: tested in Windows11 setup
:: install nodejs, fontforge python 3. Used below versions:
:: node version: v22.12.0
:: Fontforge: https://github.com/fontforge/fontforge/releases/download/20230101/FontForge-2023-01-01-Windows.exe
SET IOSEVKA_PATH="%temp%\Iosevka"
SET "PATH=C:\Program Files (x86)\FontForgeBuilds\bin;%~dp0\..\bin;%PATH%"
SET FFPYTHON_EXE="C:\Program Files (x86)\FontForgeBuilds\bin\ffpython.exe"
SET OUTPATH="D:\Font\Miosevka%FONTVERNUM%"
SET NERDFONT_PATCHER_PATH="%~dp0\..\bin\nerdfont\font-patcher"
SET FONTVER=Miosevka%FONTVERNUM%
rmdir /S /Q %OUTPATH% >nul 2>&1
mkdir %OUTPATH%
echo =======================================================
if exist %IOSEVKA_PATH%\ (
echo Sync Iosevka
cd /d %IOSEVKA_PATH%
rmdir /S /Q "%IOSEVKA_PATH%\dist" >nul 2>&1
git pull --depth=1
) else (
echo Clone Iosevka
git clone https://github.com/be5invis/Iosevka.git %IOSEVKA_PATH% --depth=1
cd /d %IOSEVKA_PATH%
)
call npm install
echo =======================================================
echo Build Miosevka
copy /Y %~dp0\miosevka-build-plans.toml %IOSEVKA_PATH%\private-build-plans.toml
call npm run build -- ttf::Miosevka
echo =======================================================
echo Build Riosevka
copy /Y %~dp0\riosevka-build-plans.toml %IOSEVKA_PATH%\private-build-plans.toml
call npm run build -- ttf::Riosevka
echo =======================================================
call :PATCH miosevka
call :PATCH riosevka
echo =======================================================
echo Copy Files
copy /Y %~dp0\..\*license.* %OUTPATH%
copy /Y "%IOSEVKA_PATH%\dist\miosevka\ttf\*.ttf" %OUTPATH%
copy /Y "%IOSEVKA_PATH%\dist\riosevka\ttf\*.ttf" %OUTPATH%
cd /d %OUTPATH%\..\
echo create %FONTVER%.zip
tar.exe -a -c -f "%FONTVER%.zip" %OUTPATH%
REM :PROMPT
REM SET /P INSTALL=Install Fonts (yes/[no])?
REM IF /I "%INSTALL%" NEQ "yes" GOTO END
REM echo installing fonts
REM cd /d %OUTPATH%
REM start FontReg.exe /copy
REM cd ..
REM :END
explorer .
exit /b 0
::================ ROUTINE PATCH ====================
:PATCH
echo =======================================================
set fontdir="%IOSEVKA_PATH%\dist\%1\ttf"
echo patch fonts in %fontdir%
cd /d %fontdir%
:: setlocal enabledelayedexpansion
for /r %%f in (%1-*.ttf) do (
echo "Patching: %%f"
%FFPYTHON_EXE% %NERDFONT_PATCHER_PATH% -c %%f
)
exit /b 0
::====================================================