Skip to content

Instantly share code, notes, and snippets.

@lightonphiri
Last active November 13, 2024 06:58
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

@lightonphiri
Copy link
Author

Thanks for this!
The install part is better written as:

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

Thanks. Reformatted gist [...]

@adityatelange
Copy link

if you want google_product_sans =>

https://forum.xda-developers.com/attachment.php?attachmentid=4324851&d=1509979469 and copy
Font_ProductSans2/system/fonts/ to /usr/share/fonts/googlefonts

@bhachauk
Copy link

bhachauk commented Jun 8, 2019

I have used typecatcher. i think, worth to mention here.

@dhirajpatra
Copy link

Very nice thanks

@morehwachege
Copy link

This is fantastic...works on various debian based linux distros swiftly, thank you

@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)

@4yman-0
Copy link

4yman-0 commented Jul 5, 2024

Thanks!

@lusdavo
Copy link

lusdavo commented Sep 5, 2024

This works all the time, thanks a lot.

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