• Stars
    star
    2,404
  • Rank 19,136 (Top 0.4 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tools and instructions on how to have awesome symbols in a terminal with a monospace font

Why?

Why do you want to use fancy symbols in your standard monospace font? Obviously to have a fancy prompt like mine :-)

prompt

And because when you live in a terminal a symbol can convey more informations in less space creating a dense and beautiful (for those who have a certain aesthetic taste) informative workspace

Heavily inspired by https://github.com/Lokaltog/vim-powerline and the relative patch script from Kim Silkebækken ([email protected])

Patching vs Fallback

There are two strategies that could be used to have symbols in a terminal

  • you can take a bunch of symbol fonts, your favourite monospace font and merge them together (patching strategy)
  • you can use a feature of freetype2 font engine, basically you can say that whenever the current font doesn't have a glyph for a certain codepoint then fallback and go look into other fonts (fallback strategy)

Initially I used the first strategy, later I switched to the second. The patching strategy it's more reliable and portable, the problem is that you need to patch every monospace font you want to use and patching a single font it's a lot of manual fine tuning. If you want you can find all previous patched fonts in patching-strategy branch

Font Maps

Referring to glyphs by codepints (eg. \uf00c) in your scripts or shell configuration it's not recommended because icon fonts like Font Awesome use code points ranges those ranges are not disciplined by the unicode consortium, every font can associate every glyphs to those codepoints. This means that Font Awesome can choose to move glyphs around freely, today \uf00c is associated to the check symbol, tomorrow it can be associated to something else. Moreover, more than one icon font can use the same codepoint for different glyphs and if we want to use them both we need to move one of them. So, if you use a codepoint to refer to a glyph after an update that codepoint can point to another glyph. To avoid this situation you can use the font maps in the ./build directory, font maps are scripts which define shell variables that give names to glyphs, by sourcing those files in your shell you can refer to glyphs by name (eg. $CODEPOINT_OF_AWESOME_CHECK).

TLDR: don't refer to glyphs by codepoints (eg. \uf00c) but by name (eg. $CODEPOINT_OF_AWESOME_CHECK) to make your scripts and shell configurations resilient to future updates. To do that don't forget to copy font maps (*.sh files) in the ./build directory in your home directory and to source them in your shell startup

Included Fonts

In this repository you can find a bunch of fonts that I use as symbol fonts with the relative font maps

