lib/Tools/installfonts
author wenzelm
Fri, 15 Sep 2000 16:29:36 +0200
changeset 9974 5361a27c1853
parent 9788 df671fa2562a
child 10511 efb3428c9879
permissions -rwxr-xr-x
support XSYMBOL_INSTALLFONTS as well;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3007
e5efa177ee0c removed -norc;
wenzelm
parents: 2784
diff changeset
     1
#!/bin/bash
2297
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
     2
#
2311
69c51db9481f fails more gracefully;
wenzelm
parents: 2297
diff changeset
     3
# $Id$
9788
wenzelm
parents: 3253
diff changeset
     4
# Author: Markus Wenzel, TU Muenchen
wenzelm
parents: 3253
diff changeset
     5
# License: GPL (GNU GENERAL PUBLIC LICENSE)
2311
69c51db9481f fails more gracefully;
wenzelm
parents: 2297
diff changeset
     6
#
9974
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
     7
# DESCRIPTION: install symbol fonts on the current X11 server
2311
69c51db9481f fails more gracefully;
wenzelm
parents: 2297
diff changeset
     8
2297
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
     9
9788
wenzelm
parents: 3253
diff changeset
    10
PRG=$(basename "$0")
2297
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    11
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    12
function usage()
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    13
{
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    14
  echo
9974
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    15
  echo "Usage: $PRG [OPTIONS]"
2297
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    16
  echo
9974
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    17
  echo "  Options are:"
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    18
  echo "    -x           install X-Symbol fonts"
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    19
  echo
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    20
  echo "  Install symbol fonts on the current X11 server."
2297
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    21
  echo
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    22
  exit 1
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    23
}
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    24
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    25
9974
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    26
## process command line
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    27
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    28
# options
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    29
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    30
XSYMB=""
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    31
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    32
while getopts "x" OPT
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    33
do
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    34
  case "$OPT" in
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    35
    x)
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    36
      XSYMB=true
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    37
      ;;
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    38
    \?)
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    39
      usage
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    40
      ;;
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    41
  esac
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    42
done
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    43
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    44
shift $(($OPTIND - 1))
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    45
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    46
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    47
# args
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    48
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    49
[ "$#" -ne 0 ] && usage
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    50
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    51
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    52
## check fonts
2578
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    53
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    54
function checkfonts()
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    55
{
9974
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    56
  RESULT=$(xlsfonts -fn "$1" 2>&1) || return 1
2578
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    57
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    58
  case "$RESULT" in
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    59
    xlsfonts:*)
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    60
      return 1
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    61
      ;;
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    62
  esac
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    63
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    64
  return 0
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    65
}
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    66
cc768a16ef65 now uses ISABELLE_INSTALLFONTS;
wenzelm
parents: 2335
diff changeset
    67
2297
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    68
## main
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    69
9974
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    70
ISABELLE_PATTERN="-isabelle-fixed-*-isabelle-0"
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    71
XSYMBOL_PATTERN="-xsymb-xsymb0-*"
2297
efcabc6df91a installfonts: install Isabelle symbol fonts.
wenzelm
parents:
diff changeset
    72
9974
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    73
if [ -z "$XSYMB" ]; then
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    74
  checkfonts "$ISABELLE_PATTERN" || eval $ISABELLE_INSTALLFONTS
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    75
  checkfonts "$ISABELLE_PATTERN" || \
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    76
    echo "Warning: Isabelle fonts probably not installed correctly!" >&2
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    77
else
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    78
  checkfonts "$XSYMBOL_PATTERN" || eval $XSYMBOL_INSTALLFONTS
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    79
  checkfonts "$XSYMBOL_PATTERN" || \
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    80
    echo "Warning: X-Symbol fonts probably not installed correctly!" >&2
5361a27c1853 support XSYMBOL_INSTALLFONTS as well;
wenzelm
parents: 9788
diff changeset
    81
fi