Next Previous Contents

6. CREATE A PATTERN FILE FROM SOFT-FONT: sf2pat

6.1 Introduction

The sf2pat program converts soft-font for Wyse or VT220 terminals to a drawing of a bitmap (a pattern file). This bitmap pattern file is just an ordinary ASCII file with pixels dots represented by *'s. The file may then be edited and converted back into soft-font using my pat2sf program. This permits one to edit existing soft-fonts. sf2pat means Soft-Font to PATtern. This program, sf2pat does the inverse of pat2sf.

In order to fully understand the sf2pat program, you should first understand the pat2sf program (as described elsewhere in this document). This is because sf2pat is just the inverse of pat2sf. Note that using this software creates a pattern file conforming to the format per this document (with a background of spaces).

6.2 Use to Translate Between Languages

One may also use these two programs to translate soft-font from one type to another. For example one could start with soft-font for a Wyse terminal and then run sf2pat -W on it. The resulting pattern file (after adding the cell size and chars/band size using an editor) is then given as input to he pat2sf program and VT220 type soft-font is created. You have just translated (by a 2-step process) Wyse font to VT220 font. Of course this is bit-mapped font and both fonts will have identical pixels. The translated font will not be of the same physical size if the dots/inch resolutions of the terminals are different and thus may not look right.

6.3 Can't Create Pattern File Exactly

A file of soft-font contains the shape of the characters, but it lacks certain information required to create a complete pattern file per my format. You can supply some of the missing information on the command line when you run sf2pat. Other information you'll need to add manually to the pattern file using any convenient editor or word processor.

Since soft-font supplied by others is not likely to contain comments such as the number of dot-matrix characters per "band" (= thick row on a sheet of printout), some information from the original pattern file (or the like) will be lost. Most soft-font does not tell one what type of separators were used to separate characters in a pattern file, nor what the comment and band header lines said. Also, there may have been no pattern file if the font was created by hand or by someone else's software. Until someone makes this program clairvoyant you will need to add some of this information to the pattern file when you edit it.

6.4 No Error Checking

While the font generator program (pat2sf) does much error checking on the pattern file to see if it is in the correct format the sf2pat program does little error checking of the soft-font code. It assumes that you have a soft-font code that works OK. But even if it works OK its format may not be exactly correct. Thus you may need to do some editing of the soft-font file before running this program (or after this program fails).

6.5 Running the Program

Type sf2pat to see what the options are. You must either use the -W (Wyse) of -V (VT220) option. The -p option is useful to send the output pattern file to the screen so you can preview what your output file will look like. To do this use the -p option and don't redirect the output to a file (Don't use >). You should see the large character matrices (*-patterns) on the screen. If you don't, something is wrong.

Also, you should give the height or width of the character cells, but if you don't know them, you will still get default results. In case of such default, the character cells will likely be too large for the characters. By inspecting the pattern file you may be able to guess what the cell size should be and then rerun pat2sf using that size. Note that you only give the width for Wyse and you only give the height for VT220.

Usage: sf2pat [options] [soft-font_file] > pattern_file Options: -V font is for a VT220 type terminal. -W font is for a Wyse type terminal. -s use Standard input. -p Preview pattern output on CRT (no messages shown). -h 16 Only for VT220. Char-cell Height=16. Default is up to 5 too high. -w 7 Only for Wyse. Char-cell Width is 7. Default = 8. -b 6 chars/Band = 6. (Put 6 dot-matrix chars per line). Default = 8.


Next Previous Contents