예전의 복잡했던 방법에서 탈피해서 MS 의 CoreFonts 들을 쉽게 설치할 수 있는 방법이 열렸습니다. 너무 쉬어서 쓰기도 부끄럽군요. 

 우분투 (Ubuntu) 11.10 에서 테스트 했습니다. "Oneiric Ocelot"(몽환적 시라소니) 라고도 하지요. 
 
$sudo apt-get install cabextract



로 다운 받으시면 됩니다.  제 경우에는 이미 설치되어 있더군요. 
 
그리고  스크립트를 한개 만듭니다.  vista-fonts-installer.sh 로 만들어 줬습니다. 다음은 그 파일에 저장될 내용입니다.




#!/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


그리고 


$ chmod a+x ./vista-fonts-installer.sh 




를 해주고 자신의 $HOME 에서 임시 폰트가 저장될 위치를 만들어 줍니다. 


$mkdir ~/.fonts




그리고 파일 다운로드를 위해서 curl 이라는 명령을 설치해줘야 합니다. 


$sudo apt-get install curl 




그리고 마지막으로 위에서 만들어준 스크립트를 실행시켜 줍니다. 


$ ./vista-fonts-installer.sh



만약 에러가 발생한다면 다음 명령을 수동으로 한번 실행해줍니다.

fc-cache -fv ~/.fonts




이상입니다. 이렇게 하면 아주 간단하게 폰트가 설치됩니다. 




+ Recent posts