5 .
/usr
/share
/debconf
/confmodule
7 LOCALCONF
=/var
/lib
/fontconfig
/local.conf
10 CONFDIR
=/etc
/fonts
/conf.d
12 db_get fontconfig
/hinting_type
15 hint_prio
="10-debconf-"
16 unhinted
="unhinted.conf"
17 autohint
="autohint.conf"
19 if [ -h $CONFDIR/$hint_prio$unhinted ]; then
20 rm $CONFDIR/$hint_prio$unhinted
22 if [ -h $CONFDIR/$hint_prio$autohint ]; then
23 rm $CONFDIR/$hint_prio$autohint
26 case "$hinting_type" in
30 ln -s $CONFDIR/$autohint $CONFDIR/$hint_prio$autohint
33 ln -s $CONFDIR/$unhinted $CONFDIR/$hint_prio$unhinted
37 db_get fontconfig
/subpixel_rendering
38 subpixel_rendering
="$RET"
40 subpixel_prio
="20-debconf-"
41 subpixel
="sub-pixel.conf"
42 no_subpixel
="no-sub-pixel.conf"
44 if [ -h $CONFDIR/$subpixel_prio$subpixel ]; then
45 rm $CONFDIR/$subpixel_prio$subpixel
48 if [ -h $CONFDIR/$subpixel_prio$no_subpixel ]; then
49 rm $CONFDIR/$subpixel_prio$no_subpixel
52 case "$subpixel_rendering" in
56 ln -s $CONFDIR/$subpixel $CONFDIR/$subpixel_prio$subpixel
59 ln -s $CONFDIR/$no_subpixel $CONFDIR/$subpixel_prio$no_subpixel
63 db_get fontconfig
/enable_bitmaps
66 bitmaps_prio
="30-debconf-"
67 yes_bitmaps
="yes-bitmaps.conf"
68 no_bitmaps
="no-bitmaps.conf"
70 if [ -h $CONFDIR/$bitmaps_prio$yes_bitmaps ]; then
71 rm $CONFDIR/$bitmaps_prio$yes_bitmaps
74 if [ -h $CONFDIR/$bitmaps_prio$no_bitmaps ]; then
75 rm $CONFDIR/$bitmaps_prio$no_bitmaps
78 case "$enable_bitmaps" in
80 ln -s $CONFDIR/$yes_bitmaps $CONFDIR/$bitmaps_prio$yes_bitmaps
83 ln -s $CONFDIR/$no_bitmaps $CONFDIR/$bitmaps_prio$no_bitmaps
87 cp /dev
/null
$LOCALCONF
88 rm -f $LOCALCONF.
md5sum
89 ln -sf /usr
/share
/fontconfig
/local.conf.
md5sum $LOCALCONF.
md5sum
90 ucf
--debconf-ok $LOCALCONF /etc
/fonts
/local.conf
91 rm -f $LOCALCONF.
md5sum
93 # if the local.conf file is now empty, remove it
95 if [ -s /etc
/fonts
/local.conf
]; then
98 if [ -f /etc
/fonts
/local.conf
]; then
99 rm /etc
/fonts
/local.conf
103 # Create /usr/local/share/fonts
104 LOCALDIR
=/usr
/local
/share
/fonts
105 if [ ! -d $LOCALDIR ]; then
106 if mkdir
$LOCALDIR 2>/dev
/null
; then
108 chown root
:staff
$LOCALDIR
112 if [ "$1" = configure
]; then
113 # Ensure Defoma subst file exists, with some default substitutions
114 if ! defoma-subst check-rule fontconfig
; then
115 defoma-subst new-rule fontconfig \
116 'serif --GeneralFamily,* Roman --Shape Serif Upright --Weight Medium' \
117 'sans-serif --GeneralFamily,* SansSerif --Shape NoSerif Upright --Weight Medium' \
118 'monospace --Width,* Fixed --GeneralFamily,2 Typewriter --Shape Upright --Weight Medium'
122 if [ -d /var
/lib
/defoma
/x-ttcidfont-conf.d
]; then
123 # Remove old fonts.cache-1 files
124 find /var
/lib
/defoma
/x-ttcidfont-conf.d
-name fonts.cache-1 |
xargs rm -f
129 if [ "$1" = configure
]; then
130 # (Hacked up from Red Hat 8 fontconfig RPM)
131 # Force regeneration of all fontconfig cache files.
132 # The redirect is because fc-cache is giving warnings about ~/fc.cache
133 # the HOME setting is to avoid problems if HOME hasn't been reset
134 printf "Regenerating fonts cache... "
135 HOME
=/root fc-cache
-f -v 1>/var
/log
/fontconfig.log
2>&1 ||
(printf "failed.\nSee /var/log/fontconfig.log for more information.\n"; exit 1)