![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Art & Design Discuss various aspects of Ubuntu and Art here. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Way Too Much Ubuntu
![]() Join Date: Sep 2006
Location: Norway
Beans: 262
|
How to install fonts in Ubuntu?
Hi,
I have a .ttf font file here and I am wondering how I install it into the system?
__________________
Visit |
|
|
|
|
|
#2 |
|
I Ubuntu, Therefore, I Am
![]() |
Re: How to install fonts in Ubuntu?
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
__________________
What's a blub programmer? Registered Linux user #419974 My projects: |
|
|
|
|
|
#3 |
|
Way Too Much Ubuntu
![]() Join Date: Sep 2006
Location: Norway
Beans: 262
|
Re: How to install fonts in Ubuntu?
Well, I cannot seam to be able to copy the font over! Not even as root.
__________________
Visit |
|
|
|
|
|
#4 |
|
A Carafe of Ubuntu
![]() |
Re: How to install fonts in Ubuntu?
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. |
|
|
|
|
|
#5 |
|
I Ubuntu, Therefore, I Am
![]() |
Re: How to install fonts in Ubuntu?
I wrote a script a while back that installs fonts. Save the script somewhere in your $PATH and make it executable. Type
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
__________________
What's a blub programmer? Registered Linux user #419974 My projects: |
|
|
|
|
|
#6 |
|
A Carafe of Ubuntu
![]() |
Re: How to install fonts in Ubuntu?
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 |
|
|
|
|
|
#7 |
|
A Carafe of Ubuntu
![]() |
Re: How to install fonts in Ubuntu?
That did it! Thanks so much!
|
|
|
|
|
|
#8 | |
|
I Ubuntu, Therefore, I Am
![]() |
Re: How to install fonts in Ubuntu?
Quote:
$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.
__________________
What's a blub programmer? Registered Linux user #419974 My projects: |
|
|
|
|
|
|
#9 |
|
First Cup of Ubuntu
![]() Join Date: Oct 2006
Location: Maryland, USA
Beans: 1
Ubuntu 6.06
|
Re: How to install fonts in Ubuntu?
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?) |
|
|
|
|
|
#10 | |
|
A Carafe of Ubuntu
![]() |
Re: How to install fonts in Ubuntu?
Quote:
I wonder if using Nautilus would work for item 4. then you wouldn't have to type everyting out. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|