| 3007 |      1 | #!/bin/bash
 | 
| 2297 |      2 | #
 | 
| 2311 |      3 | # $Id$
 | 
|  |      4 | #
 | 
| 2784 |      5 | # DESCRIPTION: install the isabelle fonts into your X11 server
 | 
| 2311 |      6 | 
 | 
| 2297 |      7 | 
 | 
|  |      8 | PRG=$(basename $0)
 | 
|  |      9 | 
 | 
|  |     10 | function usage()
 | 
|  |     11 | {
 | 
|  |     12 |   echo
 | 
|  |     13 |   echo "Usage: $PRG"
 | 
|  |     14 |   echo
 | 
| 2784 |     15 |   echo "  Install the isabelle fonts into your X11 server."
 | 
| 3253 |     16 |   echo "  (May be safely called repeatedly.)"
 | 
| 2297 |     17 |   echo
 | 
|  |     18 |   exit 1
 | 
|  |     19 | }
 | 
|  |     20 | 
 | 
|  |     21 | 
 | 
| 2578 |     22 | ## check for isabelle fonts
 | 
|  |     23 | 
 | 
|  |     24 | function checkfonts()
 | 
|  |     25 | {
 | 
| 2784 |     26 |   RESULT=$(xlsfonts -fn "-isabelle-fixed-*-isabelle-0" 2>&1) || return 1
 | 
| 2578 |     27 | 
 | 
|  |     28 |   case "$RESULT" in
 | 
|  |     29 |     xlsfonts:*)
 | 
|  |     30 |       return 1
 | 
|  |     31 |       ;;
 | 
|  |     32 |   esac
 | 
|  |     33 | 
 | 
|  |     34 |   return 0
 | 
|  |     35 | }
 | 
|  |     36 | 
 | 
|  |     37 | 
 | 
| 2297 |     38 | ## main
 | 
|  |     39 | 
 | 
|  |     40 | [ $# -ne 0 ] && usage
 | 
|  |     41 | 
 | 
| 2578 |     42 | checkfonts || eval $ISABELLE_INSTALLFONTS
 | 
|  |     43 | checkfonts || echo "WARNING: Isabelle fonts probably not installed correctly!" >&2
 |