#!/usr/pkg/bin/ksh93
# $XConsortium: Xsetup.src /main/8 1996/07/02 11:40:32 mgreess $
# ##########################################################################
#
#  Common Desktop Environment
#
#  (c) Copyright 1993, 1994 Hewlett-Packard Company
#  (c) Copyright 1993, 1994 International Business Machines Corp.
#  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
#  (c) Copyright 1993, 1994 Novell, Inc.
#
#      ************** DO NOT EDIT THIS FILE **************
#
#  /usr/dt/config/Xsetup is a factory-default file and will
#  be unconditionally overwritten upon subsequent installation.
#  Before making changes to the file, copy it to the configuration 
#  directory, /etc/dt/config. You must also update the setup
#  resource in /etc/dt/config/Xconfig.
#
# ##########################################################################
# ##########################################################################
# 
# Directory specifications
# 
# ##########################################################################










  XDIR=/usr/X11R7/bin


















# ##########################################################################
#  
# Append desktop font aliases to font path
#
# ##########################################################################


    #
    # Append desktop font paths. Note: these directories should be
    # accessable by the X server. The file precedence is:
    #
    #   /etc/dt/config/xfonts/$LANG
    #   /usr/dt/config/xfonts/$LANG
    #   /etc/dt/config/xfonts/C
    #   /usr/dt/config/xfonts/C
    #






    if [ "$DTXSERVERLOCATION" != "remote" ]; then

      #
      # Since X server is local, optimize by checking local desktop
      # font directories and making one call to xset.
      #

      if [ "${LANG-C}" != "C" ]; then
        if [ -f /etc/dt/config/xfonts/$LANG/fonts.dir ]; then
          fontpath=/etc/dt/config/xfonts/$LANG
        fi

        if [ -f /usr/dt/config/xfonts/$LANG/fonts.dir ]; then
          if [ -z "$fontpath" ]; then
            fontpath=/usr/dt/config/xfonts/$LANG
          else
            fontpath=$fontpath,/usr/dt/config/xfonts/$LANG
          fi
        fi
      fi

      if [ -f /etc/dt/config/xfonts/C/fonts.dir ]; then
          if [ -z "$fontpath" ]; then
            fontpath=/etc/dt/config/xfonts/C
          else
            fontpath=$fontpath,/etc/dt/config/xfonts/C
          fi
      fi

      if [ -f /usr/dt/config/xfonts/C/fonts.dir ]; then
        if [ -z "$fontpath" ]; then
          fontpath=/usr/dt/config/xfonts/C
        else
          fontpath=$fontpath,/usr/dt/config/xfonts/C
        fi
      fi


      if [ ! -z "$fontpath" ]; then
        $XDIR/xset fp+ $fontpath
      fi

    else
      #
      # Since X server not local, we don't know if the desktop font
      # directories exist on the X server machine, so we have to
      # set them one at a time.
      #

      if [ "${LANG-C}" != "C" ]; then 
        $XDIR/xset fp+ /etc/dt/config/xfonts/$LANG 1>/dev/null

        $XDIR/xset fp+ /usr/dt/config/xfonts/$LANG 1>/dev/null
      fi

      $XDIR/xset fp+ /etc/dt/config/xfonts/C 1>/dev/null

      $XDIR/xset fp+ /usr/dt/config/xfonts/C 1>/dev/null

    fi









