Page 1 of 19 12311 ... LastLast
Results 1 to 10 of 186

Thread: How to install fonts in Ubuntu?

  1. #1
    Join Date
    Sep 2006
    Location
    Norway
    Beans
    265
    Distro
    Ubuntu 10.04 Lucid Lynx

    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?

  2. #2
    Join Date
    Jun 2006
    Location
    Gwangju, Korea
    Beans
    3,479

    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

  3. #3
    Join Date
    Sep 2006
    Location
    Norway
    Beans
    265
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to install fonts in Ubuntu?

    Well, I cannot seam to be able to copy the font over! Not even as root.

  4. #4
    Join Date
    Aug 2006
    Location
    California
    Beans
    93
    Distro
    Ubuntu 7.04 Feisty Fawn

    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. #5
    Join Date
    Jun 2006
    Location
    Gwangju, Korea
    Beans
    3,479

    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

  6. #6
    Join Date
    Aug 2006
    Location
    California
    Beans
    93
    Distro
    Ubuntu 7.04 Feisty Fawn

    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. #7
    Join Date
    Aug 2006
    Location
    California
    Beans
    93
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: How to install fonts in Ubuntu?

    That did it! Thanks so much!

  8. #8
    Join Date
    Jun 2006
    Location
    Gwangju, Korea
    Beans
    3,479

    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.

  9. #9
    Join Date
    Oct 2006
    Location
    Maryland, USA
    Beans
    1
    Distro
    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. #10
    Join Date
    Aug 2006
    Location
    California
    Beans
    93
    Distro
    Ubuntu 7.04 Feisty Fawn

    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.

Page 1 of 19 12311 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •