Ubuntu – How To Install Multiple Fonts At Once From .zip Files


Well I did search through AskUbuntu and found some threads where people are asking about how can they install multiple fonts at once? I know the process. I have to copy-paste all the fonts, .ttf/.otf files inside of .font hidden folder and then rebuild the font cash via this command…

fc-cache -rv

This is crystal clear. I just want to know this…

I downloaded 10+ .zip font files. When I extracted the .zip folders I see within each folder there are couple of files. A readme file, a .ttf/.otf file and in some cases some variants of the fonts. Like bold.ttf, ultra_bold.ttf, semi_bold.ttf, black.ttf etc. I am not sure what these additional files are but I guess these are mainly variants of the core fonts. However my question is…

Do I need to extract all the .zip files manually and then copy only .ttf/.otf files and then paste them manually in .font folder? Or I can use a terminal command which will do everything on behalf of me. Here by the word everything I meant…

  1. Extracting the .zip files
  2. Copying only .ttf/.otf files
  3. Pasting only the .ttf/.otf files into .font folder
  4. Finally installing the .ttf/.otf files in Ubuntu

Sorry for asking a broad question. But to avoid down votes I had to make sure I am not asking anything which is asked before. And thanks in advanced for all your helps.

Best Answer

This is a one-liner in a terminal. Open a terminal with Ctr+Alt+T and run the commands below. Replace <your_font_zips> with the folder name, where you have placed your zip font files.

cd <your_font_zips>
# next command extracts all TTF and OTF files into your `.fonts` folder.
unzip "*.zip" "*.ttf" "*.otf" -d ${HOME}/.fonts
# next command rebuilds font cache
sudo fc-cache -f -v

If you want to remove the fonts again, then simply delete the TTF files in your .fonts folder and rebuild the font cache.

More about fonts and Ubuntu here.

And yes, you need all TTF files.

TTF and/or OTF

I quote:

OTF is more likely to be a “better” font, as it supports more advanced typesetting features (smallcaps, alternates, ligatures and so on actually inside the font rather than in fiddly separate expert set fonts). It can also contain either spline (TTF-style) or Bezier (PostScript Type 1-style) curves, so hopefully you're getting the shapes the font was originally designed in and not a potentially-poorer-quality conversion.