Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Art & Design
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

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
Old October 11th, 2006   #1
Aleksandersen
Way Too Much Ubuntu
 
Aleksandersen's Avatar
 
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 Open Source Notebook —get your daily doze of propaganda for a geek friendly guture!
Aleksandersen is offline   Reply With Quote
Old October 11th, 2006   #2
mssever
I Ubuntu, Therefore, I Am
 
mssever's Avatar
 
Join Date: Jun 2006
Location: 대전, Korea
Beans: 3,443
Ubuntu 8.10 Intrepid Ibex
Send a message via AIM to mssever Send a message via Yahoo to mssever Send a message via Skype™ to mssever
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:
Net Responsibility -- Internet accountability software for Linux
BadgeEntry -- Track attendance for children's events
mssever is offline   Reply With Quote
Old October 11th, 2006   #3
Aleksandersen
Way Too Much Ubuntu
 
Aleksandersen's Avatar
 
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 Open Source Notebook —get your daily doze of propaganda for a geek friendly guture!
Aleksandersen is offline   Reply With Quote
Old October 11th, 2006   #4
eg-maverick
A Carafe of Ubuntu
 
Join Date: Aug 2006
Location: California
Beans: 93
Ubuntu 7.04 Feisty Fawn
Send a message via Yahoo to eg-maverick
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.
eg-maverick is offline   Reply With Quote
Old October 11th, 2006   #5
mssever
I Ubuntu, Therefore, I Am
 
mssever's Avatar
 
Join Date: Jun 2006
Location: 대전, Korea
Beans: 3,443
Ubuntu 8.10 Intrepid Ibex
Send a message via AIM to mssever Send a message via Yahoo to mssever Send a message via Skype™ to mssever
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
Then, 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:
#!/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:
Net Responsibility -- Internet accountability software for Linux
BadgeEntry -- Track attendance for children's events
mssever is offline   Reply With Quote
Old October 11th, 2006   #6
eg-maverick
A Carafe of Ubuntu
 
Join Date: Aug 2006
Location: California
Beans: 93
Ubuntu 7.04 Feisty Fawn
Send a message via Yahoo to eg-maverick
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
eg-maverick is offline   Reply With Quote
Old October 11th, 2006   #7
eg-maverick
A Carafe of Ubuntu
 
Join Date: Aug 2006
Location: California
Beans: 93
Ubuntu 7.04 Feisty Fawn
Send a message via Yahoo to eg-maverick
Re: How to install fonts in Ubuntu?

That did it! Thanks so much!
eg-maverick is offline   Reply With Quote
Old October 11th, 2006   #8
mssever
I Ubuntu, Therefore, I Am
 
mssever's Avatar
 
Join Date: Jun 2006
Location: 대전, Korea
Beans: 3,443
Ubuntu 8.10 Intrepid Ibex
Send a message via AIM to mssever Send a message via Yahoo to mssever Send a message via Skype™ to mssever
Re: How to install fonts in Ubuntu?

Quote:
Originally Posted by eg-maverick View Post
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
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.
__________________
What's a blub programmer?         Registered Linux user #419974
My projects:
Net Responsibility -- Internet accountability software for Linux
BadgeEntry -- Track attendance for children's events
mssever is offline   Reply With Quote
Old October 12th, 2006   #9
emiphiste
First Cup of Ubuntu
 
emiphiste's Avatar
 
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?)
emiphiste is offline   Reply With Quote
Old October 12th, 2006   #10
eg-maverick
A Carafe of Ubuntu
 
Join Date: Aug 2006
Location: California
Beans: 93
Ubuntu 7.04 Feisty Fawn
Send a message via Yahoo to eg-maverick
Re: How to install fonts in Ubuntu?

Quote:
Originally Posted by emiphiste View Post
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?)

I wonder if using Nautilus would work for item 4. then you wouldn't have to type everyting out.
eg-maverick is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:15 AM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry