Open joonas-fi opened 1 year ago
Patcher available from: https://github.com/ryanoasis/nerd-fonts
Example font download: https://fonts.google.com/specimen/Roboto
Run:
docker run --rm -v /tmp/fonts/in:/in -v /tmp/fonts/out:/out nerdfonts/patcher
Outcome:
/tmp/fonts
├── in
│ ├── LICENSE.txt
│ ├── Roboto-Black.ttf
│ ├── Roboto-BlackItalic.ttf
│ ├── Roboto-Bold.ttf
│ ├── Roboto-BoldItalic.ttf
│ ├── Roboto-Italic.ttf
│ ├── Roboto-Light.ttf
│ ├── Roboto-LightItalic.ttf
│ ├── Roboto-Medium.ttf
│ ├── Roboto-MediumItalic.ttf
│ ├── Roboto-Regular.ttf
│ ├── Roboto-Thin.ttf
│ └── Roboto-ThinItalic.ttf
└── out
├── RobotoNerdFont-Black.ttf
├── RobotoNerdFont-BlackItalic.ttf
├── RobotoNerdFont-Bold.ttf
├── RobotoNerdFont-BoldItalic.ttf
├── RobotoNerdFont-Italic.ttf
├── RobotoNerdFont-Light.ttf
├── RobotoNerdFont-LightItalic.ttf
├── RobotoNerdFont-Medium.ttf
├── RobotoNerdFont-MediumItalic.ttf
├── RobotoNerdFont-Regular.ttf
├── RobotoNerdFont-Thin.ttf
└── RobotoNerdFont-ThinItalic.ttf
Are not discoverable with --help
, mainly visible from the README
Search icons from here: https://www.nerdfonts.com/cheat-sheet
Patcher adds by default:
Icon sets and code points: https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points
--materialdesignicons
), the process takes considerably longer time. That means that if you have lots of variations (see Roboto {Black,BlackItalic,Bold,BoldItalic,...}
from above) it's going to take minutes and minutes.
.ttf
fileSystem fonts are in: /usr/share/fonts/truetype
Let's patch Fira Code from /usr/share/fonts/truetype/firacode/FiraCode-Regular.ttf
:
docker run --rm -v /usr/share/fonts/truetype/firacode/FiraCode-Regular.ttf:/in/FiraCode-Regular.ttf:ro -v /tmp/fonts/out:/out nerdfonts/patcher --materialdesignicons
Copy the font and rebuild font cache:
sudo cp /tmp/fonts/out/FiraCodeNerd*-Regular.ttf /usr/share/fonts/truetype/firacode/
sudo fc-cache -f -v
Open text editor (e.g. Mousepad), if you patched FiraCode
then the patched font name will be FiraCode Nerd Font
Copy the "Icon" from the cheat sheet - that will be the text "symbol" that gets converted to the icon:
End result is starting to look much nicer:
Use cases: