Update nerdfont README and support Windows 10
authorAJ ONeal <aj@therootcompany.com>
Tue, 25 Aug 2020 21:51:32 +0000 (21:51 +0000)
committerAJ ONeal <aj@therootcompany.com>
Tue, 25 Aug 2020 21:51:32 +0000 (21:51 +0000)
nerdfont/README.md
nerdfont/install.ps1 [new file with mode: 0644]

index 52071b62344a6dffbbbfa5e532e2d4387050095a..89d7537869c0cc0c89677972b7bd67a4e2392b69 100644 (file)
@@ -14,7 +14,98 @@ tagline: |
 
 This installs just "Droid Sans Mono for Powerline Nerd Font Complete.otf".
 
-### Enable for Terminal.app
+See [All Nerd Fonts](https://www.nerdfonts.com/font-downloads)
+
+<details>
+<summary>
+view list
+</summary>
+
+- [3270 Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/3270)
+- [Agave](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Agave)
+- [Anonymice Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/AnonymousPro)
+- [Arimo](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Arimo)
+- [Aurulent Sans Mono Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/AurulentSansMono)
+- [BigBlueTerminal](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/BigBlueTerminal)
+- [Bitstream Vera Sans Mono Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/BitstreamVeraSansMono)
+- [Blex\*](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/IBMPlexMono)
+- [Caskaydia Cove Nerd Font\*](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/CascadiaCode)
+- [Code New Roman Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/CodeNewRoman)
+- [Cousine Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Cousine)
+- [DaddyTimeMono](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/DaddyTimeMono)
+- [DejaVu Sans Mono Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/DejaVuSansMono)
+- [Droid Sans Mono Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/DroidSansMono)
+- [Fantasque Sans Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/FantasqueSansMono)
+- [Fira Code Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/FiraCode)
+- [Fira Mono Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/FiraMono)
+- [Go Mono Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Go-Mono)
+- [Gohu Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Gohu)
+- [Hack Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Hack)
+- [Hasklug Nerd Font\*](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Hasklig)
+- [Heavy Data Mono Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/HeavyData)
+- [Hermut Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Hermit)
+- [iM-Writing\*](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/iA-Writer)
+- [Inconsolata Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Inconsolata)
+- [Inconsolata Go Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/InconsolataGo)
+- [Inconsolata LGC Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/InconsolataLGC)
+- [Iosevka Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Iosevka)
+- [JetBrains Mono](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono)
+- [Lekton Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Lekton)
+- [Literation Mono Nerd Font\*](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/LiberationMono)
+- [Meslo Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Meslo)
+- [Monofur Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Monofur)
+- [Monoid Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Monoid)
+- [Mononoki Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Mononoki)
+- [M+ (MPlus) Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/MPlus)
+- [Noto](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Noto)
+- [OpenDyslexic](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/OpenDyslexic)
+- [Overpass](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Overpass)
+- [ProFont (Windows tweaked) Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/ProFont)
+- [ProFont (x11) Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/ProFont)
+- [ProggyClean Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/ProggyClean)
+- [Roboto Mono](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/RobotoMono)
+- [Sauce Code Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/SourceCodePro)
+- [Shure Tech Mono Nerd Font\*](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/ShareTechMono)
+- [Space Mono Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/SpaceMono)
+- [Terminess Nerd Font\*](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Terminus)
+- [Tinos](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Tinos)
+- [Ubuntu Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Ubuntu)
+- [Ubuntu Mono Nerd Font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/UbuntuMono)
+- [Victor Mono](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/VictorMono)
+
+<!--
+// https://github.com/ryanoasis/nerd-fonts
+var list = [];
+$$('table tr td:first-child').forEach(function (el) {
+  list.push('[' + el.innerText + '](' + el.querySelector('[href]').href + ')')
+});
+console.log(list.join('\n  -'));
+-->
+
+</details>
+
+<br/>
+
+### Nerd Fonts for Windows Terminal
+
+Note: This will _NOT_ work in Command.exe. You must get _Windows Terminal_ from
+the Microsoft Store.
+
+Select `Settings` from the drop down and update `profiles.defaults.fontFace`:
+
+```json
+{
+  "profiles": {
+    "defaults": {
+      "fontFace": "DroidSansMono Nerd Font"
+    }
+  }
+}
+```
+
+![Windows Terminal Settings](https://i.imgur.com/4RgK6s9.png 'lsd using The Nerd Font in Windows Terminal')
+
+### Nerd Fonts for Terminal.app (similar for iTerm2)
 
 Find `Terminal` in the top Mac menu, then...
 
@@ -25,8 +116,9 @@ Find `Terminal` in the top Mac menu, then...
 - => Font
 - => Change
 - => Select "Droid Sans Mono for Powerline Nerd Font Complete.otf"
+- => **Double Click** the font name to Save & Apply!
 
-![](https://i.imgur.com/zNrfJBa.png)
+![MacOS Terminal.app Settings](https://i.imgur.com/zNrfJBa.png 'how to select The Nerd Font in Terminal.app')
 
 ### Where does the font go?
 
@@ -36,6 +128,16 @@ Find `Terminal` in the top Mac menu, then...
 ~/Library/Fonts/
 ```
 
+**Windows**
+
+```pwsh
+$Env:UserProfile\AppData\Local\Microsoft\Windows\Fonts
+```
+
+```reg
+HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fonts
+```
+
 **Linux**:
 
 ```bash
diff --git a/nerdfont/install.ps1 b/nerdfont/install.ps1
new file mode 100644 (file)
index 0000000..882de45
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/pwsh
+
+$my_nerdfont_otf = "Droid Sans Mono for Powerline Nerd Font Complete Windows Compatible.otf"
+$my_fontdir = "$Env:UserProfile\AppData\Local\Microsoft\Windows\Fonts"
+
+New-Item -Path "$my_fontdir" -ItemType Directory -ErrorAction Ignore
+IF (!(Test-Path -Path "$my_fontdir\$my_nerdfont_otf"))
+{
+
+    & curl.exe -fsSLo "$my_nerdfont_otf" 'https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete%20Windows%20Compatible.otf'
+    & move "$my_nerdfont_otf" "$my_fontdir"
+}
+
+
+# See https://superuser.com/a/1306464/73857
+pushd "$my_fontdir"
+Add-Type -Name Session -Namespace "" -Member @"
+[DllImport("gdi32.dll")]
+public static extern int AddFontResource(string filePath);
+"@
+
+$null = foreach($font in Get-ChildItem -Recurse -Include *.ttf, *.otf) {
+    [Session]::AddFontResource($font.FullName)
+}
+
+echo "Installed $my_nerdfont_otf to $my_fontdir"