mirror of
https://github.com/mpv-player/mpv
synced 2024-11-07 01:47:00 +01:00
11250d1f4c
add a debconf TrueType font configuration. Based on the Debian package by Andrea Menucci. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17347 b3059339-0415-0410-9bf9-f77b7e298cf2
53 lines
1.3 KiB
Bash
Executable File
53 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
CONFIGFILE=/etc/mplayer/mplayer.conf
|
|
|
|
set -e
|
|
|
|
# Source debconf library.
|
|
. /usr/share/debconf/confmodule
|
|
|
|
if test -r $CONFIGFILE && ! grep -q '### mplayer DEBCONF AREA' $CONFIGFILE
|
|
then
|
|
db_input medium 'mplayer/replace-existing-files' || true
|
|
db_go || true
|
|
if [ "$RET" != "true" ]; then
|
|
exit 0
|
|
fi
|
|
db_get 'mplayer/replace-existing-files' || true
|
|
fi
|
|
|
|
########################################## find fonts
|
|
#default font (if available)
|
|
BESTFONT=/usr/share/fonts/truetype/Arial.ttf
|
|
[ -r $BESTFONT ] || BESTFONT=/usr/share/fonts/truetype/freefont/FreeSans.ttf
|
|
|
|
t=$(tempfile -p fonts )
|
|
find /usr/share/fonts/ /?/?in*/?ont* -type f -iname '*.ttf' -maxdepth 3 2> /dev/null > $t || true
|
|
|
|
if test -s $t
|
|
then
|
|
fonts=$( awk '{print a $0;a=", "}' $t || true )
|
|
db_subst "mplayer/ttfont" ttfontchoices $fonts || true
|
|
## suppose the question is skipped: give a default
|
|
a=$BESTFONT
|
|
[ -r $BESTFONT ] || a=$(head -1 $t)
|
|
db_subst "mplayer/ttfont" ttfontdefault $a || true
|
|
|
|
db_input medium mplayer/ttfont || true
|
|
if [ "$?" = 30 ] ; then
|
|
db_set mplayer/ttfont $a || true
|
|
fi
|
|
else
|
|
db_input medium "mplayer/no-ttfont" || true
|
|
fi
|
|
|
|
rm $t
|
|
|
|
db_go || true
|
|
|
|
############################################################
|
|
|
|
|
|
exit 0
|