]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - xorg-x11-font-utils/xorg-x11-fonts-update-dirs
Merge remote-tracking branch 'stevee/compat-packages'
[people/ms/ipfire-3.x.git] / xorg-x11-font-utils / xorg-x11-fonts-update-dirs
CommitLineData
f15bd751
SS
1#!/bin/sh
2# This script is used by the xorg-x11-fonts package in the %post stage for
3# some fonts to generate the right encodings.
4
5fontdir=""
6encodingsdir="@DATADIR@/X11/fonts/encodings"
7
8# some fonts need to skip mkfontscale, set to "yes" to skip
9skip_fontscale=""
10# some fonts need to run ttmkfdir, set to "yes" to run
11need_ttmkfdir=""
12
13if [ $# -lt 1 ]; then
14 echo "Need at least one parameter for font dir."
15 exit 1
16fi
17
18while [ $# != 0 ]; do
19 case $1 in
20 --skip-fontscale)
21 skip_fontscale="yes"
22 ;;
23 --need-ttmkfdir)
24 need_ttmkfdir="yes"
25 ;;
26 --encodingsdir)
27 shift
28 encodingsdir="$1"
29 ;;
30 *)
31 fontdir="$1"
32
33 if [ $# != 1 ]; then
34 echo "Too many parameters."
35 exit 1
36 fi
37 ;;
38 esac
39 shift
40done
41
42if [ "$skip_fontscale" != "yes" ]; then
43 mkfontscale $fontdir
44fi
45if [ "$need_ttmkfdir" = "yes" ]; then
46 ttmkfdir $fontdir
47fi
48
49mkfontdir $fontdir
50fc-cache $fontdir
51
52if ! [ -z "$encodingsdir" ]; then
53 [ -d "$encodingsdir" ] || mkdir -p "$encodingsdir"
54 oldpwd=$(pwd)
55 cd "$encodingsdir"
56 mkfontscale -n -e "$encodingsdir" -e "$encodingsdir/large"
57 cd ${oldpwd}
58fi
59
60