| This my third attempt to enter this note ARGHH!
Please follow the instructions.
But first extract this note to your directory, call the file PROMPT.COM
Edit PROMPT.COM
CUT it and EXIT
Than edit a new file, BADGE.TXT for instance, and with capital Xs you draw what
you want, letters, whatever you like. Use a whole screen. EXIT
Enter @PROMPT.COM and then the name of the file BADGE.TXT
The draw will be reduced.
Good luck!
<<< FUTURS::SYS$SYSDEVICE:[NOTES$LIBRARY]TERMINAL_ART.NOTE;1 >>>
-< Art for VT Terminals ,LN03 , LPS40 + Lots More >-
================================================================================
Note 204.1 VT340 Prompt designer 1 of 61
BTO::COOTWARE_T "joking ? about what ?!!?" 221 lines 6-APR-1989 20:20
-< prompt.com >-
--------------------------------------------------------------------------------
-----------------------------------cut here------------------------------------
$! PROMPT.COM
$!
$! 20-SEP-1988 W.Hickson
$!
$! Set the prompt string on a VT330/340 to a graphics image.
$!
$! Two parameters
$! P1 - required input file describing desired prompt image
$! P2 - optional output file to capture commands defining prompt
$!
$! Input File Format:
$! ------------------
$! The prompt image is described in a file which is essentially a
$! scaled up version of the graphics prompt. In this file each character
$! corresponds to one pixel (a pixel is a dot on the screen) and the
$! whole file can be thought of as a matrix of these pixels.
$! To create the file, use a text editor and place an "X" (uppercase)
$! in each position in which you want a pixel "on". Any other character
$! indicates an "off" character. A hint for designing the
$! prompt is to do it on graph paper first and then transfer it to
$! a file as it looks distorted (tall & narrow) in the editor.
$!
$! Size Limitation:
$! ----------------
$! The rough limits on the size of the matrix is 40 high by 40 wide.
$! The rest of this paragraph explains why. The only real limitation
$! on size is that the final prompt string must be less than the VMS
$! limit (32 with V4.7). The matrix will be divided up into "cells"
$! of width 10 and heigth 20. Each of these will count as one character
$! and there are some control characters which are added by this
$! procedure. This effectively limits the size of the matrix to
$! about 40 wide by 40 high. The exact formula is number_of_cells
$! + 2*(round_up(height/20)) + 17 <= 32.
$!
$! Optional Output File:
$! ---------------------
$! A second file can be specified (P2) to receive the commands
$! generated to set the prompt. This will cut down on the time needed
$! to set the prompt in the future as this routine takes several seconds
$! to run.
$!
$ start:
$! get the file containing the prompt pixel description
$ if p1 .eqs. "" then inquire p1 "input file"
$ if p1 .eqs. "" then goto start
$ open/read prompt_file 'p1
$! if they ask for it, open an output file for the final commands
$ if p2 .nes. "" then open/write output_file 'p2
$ gosub define_ctl_characters
$ prompt_string = bold + scs + so
$ prompt_character_count = 3
$ main_loop:
$ string_1 = ""
$ string_2 = ""
$ string_3 = ""
$ string_4 = ""
$ prompt_string_build:
$ string_count = 1
$ gosub collect_sixels
$ gosub arrange_sixels
$! not eof means they'll need another row of character cells in prompt
$ if .not. eof_flag then prompt_string = prompt_string + cr + lf
$ if .not. eof_flag then goto main_loop
$ prompt_string = prompt_string + scs + si + off + " "
$ set prompt = "''prompt_string'"
$ if p2 .nes. "" then write output_file -
"set prompt = ""''prompt_string'"""
$ close prompt_file
$ if p2 .nes. "" then close output_file
$ exit
$!************************************************************************
$ define_ctl_characters:
$! define some needed control characters
$ esc[0,8] = 27
$ dcs[0,8] = 144
$ st[0,8] = 156
$ so[0,8] = 14
$ si[0,8] = 15
$ cr[0,8] = 13
$ lf[0,8] = 10
$ bold = "''esc'[1m"
$ off = "''esc'[0m"
$ scs = "''esc')1"
$ return
$!************************************************************************
$ collect_sixels:
$! Collect all of the sixels which will make up the first line
$! of characters in the prompt.
$ character_string = ""
$ gosub build_sixel_string
$ if string_count .eq. 1 then string_1 = character_string
$ if string_count .eq. 2 then string_2 = character_string
$ if string_count .eq. 3 then string_3 = character_string
$ if string_count .eq. 4 then string_4 = character_string
$ string_count = string_count + 1
$ if .not. eof_flag .and. string_count .lt. 5 then -
goto collect_sixels
$ return
$!***********************************************************************
$ arrange_sixels:
$! Arrange the sixels into characters and store these characters
$! in a soft character set.
$ prompt_character = dcs + "1;" + f$string(prompt_character_count) -
+ ";1;10;1;2;20;0{1"
$ first_pass = 1
$ more_string_flag = 0
$ string = string_1
$ gosub prompt_character_build
$ string_1 = string
$ string = string_2
$ gosub prompt_character_build
$ string_2 = string
$ string = string_3
$ gosub prompt_character_build
$ string_3 = string
$ string = string_4
$ gosub prompt_character_build
$ string_4 = string
$ prompt_character = prompt_character + st
$ write sys$output prompt_character
$ if p2 .nes. "" then write output_file -
"write sys$output ""''prompt_character'"""
$ prompt_ascii_character[0,8] = prompt_character_count + 32
$ prompt_string = prompt_string + prompt_ascii_character
$ prompt_character_count = prompt_character_count + 1
$ if more_string_flag then goto arrange_sixels
$ return
$!************************************************************************
$ prompt_character_build:
$! Pad 'string' out so that it is at least 10 characters long
$! and append a '/' and the first 10 characters of 'string' to
$! 'prompt_character'. Strip these same 10 characters off 'string'.
$! If this is the first time 10 characters are being appended to
$! 'prompt_character' skip the '/'.
$ string_length = f$length(string)
$ if string_length .lt. 10 then string = string + "?"
$ if string_length .lt. 10 then goto prompt_character_build
$ if string_length .gt. 10 then more_string_flag = 1
$ if first_pass then prompt_character = -
prompt_character + f$extract(0,10,string)
$ if .not. first_pass then prompt_character = -
prompt_character + "/" + f$extract(0,10,string)
$ first_pass = 0
$ string = f$extract(10,string_length-10,string)
$ return
$!*************************************************************************
$ build_sixel_string:
$! read six lines from the picture file and translate them into
$! a string of characters representing a string of sixels.
$! Store this string in 'character_string'
$! If the end of file is reached set 'eof_flag' to 1.
$! If this is the 4th set of six lines only read the first two lines
$ line_1 = ""
$ line_2 = ""
$ line_3 = ""
$ line_4 = ""
$ line_5 = ""
$ line_6 = ""
$ eof_flag = 0
$ read/end_of_file=no_records prompt_file line_1
$ read/end_of_file=eof prompt_file line_2
$ if string_count .eq. 4 then goto not_eof
$ read/end_of_file=eof prompt_file line_3
$ read/end_of_file=eof prompt_file line_4
$ read/end_of_file=eof prompt_file line_5
$ read/end_of_file=eof prompt_file line_6
$ goto not_eof
$ no_records:
$ eof_flag = 1
$ return
$ eof:
$ eof_flag = 1
$ not_eof:
$ gosub build_sixel
$ character_string = character_string + character
$ if continue then goto not_eof
$ return
$!****************************************************************************
$ build_sixel:
$! Look at the first two characters on each of the six lines,
$! line_1 through line_6. Each pair represents one pixel and
$! the full six pairs represent one sixel. Find the correct
$! character to represent that sixel and store it in the symbol
$! 'character'. Set the value of 'continue' to 1 as long as
$! there are characters left in any of the lines.
$ continue = 0
$ bit_value = 63
$ pixel = f$extract(0,1,line_1)
$ length = f$length(line_1)
$ if length .gt. 1 then continue = 1
$ line_1 = f$extract(1,length-1,line_1)
$ if pixel .eqs. "X" then bit_value = bit_value + 1
$ pixel = f$extract(0,1,line_2)
$ length = f$length(line_2)
$ if length .gt. 1 then continue = 1
$ line_2 = f$extract(1,length-1,line_2)
$ if pixel .eqs. "X" then bit_value = bit_value + 2
$ pixel = f$extract(0,1,line_3)
$ length = f$length(line_3)
$ if length .gt. 1 then continue = 1
$ line_3 = f$extract(1,length-1,line_3)
$ if pixel .eqs. "X" then bit_value = bit_value + 4
$ pixel = f$extract(0,1,line_4)
$ length = f$length(line_4)
$ if length .gt. 1 then continue = 1
$ line_4 = f$extract(1,length-1,line_4)
$ if pixel .eqs. "X" then bit_value = bit_value + 8
$ pixel = f$extract(0,1,line_5)
$ length = f$length(line_5)
$ if length .gt. 1 then continue = 1
$ line_5 = f$extract(1,length-1,line_5)
$ if pixel .eqs. "X" then bit_value = bit_value + 16
$ pixel = f$extract(0,1,line_6)
$ length = f$length(line_6)
$ if length .gt. 1 then continue = 1
$ line_6 = f$extract(1,length-1,line_6)
$ if pixel .eqs. "X" then bit_value = bit_value + 32
$ character[0,7]=bit_value
$ return
$!************************************************************************
|