2010-11-21 22:59:27 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# This script is used by the xorg-x11-fonts package in the %post stage for
|
|
|
|
# some fonts to generate the right encodings.
|
|
|
|
|
|
|
|
fontdir=""
|
|
|
|
encodingsdir="@DATADIR@/X11/fonts/encodings"
|
|
|
|
|
|
|
|
# some fonts need to skip mkfontscale, set to "yes" to skip
|
|
|
|
skip_fontscale=""
|
|
|
|
# some fonts need to run ttmkfdir, set to "yes" to run
|
|
|
|
need_ttmkfdir=""
|
|
|
|
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
echo "Need at least one parameter for font dir."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
while [ $# != 0 ]; do
|
|
|
|
case $1 in
|
|
|
|
--skip-fontscale)
|
|
|
|
skip_fontscale="yes"
|
|
|
|
;;
|
|
|
|
--need-ttmkfdir)
|
|
|
|
need_ttmkfdir="yes"
|
|
|
|
;;
|
|
|
|
--encodingsdir)
|
|
|
|
shift
|
|
|
|
encodingsdir="$1"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
fontdir="$1"
|
|
|
|
|
|
|
|
if [ $# != 1 ]; then
|
|
|
|
echo "Too many parameters."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$skip_fontscale" != "yes" ]; then
|
|
|
|
mkfontscale $fontdir
|
|
|
|
fi
|
2010-11-24 04:02:13 +00:00
|
|
|
if [ "$need_ttmkfdir" = "yes" ]; then
|
2013-05-30 05:52:02 +00:00
|
|
|
ttmkfdir -d $fontdir -o "$fontdir/fonts.scale"
|
2010-11-21 22:59:27 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
mkfontdir $fontdir
|
|
|
|
fc-cache $fontdir
|
|
|
|
|
|
|
|
if ! [ -z "$encodingsdir" ]; then
|
|
|
|
[ -d "$encodingsdir" ] || mkdir -p "$encodingsdir"
|
2013-04-08 08:47:04 +00:00
|
|
|
[ -d "$encodingsdir/large" ] || mkdir -p "$encodingsdir/large"
|
2010-12-22 12:16:40 +00:00
|
|
|
oldpwd=$(pwd)
|
|
|
|
cd "$encodingsdir"
|
2010-11-21 22:59:27 +00:00
|
|
|
mkfontscale -n -e "$encodingsdir" -e "$encodingsdir/large"
|
2010-12-22 12:16:40 +00:00
|
|
|
cd ${oldpwd}
|
2010-11-21 22:59:27 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|