Page 1 of 4 123 ... LastLast
Results 1 to 10 of 186

Thread: How to install fonts in Ubuntu?

Hybrid View

  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 2007
    Location
    Iceland
    Beans
    23
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How to install fonts in Ubuntu?

    Thank you mssever!
    This helped me installing the Calibri font!

  8. #8
    Join Date
    Jul 2008
    Location
    Maryland
    Beans
    85
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to install fonts in Ubuntu?

    Dude, this script rocks. Thank you very much for sharing it...

  9. #9
    Join Date
    Feb 2007
    Location
    Sydney, Australia
    Beans
    654
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to install fonts in Ubuntu?

    Quote Originally Posted by mssever View Post
    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
    Useful even today. Too easy!!! (just remember: case sensitive)
    Last edited by labinnsw; August 22nd, 2009 at 05:12 AM.

  10. #10
    Join Date
    Apr 2007
    Beans
    4

    Re: How to install fonts in Ubuntu?

    Quote Originally Posted by mssever View Post
    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
    This seemed to work perfectly for me. Thanks.

Page 1 of 4 123 ... 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
  •