Skip to content

Commit

Permalink
[Add app] 增加第三方 Monaco Nerd Font 字体
Browse files Browse the repository at this point in the history
from [thep0y/monaco-nerd-font](https://github.com/thep0y/monaco-nerd-font)
  • Loading branch information
Jenway committed Aug 2, 2024
1 parent 62d7874 commit 1dd763c
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ To install apps from this bucket, run `scoop install Jenway_scoop/<app>`
| -------- | ----------- | --------------- |
|KikoPlay | NOT ONLY A Full-Featured Danmu Player 不仅仅是全功能弹幕播放器 | `scoop install jenway_scoop/kikoplay` |
|mikan_flutter| Flutter 驱动的三方 蜜柑计划(https://mikanani.me) APP | `scoop install jenway_scoop/mikan_flutter` |
|Monaco-NF-Mono|see [thep0y/monaco-nerd-font](https://github.com/thep0y/monaco-nerd-font).| `scoop install jenway_scoop/Monaco-NF-Mono` |
|Monaco-NF-Mono-Ligaturized|see [thep0y/monaco-nerd-font](https://github.com/thep0y/monaco-nerd-font). | `scoop install jenway_scoop/Monaco-NF-Mono-Ligaturized` |

### Deprecated

Expand Down
95 changes: 95 additions & 0 deletions bucket/Monaco-NF-Mono-Ligaturized.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"version": "0.2.1",
"description": "Nerd Fonts patched 'Monaco' Font family. (Ligaturized version; Monospace version, Nerd Fonts Symbol/Icon will be always 1 cell wide)",
"homepage": "https://github.com/thep0y/monaco-nerd-font",
"license": "MIT",
"url": "https://github.com/thep0y/monaco-nerd-font/releases/download/v0.2.1/MonacoLigaturizedNerdFontMono.zip",
"hash": "A6D75600D2529912C9537DDADF6827F236157D3B5593916AF1C8CC1AA0B120F8",
"installer": {
"script": [
"$currentBuildNumber = [int] (Get-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\").CurrentBuildNumber",
"$windows10Version1809BuildNumber = 17763",
"$isPerUserFontInstallationSupported = $currentBuildNumber -ge $windows10Version1809BuildNumber",
"if (!$isPerUserFontInstallationSupported -and !$global) {",
" scoop uninstall $app",
" Write-Host \"\"",
" Write-Host \"For Windows version before Windows 10 Version 1809 (OS Build 17763),\" -Foreground DarkRed",
" Write-Host \"Font can only be installed for all users.\" -Foreground DarkRed",
" Write-Host \"\"",
" Write-Host \"Please use following commands to install '$app' Font for all users.\" -Foreground DarkRed",
" Write-Host \"\"",
" Write-Host \" scoop install sudo\"",
" Write-Host \" sudo scoop install -g $app\"",
" Write-Host \"\"",
" exit 1",
"}",
"$fontInstallDir = if ($global) { \"$env:windir\\Fonts\" } else { \"$env:LOCALAPPDATA\\Microsoft\\Windows\\Fonts\" }",
"if (-not $global) {",
" # Ensure user font install directory exists and has correct permission settings",
" # See https://github.com/matthewjberger/scoop-nerd-fonts/issues/198#issuecomment-1488996737",
" New-Item $fontInstallDir -ItemType Directory -ErrorAction SilentlyContinue | Out-Null",
" $accessControlList = Get-Acl $fontInstallDir",
" $allApplicationPackagesAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule([System.Security.Principal.SecurityIdentifier]::new(\"S-1-15-2-1\"), \"ReadAndExecute\", \"ContainerInherit,ObjectInherit\", \"None\", \"Allow\")",
" $allRestrictedApplicationPackagesAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule([System.Security.Principal.SecurityIdentifier]::new(\"S-1-15-2-2\"), \"ReadAndExecute\", \"ContainerInherit,ObjectInherit\", \"None\", \"Allow\")",
" $accessControlList.SetAccessRule($allApplicationPackagesAccessRule)",
" $accessControlList.SetAccessRule($allRestrictedApplicationPackagesAccessRule)",
" Set-Acl -AclObject $accessControlList $fontInstallDir",
"}",
"$registryRoot = if ($global) { \"HKLM\" } else { \"HKCU\" }",
"$registryKey = \"${registryRoot}:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\"",
"Get-ChildItem $dir -Filter '*NerdFontMono-*' | ForEach-Object {",
" $value = if ($global) { $_.Name } else { \"$fontInstallDir\\$($_.Name)\" }",
" New-ItemProperty -Path $registryKey -Name $_.Name.Replace($_.Extension, ' (TrueType)') -Value $value -Force | Out-Null",
" Copy-Item -LiteralPath $_.FullName -Destination $fontInstallDir",
"}",
" Write-Host \"\"",
" Write-Host \" Hint: Using name 'MonacoLigaturized Nerd Font Mono' \" -Background DarkCyan -Foreground White -NoNewline",
" Write-Host \"\""
]
},
"pre_uninstall": [
"$fontInstallDir = if ($global) { \"$env:windir\\Fonts\" } else { \"$env:LOCALAPPDATA\\Microsoft\\Windows\\Fonts\" }",
"Get-ChildItem $dir -Filter '*NerdFontMono-*' | ForEach-Object {",
" Get-ChildItem $fontInstallDir -Filter $_.Name | ForEach-Object {",
" try {",
" Rename-Item $_.FullName $_.FullName -ErrorVariable LockError -ErrorAction Stop",
" } catch {",
" Write-Host \"\"",
" Write-Host \" Error \" -Background DarkRed -Foreground White -NoNewline",
" Write-Host \"\"",
" Write-Host \" Cannot uninstall '$app' font.\" -Foreground DarkRed",
" Write-Host \"\"",
" Write-Host \" Reason \" -Background DarkCyan -Foreground White -NoNewline",
" Write-Host \"\"",
" Write-Host \" The '$app' font is currently being used by another application,\" -Foreground DarkCyan",
" Write-Host \" so it cannot be deleted.\" -Foreground DarkCyan",
" Write-Host \"\"",
" Write-Host \" Suggestion \" -Background Magenta -Foreground White -NoNewline",
" Write-Host \"\"",
" Write-Host \" Close all applications that are using '$app' font (e.g. vscode),\" -Foreground Magenta",
" Write-Host \" and then try again.\" -Foreground Magenta",
" Write-Host \"\"",
" exit 1",
" }",
" }",
"}"
],
"uninstaller": {
"script": [
"$fontInstallDir = if ($global) { \"$env:windir\\Fonts\" } else { \"$env:LOCALAPPDATA\\Microsoft\\Windows\\Fonts\" }",
"$registryRoot = if ($global) { \"HKLM\" } else { \"HKCU\" }",
"$registryKey = \"${registryRoot}:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\"",
"Get-ChildItem $dir -Filter '*NerdFontMono-*' | ForEach-Object {",
" Remove-ItemProperty -Path $registryKey -Name $_.Name.Replace($_.Extension, ' (TrueType)') -Force -ErrorAction SilentlyContinue",
" Remove-Item \"$fontInstallDir\\$($_.Name)\" -Force -ErrorAction SilentlyContinue",
"}",
"if ($cmd -eq \"uninstall\") {",
" Write-Host \"The '$app' Font family has been uninstalled and will not be present after restarting your computer.\" -Foreground Magenta",
"}"
]
},
"checkver": "github",
"autoupdate": {
"url": "https://github.com/thep0y/monaco-nerd-font/releases/download/v$version/MonacoLigaturizedNerdFontMono.zip"
}
}
95 changes: 95 additions & 0 deletions bucket/Monaco-NF-Mono.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"version": "0.2.1",
"description": "Nerd Fonts patched 'Monaco' Font family. (Monospace version, Nerd Fonts Symbol/Icon will be always 1 cell wide)",
"homepage": "https://github.com/thep0y/monaco-nerd-font",
"license": "MIT",
"url": "https://github.com/thep0y/monaco-nerd-font/releases/download/v0.2.1/MonacoNerdFontMono.zip",
"hash": "DE50D38CEF7D8855202F652D85DB92593A62D7C27982B286B6066274D12F6831",
"installer": {
"script": [
"$currentBuildNumber = [int] (Get-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\").CurrentBuildNumber",
"$windows10Version1809BuildNumber = 17763",
"$isPerUserFontInstallationSupported = $currentBuildNumber -ge $windows10Version1809BuildNumber",
"if (!$isPerUserFontInstallationSupported -and !$global) {",
" scoop uninstall $app",
" Write-Host \"\"",
" Write-Host \"For Windows version before Windows 10 Version 1809 (OS Build 17763),\" -Foreground DarkRed",
" Write-Host \"Font can only be installed for all users.\" -Foreground DarkRed",
" Write-Host \"\"",
" Write-Host \"Please use following commands to install '$app' Font for all users.\" -Foreground DarkRed",
" Write-Host \"\"",
" Write-Host \" scoop install sudo\"",
" Write-Host \" sudo scoop install -g $app\"",
" Write-Host \"\"",
" exit 1",
"}",
"$fontInstallDir = if ($global) { \"$env:windir\\Fonts\" } else { \"$env:LOCALAPPDATA\\Microsoft\\Windows\\Fonts\" }",
"if (-not $global) {",
" # Ensure user font install directory exists and has correct permission settings",
" # See https://github.com/matthewjberger/scoop-nerd-fonts/issues/198#issuecomment-1488996737",
" New-Item $fontInstallDir -ItemType Directory -ErrorAction SilentlyContinue | Out-Null",
" $accessControlList = Get-Acl $fontInstallDir",
" $allApplicationPackagesAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule([System.Security.Principal.SecurityIdentifier]::new(\"S-1-15-2-1\"), \"ReadAndExecute\", \"ContainerInherit,ObjectInherit\", \"None\", \"Allow\")",
" $allRestrictedApplicationPackagesAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule([System.Security.Principal.SecurityIdentifier]::new(\"S-1-15-2-2\"), \"ReadAndExecute\", \"ContainerInherit,ObjectInherit\", \"None\", \"Allow\")",
" $accessControlList.SetAccessRule($allApplicationPackagesAccessRule)",
" $accessControlList.SetAccessRule($allRestrictedApplicationPackagesAccessRule)",
" Set-Acl -AclObject $accessControlList $fontInstallDir",
"}",
"$registryRoot = if ($global) { \"HKLM\" } else { \"HKCU\" }",
"$registryKey = \"${registryRoot}:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\"",
"Get-ChildItem $dir -Filter '*NerdFontMono-*' | ForEach-Object {",
" $value = if ($global) { $_.Name } else { \"$fontInstallDir\\$($_.Name)\" }",
" New-ItemProperty -Path $registryKey -Name $_.Name.Replace($_.Extension, ' (TrueType)') -Value $value -Force | Out-Null",
" Copy-Item -LiteralPath $_.FullName -Destination $fontInstallDir",
"}",
" Write-Host \"\"",
" Write-Host \" Hint: Using name 'Monaco Nerd Font Mono' \" -Background DarkCyan -Foreground White -NoNewline",
" Write-Host \"\""
]
},
"pre_uninstall": [
"$fontInstallDir = if ($global) { \"$env:windir\\Fonts\" } else { \"$env:LOCALAPPDATA\\Microsoft\\Windows\\Fonts\" }",
"Get-ChildItem $dir -Filter '*NerdFontMono-*' | ForEach-Object {",
" Get-ChildItem $fontInstallDir -Filter $_.Name | ForEach-Object {",
" try {",
" Rename-Item $_.FullName $_.FullName -ErrorVariable LockError -ErrorAction Stop",
" } catch {",
" Write-Host \"\"",
" Write-Host \" Error \" -Background DarkRed -Foreground White -NoNewline",
" Write-Host \"\"",
" Write-Host \" Cannot uninstall '$app' font.\" -Foreground DarkRed",
" Write-Host \"\"",
" Write-Host \" Reason \" -Background DarkCyan -Foreground White -NoNewline",
" Write-Host \"\"",
" Write-Host \" The '$app' font is currently being used by another application,\" -Foreground DarkCyan",
" Write-Host \" so it cannot be deleted.\" -Foreground DarkCyan",
" Write-Host \"\"",
" Write-Host \" Suggestion \" -Background Magenta -Foreground White -NoNewline",
" Write-Host \"\"",
" Write-Host \" Close all applications that are using '$app' font (e.g. vscode),\" -Foreground Magenta",
" Write-Host \" and then try again.\" -Foreground Magenta",
" Write-Host \"\"",
" exit 1",
" }",
" }",
"}"
],
"uninstaller": {
"script": [
"$fontInstallDir = if ($global) { \"$env:windir\\Fonts\" } else { \"$env:LOCALAPPDATA\\Microsoft\\Windows\\Fonts\" }",
"$registryRoot = if ($global) { \"HKLM\" } else { \"HKCU\" }",
"$registryKey = \"${registryRoot}:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\"",
"Get-ChildItem $dir -Filter '*NerdFontMono-*' | ForEach-Object {",
" Remove-ItemProperty -Path $registryKey -Name $_.Name.Replace($_.Extension, ' (TrueType)') -Force -ErrorAction SilentlyContinue",
" Remove-Item \"$fontInstallDir\\$($_.Name)\" -Force -ErrorAction SilentlyContinue",
"}",
"if ($cmd -eq \"uninstall\") {",
" Write-Host \"The '$app' Font family has been uninstalled and will not be present after restarting your computer.\" -Foreground Magenta",
"}"
]
},
"checkver": "github",
"autoupdate": {
"url": "https://github.com/thep0y/monaco-nerd-font/releases/download/v$version/MonacoNerdFontMono.zip"
}
}

0 comments on commit 1dd763c

Please sign in to comment.