Install fonts on Linux Mint using Terminal commands

Alexio
  13 years ago
  1

To install some fixed width fonts you can run in the Terminal:

sudo apt-get install console-terminus ttf-dejavu ttf-droid ttf-inconsolata xfonts-terminus

 

Some other fonts designed for desktop readability can be installed with the command:

sudo apt-get install sun-java6-fonts ttf-liberation ttf-ubuntu-font-family ttf-xfree86-nonfree

 

To install the Google Web Fonts, open the Terminal and press the Enter key after you copy each command:

wget http://webupd8.googlecode.com/files/install-google-fonts

chmod +x install-google-fonts

./install-google-fonts

This is a script that downloads all the fonts from the Google Font Directory and installs them under /usr/share/fonts/truetype/google-fonts/

If you want to remove them later, simply delete that folder.

 

To install the Windows Vista fonts (like Calibri and Consolas, but not the Segoe UI font), open the Terminal and press the Enter key after you copy each command:

wget http://plasmasturm.org/code/vistafonts-installer/vistafonts-installer

chmod +x vistafonts-installer

./vistafonts-installer

This script extracts the Vista fonts from PowerPointViewer.exe, directly from the Microsoft website, so it is legal to use as it downloads the fonts from the official website.

 

To install something else, like the sharp fonts, just use the command:

wget http://webupd8.googlecode.com/files/sharpfonts-2.1.sh

chmod +x sharpfonts-2.1.sh

sudo ./sharpfonts-2.1.sh

If you are not happy with the sharp fonts, you can revert back to polished fonts by deleting some files:

rm /etc/fonts/alias.conf

rm /etc/fonts/local.conf

rm /etc/fonts/misc.conf

rm /etc/fonts/msfonts-rules.conf

Comments
redact 11 years ago

Followup: whoops. That's not your script, unless you are Aristotle Pagaltzis (http://plasmasturm.org/log/457/). I've tried to contact him. Next time I shall try to pay more attention. Perhaps it would help if you'd cite the author of scripts you employ in tips.


redact 11 years ago

Yeah, this is good stuff ;-). Thank you!

I want to make one report of a failure that I don't understand, but cannot be
attributed to your script in an unaltered form. I want to be clear: I changed
your script and then it failed ;-/. So you can completely ignore this; but I
don't think my reason for the change was ridiculous. I'll describe that change
in a moment.

The script (above) named vistafonts-installer did not run to successful
completion. Well, so it goes, even with 'simple' scripts, I've found. The
failing command is the chmod expression in (at present) line # 53

( cd ~/.fonts && mv cambria.ttc cambria.ttf && chmod 600 \
calibri{,b,i,z}.ttf cambria{,b,i,z}.ttf candara{,b,i,z}.ttf \
consola{,b,i,z}.ttf constan{,b,i,z}.ttf corbel{,b,i,z}.ttf )

The failure:

chmod: cannot access `calibri{,b,i,z}.ttf': No such file or directory
chmod: cannot access `cambria{,b,i,z}.ttf': No such file or directory
chmod: cannot access `candara{,b,i,z}.ttf': No such file or directory
chmod: cannot access `consola{,b,i,z}.ttf': No such file or directory
chmod: cannot access `constan{,b,i,z}.ttf': No such file or directory
chmod: cannot access `corbel{,b,i,z}.ttf': No such file or directory


** Here's the change I made - out of personal preference regarding what
happens in my ~. I created a variable $FONT_DL_TARGET_DIR to place the fonts
in. I edited the script so that all instances of text "~/.fonts" was replaced
by this variable.

PUTIN=$1
FONT_DL_TARGET_DIR=${PUTIN:-~/.local/share/fonts}

Ack that maybe FC expects ~/.fonts as a standard location. The fc-cache
command seemed to work even so.

Rationale is that XDG standards lead to fewer top-level dotdirs and
dotfiles under ~ and that makes it easier to keep myself organized.

So ~/.local/share/fonts is what I think an XDG-conformant choice would look
like.

I'm a passable *sh scriptor when I'm fully awake. IMHO.

In any event: the failure to chmod the files based on that shell expansion you
used is the reason for this comment, and I cannot account for it. My shell is
bash and my platform is LMDE, so my `sh´ ought to be a symlink to /bin/dash
...yup, it is.

I've put my edited version of your script up as a gist at

https://gist.github.com/somian/6054348

Best regards, yours in Minty-Freshness,
redact