Posted by: jasper22 | July 6, 2009

Installing Vista Fonts in Ubuntu


Getting them installed in Ubuntu is a breeze, thanks to a script I found.
To install the Vista ClearType fonts in Ubuntu, you need to install cabextract first. Cabextract is a utility found in the universe repository, so before you run the following command, make sure you have universe enabled in your repository list. Once this is done, install cabextract using:
$sudo apt-get install cabextract

Then, once that is done, use this script to install the Vista fonts. Create a file called “vista-fonts-installer.sh” in your home (~) directory.
Then open up a text editor and copy and paste the script into that file.
Do a chmod a+x ~/vista-fonts-installer.sh to make the file/script executable.
Then run the script using:
$ ~/vista-fonts-installer.sh

The script downloads the Powerpoint Viewer installer from microsoft.com, and then extracts the Vista cleartype fonts using cabextract. These fonts are then installed in the ~/.fonts directory.

Please remember that the ClearType Vista fonts are not free as in they are not GPL-ed or made available under a re-distributable license. Since you are downloading the fonts from the MS website, and since you might already have a Windows XP/Vista license, this is not a crime, but consider yourself warned against the perils of supporting closed systems :)

Update::

   1. Looks like the use of these fonts are restricted to only Microsoft Windows/Vista operating systems according to the terms of the license. I am sorry, but you’ll be installing them at your own risk.
   2. Also, please make sure you use the bash shell, or change the first line of the code to #!/bin/bash
   3. In retrospect, this was a bad post – I think we’re better off not using stuff folks don’t want us to use – let’s use the better, freer, easier to install fonts.

vista-fonts-installer.sh
—–cut here———————————————————————————————————————————
#!/bin/sh
# Copyright (c) 2007 Aristotle Pagaltzis
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the “Software”), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

set -e

exists() { which “$1″ &> /dev/null ; }

if ! [ -d ~/.fonts ] ; then
    exec 2>&1
    echo ‘There is no .fonts directory in your home.’
    echo ‘Is fontconfig set up for privately installed fonts?’
    exit 1
fi

# split up to keep the download command short
DL_HOST=download.microsoft.com
DL_PATH=download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26
ARCHIVE=PowerPointViewer.exe
URL=”http://$DL_HOST/$DL_PATH/$ARCHIVE”

if ! [ -e "$ARCHIVE" ] ; then
    if   exists curl  ; then curl -O “$URL”
    elif exists wget  ; then wget    “$URL”
    elif exists fetch ; then fetch   “$URL”
    fi
fi

TMPDIR=`mktemp -d`
trap ‘rm -rf “$TMPDIR”‘ EXIT INT QUIT TERM

cabextract -L -F ppviewer.cab -d “$TMPDIR” “$ARCHIVE”

cabextract -L -F ‘*.TT[FC]‘ -d ~/.fonts “$TMPDIR/ppviewer.cab”

( cd ~/.fonts && mv cambria.ttc cambria.ttf && chmod 600 \
    calibri{,b,i,z}.ttf cambria{,b,i,z}.ttf candara{,b,i,z}.ttf \
    consola{,b,i,z}.ttf constan{,b,i,z}.ttf corbel{,b,i,z}.ttf )

fc-cache -fv ~/.fonts
—–cut here———————————————————————————————————————————

Read from: Ubuntu blog


Leave a response

Your response:

Categories