[76] in linux-announce channel archive
eps-0.6.6 available (dvi converter for Epson printers)
daemon@ATHENA.MIT.EDU (Lars Wirzenius)
Thu Jan 19 06:24:52 1995
Date: Thu, 19 Jan 1995 11:32:30 +0200
From: Lars Wirzenius <wirzeniu@cc.helsinki.fi>
To: linux-activists@niksula.hut.fi, linux-announce@vger.rutgers.edu
X-Mn-Key: announce
From: neal@ctd.comsat.com (Neal Becker)
Newsgroups: comp.os.linux.announce
Subject: eps-0.6.6 available (dvi converter for Epson printers)
Organization: COMSAT Labs
Keywords: Epson, printers, eps, dvi, TeX
Approved: linux-announce@tc.cornell.edu (Lars Wirzenius)
Followup-to: comp.os.linux.setup
eps-0.6.6.tar.gz is now available from ftp.ctd.comsat.com:/pub
News:
The compiled-in default location of the eps.config file can be
overridden by:
1) EPSCONFIG env variable
2) -C command line option
The compiled-in default printer name (the name to lookup in
eps.config) can be overridden by:
1) EPSPRINTER env variable
2) -R command line switch (ran out of letters)
The debug switch -D is now more useful. Basically, the option
arguments are parsed twice, so that -D can be flagged earlier and more
info can be given to the user.
Here is an old (out of date) blurb:
What is eps?
This is a dvi driver originally for epson 9-pin dot matrix.
Now it is sufficiently general to work for many kinds of printers,
with varying dpi, varying numbers of pins, etc. It was built from
the mctex package, which is found in the standard TeX distribution.
I converted all the mctex source to c++. This was done mostly to
catch some portability problems when I built this for MSDOS.
Next, I added the epson driver which is in the eps directory.
I also modified the mctex code to allow for separate vertical
and horizontal dpi, since my epson is 240 x 216.
Thanks to gaa@world.std.com (Gordon A Acocella) for helpful code and
suggestions to make eps work for a more general class of printers!
Thanks to Michael Klemme, klemme@uni-paderborn.de for help with MakeTeXPK
and with printer redirection!
BEFORE YOU START:
1. You need to know how to make fonts for your printer. Mine is 9-pin
epson compatible, and uses EpsonMXFX mode. You need a mf mode for
your printer. If you are lost look at the end of this file.
2. You need to know how to setup MakeTeXPK to make fonts for your
printer. (Unless you don't care about MakeTeXPK).
3. You need to know what escape sequence selects the desired graphics
mode for your printer.
HOW IT WORKS:
eps needs to know some characteristics of your printer. It gets this
information from 3 sources:
1) compiled-in defaults
2) a run-time config file
3) command-line switches
All compiled-in defaults are set in config.h.
At run-time a configuration for your printer is searched in the config
file CONFIG_FILE (default eps.config). The key to lookup for a
matching printer name is given by the config.h file parameter
PRINTERNAME. This can be overridden by the environment variable
EPSPRINTER.
If a string matching this key is found in CONFIG_FILE the corresponding
entries will override any compiled-in defaults.
You don't have to have a CONFIG_FILE if you don't want one. You could
also put multiple entries for different printers or modes of your
printer.
When it is time to search for fonts the fontdesc file is searched for
an entry with an engine field (3rd field!) matching the print engine
parameter. The default print engine parameter is set by
DEFAULT_ENGINE in config.h, and can be overridden by 'engine' in
CONFIG_FILE. Note that if MakeTeXPK is called, the same 'engine'
parameter will be passed in as the mode. I find it easy to be
consistent. I set DEFAULT_ENGINE to EpsonMXFX, and put those fonts in
/usr/TeX/lib/tex/EpsonMXFX. Note that EpsonMXFX is also the mode
passed to MF, which is the MF mode for 240x216 dpi epson. If you are
using a different printer you may want to
1) Find out the name for the MF mode used to build fonts for
your printer
2) Replace all EpsonMXFX in the foregoing with whatever your
MF mode is.
PARAMETERS:
As eps has gotten more flexible, so it has become more
complex. Now there are lots of parameters to set.
DPIv is the vertical dots/inch. This is NOT necessarily the
spacing of the pins on your printer! In fact, it has almost nothing
to do with the spacing of the pins!
DPIv is either the 1/smallest vertical space you can position
your (topmost) pin to, or a convenient multiple of that. (Note: in
some cases DPIv can be a submultiple instead. See VSkipUnit below ).
For example, on my EpsonMXFX compatible I can advance to any point in
1/216 inch steps. So I can use DPIv=216, or for lower resolution
DPIV=108.
The vertical resolution of your fonts MUST match DPIv!
VPins is the number of pins you want to use. This is not
necessarily the same as the number of pins you have! You can't use
pins unless they will fall at spacing that is a multiple of DPIv! For
example, my EpsonMXFX compatible has pin spacing of 1/72 inch. So if
I want to print at 240x216, I can use 8 pins. Each pin is space 3
DPIv. But if I want to print at 120x108, I can't use 8 pins. I have
to skip every other pin, so the spacing will be a multiple of 1/108
inch. In this case I say VPins=4.
So what about VInterleave, and VSpread? Eps needs to know
about this plan. If every 3 rows in the bitmap (with resolution DPIv)
lines up with a pin, I need say VInterleave = 3. This takes every
third row from the bitmap and packs it into successive bits in the
output.
Now what about VSpread? Suppose I run my EpsonMXFX at
120x108. Now every 3 rows in the 108dpi bitmap lines up with a pin -
but NOT every pin! Every 3 rows lines up with every 2 pins. And I
can only use 4 pins. So I need to say VSpread = 2. Literally, this
"spreads" the bits out as they are packed into bytes and sent to the
printer.
Confused yet? Wait - there's more.
How do you tell eps to move the paper vertically? You must
set VaddvStr to a string passed to fprintf(), as in
printf( "VaddvStr", n )
to move the paper by n rows. You will need to have %c in this string
for n to go in. n will be in the range $[0 \dots 255]$.
Now it may be that printf( "VaddvStr", n ) does not move the
paper by n/DPIv. Maybe you picked a lower resolution. For my
EpsonMXFX above, when I use 120x108 and I tell it the VaddvStr for
n/216 dpi, eps needs to know that this advances by n/(2 DPIv). You
tell eps this by setting VSkip to 1/(amount advanced by VAddvStr). In
this example, I need VSkip=216. Eps will see that VSkip > DPIv, and
will know that it needs to repeat the VAddvStr by (VSkip/DPIv) times
to advance the paper by n/DPIv units.
There is another variation on this where VSkip < DPIv; that
is, vertical increments are only possible in some units (VSkipUnit)
that is more that a single row in the bitmap. Eps will accomodate
this also, but it is not very clever about it. If you set VSkip <
DPIv then it will calculate VSkipUnit = DPIv/VSkip which had better be
an integer. It will blindly assume that having moved vertically in
multiples of VSkipUnit there will be pins in the right places at
multiples of DPIv. (I forget which printers use this, I think this is
for 180x180 or is it 360x360?)
On some printers in some graphics modes you should not use
adjacent pins in a horizontal row. Instead you should print in two
passes. In this case set HInc=2.
Similarly, some printers work better if you don't fire adjacent
pins in a vertical column. In this case set VInc=2.
Eps will try to speed things up by converting runs of blank to
use various spacing commands. The smallest number of consecutive
spaces worth converting is given by the parameter MinSkipSpaces. If
you don't want this feature you can set it to <= 0, which will turn it
off.
Having decided to convert spaces, eps can choose 3 different
methods. You can choose UseEscF0, UseTabs, or UseSpaces. UseEscF0
uses "ESC f 0 n" to space over by n spaces. UseTabs sets tabs using
"ESC D", then uses TAB to go there. UseSpaces uses plain old spaces.
INSTALLING:
Edit eps/config.h to set compiled-in defaults as desired (see below).
Then do make.
USING:
* You'll need to install a fontdesc file to describe the location of
your fonts. Here's mine:
font pk EpsonMXFX 3 /usr/TeX/lib/tex/fonts/EpsonMXFX/%f.%mpk
I put this file in '/usr/TeX/lib/tex/fonts/fontdesc'. This says that
the font cmr10 at 240x216 dpi can be found at
'/usr/TeX/lib/tex/fonts/EpsonMXFX/cmr10.240pk'. Feel free to change it.
The format for this file comes from the MCTEX stuff. If you don't
want to get MCTEX and read up, just copy my example. %f will stand
for the font name, and %m will stand for the dpi.
* Edit the defaults in eps/config.h to your liking. Comments there
describe the parameters. These are the compiled-in defaults. But you
can overide these at runtime, using values read from CONFIG_FILE, and
then by command-line switches.
* Compiled-in defaults are set by eps/config.h. At runtime a config
file is searched for. The name of this file is set in eps/config.h
(CONFIG_FILE).
* CONFIG_FILE is searched for an entry for your printer. The printer
name to look for is set in config.h by PRINTERNAME, but you can
overide this at runtime using the environment variable EPSPRINTER.
* CONFIG_FILE should consists of a series of entries. Each entry
describes the parameters for a printer (or set of equivalent
printers). This file is searched for the first entry matching the
printername specified by the config.h parameter PRINTERNAME or the
environment variable EPSPRINTER. Entries for that printer will
override defaults in config.h. Values unspecified will default to the
settings in config.h. Here is the syntax for entries in CONFIG_FILE:
names { params }
where 'names' is a printer name optionally followed by a aliases,
seperated by pipe symbols '|', like:
name [ | alias1 | alias2 ... ]
Here is a good time to say that all strings consist of the usual
alphanumeric characters together with the characters '_.-'. If you
like, you can include any characters (except newline) in names by
quoting them. You may use either single or double quotes.
'params' is a list of parameter entries. Each entry looks like:
keyword = value
or just keyword for the cases noted as 'enum' below
The possible 'params' are:
engine = string
vpins = int
dpih = int
dpiv = int
graphicsmode = int
vskip = int
vinterleave = int
xoff = int
yoff = int
width = float
height = float
useescf0 enum
usetabs enum
usespaces enum
initstring = strings
resetstring = strings
vspread = int
vaddvstr = strings
A 'string' has already been explained, while 'strings' is special.
This is a list of string(s), with some special processing. First, all
the string(s) have backslash escape sequences expanded, as follows: \e
stands for ESC, \f stands for FF, \r stands for CR, \n for LF, \xnnn
stands for any hex (like C, but any number of digits), and anything
else just stands for itself (\w gives the character 'w'). Then all
the 'strings' are concatenated. This allows you to write something
like:
"Panasonic KX-P1080" | EpsonMXFX {
engine = EpsonMXFX
resetstring = '\e' "@"
}
to say that the reset string is "ESC-@". (Note: extra quotes in this
example are just for fun. You only actually need quotes to include
whitespace or special characters.)
Anything from a # to the newline is a comment, like in shell scripts.
The meanings of all these parameters are explained in config.h (I
hope).
* You don't have to have a CONFIG_FILE. You'll get the compiled-in
defaults if you don't have one.
* eps now supports MakeTeXPK! But you'll need to setup your MakeTeXPK
script specially. eps will pass the absolute path to the font as arg
6 (not a subdir). You should make a modification like this to
MakeTeXPK:
if test "$6" != ""
then
case "$6" in
/*) DESTDIR="$6" ;;
*) DESTDIR=$DESTDIR"/$6"
esac
if test ! -d $DESTDIR
then
mkdir $DESTDIR
fi
fi
Now your MakeTeXPK will work if argument 6 is either a subdirectory or
an absolute pathname. This is a good idea and all other dvifile
drivers should support this.
CARE and FEEDING of MF:
If you need a mf mode for your printer:
1. look for a file called modes.mf.
2. edit to taste. Just make sure you get the pixels_per_inch and
aspect_ratio correct. It's not going to look like a laser-printer
anyway, so I wouldn't worry too much about fillin and other junk.
3. do something like:
inimf \\input plain \\input modes \\dump
mv plain.base wherever/bases/mf.base
* If you have any problems, suggestions, or especially successful
installation you can reach me at:
neal@ctd.comsat.com
* TODO:
msdos used to work. It needs the TWO_PASS stuff turned back on
(yechh --- 640k --- puke). But I don't use msdos any more. Anyone
want to volenteer?
--
Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov
PLEASE remember Keywords: and a short description of the software.