#!/bin/csh -f
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#
#  This is a csh script that uses the Utah Raster Toolket (URT) to
#  make some text and composite it onto a background which can then
#  be sent to the Abekas A60.
#
#  Author:     Wesley C. Barris
#              AHPCRC
#              Minnesota Supercomputer Center, Inc.
#  Date:       June 13, 1991
#
#  Copyright @ 1991, Minnesota Supercomputer Center, Inc.
#
#  RESTRICTED RIGHTS LEGEND
#
#  Use, duplication, or disclosure of this software and its documentation
#  by the Government is subject to restrictions as set forth in subdivision
#  { (b) (3) (ii) } of the Rights in Technical Data and Computer Software
#  clause at 52.227-7013.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#
#  Edit these lines to customize this script...
#
@ aframe  = 748				#location on Abekas
set font  = Times-Roman			#font name (see end of file for more)
@ fsize   = 60				#font size
@ xabekas = 720				#do not change this line
@ yabekas = 486				#do not change this line
#
#  Make some text.
#
texttorle $font $fsize 255 195 40 <<! >text.rle
.CENTER.
Here are a
few lines
of centered
text.
!
#
#  Get the size of the text image.
#
#text.rle:       [0,0]+[186,160]x3+A, BG=0,0,0 , (C)
@ xsize = `rlehdr -h -b text.rle | awk -F, '{print $2}' | awk -F'['  '{print $2}'`
@ ysize = `rlehdr -h -b text.rle | awk -F, '{print $3}' | awk -F']'  '{print $1}'`
#
#  Make sure it's valid.
#
if ($xsize > $xabekas || $ysize > $yabekas) then
   echo "Your text is too big to fit onto the Abekas."
   exit
endif
#
#  Determine its proper position.
#
@ xpos = `echo $xabekas $xsize | nawk '{print int(($1-$2)/2)}'`
@ ypos = `echo $yabekas $ysize | nawk '{print int(($1-$2)/2)}'`
#
#  Make a background.
#  NOTE:  The "100 100 255" in the following line will be the RGB value
#         of the background.
#
rlebg -s $xabekas $yabekas -v 0.1 0.9 80 80 255 >back.rle
#
#  Locate and composite the text over the background.
#
repos -p $xpos $ypos text.rle | rlecomp - over back.rle | get4d -g 1
#
#  To sent this image to the abekas, replace "get4d -g 1" with
#                                            "rletoabA60 >junk.yuv"
#  then uncomment the following two lines.
#
#rcp junk.yuv abekas:$aframe
#rm junk.yuv
#
#
#  FYI, here are some font names.
#
#
#set font = Boston
#set font = Charter-BlackItalic
#set font = Charter-Black
#set font = Charter-Italic
#set font = Charter-Roman
#set font = Courier
#set font = Courier-Bold
#set font = Courier-BoldOblique
#set font = Courier-Oblique
#set font = Cursor
#set font = GFont
#set font = Helvetica
#set font = Helvetica-Bold
#set font = Helvetica-BoldOblique
#set font = Helvetica-Oblique
#set font = Icon
#set font = International
#set font = Iris
#set font = Kanji
#set font = NineBy
#set font = NewCenturySchlbk-BoldItalic
#set font = NewCenturySchlbk-Bold
#set font = NewCenturySchlbk-Italic
#set font = NewCenturySchlbk-Roman
#set font = Screen
#set font = Screen-Bold
#set font = Symbol
#set font = Space
#set font = Times-Bold
#set font = Times-BoldItalic
#set font = Times-Italic
#set font = Times-Roman
#set font = cursor
#set font = type
