DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T i

⟦06fee6c4b⟧ TextFile

    Length: 5042 (0x13b2)
    Types: TextFile
    Names: »install_fonts«

Derivation

└─⟦6ac9a67ca⟧ Bits:30000548 8mm tape, Rational 1000, access 1_0_1
    └─ ⟦78f173837⟧ »DATA« 
        └─⟦687a7d38f⟧ 
└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦687a7d38f⟧ 
            └─⟦76eb391d8⟧ 
                └─⟦56d8da70c⟧ 
                    └─ ⟦this⟧ »bin/install_fonts« 

TextFile

#! /bin/csh -f

# Figure out where the fonts are first

set argv0=$0
set rahome=$argv0:h
set raname=$argv0:t

if ($rahome == $raname) then
   set rahome = ''
endif

if ($rahome =~ */bin) then
   set rahome = $rahome:h
endif

set current_dir = $cwd
# Quotes around $current_dir prevents Divide by 0 error, running in /
if ("$current_dir" =~ */bin) then
   set current_dir = $current_dir:h
endif

if ($rahome =~ /*) then
   setenv ACCESSHOME $rahome
else if ((-e ./bin/rational) || (-e ./rational)) then
   setenv ACCESSHOME $current_dir
else if ((-e $rahome/bin/rational) || (-e $rahome/rational)) then
   setenv ACCESSHOME $current_dir/$rahome
endif

set path=( /bin /usr/ucb $path )
set uname = `uname`

#
getpath1:
if (`xset -display xxxxx -q |& awk '$1 == "xset:" {print $2}'` == "Command") then
    echo "Unable to find xset, please provide the path for xset."
    echo -n "xset path:"
    set ANSWER=$<
    set path=( $ANSWER $path )
    goto getpath1
endif

#
select:
echo "Choose one of the following directories to install the fonts:"
echo " "
echo "0 ) Choose 0 to specify a different directory."

if ( $uname == "SunOS" || $uname == "AIX" ) then
    set the_list = `xset -q | awk 'BEGIN { FS = ","; enable = 0 } enable == 1 {  for (i = 1; i <= NF; i++) print $i; enable = 0 } $1 == "Font Path:" { enable = 1 }' | sed 's/^ *//g'`
else 
    echo "Unsuported configuration."
    exit 1
endif

set count = 0
foreach item ( $the_list )
    @ count++
    echo $count ")" $item
end
echo " "
echo -n "Type the number that corresponds to one of the above choices: "
set SELECT=$<
if ( ${SELECT} == 0 ) then
    echo " "
    echo -n "Install fonts in directory:"
    set font_dir=$<
endif
if ( ${SELECT} > $count ) then
   echo "Out of range choice, try again."
   goto select
endif
set count = 0
foreach item ( $the_list )
    @ count++
    if ( $count == $SELECT ) then
       set font_dir = $item
    endif
end

if ( -e $font_dir ) then
    if ( -f $font_dir ) then
       echo "$font_dir is a file.  Delete the files or choose another"
       echo "directory for the install."
       goto select
    endif
else
    echo -n Directory $font_dir does not exist.  Create one\?" "\[y\]" "
    set ANSWER=$<
    if ( ${ANSWER} == "" || ${ANSWER} == 'Y' || ${ANSWER} == 'y' ) then
       if ( $uname == "SunOS" ) then
          mkdir -p $font_dir
       else 
          mkdir $font_dir
       endif
       if ( ! -e $font_dir ) then
          echo "Unable to create directory.  Create directory manually and"
          echo "rerun the install script."
          exit
       endif
    else
       echo "Please choose a different directory to install fonts."
       goto select
    endif
endif

echo "Installing fonts in "$font_dir 

cd $ACCESSHOME/fonts/source

set fonts_for = 0

if ( ! -e ${font_dir}/fonts.dir ) then
   if ( ! -e ${font_dir}/Families.list ) then
      set NEW = 1
      if ( $uname == "AIX" ) then 
         set fonts_for = 1
      else 
         echo -n "Install fonts for openlook or motif? "\[o\]" "
         set ANSWER=$<
         if ( ${ANSWER} == "m" || ${ANSWER} == "M" ) then
            set fonts_for = 1
         else 
            set fonts_for = 2
         endif
      endif
   else set NEW = 0
   endif
else set NEW = 0
endif

# Installing fonts for Motif

if ( -e ${font_dir}/fonts.dir || ${fonts_for} == 1 ) then
   foreach bdf ( `ls *.bdf` )
      set snf = `echo ${bdf} | sed 's/\.bdf/.snf/g'`
      echo ${bdf} '=>' ${font_dir}/${snf}
      bdftosnf -t ${bdf} > ${font_dir}/${snf}
   end
   cd $font_dir
   if ( -e fonts.dir ) then
      mv fonts.dir fonts.dir.`date | sed -e 's/ /-/g'`
   endif
   mkfontdir .
   if ( ${NEW} == 1 ) then
      xset fp+ $font_dir
   else
      xset fp rehash
   endif
endif

# Installing fonts for Openlook

if ( -e ${font_dir}/Families.list || ${fonts_for} == 2 ) then
   foreach bdf ( `ls *.bdf` )
      dumpfont -f 200 -d $font_dir $bdf
   end
   cd $font_dir
   rm -f *.ff
   echo "Ignore errors such as: (Encoding: Unknown) and (cat: ./Compat.list:..)"
   bldfamily -f 40 | tee bldfamily.log | fgrep fixed
   echo /setdefaultfontpath exit | psh
   if ( ${NEW} == 1 ) then
      xset fp+ $font_dir
   else 
      xset fp rehash
   endif
endif 

echo "Checking whether fonts installed fine...."

#
getpath2:
if (`xlsfonts -display xxxxx |& awk '$1 == "xlsfonts:" {print $2}'` == "Command") then
    echo "Unable to find xlsfonts, please provide the path for xlsfonts."
    echo -n "xlsfonts path:"
    set ANSWER=$<
    set path=( $ANSWER $path )
    goto getpath2
endif

set fonts = `xlsfonts | egrep '(fixed-screen-|cairo-|icon-|parker-|plunk)'`

if (`echo $fonts | grep 'fixed-screen' | wc -l` == "0" || \
    `echo $fonts | grep 'cairo' | wc -l` == "0" || \
    `echo $fonts | grep 'icon' | wc -l` == "0" || \
    `echo $fonts | grep 'parker' | wc -l` == "0" || \
    `echo $fonts | grep 'plunk' | wc -l` == "0") then
    echo "Problem installing Rational Access fonts, could not find fonts."
else
    echo "Rational Access fonts has been installed successfully"
endif