]> git.wh0rd.org - fontconfig.git/blob - setfontdirs
Build fc-lang, install local.conf
[fontconfig.git] / setfontdirs
1 #!/bin/sh
2 #
3 # $XFree86: xc/lib/fontconfig/setfontdirs,v 1.5 2002/12/17 03:26:36 dawes Exp $
4 #
5 LC_ALL=C
6 export LC_ALL
7 FONTDIRS=fontdirs$$
8 trap "rm $FONTDIRS" 0
9 sh ./findfonts ${1+"$@"} > $FONTDIRS
10 cp fonts.conf.in fonts.conf
11 chmod +w fonts.conf
12 EDITOR=ed
13 (echo q | ed) > /dev/null 2>&1
14 if [ $? -ne 0 ]; then
15 EDITOR=ex
16 (echo q | ex) > /dev/null 2>&1
17 if [ $? -ne 0 ]; then
18 echo "$0: *** Error: Cannot find 'ed' or 'ex' editor"
19 exit 1
20 fi
21 fi
22 $EDITOR fonts.conf << EOF
23 /FONTPATH_END/a
24 <!-- Font directory list configured on `date` -->
25 .
26 +r $FONTDIRS
27 a
28 <dir>~/.fonts</dir>
29
30 .
31 /FONTPATH_START/,/FONTPATH_END/d
32
33 w
34 q
35 EOF
36