Hi,
I have a .ttf font file here and I am wondering how I install it into the system?
Hi,
I have a .ttf font file here and I am wondering how I install it into the system?
This is one of the best-kept secrets in Ubuntu. Open up Nautilus, hit Ctrl+L, and type fonts://<Enter>.
It's possible that you'll need a root nautilus for this:Code:gksudo nautilus
Well, I cannot seam to be able to copy the font over! Not even as root.
when I do this, it looks like it is going to copy (I have a server that has thousands of TTF). it asks for a password and a window pops up saying that it is preparing to copy. Then when I enter the password, the windows disappear happily but the font does not appear in the font directory. Any ideas?
Thanks.
I wrote a script a while back that installs fonts. Save the script somewhere in your $PATH and make it executable. TypeThen, cd to the directory that the fonts you want to install are in, run the script from a terminal window, and follow the prompts. Remember that Linux is case-sensitive, so if some files have a ttf extension and some hava a TTF extension, you'll either need to rename them or run the script twice.Code:sudo mkdir -p /usr/share/fonts/truetype/font-install
Code:#!/bin/bash # # This script helps to install fonts # # Set your default font storage directory here ##DEFAULT_DIR="$HOME/fonts" DEFAULT_DIR=`pwd` # Set the default font installation directory here DEFAULT_DEST="/usr/share/fonts/truetype/font-install" # Don't edit anything below unless you know what you're doing. echo "In which directory are the fonts?" echo -n "[$DEFAULT_DIR] " read DIR echo echo "What is the extention (without the dot) of the fonts?" echo -n "[ttf] " read EXT echo echo "Where should the fonts be installed?" echo "DO NOT CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING!" echo -n "[$DEFAULT_DEST] " read DEST if [ -z "$DIR" ]; then DIR="$DEFAULT_DIR" fi if [ -z "$EXT" ]; then EXT="ttf" fi if [ -z "$DEST" ]; then DEST="$DEFAULT_DEST" fi sudo -v if [ $? != 0 ]; then echo "Unable to obtain the necessary privileges. Exiting..." echo -n "Press <Enter> to continue. " read WER exit $? fi echo echo if [ ! -d "$DIR" ]; then echo "Directory $DIR does not exist. Exiting..." echo -n "Press <Enter> to continue. " read SDF exit 2 fi if [ ! -d "$DEST" ]; then echo "Directory $DEST does not exist. Exiting..." echo -n "Press <Enter> to continue. " read DFG exit 1 fi echo "Copying fonts..." cd "$DIR" for i in *."$EXT"; do sudo cp -iv "$i" "$DEST" done echo echo echo "Updating the font cache..." sudo fc-cache -fv if [ $? != 0 ]; then echo "Error updating the font cache. Your fonts haven't been completely installed. Try running sudo fc-cache -fv manually. Exiting..." echo -n "Press <Enter> to continue." read FSF exit $? fi echo echo echo "Finished." echo echo "You will probably need to restart running programs to use the new fonts." echo -n "Press <Enter> to exit. " read WERT exit 0
thanks for the script.
before i do damage to myself, what is the correct DEFAULT_DIR? I have standard dapper 6.06. I assume it is /home/'myusrname'/fonts . Is that correct?
thanks, Craig
That did it! Thanks so much!
This script is set up for Dapper. $DEFAULT_DIR can be anything you want. It defaults to the current directory. So, if you cd to the directory containing the fonts you want to install and run the script, everything should be OK.
$DEFAULT_DEST is the only distro-specific location. Technically, it can be any directory inside /usr/share/fonts/truetype (or it might be even more flexible--I haven't tried that), but I think that it's neater to put locally-installed fonts in a directory of their own.
I tried using the script, and it looked like it copied the fonts over fine; however, when I opened the GIMP to make sure I had the fonts, they were all defaulted to look like one of the monotypes. This may or may not be a unique issue - just thought I'd let you know (though the most likely reason is that I'm doing something wrong).
After some research on ubuntuforums.org, I've located a really simple way to install fonts (just to add on to the thread in case you're only looking to install maybe a few fonts at a time).
1) Download any/all fonts into one location (I'm using /home/"USERNAME"/ttffonts).
2) Navigate back to your home directory and create a folder called ".fonts". (This directory will disappear from view; don't worry about it, it's still there.)
3) In terminal, cd to /home/"USERNAME"/ttffonts.
4) cp all fonts in ttffonts to /home/"USERNAME"/.fonts (The only minor inconvenience about this is that, unlike using the script, you have to type out all fonts by hand - which may suck quite heartily if you're trying to install thousands of fonts from a server.)
5) Installation complete! (Source: http://ubuntuforums.org/showthread.php?t=263689)
(By the way, if you can help me get the script to work 100%, that would be awesome. It looks to be a very handy and well-written tool. I thought it might be because I'm using Breezy Badger instead of Dapper - could that be the culprit?)
Bookmarks