Skip to content

Instantly share code, notes, and snippets.

@lightonphiri
Last active April 19, 2024 18:44
Show Gist options
  • Save lightonphiri/5811226a1fba0b3df3be73ff2d5b351c to your computer and use it in GitHub Desktop.
Save lightonphiri/5811226a1fba0b3df3be73ff2d5b351c to your computer and use it in GitHub Desktop.
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip
sudo chmod -R --reference=/usr/share/fonts/opentype /usr/share/fonts/googlefonts

Register fonts

sudo fc-cache -fv

Check if font installed

fc-match OpenSans

Bibliography

http://www.binarytides.com/gorgeous-looking-fonts-ubuntu-linux
http://ubuntuhandbook.org/index.php/2016/05/manually-install-fonts-ubuntu-16-04

@davidajimati
Copy link

You can also install some of the fonts as packages on newer ubuntu (I'm on 18.04): sudo apt install fonts-lato fonts-open-sans fonts-roboto fonts-mononoki

this is awesome, it helped me. thanks

@unalignedcoder
Copy link

Could I not install new fonts in the user Home folder?

@lcongdanh
Copy link

for anyone using WSL2:
sudo unzip -d . /mnt/c/Users/admin/Downloads/Cantarell.zip

@patrickhag
Copy link

patrickhag commented Sep 18, 2023

Thanks man!!!

@githubdotcomuser
Copy link

You can also install some of the fonts as packages on newer ubuntu (I'm on 18.04): sudo apt install fonts-lato fonts-open-sans fonts-roboto fonts-mononoki

Hey! How do you figure out which of the fonts can be installed this way. I wanted to install the Inter Tight but sudo apt install fonts-inter-tight doesn't seem to work.

@lusdavo
Copy link

lusdavo commented Dec 31, 2023

Thanks.

@viotti
Copy link

viotti commented Mar 31, 2024

You can also install some of the fonts as packages on newer ubuntu (I'm on 18.04): sudo apt install fonts-lato fonts-open-sans fonts-roboto fonts-mononoki

Hey! How do you figure out which of the fonts can be installed this way. I wanted to install the Inter Tight but sudo apt install fonts-inter-tight doesn't seem to work.

You can search the Debian Packages: https://www.debian.org/distrib/packages. For example, here is the search results for "fonts-inter": https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=fonts-inter. Usually, when you find a Debian package there will be an Ubuntu equivalent.

You can also search with the apt command itself.

$ apt-cache search fonts-inter
fonts-inter - Inter font family
fonts-inter-variable - Inter font family (VF)

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