Use any fonts in the terminal without replacing or patching
The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
icons-in-terminalallows you to get any fonts in your terminal without replacing or patching your font.
icons-in-terminalcan also be use with graphical applications.
$ git clone https://github.com/sebastiencs/icons-in-terminal.git
bash $ ./install.sh $ # Follow the instructions to edit ~/.config/fontconfig/conf.d/30-icons.confOr if your terminal is supported (Experimental)
bash $ ./install-autodetect.shDone ! You can start a new terminal and run
print_icons.shto see the installed gryphs.
bash $ ./print_icons.sh $ ./print_icons.sh --names $ ./print_icons.sh --names | grep ANY_NAMETo use icons in your terminal, do not copy-paste icons from the output of
print_icons.shbut use their variable name: see integrations.
icons-in-terminal.ttfwill be changed, the variable names won't.
If you want to add new font, follow these instructions:
There are a few dependencies to install:
You can add the name and path of your font to the file
start-from: exclude all glyphes before the given codepoint. -
until: exclude all glyphes at the given codepoint and after. -
excludes: exclude the given codepoints. -
move-vertically: Use this parameter if your font and its glyphes are not centered vertically. -
short-name: Prefix to insert before the glyph name when you want to use the icon in your shell or anywhere else -
map-names: Define a name to the glyph. If not provided, the name will be read from the ttf file
Once done, you can run:
bash $ ./build.sh
This project is inspired by awesome-terminal-fonts but is different.
I don't modify any existing font, I merge all glyphes from the provided fonts in a new font file and insert them in the private use areas.
~/.config/fontconfig/conf.d/30-icons.conftells to freetype to search the glyph in
icons-in-terminal.ttfif it fails in your default font file. As the codepoints generated are in the private use areas, freetype should always fail and fallback to icons-in-terminal.ttf
There are already 3618 glyphes included:
| Name | Version | Notes | | ---------------------------------------------------------------------------------|---------------:|--------| | powerline-extra-symbols | commit 4eae6e8 | | | octicons | 4.4.0 | | | fontawesome | 4.7 | | | material-design-icons | 3.0.1 | | | file-icons | 2.1.4 | | | weather-icons | 2.0.10 | | | font-linux | 0.9 | | | devicons | 1.8.0 | | | Pomicons | commit bb0a579 | | | linea | 1.0 | | | font-mfizz | 2.4.1 | | | FiraCode | 1.200 | See if your terminal is compatible |
icons-in-terminalwith fish, add this line to
bash source ~/.local/share/icons-in-terminal/icons.fishRestart a terminal, now you can print any icons with its name:
bash $ echo $oct_location
Add this line to your .bashrc:
bash source ~/.local/share/icons-in-terminal/icons_bash.shRestart a terminal, now you can print any icons with its name:
bash $ echo -e $oct_location # note the '-e'
Add this line to your emacs init file:
el (add-to-list 'load-path "~/.local/share/icons-in-terminal/")To use icons-in-terminal in your package:
el (require 'icons-in-terminal) (insert (icons-in-terminal 'oct_flame)) ; C-h f icons-in-terminal[RET] for more info