Category : Printer Utilities
Archive   : NEUTECH.ZIP
Filename : NEUTECH.DOC

Output of file : NEUTECH.DOC contained in archive : NEUTECH.ZIP


Technical character generator for MS-DOS and Epson-compatible
dot-matrix printers

Version 2.1


(C) Copyright Walter D. Neumann, 1985
All rights reserved

Walter D. Neumann
1F Southway
Greenbelt MD 20770
(301) 345-7017



1. General description of the program.

NEUTECH is a memory-resident technical character generator for the
IBM Personal Computer and for Epson printers or compatible equipment
(IBM Graphics printer etc.). It is designed to be invisible to
applications that do not specifically try to use it. Its effect is to
add a set of technical or other user-defined symbols to the set of fonts
of your printer and to make them easily accessible to application
programs (word-processors, Basic, etc.) which do wish to use them.
Individual characters or complete character sets can also be
"downloaded" to the program from the document being printed or from the
operating system.

The built-in character set consists of a Greek alphabet plus a set
of Gothic capitals plus a set of mathematical symbols, each one in a
regular (pica) size and in a compressed size. This character set can be
replaced (in whole or part) by the user. NEUTECH keeps track of whether
the printer is printing in compressed and/or wide mode and adjusts its
characters accordingly. Several copies of NEUTECH with different symbol
sets can be loaded and accessed at once. Each copy takes up less than
3K of PC memory.

The NEUTECH character set can be printed for reference by installing
NEUTECH and printing the file NEUCHARS.DOC.

NEUTECH works by watching the character stream sent to the printer
for its own one-character "attention command." When it sees its
attention command, it replaces the next character sent to the printer by
the corresponding character from an internal alphabet, using graphics
mode. A secondary one-character command is used to initiate downloading
a character to NEUTECH. The attention command and secondary command
both default to ^Q ("control-Q" or ASCII 11h) but can be changed by the
user (see section 2; this is necessary for using multiple copies of
NEUTECH or using it with programs that cannot send a "^Q" to the
printer). Thus, using the defaults, "^Qa" would print the NEUTECH
character corresponding to "a" (a greek "alpha") and "^Q^Qa" initiates
downloading a new character to NEUTECH to be printed by "^Qa".

NEUTECH assumes the printer is attached to printer port 1, but
another printer port can be specified when loading NEUTECH (section 2).

NEUTECH must keep track of all printer commands being sent, since
if the NEUTECH attention command occurs as part of an Epson printer
command, it must be ignored by NEUTECH. For this reason the program is
relatively printer-specific. It is designed to work with any printer
that uses the Epson FX80 printer protocol or a subset of it (e.g.
earlier Epson printers, the IBM graphics printer, and many others).
NEUTECH will also work with printers that allow additional commands, so
long as the software never uses a non-FX printer command containing a
NEUTECH command character.

In the following, "^a" and "^s" will denote the NEUTECH attention
command character and secondary command character respectively. As
already described, the default is ^a = ^s = ^Q (ASCII 11h).


2. Loading and unloading the program.

NEUTECH is loaded into memory by running the program NEUTECH.EXE
(enter "NEUTECH" at the DOS command prompt, or include it in your
AUTOEXEC.BAT file). Once loaded, it remains resident in memory, taking
less than 3K of memory space.

The printer port and the two NEUTECH command characters can be set
to other values than the default by adding a parameter on the command
line when loading NEUTECH . The format is "NEUTECH n" or "NEUTECH nXX"
or "NEUTECH nXXYY" where:

n = 1, 2, or 3 is the printer port to use (default is n = 1);

XX is the hex representation of the NEUTECH "attention character"
^a (default is XX = 11);

YY is the hex representation of the NEUTECH "secondary command
character" ^s (default is YY = 11).

NEUTECH will accept ANY value of XX and YY for ^a and ^s; if ^a is
also a printer command it will then always be intercepted by NEUTECH and
will be unavailable to the printer, so changes to the default should be
chosen with care (see Section 7).

If the attention character ^a has been installed to a character
normally used for other purposes, it may become desirable to switch off
NEUTECH. This can be done by printing the three-character command
"^a^s^s". NEUTECH can then be restored only by re-loading it.

3. Accessing NEUTECH.

