diff --git a/README.md b/README.md index c5dbf112..8d5815bc 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,11 @@ brew install font-monaspace ### Windows You can manually drag the fonts from the `fonts/otf` or `fonts/variable` directory into `C:\Windows\Fonts`. Alternatively, right-click the fonts you want and click Install. +```powershell +$ cd util +$ ./install_windows.cmd +``` + ### Linux You can manually drag the fonts from the `fonts/otf` and `fonts/variable` directory into `~/.local/share/fonts`. diff --git a/util/install_windows.cmd b/util/install_windows.cmd new file mode 100644 index 00000000..793b5f1c --- /dev/null +++ b/util/install_windows.cmd @@ -0,0 +1,28 @@ +@echo off + +echo Checking for admin rights... +net session >nul 2>&1 +if %errorLevel% == 0 ( + echo Admin rights granted. +) else ( + echo Admin rights required. Please run this script as an administrator. + exit /b 1 +) + +echo Installing fonts... + +set mainFontFolder="./../fonts/otf" + +for /r "%mainFontFolder%" %%f in (*.ttf, *.otf, *.woff, *.woff2) do ( + copy "%%f" "%WINDIR%\Fonts" + reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "%%~nxf (TrueType)" /t REG_SZ /d %%~nxf /f +) + +set mainFontFolder="./../fonts/varible" + +for /r "%mainFontFolder%" %%f in (*.ttf, *.otf, *.woff, *.woff2) do ( + copy "%%f" "%WINDIR%\Fonts" + reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "%%~nxf (TrueType)" /t REG_SZ /d %%~nxf /f +) + +echo All fonts installed successfully. \ No newline at end of file