File: font.sh

package info (click to toggle)
fim 0.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,048 kB
  • sloc: cpp: 32,769; ansic: 4,507; makefile: 1,549; sh: 1,502; perl: 189; exp: 28; awk: 9
file content (52 lines) | stat: -rwxr-xr-x 1,475 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh

# tests font functionality in fim
# this script shall work whatever its configure options (even if fim was compiled 'dumb')

f=${FIM_EXE-src/fim} # for e.g. Debian's post-installation tests
if test x != "$top_srcdir"; then true ; else top_srcdir=./ ; fi
ff="$top_srcdir/media/fim.png media/icon_smile.gif"
fa="-b -c quit $ff "
fv="-V "
fq="$FIMNORCOPTS"

fail()
{
	echo "[!] $@";
	exit -1;
}

resign()
{
	echo "[~] $@";
	exit 0;
}
succeed()
{
	echo "[*] $@";
	exit 0;
}

which grep || fail "we don't go anywhere without grep in our pocket"
g="`which grep` -i"

export FBFONT=''
e='s/^.*://g'

POD='\(sdl\|fb\|imlib2\)'
$f $fv 2>&1 | $g -i 'supported output devices.*:' | $g "$POD"|| resign "missing a pixel oriented driver (as one of $POD)"
$f $fv 2>&1 | $g 'supported file formats:'   | $g '\(png\|gif\)' | resign "missing adequate file format support"

if test x"$SSH_TTY" = x"" ; then
export FBFONT=/dev/null
if $f $fq $fa -o dumb ; then fail "$f $fa does not fail as it should on wrong font file" ; 
else echo "$f $fq $fa correctly recognizes an invalid FBFONT variable and exits" ; fi
else echo "Skipping FBFONT=/dev/null because seems we're running under ssh" ; fi

export FBFONT=$top_srcdir/var/fonts/Lat15-Terminus16.psf
if ! $f $fq $fa -o dumb ; then fail "$f $fq $fa fails, but it should not, as a correct font was provided" ; 
else echo "$f $fq $fa correctly recognizes a valid font file" ; fi

succeed "Font environment variables check PASSED"
exit 0