Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Download and install Fira fonts in Linux or Mac OS X
#!/bin/bash
## cf from http://programster.blogspot.com/2014/05/ubuntu-14-desktop-install-fira-sans-and.html
cd /tmp
# install unzip just in case the user doesn't already have it.
if [[ `uname` = Linux ]]; then
sudo apt-get install unzip -y
wget "http://www.carrois.com/downloads/fira_4_1/FiraFonts4106.zip"
wget "http://www.carrois.com/downloads/fira_mono_3_2/FiraMonoFonts3206.zip"
unzip FiraSans4106.zip
unzip FiraMono3206.zip
sudo mkdir -p /usr/share/fonts/truetype/FiraSans
sudo mkdir -p /usr/share/fonts/opentype/FiraSans
sudo cp Fira*/WEB/*.ttf /usr/share/fonts/truetype/FiraSans/
sudo cp Fira*/OTF/Fira* /usr/share/fonts/opentype/FiraSans/
sudo fc-cache -fv
else
wget https://github.com/mozilla/Fira/archive/4.202.zip
unzip 4.202.zip
font_dir="$HOME/Library/Fonts"
mkdir -p $font_dir
cp Fira-4.202/otf/* $font_dir/
fi
@naeramarth7
Copy link

naeramarth7 commented Sep 10, 2016

Using brew cask, this would be:

brew tap caskroom/fonts
brew cask install \
  font-fira-code \
  font-fira-mono \
  font-fira-mono-for-powerline \
  font-fira-sans

@jocubeit
Copy link

jocubeit commented Apr 20, 2017

Awesome thanks!

@mervick
Copy link

mervick commented Sep 4, 2017

Replace line #16 with

sudo cp Fira*/WEB/TTF/*.ttf /usr/share/fonts/truetype/FiraSans/

@sturmenta
Copy link

sturmenta commented Oct 18, 2018

@naeramarth7 Thanks!

@awwsmm
Copy link

awwsmm commented Oct 23, 2018

brew cask install \ font-fira-code \ font-fira-mono \ font-fira-mono-for-powerline \ font-fira-sans

Perfect! I'll also mention that if you get an error like

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

...you should run:

xcode-select --install

Source

@amacfie
Copy link

amacfie commented Nov 17, 2018

404

@caph1993
Copy link

caph1993 commented Jan 28, 2019

404 Not Found

@arvi1000
Copy link

arvi1000 commented May 22, 2019

The brew method posted by @naeramarth7 worked well for me on OS X. Thx

@chenzhihao
Copy link

chenzhihao commented Nov 14, 2019

Using brew cask, this would be:

brew tap caskroom/fonts
brew cask install \
  font-fira-code \
  font-fira-mono \
  font-fira-mono-for-powerline \
  font-fira-sans

caskroom/fonts was moved. Tap homebrew/cask-fonts instead.

brew tap  homebrew/cask-fonts
brew cask install \
  font-fira-code \
  font-fira-mono \
  font-fira-mono-for-powerline \
  font-fira-sans

@gravityrahul
Copy link

gravityrahul commented Dec 2, 2019

Looks like the brew has issues
$brew tap caskroom/fonts
Error: caskroom/fonts was moved. Tap homebrew/cask-fonts instead.
$brew tap caskroom/cask-fonts
Error: caskroom/cask-fonts was moved. Tap homebrew/cask-cask-fonts instead.
$brew tap caskroom/cask-cask-fonts
Error: caskroom/cask-cask-fonts was moved. Tap homebrew/cask-cask-cask-fonts instead.
$brew tap caskroom/cask-cask-cask-fonts
Error: caskroom/cask-cask-cask-fonts was moved. Tap homebrew/cask-cask-cask-cask-fonts instead.
$brew tap caskroom/cask-cask-cask-cask-fonts
Error: caskroom/cask-cask-cask-cask-fonts was moved. Tap homebrew/cask-cask-cask-cask-cask-fonts instead.

Oh come on Brew are you kidding me !!!

@rajithsam
Copy link

rajithsam commented Dec 13, 2019

@gravityrahul Try brew tap homebrew/cask-fonts

@dnnp2011
Copy link

dnnp2011 commented Dec 31, 2019

Using brew cask, this would be:

brew tap caskroom/fonts
brew cask install \
  font-fira-code \
  font-fira-mono \
  font-fira-mono-for-powerline \
  font-fira-sans

As of Dec 31, 2019 the new Fira Code font cask is:

brew tap homebrew/cask-fonts

@FDiskas
Copy link

FDiskas commented Mar 4, 2020

Not officially supported, might install outdated version

    brew tap caskroom/fonts
    brew cask install font-fira-code

@wfz0755
Copy link

wfz0755 commented Jan 16, 2021

Very useful script! Thank you so much!

@latavin243
Copy link

latavin243 commented Jan 27, 2021

As of Jan 27, 2021 brew cask install is disabled, use brew install --cask instead.

brew tap homebrew/cask-fonts

brew install --cask \
  font-fira-code \
  font-fira-mono \
  font-fira-mono-for-powerline \
  font-fira-sans

Copy link

ghost commented Feb 12, 2021

Works like a charm! Thanks.

@codepriezt
Copy link

codepriezt commented Sep 26, 2021

nice one.. works fine

@renatomoor
Copy link

renatomoor commented Nov 5, 2021

Thanks @latavin243

@jprg
Copy link

jprg commented Nov 21, 2021

Cask 'font-fira-mono-for-powerline' depends on brew install subversion done first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment