home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
usenet
/
altsrcs
/
1
/
1370
< prev
next >
Wrap
Text File
|
1990-12-28
|
7KB
|
249 lines
Newsgroups: alt.sources
From: kirkaas@oahu.cs.ucla.edu (paul kirkaas)
Subject: [tex] HP DeskJet Plus: DVI driver patch and deskjet.mf metafont definition
Message-ID: <1990May23.231628.21075@math.lsa.umich.edu>
Date: Wed, 23 May 90 23:16:28 GMT
Archive-name: dvidjp/patch1
Original-posting-by: kirkaas@oahu.cs.ucla.edu (paul kirkaas)
Original-subject: HP DeskJet Plus: DVI driver patch and deskjet.mf metafont definition
Reposted-by: emv@math.lsa.umich.edu (Edward Vielmetti)
[Reposted from comp.text.tex.
Comments on this service to emv@math.lsa.umich.edu (Edward Vielmetti).]
I just sent out the modified source for dvidjp.c (desk jet dvi driver)
yesterday, and already found a couple of bugs that crept up on me.
I am including the patch, as well as the deskjet.mf metafont definition
that I use for my desk jet which was also requested recently on the net.
Paul Kirkaas
kirkaas@cs.ucla.edu
------------------------ deskjet.mf metafont definition ------------------
% Mode definition describing 300 by 300 dpi HP DeskJet Plus printer (pxk)
mode_def deskjet =
proofing:=0;
fontmaking:=1;
tracingtitles:=1;
pixels_per_inch:=300;
blacker:=.1; % Thicker lines -- For a perfect printer, set to 0, bad ~= 4.0
o_correction:=.4; % % of normal overshoot -- Perfect = 1.0; worst = 0.0
fillin:=.15; % Perfect = 0; -.5 < bad < .5 (The amount by which diagonal
% lines are darker than vertical lines -- compensate)
enddef;
base_version:=base_version&"/deskjet";
localfont:=deskjet;
------------------------ dvidjp.c patch 1 --------------------------------
*** dvidjp.c Tue May 22 16:45:26 1990
--- dvidjjp.c Wed May 23 12:34:37 1990
***************
*** 36,41 ****
--- 36,42 ----
/* Driver for HP DeskJet Plus printer -- modified from
* Beebe Laser Jet driver
* by Paul Kirkaas (kirkaas@cs.ucla.edu) 22 May 1990
+ * patch 1 -- bugs in YOFF & COMPACTION fixed 23 May 1990
*
* Employs 3 types of data compaction for greater efficiency --
* up to 60 - 70% reduction in output file size. Each compaction
***************
*** 84,105 ****
#define XOFF 1
/* Include the following line for Mode 2 Compaction */
#define COMPACTION 1
#define VERSION_NO "2.10" /* DVI driver version number */
! #ifdef COMPACTION
! #define DEVICE_ID "Hewlett-Packard Desk Jet plus (from LaserJet)\n\
! WITH Data Compaction for faster I/O"
! #else
! #define DEVICE_ID "Hewlett-Packard Desk Jet plus (from LaserJet)\n\
! with-OUT Data Compaction I/O"
! #endif COMPACTION
/* this string is printed at runtime */
! #ifdef COMPACTION
! #define OUTFILE_EXT "djp"
! #else
! #define OUTFILE_EXT "dj"
! #endif COMPACTION
#define DEFAULT_RESOLUTION 300 /* default dots/inch on HP Desk Jet */
--- 85,103 ----
#define XOFF 1
/* Include the following line for Mode 2 Compaction */
#define COMPACTION 1
+ /*
+ #define COMPACTION 0
+ */
#define VERSION_NO "2.10" /* DVI driver version number */
! #define DEVICE_ID (comp ? \
! "Hewlett-Packard Desk Jet plus (from LaserJet)\n\
! WITH Data Compaction for faster I/O" : \
! "Hewlett-Packard Desk Jet plus (from LaserJet)\n\
! with-OUT Data Compaction I/O" )
/* this string is printed at runtime */
! #define OUTFILE_EXT (comp ? "djc" : "dj")
#define DEFAULT_RESOLUTION 300 /* default dots/inch on HP Desk Jet */
***************
*** 133,138 ****
--- 131,137 ----
#undef SEGMEM
#define SEGMEM 1 /* ( ((long)XBIT * (long)YBIT) > 65536L ) */
#endif
+ int comp = COMPACTION; /* compaction flag -- reset in option.h */
#include "bitmap.h"
***************
*** 164,176 ****
(void)getbmap();
OUTS("\033E"); /* printer reset */
OUTS("\033&l0L"); /* Disable perforation skip */
! OUTS("\033*rB"); /* End graphics */
OUTS("\033*t300R"); /* printer resolution */
! #ifdef COMPACTION
OUTS("\033*b2M"); /* Select Compacted Graphics Mode Two */
! #else
OUTS("\033*b0M"); /* Select Full Graphics Mode */
! #endif COMPACTION
OUTS("\033*r0A"); /* Start graphics, at leftmost position */
}
--- 163,175 ----
(void)getbmap();
OUTS("\033E"); /* printer reset */
OUTS("\033&l0L"); /* Disable perforation skip */
! /* OUTS("\033*rB"); /* End graphics */
OUTS("\033*t300R"); /* printer resolution */
! if (comp)
OUTS("\033*b2M"); /* Select Compacted Graphics Mode Two */
! else
OUTS("\033*b0M"); /* Select Full Graphics Mode */
!
OUTS("\033*r0A"); /* Start graphics, at leftmost position */
}
***************
*** 242,248 ****
register INT16 i,last_word;
int ic,jc; /* just counters */
unsigned char * endb; /* pointer to end of buf */
- #ifdef COMPACTION
unsigned char greystr[129]; /* Max length of 127 in compacted mode 2 */
unsigned char * greyp; /* Pointer to greystr[] */
unsigned char outstr[999]; /* Compacted mode 2 output string */
--- 241,246 ----
***************
*** 253,261 ****
int count;
int gcnt; /* Length of grey runs */
- #endif COMPACTION
-
#if IBM_PC_MICROSOFT
for (last_word = XBIT - 1;
(last_word >= 1) && (*(UNSIGN32*)normaddr(pbit,last_word) == 0);
--- 251,257 ----
***************
*** 320,326 ****
endb = &buf[last_word];
! #ifdef COMPACTION
greyp = greystr;
outp = outstr;
outsz = gcnt = 0;
--- 316,323 ----
endb = &buf[last_word];
! if (comp)
! {
greyp = greystr;
outp = outstr;
outsz = gcnt = 0;
***************
*** 390,402 ****
for (outp = outstr; outp <= endob; outp++ )
OUTC(*outp);
! #else
OUTF("%dW",(int)last_word-ic); /* How much is coming ... */
/* cannot use fprintf with %s format because of
NUL's in string, and it is slow anyway */
for (i = ic; i < last_word; ++pbuf,++i)
OUTC(*pbuf);
! #endif COMPACTION
#else
OUTF("\033*b%dW",(int)last_word);
pbuf = &buf[0]; /* cannot use fprintf with %s format because of
--- 387,401 ----
for (outp = outstr; outp <= endob; outp++ )
OUTC(*outp);
! }
! else
! {
OUTF("%dW",(int)last_word-ic); /* How much is coming ... */
/* cannot use fprintf with %s format because of
NUL's in string, and it is slow anyway */
for (i = ic; i < last_word; ++pbuf,++i)
OUTC(*pbuf);
! }
#else
OUTF("\033*b%dW",(int)last_word);
pbuf = &buf[0]; /* cannot use fprintf with %s format because of
***************
*** 420,426 ****
--- 419,435 ----
#ifdef YOFF
int ycnt = 0;
#endif YOFF
+ /* OUTS("\033E"); /* printer reset */
+ /* OUTS("\033&l0L"); /* Disable perforation skip */
+ /* OUTS("\033*rB"); /* End graphics */
+ /* OUTS("\033*t300R"); /* printer resolution */
+ if (comp)
+ OUTS("\033*b2M"); /* Select Compacted Graphics Mode Two */
+ else
+ OUTS("\033*b0M"); /* Select Full Graphics Mode */
+ OUTS("\033*r0A"); /* Start graphics, at leftmost position */
+
if (DBGOPT(DBG_PAGE_DUMP))
{
INT16 k1,k2,k3;
***************
*** 535,541 ****
#else
p = pbit + XBIT - 1; /* point to last word on line */
while ( !*p && p>pbit ) p--;
! if (p==pbit) return 1;
return 0;
#endif IBM_PC_MICROSOFT
}
--- 544,550 ----
#else
p = pbit + XBIT - 1; /* point to last word on line */
while ( !*p && p>pbit ) p--;
! if (p==pbit && !*p) return 1;
return 0;
#endif IBM_PC_MICROSOFT
}
--
Paul Kirkaas
kirkaas@cs.ucla.edu