fontconfig/setfontdirs

37 lines
621 B
Plaintext
Raw Normal View History

2002-02-15 00:34:13 +01:00
#!/bin/sh
#
# $XFree86: xc/lib/fontconfig/setfontdirs,v 1.5 2002/12/17 03:26:36 dawes Exp $
#
LC_ALL=C
export LC_ALL
2002-02-15 00:34:13 +01:00
FONTDIRS=fontdirs$$
trap "rm $FONTDIRS" 0
2002-05-21 19:08:42 +02:00
sh ./findfonts ${1+"$@"} > $FONTDIRS
2002-02-15 00:34:13 +01:00
cp fonts.conf.in fonts.conf
chmod +w fonts.conf
EDITOR=ed
(echo q | ed) > /dev/null 2>&1
if [ $? -ne 0 ]; then
EDITOR=ex
(echo q | ex) > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "$0: *** Error: Cannot find 'ed' or 'ex' editor"
exit 1
fi
fi
$EDITOR fonts.conf << EOF
2002-02-15 00:34:13 +01:00
/FONTPATH_END/a
2002-05-21 19:08:42 +02:00
<!-- Font directory list configured on `date` -->
2002-02-15 00:34:13 +01:00
.
+r $FONTDIRS
a
<dir>~/.fonts</dir>
2002-02-15 00:34:13 +01:00
.
/FONTPATH_START/,/FONTPATH_END/d
2002-02-15 00:34:13 +01:00
w
q
EOF