home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
sprint
/
hplj3j11.zip
/
HPLJ-III.TXT
< prev
next >
Wrap
Text File
|
1991-09-02
|
47KB
|
825 lines
Hewlett-Packard LaserJet III/IIID printer driver for Sprint version 1.0x
By Allen Brunson 06/28/91
Revised by James R. Celoni 9-2-91
See the README.TXT file for an explanation of the contents of each file
included.
Warning! Don't load this document into Sprint and then print it! It's
full of examples of at-sign commands that Sprint will try to translate at
print time!
INTRODUCTION
This is a Sprint printer driver for the LaserJet III. It also supports the
duplexing feature of the LaserJet IIID. I haven't tried it, but I strongly
suspect this driver would also work on Hewlett-Packard's new LaserJet
IIIsi, and that with its duplexing option installed, my IIID duplexing
support would work on it as well.
I wrote this driver after downloading several from CompuServe and found
them all to be hopelessly inadequate. (How many times have you read
something like that at the start of a customized printer driver? It
reflects the DIY spirit of personal computers, I suppose.) Most problems
were small and easily fixed -- except for the proportional spacing tables.
Typically, the drivers' PSTs were way off, didn't include all the ASCII
values, or a separate PST for each attribute combination (regular, bold,
italic, and bold-italic) wasn't provided (all four attribute combinations
are indeed different). So I "rolled my own." I have Sprint version 1.00
and Jim has version 1.01; the driver has been tested with both versions.
Like all the drivers I downloaded, you may find this one hopelessly
inadequate for you in some way or another. If so, feel free to cannibalize
my PST tables or any other element you like and combine it with your
favorite parts of other drivers. Customization is the only way to get
exactly what you want.
DESIGN PHILOSOPHY
I use Sprint for correspondence, lengthy manuscripts, and very little else.
I'm very fond of typeset-quality enhancements, such as duplexing, justified
right margins, distinct open and close quotation marks, kerning, and
ligatures. I think this bias shows in the printer driver I created.
This printer driver contains very complete PST tables for both of the
LaserJet III's built-in proportional and scalable fonts, Times and Univers.
These PST tables are EXACTLY CORRECT, down to the last pixel, for every
printing ASCII character (values 32 to 255) in the PC-8 character set at 12
points. This is an absolute necessity if Sprint is expected to do accurate
justification and kerning. The methods I used to achieve this level of
perfection are revealed in a later section of this file, Printer Driver
Tools.
This printer driver includes a new and revolutionary technique to almost
completely eliminate scaling errors introduced when the LaserJet III's
fonts are scaled to different sizes. If the Sprint users on Borland's
CompuServe Sprint forum are any indication, this is the first printer
driver of its kind anywhere. This method will be covered in greater detail
in a later document section called Notes on Using Scalable Fonts (The 1800
DPI Lie), but to summarize, this printer driver convinces Sprint that the
LaserJet III can print at 1800 dpi (when it can really only print at 300
dpi). This is the same trick that the Sprint PostScript printer drivers
use to make fonts scale smoothly on PostScript devices.
Most printer drivers are based primarily on the Roman-8 character set,
because of the fact that it has prettier quotation marks, I guess.
Personally, I am a big proponent of the PC-8 character set for the simple
reason that it is the same "character set" used by the text-mode video
displays produced by every IBM-PC compatible computer ever made, which also
means that the line-drawing characters are included (they aren't in the
Roman-8 character set). In short, if you're using the printer's PC-8
character set, when you see a certain character on-screen for a given ASCII
value, you will see that same character on the printer for that value as
well. I make almost exclusive use of the printer's PC-8 character set in
my printer driver. The HPLJ3J driver also allows use of the Roman-8 and
Legal symbol sets. The Legal symbol set includes characters like trademark,
registered trademark (R inside a circle), and copyright.
That isn't to say that I don't like pretty quotation marks. Far from it.
In fact, when you also use my enclosed formatter macros, this printer
driver automatically produces open and close quotation marks in the two
proportional fonts. (You don't have to make any changes to the quotation
marks in your document for this to work.) I get around the problem of
these characters not being available in the PC-8 set by making use of a
little-known character set on the LaserJet III called Microsoft Publishing.
I use only 24 characters from this set; four of them are open and close
double quotation marks and open and close single quotation marks.
Another benefit of using the Microsoft Publishing character set is the
automatic support of ligatures (see a later section called Notes on
Ligatures for more information). Ligatures only work in Times and Helvetica.
Formatter macros automatically substitute the ligature characters; you
don't have to type anything special in your document.
A word about fonts. The LaserJet III includes only four font families:
Courier, LinePrinter, CG Times, and Univers. The first two are monospaced
and come in very limited type sizes; the last two are proportional and
scalable to any point size from .25 point all the way up to 999.75 point,
but this printer driver only uses integer point values.) In the driver, CG
Times is called Times, and Univers is called Helvetica, because many PCL
printers (like the LaserJet III) also do PostScript (maybe with a cartridge),
and using the same names for fonts that look so much alike allows for printing
the same documents using different printer drivers with minimal changes to
the documents (or none at all).
Many printer drivers have a font list as long as your arm, including an entry
for nearly every combination of font size, attributes, and character set,
all with fairly cryptic names like Times12PCBold. In my mind, this is a
mistake. My font list has five entries, only one more than the number of
font families. (The fifth is a second Courier type, which was unavoidable,
as we shall see.) This doesn't prevent you from using any type size you
want (with the two scalable fonts), and it also doesn't prevent you from
using useful type attributes like boldface, italics, superscript, and
subscript, it just puts them in their proper place. I like things to be as
simple as possible.
I included support for duplex printing, but I left landscape printing out
entirely. The other LaserJet III drivers I've seen only support LinePrinter
and Courier in landscape; frankly, what's the point? I have access
to a nice, wide carriage OkiData for stuff like that. The LaserJet III is
supposed to be able to rotate its fonts, so in theory it should be possible
to include the "good" fonts in a landscape driver, but I haven't pursued
this yet. Perhaps in a later version of this printer driver.
Kerning is supported through formatter translations. Actually, I didn't
have to do a thing to make this work except co-opt all the kerning
character pairs out of POSTSCR.TCT, Sprint's enhancement file for
PostScript printers. Finally, two dashes right together, such as --, are
translated into an "em-dash," a dash that is much longer than the average
one, about the length of an upper-case M.
In case you're thinking about customizing this driver or writing one of
your own (perhaps for a font cartridge) but feel daunted because you think
you don't have access to the right materials and tools to do so, fret no
more. I created this printer driver using only other printer drivers (as a
starting point), a LaserJet IIID and its manuals, and Sprint itself. If
you're interested in this type of thing, see a later section in this
document called Printer Driver Tools.
INSTALLING THE PRINTER DRIVER
Put a copy of the files SP-SETUP.EXE (provided with Sprint) and the files
HPLJ3J.SPL (provided here as the main file of this printer driver) and
MAIN.SPL together on a diskette or in a subdirectory.
Run SP-SETUP to install the printer driver. It will ask you lots of
questions about disk types and directories; if in doubt, consult your
Sprint manuals. When you get to the main menu, select Printer
Installation, then Hewlett-Packard, then LaserJet III. The choices you'll
get are Simplex, which will print on one side of the page and works with
either the LaserJet III or IIID; and Duplex, which prints on both sides of
the page in portrait orientation and therefore only works with the IIID.
I suggest you use Courier as the default font when installing these
drivers. Further explanation for this is given in a later section, Using
the Printer Driver.
If you have a LaserJet IIID, you can install both of these printer drivers
at once, using Simplex to print on only one side of the page and Duplex to
print on both.
When installing the drivers, you have to give them an eight-character DOS
filename. Remember or write down which name you assigned to each driver,
because once you're inside Sprint you won't get any further help as to
which printer driver might do what.
A quick note on customizing the margins. By default, Sprint prints
everything with a one inch margin all around, which I happen to like. My
first version of this driver had too little space in the left and top
margins and too much in the bottom and right ones. So I added a couple of
custom lines to my driver, which are probably specific to the page
registration on my particular printer, which might be different on yours.
To tweak these values, there are several values in HPLJ3J.SPL you can
change. They are all very near the top of the file.
To make the left margin bigger (and the right one smaller), or vice versa,
you can change the "leftm" parameter. It is currently set to 3. A smaller
value will decrease the left margin; larger will increase it. The unit of
measure here is columns, unfortunately; you can't be too precise.
You can be much more picky when changing the top and bottom margins. The
first available option is the "topm" parameter, given in lines. It is
currently set to 1. Setting it to 0 would give a smaller top margin and a
larger bottom margin; making it bigger would have the opposite effect.
This is the "official" top margin that Sprint knows about.
The other way to tweak the top margin is with the command in the file that
reads like this:
page ^[*p60Y^M,
This is a command that Sprint will send at the beginning of every page.
You're supposed to use the "page" command for things like doing something
different on odd and even pages, but I cheated a little. The command tells
Sprint to move down 60/300ths of an inch at the start of every page it
prints before doing anything else. You can change the 60 to any other
value you want. Note that Sprint isn't aware that this will have an effect
on the top margin, so use this command with care.
If you change these values, you have to reinstall the printer driver for
them to take effect.
If you want to use the typeset-quality enhancements this printer driver
provides, such as kerning, ligatures, and automatic open and close quotes,
continue the installation with the next section.
INSTALLING THE FORMATTER MACROS
For Sprint to be able to fully utilize the resources provided by this
printer driver, it has to be given the smarts to do so. This is done
through the use of formatter macros. Following are suggestions for
incorporating these macros into your Sprint setup. If you're an
experienced Sprint user, you can probably just dive right in and put the
macros in HPALLEN.TCT and EXTRA.FMT to work, picking and choosing the
parts you like.
I suggest you make a copy of the standard format file that comes with
Sprint, STANDARD.FMT, and call it something else, say, HPLJ-III.FMT. It's
probably best to start with a fresh copy right off of the Sprint
distribution disks. Then, at the bottom of the file, somewhere BEFORE the
line that says "@style(comments no)", insert all the stuff from the file
supplied with this driver called HPALLEN.TCT. This can set the default
font (e.g., to 12 point Times), enable Sprint to translate single and double
quotation marks into their typeset-looking open and close equivalents,
enable double dash to em-dash translations, and turn on kerning and
ligatures. If you don't want one or more of these features, just comment
out or remove the sections you don't like. There are comments in the TCT
file explaining what each part does.
Finally, there are a few changes to some of the Sprint formats in EXTRA.FMT
that you might care to use. Included is a change to make the Large
attribute print at twice the point size of whatever the current type size
is, a change to make the Footnote style use 10 point type, and a change to
the Bullets list type to make it use a couple of the "real" round and
diamond shaped bullets from the Microsoft Publishing character set. (The
printer driver test file, HPLJ-III.SPR, assumes that the bullet change is
made. It won't hurt anything if it's not; a few things just won't look
the same.)
The tricky part is that these changes have to be inserted into the new
HPLJ-III.FMT file at the point where these formats were originally defined,
and not just added to the end, because some other formats use these formats
as part of their definition. You also have to comment out or remove the
original definition. I leave it up to you to find the original definitions
in the file and replace them, if you wish. When you're finished, save the
HPLJ-III.FMT file in your Sprint directory.
Now you have a fully prepared format file called HPLJ-III.FMT that will
really make your LaserJet III sing. It won't automatically be used unless
you tell Sprint to do so, however. This is covered in the next section,
Using the Printer Driver.
USING THE PRINTER DRIVER
At this point, it is assumed that you have installed at least one of the
printer drivers (Simplex or Duplex or both), that you made Courier the
default font, and that you have created a special format file called
HPLJ-III.FMT. All of this was described in previous sections. It also
assumes that you're using the Sprint advanced user interface.
If you create a Sprint document with no special formatting commands and no
typeface commands, you will get regular old monospaced 12-point Courier
output with one inch margins all around. None of the typeset-quality
enhancements discussed thus far will be in effect. It's like you're using
an old original LaserJet, circa 1984. This is a good mode for printing
text files, program source files, or dashing off a quick note. (If you
print stuff with long lines that you'd like not to wrap, Courier10 might be
a better default font choice.)
When you're ready to create a typeset-quality document, however, use the
HPLJ-III.FMT file. To do this while editing in Sprint, go through the
menus like this: F10/Layout/Document-Wide/Style Sheet. Then enter HPLJ-III
as your format name. The default font and size will be set as you specified
in the file (e.g., to 12-point Times), and all the typeset-quality enhancements
will be in effect. To see these effects in action, load the included file
HPLJ-III.SPR into Sprint, examine it, then print it out. (It's set up
expecting to find HPLJ-III.FMT.) It contains examples of many enhancements
discussed in this file. You'll be amazed at how easy it is to tap
the LaserJet III's power.
NOTES ON DUPLEX PRINTING
There is a slight bug in the way that the Duplex printer driver works that
I don't think can be fixed. All I did to create the duplex driver is
change the initial setup string to include commands to put the printer into
duplex mode; Sprint really isn't aware of the concept of two sided
printing. Normally, this isn't a problem; most of the time Sprint can be
blissfully unaware that pages are being printed on both sides of the paper
and everything still works fine. The one exception to this is when you
print multiple copies of documents with an odd number of pages.
I'll explain by means of an example. Let's say you have a document that is
three pages long when printed on the LaserJet III, and you tell Sprint to
print two copies of it. Pages one and two of the first copy will be on the
first piece of paper, and page three will be on the first side of the
second piece of paper. Okay so far. Now for the fun part: page one of the
second copy will be on the second side of the second piece of paper! The
last page of the first copy and the first page of the second copy are on
the same piece of paper, which is certainly not what you want.
I can't see a way around this. There is no string that Sprint can be made
to send at the end of each copy (which could be used to force the printer
to eject the current piece of paper). My way around this problem goes like
this: when I print multiple copies of a document with an odd number of
pages, I just issue the print command several times, telling Sprint to
print one copy each time. This way, it resets the printer at the end of
each copy, which fixes the problem. Not very elegant, I'll admit, but it
does work. More creative types can probably think up an editor macro or
something that might work better. You could also insert an Escape command
at the tail end of your document that would force a formfeed.
NOTES ON SELECTING FONTS
The LaserJet III provides (and this printer driver supports) four different
font families: Courier, LinePrinter, Times, and Univers.
Courier is your standard monospaced typewriter-like font available in only
two sizes, 10 or 12 point (this printer driver only supports the 12 point
size). It has standard, bold, and italic (just a slanted version of the
base typeface). There is no bold italic. In this printer driver, the font
is named Courier10 and Courier12, each reflecting its size.
LinePrinter is a monospaced OCR-like font, available only in squinty 8.5
point. It includes neither bold nor italics. Its font name in this driver
is LinePrinter.
These first two font families will fail miserably with the typeset
enhancements provided by this printer driver. If you have to use these
fonts in a document using the HPLJ-III.FMT file for formatting, I'd suggest
using the @notct() around all of it to keep the formatter from trying to
pretty it up.
The monospaced fonts will print at 6 lines per inch unless you specify
different line spacing (e.g., in a ruler, via Layout/Ruler/Line Spacing/Other:
8.5pt for LinePrinter, 10pt for Courier10). Too bad Sprint won't make the
adjustment automatically.
CG Times is a beautiful, classic rendering of the quintessential serif font.
It is proportional and scalable. It has a standard typeface, a real italic
typeface with curly serifs, a fairly thick bold typeface, and a bold
italic. This printer driver renders it by default in 12 point, six lines
per inch, but you can get Sprint to scale it to just about any size you
want (more on that subject in the next section). This driver's name for
the font is simply Times, without an indication of size, since it can be
made any size you could conceivably want.
Finally, Univers is a proportional, scalable, businesslike sans serif font.
It is about the same as what most printers call Helvetica. It has a
standard typeface, a bold, an italic (just a slanted version of the
standard face, which is to be expected in a sans serif font), and a bold
italic. It also defaults to 12 point, 6 lines per inch. This driver calls
it Helvetica for compatibility with PostScript and other drivers. This is not
to say the font really IS Helvetica; the name is trademarked, and CompuGraphic
(the CG of CG Times) didn't license the use of the name or the associated font.
NOTES ON USING SCALABLE FONTS (THE 1800 DPI LIE)
The good news is that the LaserJet III provides two proportional, scalable
fonts that can be made to be any type size you'd ever want. The further
good news is that Sprint supports scalable fonts such as these. The bad
news is that, with most LaserJet III drivers, it doesn't support them very
well.
To understand what I'm talking about, let's delve into proportional spacing
tables for a bit. Monospaced fonts, such as Courier, are very easy for
both the printer and the software to deal with, because all characters are
exactly the same width, including spaces. It's easy to know the width of a
given character because they're all the same. Proportional fonts, on the
other hand, are a completely different ball game. Every character in a
proportional font has a variable width, listed in the printer driver in
units known as HPIs. An HPI (Horizontal Printer units per Inch) unit is
defined as the minimum amount of space that a printer can move its print
head horizontally. (A laser printer doesn't really have a print head, but
it does in a conceptual way. There is a "point" that can be manipulated
through software that determines where the next thing printed will be.) It
turns out that this is usually the same thing as the printer's resolution,
as is the case here. As a lot of people know, the resolution of almost all
laser printers is 300 dpi, or dots per inch. So there are 300 HPI units per
inch on the LaserJet III.
A Times lower-case j in 12 points is 14 HPI units wide, and this is the way it
would be listed in a 12-point PST table, as is the case with most LaserJet
III drivers. If you're working in 12 point, no translation is required at
all and everything's great.
Now, let's suppose you tell Sprint to scale the size up to 24 point. There
isn't a separate PST table for 24 point times (and no provision to add
one), so it has to extrapolate from the 12 point information. 24 point
type is twice as big as 12 point, so it will multiply by 2 and determine
that a Times lower-case j is 28 HPIs wide. At 24 points, Sprint will get
the width right for every character, most likely.
Now, let's imagine a trickier case. You tell Sprint to size down to 10
points. Again, it has to extrapolate the width of 10 point characters from
its 12 point information. This time, it figures out that 10 points is
83.333333(repeating) percent of 12 points. Already, we've got rounding
errors. Let's say it decides to use 83.33 percent as its scaling factor.
It multiplies 14 (the width of a lower-case j in 12 points, remember) by
.8333 and gets 11.6662. The width of a character has to be an integer,
however, you can't print something that's a fractional number of pixels, so
it rounds up, and rather nervously comes up with the value 12. Maybe it
got the same answer as the LaserJet III did, and maybe it didn't.
Actually, Sprint gets a surprising number of the scalings just right, given
how much it has got working against it -- it may well have some trick up
its sleeve I don't know about -- but it inevitably gets a few of them
wrong. The result is that Sprint is working with bad information, and you
know the old computer truism: garbage in, garbage out. If you're asking
Sprint to do tough things (in a type size that it has had to make a lot of
bad extrapolations for) that require exact spacing, like justified right
margins, kerning, and underlining, then it will make subtle to not so
subtle mistakes.
Hewlett-Packard realized that this would be a sticky situation for a lot of
software and so introduced a neat setup called AutoFont, where it supplies
some files so that applications can get information necessary to work out
exact character widths. WordPerfect can do this, for instance. Alas,
AutoFont support is one of many modern-day word processing conveniences
that Sprint doesn't have.
Actually, the situation isn't as bad as I've made it sound. If you're
using large typefaces for headlines and titles and such, and those titles
are usually centered between the left and right margins (and not right
justified), then you probably won't notice any spacing errors, even if you
look for them. On the other hand, if Sprint is trying to justify and kern
10 point type from 12 point spacing tables, the result is, in my opinion,
unacceptable. Go down to 8 point type and you have an unimaginable mess.
Enter LaserJet III Printer Driver Technology, Mark II, a term I just made
up this second. After chatting with some other Sprint users on Borland's
Sprint forum, it became obvious that those users with PostScript output
devices weren't having the same problems as those of us that are LaserJet
users. I did some digging and discovered that the trick was that the
PostScript driver "lies," telling Sprint that PostScript devices can do
1800 dpi! Before Sprint prints anything else, a PostScript file is sent
along to the printer saying, in effect, "That Sprint is a horrible
braggart, all the numbers it's going to send you will be six times larger
than they should be, so scale them down." Since Sprint thinks it's
printing in 1800 dpi, the PostScript PST tables have values that are all
six times greater than if they were specified for 300 dpi. The practical
upshot is far smaller scaling errors; so small, in fact, as to be
unnoticeable.
The skeptics on the Sprint forum said I couldn't get away with this lie
about the LaserJet III for the simple reason that the printer itself can't
be told to compensate for Sprint's overenthusiasm. It has no PostScript
"smarts." Pshaw, I said; and here is the result.
The way I manage the 1800 dpi magic with the LaserJet is that I account for
the lie in the printer driver itself, rather than making the printer do it.
Sprint sends numbers to the printer driver (in HPIs and VPIs) indicating
how far it wants the print head to move; my driver scales them down by a
factor of six. At most, the movement command will be off by only 5/300ths
of an inch; the errors aren't cumulative as it goes along the line, either.
Sprint sends size information in HPIs which must be converted to point
sizes when selecting fonts; my driver applies a formula that works at 1800
dpi with no scaling errors whatever for any point size between 1 and 500 or
more. (The formula is trivially simple: divide the numbers Sprint sends by
25.) It's that simple. Then I multiplied all the values in my PST tables
(which used to be for 12 point type) by 6, in effect making them 72 point
tables.
The result is DRAMATICALLY cleaner output with small point sizes than any
other LaserJet III driver I've ever seen. Most drivers have PST tables
optimized for 12 points and so produce perfect output at that size. At 10
points, most drivers start to have problems, especially with underlines.
Six points is unusable. With my driver, there are very few noticeable
scaling errors, all the way down to 4 points (the lowest size available built
into the LaserJet III)!
In fact, my driver could be made even better, probably good enough that I
could claim absolutely no visible scaling errors in any size type, ever. I
think that would be possible if I had the "real" width values for 72 point
type. As it is, I took my values for 12-point type and multiplied them by
six. If you think about that for a minute, you'll realize I haven't really
made 72-point widths, I've just magnified my 12-point values, and it's
"empty magnification" at that. This increases the "granularity" of my fake
72-point widths, thereby introducing scaling errors.
I've been making up my own PST tables up to now (as described in Printer
Driver Tools later on in this file), but there's no way my methods would
work for 72-point type. The widths aren't in the Technical Reference manual
(free to LaserJet III owners who send the request card from the User's Manual)
either, but they are in the developer's kit, which I'm getting from Agfa
CompuGraphic. (Apparently the widths don't scale linearly (so 12-point widths
aren't one-sixth of the 72-point widths), so the jury's still out on how much
this driver can be improved.)
As usual, I am amazed at how utterly and completely customizable Sprint
really is. (It's just too bad the original designers didn't think of my
scaling trick.) Hats off to what has to be the most easily programmable
word processor in the world.
Now, it's up to other Sprint users to take this trick and use it for other
printers. I am absolutely certain that it will work for every single 300 dpi
output device with scalable fonts that Sprint currently supports or can
be made to support. If you're interested, I'll be glad to give advice.
NOTES ON QUOTATION MARK TRANSLATION
You can use "double quotation marks" and `single quotation marks' (also known
as backquote and apostrophe) and HPALLEN.TCT will substitute publication-
quality marks (the ones that look like tiny superscripted 66 and 99, or 6
and 9). For the cases it doesn't do what you want, you can force the 66-style
quote via `` and the 99-style via ''. You can even force the typewriter-like
double quote symbol " via the little-used IBM-extended-ASCII character
247 decimal (≈, squiggly equal-sign), which you can assign to a Sprint editor
macros if you like for easier insertion. Or you can insert my macro names:
@Qop and @Qcl are the double open and close quote macros, and @Sop
and @Scl are the single open and close quote macros. Finally, could also
put the ugly straight up and down quotes from the PC-8 character set into
your document by using a @notct command. Putting @notct(") in a Sprint
document would get you the raw double quote and @notct(') would print the
raw single quote.
NOTES ON KERNING
In case you're not familiar with the term, "kerning" means removing the
extra space between some character pairs in proportional fonts. For
instance, when a proportional upper-case A is printed right next to an
upper-case V without kerning, your eye tells you that they aren't close
enough together. This is because of all the space at the top of the A and
the bottom of the V. All the standard kerning pairs are listed in @tct
translations in HPALLEN.TCT. Kerning works pretty well in Sprint, but it
isn't perfect. There are two main problems that crop up, both of which I
will explain.
The first is the occurrence of two kerning pairs right next to each other.
WA is a kerning pair, and so is AV. But let's say you write about an
organization called World Aviary Venue, and so end up with WAV in your
documents. The W and A will get kerned together, but the A and V will not!
To fix this, you could look at the values in the original @tct
definitions for both pairs concerned:
@tct('WA' 'W@hsp(-0.10 em)A')
@tct('AV' 'A@hsp(-0.14 em)V')
and make a new kerning "triplet," like this:
@tct('WAV' 'W@hsp(-0.10 em)A@hsp(-0.14 em)V')
Okay, that solves that problem, but it gets worse. An abbreviation I use
in some of my documents is PAVO. In this case, the P and A get kerned
together and the V and O get kerned together, but the A and V don't! So I
had to define a kerning "fourplet" to take care of it.
It would have been impossible for me to define all possible kerning
triplets and fourplets in HPALLEN.TCT; there are just too many. For
that matter, some people may use letter combinations that would require
fiveplets, sixplets, sevenplets . . . you get the idea.
The other kerning problem involves soft hyphens. The @tct command will
not translate a kerning pair of letters if a soft hyphen comes between
them. However, if you look at the list of kerning pairs, you will see that
the likelihood of a syllable breaking between any of them is very small.
NOTES ON LIGATURES
In case this term is new to you, a ligature (in publishing parlance) is a
special combination character that can be printed instead of two or three
other characters. The five ligature combinations are fi, fl, ff, ffi, and
ffl. For instance, the fi ligature looks like an f and an i printed very
close together, with the upper part of the f hanging down over the i and
replacing its dot. You sometimes see ligatures in high quality hardback
books (they are almost never included in paperbacks).
Ligatures are handled pretty much automatically in Times and Univers; you
don't have to type anything different in your documents than you ever have.
Sprint will automatically convert the proper letter pairs and triplets into
the proper ligatures. (Ligatures won't work in Courier or LinePrinter,
however, under any circumstances.) One thing to note is that fi and fl
don't meld together in Univers; the only real ligature in this font is ff.
This isn't a limitation of this printer driver, Sprint, or the LaserJet
III; it's just the way the font was designed. If you print out the test
document HPLJ-III.SPR, I think you'll agree the font designer made the
right choice there.
One caveat, and it's a doozy: because of the way the Sprint @tct
formatter command works, ligatures won't get translated if there is a soft
hyphen between any of the characters. This is really too bad, because a
lot of words do indeed break right in the middle of a ligature combination.
The (sort of) good news is you can search for possible messed up ligature
combinations easily inside Sprint. Get to the Search menu (F10/Edit/
Search-Replace). Set Case Sensitive and Use Wildcards to YES; Match Words
Only should be on NO. (Entire File can be NO or YES, depending on how you
want to search.) Then pick Find, and use the following string:
f^^[fil]
Note that you'll see two carets on-screen, just as I've typed it, but what
you must really put there is an ASCII 30 character. To do that, hold down
Alt, type 3 and 0 on your number pad, and then let go of Alt. Although
it's not immediately apparent, this string will find soft hyphens in all
five ligature types. Rather than try to explain why, just embed some soft
hyphens inside all ligature types in your document and try it for yourself.
If you find any soft hyphens inside ligatures, you probably should remove
them--but what if Sprint really needs to break a line there? I hate
that. The final decision is yours.
NOTES ON EM-DASH TRANSLATION
There's not really much to say about this. If Sprint sees two dashes
together in your document like this--it will instead print one long em-
dash, about the length of an upper-case M, the way it's done in most books.
If it sees only one dash, like this - it will print a regular short dash.
If it sees four dashes in a row, like this ----, it will print two em
dashes. And so on. If you don't want the translation to occur for a
particular pair of dashes, you could type @notct(--) instead, or put a soft
hyphen between the two dashes to keep them from getting translated.
NOTES ON MICROSOFT PUBLISHING BULLETS
Since I was including characters from the Microsoft Publishing character
set anyway, I said hey, what the heck, why not include all those neat
bullets? You can include them in your documents with @pub[@char(xxx)],
where xxx is the ASCII code of the character you want. See HPLJ-III.SPR
for examples of the bullets and their ASCII codes. You can also include
them in format definitions. For instance, the new definition for the
Bullets list type in EXTRA.FMT uses two of these bullets. Similarly, you can
get characters from the Legal or Roman-8 symbol sets by using @lgl() or @r8();
e.g., HPALLEN.TCT translates (C) documents to @lgl(^) so that a copyright
symbol will be printed.
PRINTER DRIVER TOOLS
As I've mentioned earlier in this file, I wrote this driver due to
dissatisfaction with other LaserJet III drivers I've downloaded. One of
my chief gripes about those other drivers is incomplete or inaccurate PST
tables. So, starting from a method described in the Sprint Advanced User's
Guide, Appendix F, I decided to write my own tables. However, I feel I came up
with a better method, one which doesn't require measuring, and also allows
you to be ABSOLUTELY CERTAIN you've gotten the values correct, down to the
last pixel.
I started with the same basic method described in the Advanced User's
Guide, and created a document (with a Sprint editor macro) that contains
long lines of all the ASCII characters. I added this crucial step: I also
underlined all the characters. So what?, you say. Well, I'll tell you why
that helps.
By default, Sprint performs underlining in a very strange way. First, it
prints the characters to be underlined, then it backspaces and prints a
long line of underscore characters under them. There's one problem so far,
and that is that an underline would always have to be a length that's a
multiple of the length of the underscore character; you can't print half an
underscore or a third of one or whatever. So, to get the right edge of the
underline exactly where it wants it, Sprint usually repositions the print
head a little bit to the left and then prints one final underscore
character. Here's the useful part: This method WON'T WORK properly unless
Sprint knows the EXACT width of the characters it's underlining, and all
the characters that came before that on the line!
To exploit my method, you must install an older 300 dpi printer driver that
doesn't "lie." In the CompuServe distribution, I've included the file
HPLJ-300.SPL, which works at 300 dpi and has PST tables for 12-point type.
It installs just like the real driver, but it must be renamed to HPLJ3J.SPL
(or the definition in your MAIN.SPL file must be changed) before you can
install it.
The file I made up to perform this magic is called PSTWIDTH.SPR, included on
the CompuServe distribution. It contains sections for regular, bold,
italic, and bold italic type, and then for the characters I use out of the
Microsoft Publishing character set. To demonstrate my method, install the
300 dpi printer driver given here and then print the first couple of pages
of the file. Make SURE you're using STANDARD.FMT when you print it, and NOT
HPLJ-III.FMT; that would cause all kinds of translations to be done that you
don't want at this point.
You'll see lines of most all of the characters in the set in Times, printed
along with their ASCII value. (You can exercise the Univers font family if
you want by changing the FONT command at the top of the file.) Each line
of characters begins and ends with an ASCII 205 line drawing character so
you can see exactly where the line starts and ends, even for ASCII
characters that are "invisible," such as the space. Notice that each line
of characters has a precise underline under it that begins and ends in
exactly the right place. Now, working with a backup copy of HPLJ3J.SPL,
change the value of, say, the upper-case B by ONLY ONE DIGIT. The table
you need to change starts with a line that says "pst CGTimes12r". Subtract
one from its value, then reinstall the 300 dpi printer driver. Print the
first page of PSTWIDTH.SPR again, and notice that now the underline under
the capital B's is a little bit too short!
This is how I can say with utter certainty that every single value in all
my PST tables are absolutely correct for 12 point. You can use
PSTWIDTH.SPR for any possible font by changing the font name at the top of
the file. You can also use it to judge how much Sprint will be off when it
has to scale to different point sizes.
A word of caution, however: This method really doesn't work for the space
character. In fact, before you use this method, you really should already
be pretty certain about the widths of the underline and space characters
(in standard type, as opposed to italic or bold); fortunately, the flawed
drivers I started with at least had these crucial widths correct. It is
possible for every character to seem to print perfectly in PSTWIDTH.SPR but
your documents still won't justify correctly if the space value isn't
right. It seems like the underline under the space character should be too
long or too short if that character isn't defined right, just like every
other character, but it "escapes" somehow. Maybe Sprint really doesn't
print the space character at all, but just takes your word for its width
and then moves the print head that far to the right. As for the underline,
well, obviously you need it to be right to test the widths of all the other
characters. It obviously cannot be used to test its own width. If you
were the really hardcore type, I guess you could print to disk and examine
the codes in the print file and stuff--in fact, printing to disk was how
I discovered Sprint's weird underline method--but I can't give you any
further advice, because I've never had to do this. If you're unfortunate
enough to have to create a PST table completely from scratch, well, I
sympathize; I hope you work something out. Guessing can't hurt.
Getting all the PST values exactly right in all those tables is a long and
extremely tedious process. Basically, it's print out a listing, make the
values a little smaller where the underline is too long, make the values a
little bigger where the underline is too short, reinstall the printer
driver, print out another listing, make the values a little smaller . . .
and so on and so on, ad infinitum. After all that, I had to multiply all
my values by 6 to make my 12 point tables become 72 point tables. All of
this isn't for the feint of heart. I'd guess I've spent at least 30 hours
on this printer driver. If I'd known it would take that long when I
started, I probably would have run, screaming, into some other word
processor camp.
Another, simpler tool I put together was a conversion table for the cryptic
PST codes to ASCII codes. When specifying the width of given characters in
PST tables, it's easy for the normal printing characters; for 12-point
tables, you just put the character itself, a number that represents its
width (in 1/300ths of an inch on the LaserJet III), and a comma, and go on
to the next character. When you get to the upper ASCIIs, however, things
get a little more exciting. For instance, you have to specify ~^\ for
ASCII code 156. Who can remember (or even figure out) that kind of stuff?
One of the things I didn't like about all the other printer drivers was
that almost none of them had values for every single ASCII character from
32 to 255, so I really needed a conversion table.
So, PSTCODES.SPR is a modified PST table that has ASCII values where most
tables have width values. I printed it out and use it as a reference while
performing printer driver maintenance.
RELEASE INFORMATION AND VERSION HISTORY
This is the first public release of this driver by me, version 1.0, first
distributed on June 28, 1991. I give it freely to the Sprint community,
without any strings attached. (God knows, what with the support it's
getting from Borland, Sprint and its users can use all the help they can
get.) Use it, don't use it, distribute it, cannibalize it, whatever, I
don't care. I would particularly like to see someone take this technique
and customize it for other types of printers, like the LaserJet IIIP.
My only caveat is this: I don't want to be praised or blamed for your work.
If you change this driver and upload it somewhere else, don't include this
document; write your own. That would be like stealing my voice. You can
say you based your driver on mine, but that's it. Do me at least this
favor. Don't make me sorry I gave this thing away.
[[This is Jim speaking now: I made some changes and am uploading my version
only with revising this file, not rewriting it from scratch. Allen and I
have both spent lots of time developing these drivers, and have exchanged a
fair amount of electronic mail about them; I think all Sprint users with
LaserJet III-compatible printers benefit. But I sure don't want to make
Allen sorry about sharing his efforts with the Sprint community! If you use
this version, feel free to ask me about it. If you want to ask Allen,
please try out his version first; you can download it from the Sprint
section of CompuServe's BorApp forum. Back to Allen:]]
Now that I'm hip deep in this thing, there are a bunch of changes I plan to
make or attempt. First off, I think it may be possible to perform the
scaling magic of this driver without lying to Sprint about the printer's
resolution. The Sprint Advanced User's Guide says that when using PSTs for
a font, you can tell Sprint what size type the PST is for. I tried this;
the basic approach was, Hey, this is a 300 dpi device, I want you to print
in 12 point by default, but the PSTs I'm giving you are for 72 point type.
It didn't work. I may have done something wrong. Then I thought, Well, I
can still lie about the horizontal dimensions but tell the truth about the
vertical ones, since the VPIs don't present a problem. That didn't work
either; again, it could have been "operator error." I admit I rushed this
driver out so as prove the skeptics wrong. So shoot me for having a big
ego.
I plan on adding support for the LaserJet III's envelope feeder. I'm going
to try to get the proportional fonts to work in landscape mode, in
particular so I can print Times on envelopes.
I really should have defined widths for all the characters in the Microsoft
Publishing character set, instead of lazily defining only those I saw an
immediate need for. But by the time I decided I wanted to use it, I was
sick to DEATH of making up PSTs. It is horrendously gruesome and time
consuming work.
THE AUTHOR REQUESTS FEEDBACK, IDEAS, THROWN TOMATOES, ET CETERA
I learned a lot about Sprint by writing this driver. I have gotten a lot
of help on CompuServe from Borland representatives and other Sprint users.
I'd be interested in hearing any comments you might have (I'd suggest
leaving them in the Sprint forum; GO BORAPP at a CompuServe ! prompt).
I'll answer questions if you ask nicely.
If you modify this thing for (or use my "1800 dpi lie" idea for) another
type of printer, I'd like to see the result. If you have information
pertaining to 72-point PST values for the LaserJet III, I'd REALLY like to
hear from you! If so, do us both a favor by giving me the last thing I
need to make a near perfect LaserJet III driver for everybody.
Comments to:
Allen Brunson, CompuServe 76676,2650
Jim Celoni, S.J., Internet celoni@cunixf.cc.columbia.edu