From: Michael Dillon (mpdillon@halcyon.com)
Date: 04/11/93


From: mpdillon@halcyon.com (Michael Dillon)
Subject: NAPLPS technical specs
Date: Sun, 11 Apr 1993 08:06:15 GMT

opposite to the direction of the <linefeed> or <vertical
tab> and only scrolls far enough so that the current
position of the character field is now wholly within the
display area. If the cursor movement command takes place
within the active field, then only the area within the
active field is scrolled. The blank area that scrolls into
view is nominal black in color modes 0 and 1, or the
background color in color mode 2.
     Any buffering of data that is scrolled off the display
is implementation dependent.

SCROLL OFF - 98
     This command turns off scrolling mode. If the text
cursor is advanced beyond the bounds of the display area (or
active field) by a <linefeed> or <vertical tab> then it
simply wraps to the opposite boundary.

UNDERLINE START - 99
` This command turns on underline mode. In this mode all
ASCII, supplementary, and DRCS characters and any <space>
character are displayed with a line. This line is drawn from
the character field origin across the entire width of the
character field but it does not go across the gaps created
by 5/4 and 3/2 character spacing. Its thickness is the
height of the logical pel. Mosaic characters are not
underlined, but are instead displayed in separated mode as
defined under the section "The Mosaic Set".
     The underscore is then rotated along with the rest of
the character field if a rotation is specified.

UNDERLINE STOP - 9A
     This terminates underline mode. In this mode, mosaics
are displayed contiguously so as to form a monochrome
bitmap.

FLASH CURSOR - 9B
     This cause the cursor to blink. It also may enable user
input if the active field is in an unprotected field.

STEADY CURSOR - 9C
     This cause the cursor to be displayed with no blinking.
It also may enable user input if the active field is in an
unprotected field.

CURSOR OFF - 9D
     This sets the cursor to its default invisible mode. The
cursor still exists and can be positioned. This may also
disable user input, but that is implementation dependent.

BLINK START - 8E
     This creates a simple blink process using the current
drawing color as the blink-from color and nominal black (the
background color in mode 2) as the blink-to color. The on
and off intervals are implementation dependent and the start
delay is zero. This is intended to provide a facility
similar to the ANSI graphics blinking found on PC's.

BLINK STOP - 9E
     This terminates any blink process using the current
drawing color as the blink-from color.

EDC1, EDC2, EDC3, EDC4 - 91, 92, 93, 94
     These codes are reserved for future use. At the present
time they should be discarded.

Proportional Spacing of Text

Overview
     In order to guarantee the placement of text and the
positioning of line breaks on varying implementations of
NAPLPS at varying display resolutions, it is necessary to
have some guidelines as to how to produce proportionally
spaced text. If a terminal program adheres to these
guidelines, then a host system can place proportionally
spaced text onto the screen in a predictable manner.
     An algorithm is provided which defines how far to move
the cursor if the character field width is parallel to the
character path. If it is not parallel, then proportional
spacing is not possible and the spacing is always based on
the full height of the character field. The spacing for the
widest characters is always equal to the character field
width, while the spacing for other characters is arranged so
that the visible gaps between characters are identical. The
algorithm is arranged so that normal size text will be
spaced identically on both low and high resolution
terminals.

Algorithms
     The following tables classify the ASCII and
supplementary sets into 10 different width classes.
Characters in a given class are spaced according to the same
algorithm over the range of font sizes.

               ASCII Width Classes
               2 3 4 5 6 7
          ------------------------
          0 9 5 9 5 1 5
          1 0 1 5 6 5 5
          2 4 5 5 5 5 5
          3 6 5 5 5 5 5
          4 9 5 5 9 5 2
          5 9 5 5 5 5 5
          6 9 5 5 9 5 9
          7 0 5 8 9 5 9
          8 1 5 5 9 5 9
          9 1 5 2 9 0 5
          A 9 0 5 9 4 5
          B 9 3 5 4 5 5
          C 3 5 5 9 0 0
          D 5 8 9 4 9 5
          E 0 5 5 2 5 9
          F 9 8 9 9 5

               Supplementary Width Classes
               2 3 4 5 6 7
          --------------------------------
          0 9 4 9 5 6 9
          1 0 9 2 1 9 9
          2 9 4 2 9 6 6
          3 5 4 2 9 5 5
          4 9 7 9 9 9 6
          5 9 6 5 6 9 0
          6 9 9 5 9 9 4
          7 6 0 0 9 5 4
          8 9 9 4 9 9 7
          9 1 1 9 9 9 9
          A 6 6 1 9 9 9
          B 8 8 7 9 5 6
          C 9 9 9 9 5 4
          D 7 9 4 9 9 2
          E 9 9 8 9 6 5
          F 7 8 2 9 9

     The width class of an accented character is the maximum
width of the two components. Note that the <space> character
is always in the maximum width class. In proportional mode
<tab> and <backspace> are always considered to be in the
maximum width class (same as <space>) when they are received
from the host system.
     The algorithm that determines the actual width of a
character is based upon the width class and the width of the
current fixed character field. This algorithm is intended to
make the interfont gap between all characters identical, so
when designing your implementation dependent font, you
should take this algorithm into consideration. The algorithm
is structured to ensure that smaller sizes of text appear
spaced identically in both low and high resolution video
displays.

TEXT SIZES up to (but not including) 12/256 wide
================================================
     width 0 1 2 3 4 5 6 7 8 9
================================================
       6 2 3 4 3 4 5 6 4 5 6
       7 3 4 5 4 5 6 7 5 6 7
       8 2 3 4 4 5 6 7 6 7 8
       9 3 4 5 5 6 7 8 7 8 9
      10 4 5 6 6 7 8 9 8 9 10
      11 3 4 6 6 7 8 10 8 10 11
================================================
      12 6 5 4 4 3 2 1 2 1 0

     The above table contains the cursor displacement to be
applied to characters in each width class at various
different character field widths. To determine which row to
use, take the character field width (which is a binary
fraction), multiply by 256 to get a number n.m/256, then
truncate the fractional portion of the number to find n. If
this result is less than 12, then use the corresponding row
in the table and scale the character displacement. For
instance, if the character field width is 15/512, then
multiply by 256 to get 8.5/256. Truncate to 8, therefore use
row 8 in the table. If the width class is 0 then the
character displacement is 2/256 which is the same as 2/8 of
the full displacement.
     If the scaling result is greater than or equal to 12
then the 12 row is first scaled to determine the amount to
adjust the character displacement.
     1. The character field width is truncated to DOMAIN 3
        leaving the 8 most significant bits. Call this n.
     2. Multiply n by 11/13 being careful to avoid overflow.
     3. Subtract 1/256 from the result, then bitwise OR the
        result with 1/256 and again subtract 1/256 from the
        result. Truncate this final result to DOMAIN 3, i.e.
        to 8 bits. This is the scale factor f. This step
        causes the font patterns for the widest character
        class to be scaled to an odd width.
     4. Get the unit spacing number from the 12 row for the
        appropriate width class.
     5. Multiply this unit spacing by f.
     6. Divide the result by 6, then add 1/512 for rounding,
        then truncate to DOMAIN 3 leaving the 8 most
        significant bits. Subtract this result from n to get
        the actual cursor displacement amount.
For example, a character in width class 0 using a character
field with of 12/256.
     1. 12/256 is already an 8-bit value so it is n.
     2. Multiply by 11 and divide by 13 to get a 16 bit
        number = 2599.
     3. Result 2087 scaled down to 8 bits = 8.
     4. Use 6.
     5. 6 * 8 = 48, divide by 6 to get 8, add .5 and round
        down to 8. Subtract 8 from 12 to get a displacement
        of 4/256.
Similarly, if the field width is 24/256, then the
displacement would be 6/256. This is a very tricky part of
the standard to follow and it leaves a lot to be assumed
such as 8 bit numbers being multiplied or divided into a 16
bit register. I hope that I got it right.

Ideas and Implementations

Terminal Programs
     I have come across several terminal programs that
support NAPLPS on the PC and one that supports NAPLPS on
Amiga and Macintosh computers.

PP3 (Personality Plus III) SHAREWARE
This is the only terminal program I know that fully supports
all of NAPLPS including bitmaps and DRCS characters. It is
available in English and French versions which use a user
customizable language file so it is easy to provide support
for other languages. Supports CGA, Herc mono, EGA, MCGA,
VGA, ET4000-256, TARGA-16. Basic registration fee is $25
while $40 gets you a printed manual and info on other NAPLPS
products and services.

CTLINK
Hmmm. I seem to have deleted this one. I had some problems
with it (which may have been the modem) but I remember that
it was really oriented as a terminal for commercial videotex
services. I read some comments from Dave Hughes that
indicated it is not a complete implementation, but if you
see it around, why not try it for yourself.

Tam Tam COMMERCIAL
This program is available from MacGregor Inc. in Montreal
for the Amiga and the Macintosh in both English and French
versions. The price was $79-$99 depending on which version
but I have lost my info sheet. Just call directory
assistance to get a hold of them. They do speak English just
fine, so don't be shy.

Drawing Programs
     To date, I know of only one shareware drawing program
that supports NAPLPS. There are other commercial programs
but I don't yet have any info on them. In addition, I have
written a program to convert Windows 3 icons to NAPLPS
format and have a beta version of a program to convert
metafiles created by CorelDraw into NAPLPS format. The Memra
logo in the sample file MEMRA2.NAP was converted from an
original CorelDraw image.

MGE (Microstar Graphics Editor) SHAREWARE
This is an object oriented drawing (not painting) program
from Microstar Inc. that uses NAPLPS as its file format. It
can draw all the basic objects as well as providing control
over text. It can define macros, fields and blinks. If using
the VGA 16 or 256 color drivers, you can customize the
palette. This is an important feature of NAPLPS. It is not
restricted to the default DOS/Windows 16 color palette. On a
standard VGA you can display any 16 out of the 262,000
shades it is capable of displaying. Notable omissions are
NAPLPS bitmaps and DRCS characters. Microsoft compatible
mouse required (or a graphics tablet that emulates a
Microsoft mouse). This is a good program that is often
criticized because its interface is not 100% the same as
Windows, however if you do PRINT OUT the README.MGE file and
keep it by your side while you draw, you will find that this
program is every bit as effective as CorelDraw and a much
better deal. Supports CGA, Herc mono, EGA, MCGA, VGA, ET4000-
256, TARGA-16. Basic registration fee is $50 while $75 will
get you a printed copy of the manual and info on other
NAPLPS products and services.

Teledraw COMMERCIAL
This program is being developed by Dave Hughes in
conjunction with a team of programmers in Russia. He has
working beta versions and is expected to release the program
by the end of April 1993. This program will provide full
NAPLPS support including the design and use of DRCS
characters such as the Russian characters used in
SAIL.NAP. This program is a combination drawing/terminal
program that will decode NAPLPS images in electronic mail on
the fly and will allow you to draw or edit images and
transmit them in electronic mail messages.

NAPICO SHAREWARE
This program from Memra Software Inc. is intended to enhance
NAPLPS images created with MGE by adding Windows icons to
the image. The icon positions are marked with a small
rectangle and NAPICO takes a list of Windows 3 .ICO files
and inserts the icon bitmap into those marked positions. The
use of SMALL bitmaps like these icons can really enhance a
NAPLPS image. A $10 registration fee is requested from those
who can afford it.

NAPWMF SHAREWARE
This program from Memra Software Inc. converts Windows
metafiles that are created using CorelDraw's File Export
function. It does not necessarily work with metafiles from
other programs, although full .WMF support will be included
in a future version. This makes it possible to add a wide
range of clipart images and True Type fonts to a NAPLPS
image. See the Memra logo in MEMRA2.NAP that was produced by
a beta version of this program. The images produced by
version 1.0 won't be quite as big.

TURSHOW SHAREWARE
This program doesn't fit under either category. It simply
displays the NAPLPS images on your CGA, EGA or VGA screen.

Clip Art libraries
     I would like to see people put together libraries of
non-copyrighted clipart for use by others. Note that this
means the images must be original art, not converted from a
commercial clipart library. As soon as I get NAPWMF
released, I will be creating a library of electrical symbols
for use in drawing circuits.

ANSI compatibility
     It should be possible for a terminal program to
simultaneously support both NAPLPS and the ANSI-BBS protocol
simultaneously. Because of a conflict with the FLASH CURSOR
command, it is not possible to arbitrarily interleave ANSI
and NAPLPS data streams but it should be possible to support
both code systems in a non-interleaved manner. The NAPLPS
spec uses the 3 character sequence ESC 25 41 to indicate
that NAPLPS decoding is to be turned ON and the sequence ESC
25 40 turns OFF the NAPLPS decoding. Outside of this
bracketing, it should be possible to support ANSI escape
sequences. It is fairly straightforward for sysops to ensure
that the ON/OFF sequences are transmitted, especially if
they are using Microstar's SHOWPLP utility.

User Interaction
     Although NAPLPS provides facilities for user
interaction in the form of unprotected fields, the cursor
and transmit macros, it does not require that those
facilities be used when there is an application layer
protocol for handling such things. I would like to suggest
that the general BBS and NAPLPS community should agree on a
standard way for handling such user interactions that would
allow mouse and keyboard support in a non hardware dependent
manner.
     As for mice and other pointing devices, I would like to
suggest that the terminal program transmit a POINT SET ABS
(code 24) PDI to the BBS using the currently set domain co-
ordinates to indicate a mouse click followed by some code to
indicate whether it was a button-down or button-up event and
which button it was. A POINT SET REL could be transmitted to
indicate a mouse move event.
     For keyboard events (key-up and key-down) a form of the
PC scan-codes could be transmitted. These codes are also
used by certain UNIX terminals and similar events are
generated by Macintosh keyboards and X-Windows keyboards so
the only thing about these codes that is specific to the PC
is the actual code numbers.
     There should probably be some indicator code
transmitted to distinguish between transmission of
unprotected fields and transmission of an event. Transmit
macros could, of course, be programmed to emulate either
events or unprotected field transmittal or anything else.
     I would like comments on these ideas, please.

Level 6 vs. Level 7
     It is important to remember that NAPLPS exists at the
presentation layer which is the 6th of the 7 OSI networking
levels. It is intended to be used as the foundation for
interactive on-line real-time graphical applications, which
are at the 7th OSI level. NAPLPS does not do everything and
it is not intended to do everything. I feel that it is
important for BBS operators and users to start discussions
on an overall standard for graphical BBS interchange, and I
would like to see NAPLPS as the foundation for the
presentation layer of that interchange. I would also like to
see any overall standards maintain the OSI division into 6
independent layers.
     It may be appropriate to extend NAPLPS to include
additional G-sets and I know that there is already a JPEG
extension to NAPLPS being prepared for public release. Since
the BBS community is likely to be the major user of NAPLPS
over the next few years, we need to maintain a discussion of
this protocol and its implementations and suggestions for
extensions.

 Resource List

I have put a lot of work into writing this document and
getting it widely distributed (worldwide). If you find it to
be of use and can afford to, I would appreciate receiving
$20 to help me continue to work on NAPLPS support.

Star Valley BBS 1-604-546-2705
     - speeds up to v.32bis
     - NAPLPS art galleries including some bitmaps
     - look in file areas DOS.BBS and ART.NAP
     - downloading available on the 1st call
     - author of NAPICO and NAPWMF utilities
     - Fidonet address 1:353/350
          FREQ NAPLPS - This document
               NAPICO - convert Windows 3 icons to NAPLPS
               NAPWMF - convert CorelDraw images to NAPLPS
               MGESHARE - Microstar Graphics Editor
               PP3SHARE - Personality Plus 3 term program
               SHOWPLP - door to add NAPLPS to your BBS
               TURBOARD - BBS program with built-in NAPLPS

PC Atlanta 1-404-395-6327
     - speeds up to v.32bis/HST
     - home of Turboard BBS software
     - full NAPLPS, ANSI, ASCII support
     - sysop Shawn Rhoads
     - Fidonet address 1:133/904
          FREQ TB114.EXE - latest Turboard ver 1.14

Russell Country BBS 1-406-423-5433
     - v.32bis
     - home of Native American Share-Art
     - sysop Cynthia Denton
     - wonderful online art galleries
     - Fidonet 1:3400/7

Microstar Support BBS 1-614-727-5272
     - speeds up to v.32bis (I can only connect at 9600 bps)
     - samples from many NAPLPS systems
     - interactive NAPLPS game like Tetris
     - the authors of MGE and PP3 and SHOWPLP
     - NAPLPS message area
     - Fidonet 1:163/537

Old Colorado City 1-719-632-2658
     - David Hughes (dave@oldcolo.com) operates an
       Internet/BITNET/Fidonet NAPLPS mailing list
     - about to release Teledraw a combination NAPLPS
       drawing and terminal program

Le Muse 1-514-984-1297
     - 2400 bps
     - an experimental electronic gallery
     - text in French
     - includes a selection of children's art

The Gadget Zone 1-604-946-5815
     - speeds up to v.32bis
     - home of the ONLINE_GRAPHICS echo message area
     - many NAPLPS related files
     - Fidonet address 1:153/951

Harris Technology Associates BBS 1-508-877-7233
     - NAPLPS software for TBBS systems
     - many NAPLPS menus
     - several NAPLPS games
     - illustrated electronic books
     

Hi Res BBS 1-306-782-6820
     - some sample bitmaps converted to NAPLPS with a
       commercial .PCX conversion program
     - full NAPLPS support (running Turboard)
     - sysop Warren Zatwarniski
     - Fidonet 1:140/111

Online Acess magazine
     the Summer 1992 has an article about several on-line
     NAPLPS art galleries. It includes several wonderful
     photos of sample NAPLPS artwork captured from a low-
     resolution 16-color video display

BoardWatch magazine
     The December 1992 issue has an article on NAPLPS
     support by several BBS systems. It includes 6 color
     photos of NAPLPS screens.

Byte magazine
     There was a series of 4 articles (55 pages in total)
     explaining much of the NAPLPS coding system and
     discussing the potential for NAPLPS. These articles
     were in the February, March, April and May 1983 issues.
     In the 2nd article, a small NAPLPS image is decoded and
     explained in detail. To recreate that image, cut out
     the following lines between the dashed ones and place
     in a file named BYTE.SCR. Then type DEBUG <BYTE.SCR
     This will create the image in a file called BYTE.NAP.
     If you are not using a PC, then you will have to find
     some other means of entering the hex codes into a
     document file. Note the picture will display in PP3 but
     is not editable in MGE. If you create BPREF.NAP and
     prepend it to the image by typing:
     COPY BPREF.NAP+BYTE.NAP BEDIT.NAP
     then you will create an editable version of the same
     image which will actually look more like the original
     as far as line thickness and line texture.
=========8X====cut here=============BYTE.SCR follows===
E 100 E 3C 49 20 50 3C 64 23
E 108 40 37 49 60 40 48 60 40
E 110 48 42 40 46 46 40 60 40
E 118 40 40 46 47 40 6A 60 3C
E 120 52 23 44 24 48 57 44 31

-- 
Michael Dillon                 Internet: mpdillon@halcyon.halcyon.com
C-4 Powerhouse                  Fidonet: 1:353/350
RR #2 Armstrong, BC  V0E 1B0      Voice: +1-604-546-8022
Canada                              BBS: +1-604-546-2705