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...
- Extracting the .zip files
- Copying only .ttf/.otf files
- Pasting only the .ttf/.otf files into .font folder
- 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.
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.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:
Source
Addendum to the accepted answer:
Run
fc-cache -f -v
withoutsudo
.If you use
sudo
, as indicated by the accepted answer,fc-cache
will only process the root's fonts folder, while ignoring the user's fonts folder.Not a one liner but here is slightly more robust script that works on Linux as well as OSX. Here we download codefonts and install it without overwriting existing files.