Once NEUTECH is loaded, printing "^ax" will print the current
NEUTECH character corresponding to "x". Here "x" represents any
printable character other than , ^a, or ^s. (If neither ^a or ^s
has been installed to a printable character, then only is

The character printed by "^ax" will be compressed and/or wide
according as the the printer is in compressed and/or wide mode.

(At present NEUTECH only changes character width on seeing one of
the width-change commands that is common to all Epson printers, namely
one of the 1-character commands or the W commands. Most software
uses only these, to ensure compatibility. The FX and later printers
have an additional command which should therefore be used only when
constant NEUTECH character width is desired).

Printing "^a^sx" followed by a sequence of 12 hex bytes (7 bytes in
compressed mode) will download the character represented by this byte-
sequence to the NEUTECH character corresponding to "x"; see Section 4
for details. Again, "x" should be a printable character other than a
space, ^a, or ^s.


4. Downloading to Neutech

Printing "^a^sx" followed by a sequence of 12 hex bytes will send
nothing to the printer but will download the character represented by
this sequence to the NEUTECH character corresponding to "x". For
example, when using the defaults ^a = ^Q and ^s = ^Q, then printing


would download an extra-large "W" to the NEUTECH character corresponding
to "/". Characters other than 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F are
ignored until all 12 hex bytes have been received, so puncuation and
comments can be included for clarity. Thus the following download
commands have the same effect as the above example:

"^Q^Q/: large W FF810204081008040281FF00" .

If NEUTECH is in compressed mode, then the character being
downloaded will be sent to NEUTECH's compressed symbol set, so only 7
hex bytes should be included in the command.

See your printer manual for an explanation of how a sequence of
bytes is interpreted as a sequence of vertical columns of eight dot
positions each to form a character.

5. Installing user fonts.

A file of "^a^sx" download commands can be printed at any time to
change NEUTECH's character set. For example, a command


can be included in the AUTOEXEC.BAT file to change NEUTECH's default set
on start-up. Two files, "NEUCHREG.QQ" and "NEUCHCMP.QQ," which can be
printed to restore the regular and compressed default character sets in
a default installation of NEUTECH, are included and can be edited as
desired. They can also be combined into one file which restores both
character sets at once.

6. Using multiple copies of NEUTECH.

Several copies of NEUTECH can be loaded and used simultaneously
with one printer by defining different attention characters for each of
them. Each can be loaded with a different symbol set as described in
Section 5.

Two (or more) copies of NEUTECH can also share the SAME attention
character if the secondary command ^s is NOT equal to ^a. In this case,
the copy loaded last acts as usual, but printing "^a^a" sends a single
"^a" to the previously installed NEUTECH which will therefore act as if
"^a^a" is its attention command (if there are three copies then the
first loaded one would have attention command "^a^a^a^a", and so on).


This technique is particularly useful if NEUTECH is to be used with
a word-processor or other user program which limits the number of
different non-printable characters that can be embedded in text to be
printed. A typical installation of two copies of NEUTECH might use ^a =
^Q and ^s = | (ASCII 7Ch) in both. Then the character corresponding to
"|" is unavailable in both copies of NEUTECH, but the only non-printing
symbol that need be sent by user software is "^Q". If user software
cannot send any non-printing symbols, one might replace "^Q" by "\"
(ASCII 5Ch) in this installation.

7. Recommended installation.

It is recommended that the default installation be used unless
there is good reason to do otherwise. As already pointed out,
installing a value for ^a which is a printer command (e.g. ^a = =
1Bh, ^a = = 0Fh, etc.) will cause problems. Choosing a printable
value for ^a is necessary if your software cannot send non-printing
characters in text, but it disables the corresponding NEUTECH character
(the character ^a itself can still be sent to the printer by using
"^a^a", unless ^a = ^s). If only one copy of NEUTECH is used at once,
then any choice of ^s is safe, but choosing a printable value for ^s
disables the corresponding NEUTECH character. If more than one copy of
NEUTECH will be used at once, then ^s should NOT be a printer command
since this would confuse the subsequently installed copies of NEUTECH.

The default ^Q for ^a was chosen for two reasons:

(i) ^Q is the first of the Wordstar "user commands" and thus gives
particularly easy compatibility with Wordstar. Install the ^Q user
command (USER1) in Wordstar to send a ^Q to the printer. ASCII files
containing ^Q commands will then be compatible between Wordstar and
other print utilities (e.g. "COPY PRN:"). Wordstar counts ^Q
as being of zero length, so line-length count and formatting by Wordstar
remains correct.

(ii) ^Q IS in fact a printer command on later Epson printers than
the MX -- it is the "Printer enable" command. Since there is no reason
ever to DISable the printer, this command is never needed and never used
by standard software. Since it is unlikely to be used for other
purposes in future printer upgrades, future compatibility is probable.
Currently unused characters such as ASCII 00h to 06h and 15h to 19h are
also possible choices for ^a but have less certain future compatibility.

8. Using NEUTECH with Wordstar.

I originally wrote NEUTECH for my own use with Wordstar. I was
encouraged by friends who found it useful to distribute it more widely.
The following is the installation of Wordstar which I use with NEUTECH.
This installation may be done from the standard menus in Micropro's
installation program Winstall which comes with Wordstar.


I install user key ^Q to send a ^Q (ASCII 11 hex or 17 decimal),
the user characters ^W to do "wide print to end of line" (ASCII 0Eh), ^E
as Escape (1Bh), ^R as 00h. I install the width commands ^A and ^N to
start and end compressed mode (0Fh and 12h) and the ribbon color toggle
^Y to start and end italics (1Bh,04h and 1Bh,05h respectively).
Finally, Wordstar's sub- and super-scripts are enabled by installing
half line feed as 0Dh,0Ah and full line feed as 0Dh,0Ah,0Dh,0Ah and
installing the printer initialisation sequence of 1Bh,41h,06h to set
half line feed at 1/12 inches. A termination sequence of 1Bh,40h should
then be installed to reset the printer after use. I double space normal
text and use single spacing for special effects.

This installation permits sending most Epson commands to the
printer. The one I use most often is ^EE to start emphasized print.
Line height can be changed to some extent using ^E3-commands; for
example, with the above installation of ^A and ^N, printing
"^A^E3^N^A^N" returns to the default line height of 1/12 inch per half
line (the extra ^A's and ^N are needed to make sure Wordstar sends the
"^N" after the "3"; Wordstar is smart enough not to act on a normal
width command "^N" if it thinks it is not in alternate width). Epson's
built in sub- and super-scripts have vertical alignment problems on
early Epson printers and are superfluous with this set-up, though they
are available for use if desired (e.g. ^ES^R for subscripts).

Wordstar is clever at knowing how to handle control characters in
conjunction with sub- and super-scripting but it has trouble with
backspacing at the same time. This is not often a problem, but it will
surface if you want simultaneous sub- and super-scripts using special
characters (e.g. to create a large integral sign using the NEUTECH
characters for ;, |, and :). However, it can be avoided in several
ways, for instance by installing "overprinting" in the installation menu
to use backspacing (08h -- not available on the IBM graphics printer).
Wordstar then uses backspacing also for underlining and boldface, which
is a bit slow, but no matter. The Epson MX has a bug: it cannot
backspace back over anything printed in graphics mode. Again rarely a
problem, and usually avoidable by interchanging the order of characters
being overprinted. This bug appears to be fixed in later printers.

9. Error handling.

NEUTECH makes certain assumptions to recover from user errors: if
"^a" or "^a^s" precedes a non-printing character, then the "^a" or
"^a^s" is ignored; the same is true if "^a" or "^a^s" precedes a "^a"
(unless ^a = ^s).

If NEUTECH appears to behave erratically, check the file that you
are printing: the most common cause is an accidental "^a^sx", making
NEUTECH swallow everything until the download it thinks you wanted is
completed. For example, editing in Wordstar with control-character
display off can put control characters in unusual places: make sure
control-character display is on if you are inserting or deleting text or
doing a search-and-replace.


10. Incompatibilities.

Some Epson printers with NLQ capability seem unable to correctly
mix NLQ printing and graphics on one line. Since NEUTECH prints in
graphics mode, NEUTECH characters cannot mix with NLQ mode in such
cases. This may be fixed in later Epson printers.

If a memory-resident print spooler is used, it should be loaded
after NEUTECH. This is for two reasons: it optimizes use of the
spooler's buffer, and some spoolers will not work correctly if any other
memory resident program which captures the printer interrupt is loaded
over them.

No incompatibility of NEUTECH with other software is known to date.
If you find any, please inform me, and I will try to fix it.

11. Design considerations.

NEUTECH is designed for printing occasional special characters
in regular text. It puts the printer into graphics mode for each
such character. If several special characters occur in sequence,
this is much slower than if NEUTECH buffered them and then printed
them all at once in graphics mode. A buffered version will be made
available if there is any demand.

NEUTECH intentionally does not use the download capability of the
FX and other Epson printers. Such use would make NEUTECH incompatible
with other programs which simultaniously use this feature. Moreover,
downloaded characters have marginally lower quality than NEUTECH
characters, since they may not have adjacent horizontal dots, and they
are lost if the printer is turned off.



Permission to copy:

Individuals may copy this software and documentation for their own
use or to share with others, so long as no price is charged. Computer
clubs and other non-profit organizations may copy this software and
documentation and share it with their members so long the software and
documentation are distributed unmodified and together, no price is
charged other than cost of distribution, and members are encouraged to
support the user-supported concept with their donations.

If you find this program useful you are encouraged to make a $20
contribution. You will thereby become a registered user. This will
entitle you to notice of updates and other information. Moreover, if
users contribute useful NEUTECH character sets, I will distribute them
to registered users for a small charge to cover materials, handling, and
modest honorariums to the contributors.

If you send a character set, please do so in the format of the
files NEUCHREG.QQ and NEUCHCMP.QQ and include a printout of the file
NEUCHARS.DOC with your characters installed.


In no event will the author be liable to you for any damages of any
kind arising out of the use or inability to use this program.

Walter Neumann
1F Southway
Greenbelt, MD 20770
(301) 345-7017