Next Previous Contents

3. GETTING & UTILIZING SOFT-FONT

3.1 Finding Soft-Font

If you have printers and/or terminals which accept soft-font and you need a font that's not available on your computer, how do you get it and install it? You may possibly buy soft-font or find a shareware or freeware copy on the Internet. But if the soft-font you need can't be readily located or costs too much, then you may want to create your own soft-font. First you need to determine by looking over this document (and others) just what is involved. This software may help you create (or generate) such soft-font code provided that its bit-mapped (can't be scaled).

3.2 Standard Character Sets

Once you've decided to start the process of creating your own Soft-Font, then you need to zero in on just what characters you need and what their byte codes will be. If you are creating a foreign language character set, you should strive to use a "standard" code chart to assign bytes to characters. If you fail to do this you will not be able to exchange text files with others who do not use your system of encoding.

Finding the "standard" code for a foreign alphabet (or for several alphabets supported by the same code chart) is often a difficult task since it may turn out that there is not just one "standard". To your dismay, you may find out that the foreign alphabet codes used by various popular word processors and printers do not always adhere to ISO standards. But there are sometimes certain defects in ISO standards. You can find some information on foreign language codes and fonts on the Internet. Usenet has the newsgroups comp.fonts and comp.std.internat. A good search engine for the newsgroups is dejanews.com. In 1990 there was a "Polygot" mailing list which was archived at ftp://tira.uchicago.edu but I can't find it there now.

3.3 Creating Soft-Font by Han

Using this BitFontEdit (or other programs) is much faster than drawing the characters you want on graph paper and encoding them (creating soft-font) by hand. But if you really want to understand how this software works (or spot check its results) then you may want to try writing the soft-font code by hand for a character or two. In fact, if you only need to create a few characters for your printer or terminal and they are not too large (in terms of pixels), then it may be faster to create the soft-font entirely by hand.

3.4 Six Steps to Create & Utilize Soft-Font

Six steps to create and utilize soft-font on a terminal are listed below. Someone else may have already done some of these steps for you (and furnished you with the resulting software/files compatible with your computer, terminal, printer and operating system). Thus you may not need to do all of these steps.

  1. Compile the C programs supplied to get "pat2sf" after possibly modifying the source code so it will work for your hardware.
  2. Draw bitmaps of your characters in a "pattern" file using any editor or word processor.
  3. Run the compiled font generator program (pat2sf) with a pattern file as input resulting in a soft-font file as output.
  4. Write a simple shell-script (= batch file) or other program to download the soft-font. A sample shell-script is supplied for VT220..
  5. Figure out how to map the keyboard keys to the correct characters (including a "shift" key to permit typing of up to 256 8-bit characters).
  6. Determine the user interface to the character set(s).

BitFontEdit provides step 3. and some help with step 4. Step 1. can sometimes be done by just typing "make" if you have a compiler installed. Step 2. can be done by anyone who can use an editor or word processor. No help is provided here for solving step 6 and the next subsection provides a little help for solving step 5.

3.5 Remapping the Keyboard

Some editors/word-processors can do this (for example the Emacs editor). However, you will then get this mapping only when you use the editor/word processor. Another way to remap is to modify the operating system (the part sometimes called the "terminal driver"). Most computers have programs available that will remap the computer keyboard, but it probably will not apply to dumb terminals.

A naive person might think that all they need to do is arrange the pattern file in such a way that every character is assigned to the ASCII code which corresponds to the key on the keyboard they want to press for it. This works fine to display characters as typed but the characters you type are also stored in a file according to the encoding selected for the keyboard. When you send the file to someone else, they won't be able to make sense out of it unless they have the identical encoding scheme.

A kludge to make the method of the above paragraph work is to translate every file before you send it to anyone else, and also use the inverse translation for all files you get from outside. You'll probably have to write the translator for this yourself, but it's a fairly simple task. This method probably only merits use as a last resort.

3.6 7 or 8 Bit Codes and Font Banks

The conventional way to print a character on a printer (or display it on a terminal screen), is to send a byte to the device. (There are also 2-byte "unicode" characters for huge character sets.). Some terminals (or terminal "personalities") use only 7 bits out of the 8, resulting in up to 128 different characters (provided one includes control characters which normally don't display). Other terminals allow both 8-bit and 7-bit characters permitting up to 256 different characters if 8-bits are used.

Some terminals have a number of user font banks. This means that you may download different sets of characters. With older Wyse terminals, you must use 2 banks to get an 8-bit character set since the capacity of one bank is not large enough to hold an 8-bit set. For the case of 7-bit characters, you need to establish a method of changing fonts. A special command that will execute a shell script (= batch file), small programs might do. An alias (on Unix-like systems) is another possibility. For 8 bit character sets it will usually be necessary to establish a shift key to get the keyboard to type the upper (or right bank) 128 characters (with the high order bit set to one). This shift not only switches fonts but switches keyboard mapping. In most cases you will want the special shift key to "lock" (or behave like a toggle) so that you don't need to hold it depressed while typing.

In order to find out how all of this works with your devices you should look at the relevant manual for your printer or terminal. There may be a special manual which you need to buy or borrow. Eight bit characters are the wave of the future. (Some think it's Unicode.) There are numerous eight bit character sets such as a few for Russian-English. Old terminals and printer are likely to have only 7-bit ASCII. While a single byte defines a character it takes many (perhaps 20 or so) bytes (of soft-font) to define the bitmap shape of a character on a low resolution terminal or printer. For letter quality printing several hundred bytes may be required per character.


Next Previous Contents