How to install (Linux)

  • copy all the fonts from ./build directory to ~/.fonts directory
  • copy all the font maps (all *.sh files) from ./build directory to ~/.fonts directory
  • run fc-cache -fv ~/.fonts to let freetype2 know of those fonts
  • customize the configuration file ./config/10-symbols.conf replacing PragmataPro with the name of the font you want to use in the terminal (I will add more fonts in the future so that this step could be skippable)
  • copy the above configuration file to ~/.config/fontconfig/conf.d directory
  • source the font maps (source ~/.fonts/*.sh) in your shell startup script (eg. ~/.bashrc or ~/.zshrc)

Arch Linux

We have been included in the official repositories, so if you are running an Arch Linux

  • run pacman -Syu awesome-terminal-fonts

How to install (OSX)

  • follow this detailed instructions contributed by @inkrement
  • copy all the fonts maps (all *.sh files) from ./build directory to ~/.fonts directory
  • source the font maps (source ~/.fonts/*.sh) in your shell startup script (eg. ~/.bashrc or ~/.zshrc)
  • If it still doesn't work, consider to use the patching strategy

How to install (Windows)

  • make sure you have permissions to execute Powershell scripts in your machine. To do so, open Windows Powershell as Administrator and paste & run the following command Set-ExecutionPolicy RemoteSigned
  • then run the install script ./install.ps1

License

MIT

More Repositories

1

vim-markdown

Markdown for Vim: a complete environment to create Markdown files with a syntax highlight that doesn't suck!
Vim Script
731
star
2

pomicons

Font with symbols to talk about the "Pomodoro Technique"
CSS
163
star
3

byte-units

Library to parse, format and convert byte units
PHP
159
star
4

mongodb-shell-extensions

Useful MongoDB shell extensions
JavaScript
94
star
5

graceful-death

Because PHP processes deserves to die with dignity
PHP
57
star
6

engelbart

Mac keyboard hack to have more reachable modifier keys
46
star
7

paco

A parser combinator library for Elixir
Elixir
32
star
8

node-examples

C++
28
star
9

violent-death

PHP native extension that generates segmentation faults
PHP
28
star
10

dotfiles

dotfiles
Emacs Lisp
20
star
11

mongoose-eventful

Mongoose plugin to emit events when documents are created or removed and when fields are changed
JavaScript
11
star
12

retro.el

Library to create retro games in Emacs
Emacs Lisp
10
star
13

precious

Library to build value objects
PHP
9
star
14

erlang-watchlist

A curated list of references where to find good code to read to master Erlang idioms
8
star
15

programming-elixir

"Programming Elixir" book exercises
Elixir
7
star
16

asdf-sbt

SBT plugin for https://github.com/asdf-vm/asdf/
Shell
7
star
17

elixir-quiz

Solutions to the Elixir Quiz: Weekly programming problems to help you learn Elixir
Elixir
7
star
18

veggy-2017

CodeJam 2017
Elixir
5
star
19

type-level-fizzbuzz

Type Level FizzBuzz in TypeScript
TypeScript
5
star
20

veggy

CodeJam 2016 Application
Elixir
4
star
21

pug-milano-20190213

Repository of the talk "Cool Things with PHP"
PHP
4
star
22

mongoose-trackable

Keeps track of when the document has been created, updated and optionally when some fields has changed
JavaScript
4
star
23

mongodb-class

MongoDB Class Slides
Shell
4
star
24

go-by-example

Go by Example https://gobyexample.com
Go
3
star
25

etudes-for-elixir

Études for Elixir
Elixir
3
star
26

boxfiles

Creates my development environment using Vagrant and Chef
3
star
27

rust-by-example

Rust by Example http://rustbyexample.com/
Rust
3
star
28

poker

Repository of an Elixir Quiz challenge called "Poker"
Elixir
3
star
29

nested-comments-kata

Kata taken from Ruby Quiz Study Group https://www.youtube.com/watch?v=0hGvVJBW-eQ
Elixir
2
star
30

veggy-ui

JavaScript
2
star
31

ew

Elixir Workshop
2
star
32

emock

mock processes and modules for erlang
2
star
33

twitter-kata

Twitter like console-base application Kata
Elixir
2
star
34

haskellbook-exercises

Haskell Book Exercises
Haskell
1
star
35

bowling-game-kata

Bowling Game Kata by Robert C. Martin in JavaScript with Jest
JavaScript
1
star
36

purple-fury

Codemaster 2018
JavaScript
1
star
37

hangman-http-kata

Hangman HTTP Kata
Vim Script
1
star
38

spot-your-manga

Spot your mangas in the mangareader.net home page
JavaScript
1
star
39

md-cli

Syntax highlights Markdown text with ANSI colors to be printed to the terminal
Ruby
1
star
40

erlang-otp

“Designing for Scalability with Erlang/OTP” book exercises
Erlang
1
star
41

vim-variable-segment-text-object

Custom text object and movement for pieces of variables and identifiers
Vim Script
1
star
42

advent-of-code-2017

Solutions of Advent of Code 2017 in Emacs Lisp
Emacs Lisp
1
star
43

99-OCaml

99 Lisp Problems in OCaml
OCaml
1
star
44

katas

Code Katas done in various languages
Erlang
1
star
45

veggy-ui-2017

CodeJam 2017
JavaScript
1
star
46

ping-pong

java and erlang implementation of ping-pong server for benchmarking purpose
Erlang
1
star
47

ff-cli

A command line tool to manage Firefox profiles
Ruby
1
star
48

elixir-ring

Process ring exercise in Elixir
Elixir
1
star
49

erlang-playground

Some problems and kata solved in erlang to practice with the language
Erlang
1
star