Skip to content

Commit

Permalink
Simplify building procedures.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhaopudark committed Oct 19, 2023
1 parent 39e6e0e commit ffef4e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
Binary file modified Output/JetBrainsMonoNerdFont-Regular.ttf
Binary file not shown.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ You can just download `JetBrainsMonoNerdFont-Regular.ttf` from [the latest relea
winget install --id FontForge.FontForge --force # UAC prompt may occur
Add-PathToCurrentProcessEnvPath -Path "C:\Program Files (x86)\FontForgeBuilds\bin"
pip install gftools fonttools[woff]
. ".\build.ps1"
```

Expand All @@ -69,7 +67,6 @@ You can just download `JetBrainsMonoNerdFont-Regular.ttf` from [the latest relea
cd JetBrainsMonoNerdFonts
sudo apt install fontforge
pip install gftools fonttools[woff]
. "./build.ps1"
```
17 changes: 9 additions & 8 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
pip install -r "${PSScriptRoot}/requirements.txt" -q

$guid = [guid]::NewGuid().ToString()
$temp_path = "${Home}/tmp/$guid"
$font_to_be_pathced = "JetBrainsMono-Regular.ttf"
$font_patched = "JetBrainsMonoNerdFont-Regular.ttf"
New-Item $temp_path -ItemType Directory -Force
$main_pwd = Get-Location

## Build JetBrainsMono
git submodule update --init --recursive # check the submodule `JetBrainsMono` as latest release version
git submodule foreach 'git reset --hard && git checkout master && git pull' # should be master instead of main
Set-Location './JetBrainsMono'
Set-Location "${PSScriptRoot}/JetBrainsMono"
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) --force
Set-Location $main_pwd
Copy-Item "./gftools_builder_config.yaml" -Destination "./JetBrainsMono/sources/config.yaml" -Force
Set-Location $PSScriptRoot
Copy-Item "$PSScriptRoot/gftools_builder_config.yaml" -Destination "$PSScriptRoot/JetBrainsMono/sources/config.yaml" -Force

gftools builder "./JetBrainsMono/sources/config.yaml"
gftools builder "$PSScriptRoot/JetBrainsMono/sources/config.yaml"

## Install FontPatcher and prepare target font that will be patched
$repoUrl = "https://api.github.com/repos/ryanoasis/nerd-fonts/releases/latest" # Send a GET request to the GitHub API to get the latest release information
Expand All @@ -28,12 +29,12 @@ if ($fontPatcherAsset) {
}
Expand-Archive -Path "$temp_path/FontPatcher.zip" -DestinationPath "$temp_path/FontPatcher" -Force

Copy-Item -LiteralPath "./JetBrainsMono/fonts/ttf/$font_to_be_pathced" -Destination "$temp_path/FontPatcher/$font_to_be_pathced" -Force
Copy-Item -LiteralPath "$PSScriptRoot/JetBrainsMono/fonts/ttf/$font_to_be_pathced" -Destination "$temp_path/FontPatcher/$font_to_be_pathced" -Force

Set-Location "$temp_path/FontPatcher"
fontforge -script font-patcher "./$font_to_be_pathced" -out "./" --complete --careful --quiet
Set-Location $main_pwd
Copy-Item -LiteralPath "$temp_path/FontPatcher/$font_patched" -Destination "./Output/$font_patched" -Force
Set-Location $PSScriptRoot
Copy-Item -LiteralPath "$temp_path/FontPatcher/$font_patched" -Destination "$PSScriptRoot/Output/$font_patched" -Force

# reset submodule
git submodule foreach 'git reset --hard && git checkout master && git pull'

0 comments on commit ffef4e2

Please sign in to comment.