Article View: comp.text
Article #5925Re: New DVI-LaserJet Converter (Part 2 of 2)
From: Joe Kelsey
Date: Thu, 23 Feb 1989 19:03
Date: Thu, 23 Feb 1989 19:03
2846 lines
80921 bytes
80921 bytes
I have taken the recently posted DVI-LaserJet converter and modified
it to support .gf fonts and to function as a spooler. The .gf
modifications were based on the mitdevices/dvi2ps code in the standard
TeX distribution. You need to have the files findfile.[ch] and gf.c
from that directory in order to compile with .gf support. If you do
not have a standard TeX distribution, then I'm sure I or someone else
can post the appropriate files.
I also have modified the program to function in a spooling environment
better. If you #define FILTER, then it sends output to stdout instead
of to a .lj file. It also disables the automatic .dvi extension
requirement since spool files rarely have that! I also modified all
diagnostic output to go to stderr to prevent corruption of the spooled
output. I have modified the standard HP-supplied .PCL3 spooler model
to support a TeX mode spooling. If anyone is interested in that, let
me know and I'll supply diffs. I have only tested this stuff on a
LaserJet II, so I have no idea whether or not it works on the IBM
3812. I tried to duplicate the .gf changes for the LaserJet on the
3812, but someone else will have to test it. It is also set up now so
that you have to #define USEPXL if you want the old code. I also did
not modify the findfile code taken from the dvi2ps converter to
support the .pk files or the alternate versions of .pxl files that the
old code supported, although that would not be hard to do.
Following this are my changes to dvi2xx.c. If you cannot handle a
context diff, but would rather have the actual source, drop me a line
and let me know.
/Joe
*** dvi2xx.c.orig Mon Feb 20 15:33:29 1989
--- dvi2xx.c Thu Feb 23 10:25:43 1989
***************
*** 55,60
* when -d cmdline option specified
* #define IBM3812 produce output for the IBM3812 pageprinter
* #define LJ produce output for the HP Laserjet+
*/
/**********************************************************************
************************ Global Definitions ************************
--- 55,62 -----
* when -d cmdline option specified
* #define IBM3812 produce output for the IBM3812 pageprinter
* #define LJ produce output for the HP Laserjet+
+ * #define FILTER produce output on stdout for use as a printer
+ * spooler filter.
*/
/**********************************************************************
************************ Global Definitions ************************
***************
*** 96,103
#define TRUE (bool) 1
#define FALSE (bool) 0
#define UNKNOWN -1
! #define FIRSTPXLCHAR 0
! #define LASTPXLCHAR 127 /* was 255 * change NPXLCHARS too !! */
/*#define FONTAREA "fonts" /* "/usr/lib/tex/fonts" */
#ifdef hpux
#define MAXOPEN (NOFILE - 8)
--- 98,109 -----
#define TRUE (bool) 1
#define FALSE (bool) 0
#define UNKNOWN -1
! #define FIRSTFNTCHAR 0
! #ifdef USEPXL
! #define LASTFNTCHAR 127 /* was 255 * change NFNTCHARS too !! */
! #else
! #define LASTFNTCHAR 255
! #endif
/*#define FONTAREA "fonts" /* "/usr/lib/tex/fonts" */
#ifdef hpux
#define MAXOPEN (NOFILE - 8)
***************
*** 104,110
#else
#define MAXOPEN 12 /* limit on number of open PXL files */
#endif
! #define NPXLCHARS 128 /* was 256 change LASTPXLCHAR too !! */
#define STACK_SIZE 100 /* DVI-stack size */
#define STRSIZE 255 /* stringsize for file specification */
#define NONEXISTANT -1 /* offset for PXL files not found */
--- 110,120 -----
#else
#define MAXOPEN 12 /* limit on number of open PXL files */
#endif
! #ifdef USEPXL
! #define NFNTCHARS 128 /* was 256 change LASTFNTCHAR too !! */
! #else
! #define NFNTCHARS 256
! #endif
#define STACK_SIZE 100 /* DVI-stack size */
#define STRSIZE 255 /* stringsize for file specification */
#define NONEXISTANT -1 /* offset for PXL files not found */
***************
*** 174,184
#define RESOLUTION 300
#define hconvRESOLUTION 300
#define vconvRESOLUTION 300
! #define CHAR_WIDTH_LARGE 100 /* limit for loading into printer font */
! #define CHAR_HEIGTH_LARGE 127 /* y_offset reaches the same size! */
! #define EMITFILE_EXTENSION ".lj" /* default extension of emit file */
! #define MAX_FONTS_PER_PAGE 16 /* maximum number of fonts per page */
! #define HANDLE_MAX_FONTS 255 /* max nr of fonts handled (rasterfont) */
#define EMITC(c) putc(c,outfp) /* output a single character */
#define EMITL(l,d) EMITB(l,d) /* EMIT-logical = EMITB */
#define XDEFAULTOFF RESOLUTION-54 /* y default offset on page 1 inch (LJ2)*/
--- 184,195 -----
#define RESOLUTION 300
#define hconvRESOLUTION 300
#define vconvRESOLUTION 300
! #define CHAR_WIDTH_LARGE 100 /* limit for loading into printer font */
! #define CHAR_HEIGTH_LARGE 127 /* y_offset reaches the same size! */
! #define EMITFILE_EXTENSION ".lj" /* default extension of emit file */
! #define MAX_FONTS_PER_PAGE 16 /* maximum number of fonts per page */
! #define HANDLE_MAX_FONTS 255 /* max nr of fonts handled (rasterfont) */
! #define MAXFONTSTORAGE (395*1024) /* standard user memory */
#define EMITC(c) putc(c,outfp) /* output a single character */
#define EMITL(l,d) EMITB(l,d) /* EMIT-logical = EMITB */
#define XDEFAULTOFF RESOLUTION-54 /* y default offset on page 1 inch (LJ2)*/
***************
*** 217,222
extern char *sys_errlist[];
extern int errno;
#include "findfile.h"
/**********************************************************************/
--- 228,249 -----
extern char *sys_errlist[];
extern int errno;
+ #ifndef USEPXL
+ /* interface to gf.c */
+ extern FILE *gfin;
+ extern int checksum;
+ extern long tfm_wd[], char_pointer[];
+ extern char char_exists[];
+ extern int num_cols, num_rows, num_bytes, x_offset, y_offset;
+ extern unsigned char bits[];
+ extern int gettochar();
+ extern void readbits();
+ extern void readpost();
+ extern void seekpost();
+ extern int seekchar();
+ #endif
+
+ #ifndef unix
#include "findfile.h"
#endif
***************
*** 218,224
extern int errno;
#include "findfile.h"
!
/**********************************************************************/
/************************* Global Procedures ************************/
/**********************************************************************/
--- 245,252 -----
#ifndef unix
#include "findfile.h"
! #endif
!
/**********************************************************************/
/************************* Global Procedures ************************/
/**********************************************************************/
***************
*** 277,282
/**********************************************************************/
struct char_entry { /* character entry */
unsigned short width, height; /* width and height in pixels */
short xOffset, yOffset, yyOffset; /* x offset and y offset in pixels*/
struct {
--- 305,311 -----
/**********************************************************************/
struct char_entry { /* character entry */
+ #ifdef USEPXL
unsigned short width, height; /* width and height in pixels */
short xOffset, yOffset, yyOffset; /* x offset and y offset in pixels*/
#endif
***************
*** 279,284
struct char_entry { /* character entry */
unsigned short width, height; /* width and height in pixels */
short xOffset, yOffset, yyOffset; /* x offset and y offset in pixels*/
struct {
bool isloaded;
union {
--- 308,314 -----
#ifdef USEPXL
unsigned short width, height; /* width and height in pixels */
short xOffset, yOffset, yyOffset; /* x offset and y offset in pixels*/
+ #endif
struct {
bool isloaded;
union {
***************
*** 294,302
struct font_entry { /* font entry */
long k, c, s, d;
int a, l;
! /* char n[STRSIZE]; */ /* FNT_DEF command parameters */
! /* long font_space; */ /* computed from FNT_DEF s parameter */
! long font_mag; /* computed from FNT_DEF s and d parameters */
/*char psname[STRSIZE];*/ /* PostScript name of the font */
char name[STRSIZE]; /* full name of PXL file */
FILE * font_file_id; /* file identifier (NO_FILE if none) */
--- 324,332 -----
struct font_entry { /* font entry */
long k, c, s, d;
int a, l;
! char n[STRSIZE]; /* FNT_DEF command parameters */
! long font_space; /* computed from FNT_DEF s parameter */
! long font_mag; /* computed from FNT_DEF s and d parameters */
/*char psname[STRSIZE];*/ /* PostScript name of the font */
char name[STRSIZE]; /* full name of PXL file */
FILE * font_file_id; /* file identifier (NO_FILE if none) */
***************
*** 300,305
/*char psname[STRSIZE];*/ /* PostScript name of the font */
char name[STRSIZE]; /* full name of PXL file */
FILE * font_file_id; /* file identifier (NO_FILE if none) */
long magnification; /* magnification read from PXL file */
long designsize; /* design size read from PXL file */
struct char_entry ch[NPXLCHARS]; /* character information */
--- 330,336 -----
/*char psname[STRSIZE];*/ /* PostScript name of the font */
char name[STRSIZE]; /* full name of PXL file */
FILE * font_file_id; /* file identifier (NO_FILE if none) */
+ #ifdef USEPXL
long magnification; /* magnification read from PXL file */
long designsize; /* design size read from PXL file */
#endif
***************
*** 302,308
FILE * font_file_id; /* file identifier (NO_FILE if none) */
long magnification; /* magnification read from PXL file */
long designsize; /* design size read from PXL file */
! struct char_entry ch[NPXLCHARS]; /* character information */
struct font_entry *next;
int ncdl; /* #of different chars actually downloaded */
int plusid; /* Font id in Printer */
--- 333,340 -----
#ifdef USEPXL
long magnification; /* magnification read from PXL file */
long designsize; /* design size read from PXL file */
! #endif
! struct char_entry ch[NFNTCHARS]; /* character information */
struct font_entry *next;
int ncdl; /* #of different chars actually downloaded */
int plusid; /* Font id in Printer */
***************
*** 377,390
bool EvenPage = FALSE; /* Document starts with an even Page */
long LastPtobePrinted = 0;
- /* deactivated features */
- /**********************/
- /*int nif = 0; */ /* number of files to include */
- /*char *Ifile[100]; */ /* files to include */
- /*int nps = 0; */ /* number of PostScript commands to send */
- /*char *PScmd[100]; */ /* PostScript commands to send */
- /**********************/
-
long allocated_storage = 0; /* size of mallocated storage (statistics) */
long power[32] ;
long gpower[33] ;
--- 409,414 -----
bool EvenPage = FALSE; /* Document starts with an even Page */
long LastPtobePrinted = 0;
long allocated_storage = 0; /* size of mallocated storage (statistics) */
long power[32] ;
long gpower[33] ;
***************
*** 400,405
/* raster if fonts/page>MAX_FONTS_PER_PAGE*/
#endif
#ifdef IBM3812
char PMPformat[20];
long used_fontstorage = 0;
--- 424,431 -----
/* raster if fonts/page>MAX_FONTS_PER_PAGE*/
#endif
+ long used_fontstorage = 0;
+
#ifdef IBM3812
char PMPformat[20];
char CharString[CHARSTRINGMAX];
***************
*** 402,408
#ifdef IBM3812
char PMPformat[20];
- long used_fontstorage = 0;
char CharString[CHARSTRINGMAX];
unsigned int CharStringPos = 0;
#define CharStringOut \
--- 428,433 -----
#ifdef IBM3812
char PMPformat[20];
char CharString[CHARSTRINGMAX];
unsigned int CharStringPos = 0;
#define CharStringOut \
***************
*** 473,478
"%s: DVI format = %d, can only process DVI format %d files\n\n",
G_progname, i, DVIFORMAT);
}
if ((outfp = fopen(EmitFileName, WRITE_BINARY)) == NULL) {
Fatal("opening output file: fopen(%s) : %s",EmitFileName,sys_errlist[errno]);
}
--- 498,506 -----
"%s: DVI format = %d, can only process DVI format %d files\n\n",
G_progname, i, DVIFORMAT);
}
+ #ifdef FILTER
+ outfp = stdout;
+ #else
if ((outfp = fopen(EmitFileName, WRITE_BINARY)) == NULL) {
Fatal("opening output file: fopen(%s) : %s",EmitFileName,sys_errlist[errno]);
}
***************
*** 476,481
if ((outfp = fopen(EmitFileName, WRITE_BINARY)) == NULL) {
Fatal("opening output file: fopen(%s) : %s",EmitFileName,sys_errlist[errno]);
}
#ifndef unix
AssureBinary(outfp);
--- 504,510 -----
if ((outfp = fopen(EmitFileName, WRITE_BINARY)) == NULL) {
Fatal("opening output file: fopen(%s) : %s",EmitFileName,sys_errlist[errno]);
}
+ #endif
#ifndef unix
AssureBinary(outfp);
***************
*** 490,500
if ( G_header )
CopyFile( HeaderFileName );
- /*****************************/
- /*for( i0=0; i0<nif; i0++ ) */ /* copy all included files */
- /* CopyFile( Ifile[i0] ); */
- /*****************************/
-
#ifdef IBM3812
PMPout(1, "\307"); /* unload all fonts */
PMPout(1, "\310"); /* unload all macros */
--- 519,524 -----
if ( G_header )
CopyFile( HeaderFileName );
#ifdef IBM3812
PMPout(1, "\307"); /* unload all fonts */
PMPout(1, "\310"); /* unload all macros */
***************
*** 500,505
PMPout(1, "\310"); /* unload all macros */
#endif
#ifdef LJ
if (ResetPrinter)
EMIT(outfp, "\033E");
--- 524,530 -----
PMPout(1, "\310"); /* unload all macros */
#endif
#ifdef LJ
+ #ifndef FILTER
if (ResetPrinter)
EMIT(outfp, "\033E");
***************
*** 508,513
if (ncopies>1)
EMIT(outfp, "\033&l%hdX",ncopies);
#endif
if (DoublePage) {
StartPrintPages = PrintPages;
#ifdef IBM3812
--- 533,539 -----
if (ncopies>1)
EMIT(outfp, "\033&l%hdX",ncopies);
#endif
+ #endif
if (DoublePage) {
StartPrintPages = PrintPages;
#ifdef IBM3812
***************
*** 518,524
if (Reverse) {
#ifdef DEBUG
if (Debug)
! printf("reverse\n");
#endif
ReadPostAmble(TRUE);
fseek(dvifp, ppagep, 0);
--- 544,550 -----
if (Reverse) {
#ifdef DEBUG
if (Debug)
! fprintf(stderr, "reverse\n");
#endif
ReadPostAmble(TRUE);
fseek(dvifp, ppagep, 0);
***************
*** 534,540
command = (short) NoSignExtend(dvifp, 1) ;
#ifdef DEBUG
if (Debug)
! printf("CMD:\t%d\n", command);
#endif
/* switch (command=NoSignExtend(dvifp, 1)) {*/
switch (command) {
--- 560,566 -----
command = (short) NoSignExtend(dvifp, 1) ;
#ifdef DEBUG
if (Debug)
! fprintf(stderr,"CMD:\t%d\n", command);
#endif
/* switch (command=NoSignExtend(dvifp, 1)) {*/
switch (command) {
***************
*** 918,923
#ifdef IBM3812
PMPout(10, "\373\010PMP.init"); /* re-init printer */
PMPflush;
if (used_fontstorage > MAXFONTSTORAGE) {
Warning("\n\7used font_storage of 3812: %ld Bytes (of %ld)\7",
--- 944,950 -----
#ifdef IBM3812
PMPout(10, "\373\010PMP.init"); /* re-init printer */
PMPflush;
+ #endif
if (used_fontstorage > MAXFONTSTORAGE) {
Warning("\n\7used font_storage of %s: %ld Bytes (of %ld)\7",
***************
*** 920,927
PMPflush;
if (used_fontstorage > MAXFONTSTORAGE) {
! Warning("\n\7used font_storage of 3812: %ld Bytes (of %ld)\7",
! used_fontstorage, MAXFONTSTORAGE);
Warning("Try to format file in separate runs!");
} else
qprintf(
--- 947,954 -----
#endif
if (used_fontstorage > MAXFONTSTORAGE) {
! Warning("\n\7used font_storage of %s: %ld Bytes (of %ld)\7",
! PRINTER, used_fontstorage, MAXFONTSTORAGE);
Warning("Try to format file in separate runs!");
} else
qfprintf(stderr,
***************
*** 924,933
used_fontstorage, MAXFONTSTORAGE);
Warning("Try to format file in separate runs!");
} else
! qprintf(
! "\nAll done, used font_storage of 3812: %ld Bytes (of %ld)",
! used_fontstorage, MAXFONTSTORAGE);
! #endif
#ifdef LJ
EMIT(outfp, "\033E");
if (PrintTestPage) EMIT(outfp, "\033z");
--- 951,959 -----
PRINTER, used_fontstorage, MAXFONTSTORAGE);
Warning("Try to format file in separate runs!");
} else
! qfprintf(stderr,
! "\nAll done, used font_storage of %s: %ld Bytes (of %ld)",
! PRINTER, used_fontstorage, MAXFONTSTORAGE);
#ifdef LJ
#ifndef FILTER
EMIT(outfp, "\033E");
***************
*** 929,934
used_fontstorage, MAXFONTSTORAGE);
#endif
#ifdef LJ
EMIT(outfp, "\033E");
if (PrintTestPage) EMIT(outfp, "\033z");
#endif
--- 955,961 -----
"\nAll done, used font_storage of %s: %ld Bytes (of %ld)",
PRINTER, used_fontstorage, MAXFONTSTORAGE);
#ifdef LJ
+ #ifndef FILTER
EMIT(outfp, "\033E");
if (PrintTestPage) EMIT(outfp, "\033z");
#endif
***************
*** 932,937
EMIT(outfp, "\033E");
if (PrintTestPage) EMIT(outfp, "\033z");
#endif
if (!G_quiet) {
printf( "\nDynamically allocated storage: %ld Bytes \n",
--- 959,965 -----
EMIT(outfp, "\033E");
if (PrintTestPage) EMIT(outfp, "\033z");
#endif
+ #endif
if (!G_quiet) {
fprintf(stderr,"\nDynamically allocated storage: %ld Bytes \n",
***************
*** 934,940
#endif
if (!G_quiet) {
! printf( "\nDynamically allocated storage: %ld Bytes \n",
allocated_storage);
#ifdef TIMING
--- 962,968 -----
#endif
if (!G_quiet) {
! fprintf(stderr,"\nDynamically allocated storage: %ld Bytes \n",
allocated_storage);
#ifdef TIMING
***************
*** 943,949
-start_time;
if (ndone > 0) {
! printf(
"Time of complete run: %.2f seconds, %d page(s), %.2f seconds/page",
time, ndone, time / ndone);
printf(" (%.2f ppm)\n",(ndone * 60) / time);
--- 971,977 -----
-start_time;
if (ndone > 0) {
! fprintf(stderr,
"Time of complete run: %.2f seconds, %d page(s), %.2f seconds/page",
time, ndone, time / ndone);
fprintf(stderr," (%.2f ppm)\n",(ndone * 60) / time);
***************
*** 946,952
printf(
"Time of complete run: %.2f seconds, %d page(s), %.2f seconds/page",
time, ndone, time / ndone);
! printf(" (%.2f ppm)\n",(ndone * 60) / time);
}
printf("\n");
#endif
--- 974,980 -----
fprintf(stderr,
"Time of complete run: %.2f seconds, %d page(s), %.2f seconds/page",
time, ndone, time / ndone);
! fprintf(stderr," (%.2f ppm)\n",(ndone * 60) / time);
}
fprintf(stderr,"\n");
#endif
***************
*** 948,954
time, ndone, time / ndone);
printf(" (%.2f ppm)\n",(ndone * 60) / time);
}
! printf("\n");
#endif
}
--- 976,982 -----
time, ndone, time / ndone);
fprintf(stderr," (%.2f ppm)\n",(ndone * 60) / time);
}
! fprintf(stderr,"\n");
#endif
}
***************
*** 1024,1029
case 'D': /* D selects DoublePage */
DoublePage = TRUE;
break;
case 'e': /* emit file is specified */
EmitFileName = ++tcp;
/* delete trailing ':' (causing hangup) */
--- 1052,1058 -----
case 'D': /* D selects DoublePage */
DoublePage = TRUE;
break;
+ #ifndef FILTER
case 'e': /* emit file is specified */
EmitFileName = ++tcp;
/* delete trailing ':' (causing hangup) */
***************
*** 1032,1037
EmitFileName[strlen(EmitFileName)-1] =
'\0';
break;
case 'f': /* next arg is starting pagenumber */
if ( sscanf(tcp + 1, "%ld", &FirstPage) != 1 )
Fatal("Argument is not a valid integer\n");
--- 1061,1067 -----
EmitFileName[strlen(EmitFileName)-1] =
'\0';
break;
+ #endif
case 'f': /* next arg is starting pagenumber */
if ( sscanf(tcp + 1, "%ld", &FirstPage) != 1 )
Fatal("Argument is not a valid integer\n");
***************
*** 1045,1057
HeaderFileName = ++tcp;
G_header = TRUE;
break;
- #ifdef SUPERCOMMENT
- case 'i': /* next arg is a PostScript file to copy */
- if ( ++argind >= argc )
- Fatal("No argument following -i\n");
- Ifile[nif++] = argv[argind];
- break;
- #endif
case 'x': /* specify x-offset */
this_arg = 0;
if (!(*++tcp)) {
--- 1075,1080 -----
HeaderFileName = ++tcp;
G_header = TRUE;
break;
case 'x': /* specify x-offset */
this_arg = 0;
if (!(*++tcp)) {
***************
*** 1168,1173
G_nowarn = TRUE;
break;
#ifdef LJ
case 'z':
PrintTestPage = (bool)(!PrintTestPage);
break;
--- 1191,1197 -----
G_nowarn = TRUE;
break;
#ifdef LJ
+ #ifndef FILTER
case 'z':
PrintTestPage = (bool)(!PrintTestPage);
break;
***************
*** 1172,1177
PrintTestPage = (bool)(!PrintTestPage);
break;
#endif
default:
printf("%c is not a legal flag\n", *tcp);
}
--- 1196,1202 -----
PrintTestPage = (bool)(!PrintTestPage);
break;
#endif
+ #endif
default:
fprintf(stderr,
"%c is not a legal flag\n", *tcp);
***************
*** 1173,1179
break;
#endif
default:
! printf("%c is not a legal flag\n", *tcp);
}
} else {
/* tcp = rindex(argv[argind], '/'); */
--- 1198,1205 -----
#endif
#endif
default:
! fprintf(stderr,
! "%c is not a legal flag\n", *tcp);
}
} else {
#ifdef FILTER
***************
*** 1176,1182
printf("%c is not a legal flag\n", *tcp);
}
} else {
! /* tcp = rindex(argv[argind], '/'); */
tcp = strrchr(argv[argind], '/');
/* split into directory + file name */
if (tcp == NULL) {
--- 1202,1210 -----
"%c is not a legal flag\n", *tcp);
}
} else {
! #ifdef FILTER
! (void) strcpy(filename, tcp);
! #else
tcp = strrchr(argv[argind], '/');
/* split into directory + file name */
if (tcp == NULL) {
***************
*** 1202,1207
(void) strcpy(filename, curarea);
(void) strcat(filename, curname);
if ((dvifp = BINOPEN(filename)) == NULL) {
Fatal("%s: can't find DVI file \"%s\"\n\n",
--- 1230,1236 -----
(void) strcpy(filename, curarea);
(void) strcat(filename, curname);
+ #endif
if ((dvifp = BINOPEN(filename)) == NULL) {
Fatal("%s: can't find DVI file \"%s\"\n\n",
***************
*** 1213,1224
x_goffset = (short) MM_TO_PXL(x_offset) + x_origin;
y_goffset = (short) MM_TO_PXL(y_offset) + y_origin;
! /*
! printf("setting x_goffset to %hd, x_offset= %f, x_origin= %hd\n",
! x_goffset, x_offset, x_origin);
! printf("setting y_goffset to %hd, y_offset= %f, y_origin= %hd\n",
! y_goffset, y_offset, y_origin);
! */
if (dvifp == NULL) {
printf("\nThis is the DVI to %s converter version %s",
PRINTER, VERSION);
--- 1242,1248 -----
x_goffset = (short) MM_TO_PXL(x_offset) + x_origin;
y_goffset = (short) MM_TO_PXL(y_offset) + y_origin;
!
if (dvifp == NULL) {
fprintf(stderr,"\nThis is the DVI to %s converter version %s",
PRINTER, VERSION);
***************
*** 1220,1226
y_goffset, y_offset, y_origin);
*/
if (dvifp == NULL) {
! printf("\nThis is the DVI to %s converter version %s",
PRINTER, VERSION);
printf(" (%s)\n", OS);
printf("usage: %s [OPTIONS] dvifile\n", G_progname);
--- 1244,1250 -----
y_goffset = (short) MM_TO_PXL(y_offset) + y_origin;
if (dvifp == NULL) {
! fprintf(stderr,"\nThis is the DVI to %s converter version %s",
PRINTER, VERSION);
fprintf(stderr," (%s)\n", OS);
fprintf(stderr,"usage: %s [OPTIONS] dvifile\n", G_progname);
***************
*** 1222,1229
if (dvifp == NULL) {
printf("\nThis is the DVI to %s converter version %s",
PRINTER, VERSION);
! printf(" (%s)\n", OS);
! printf("usage: %s [OPTIONS] dvifile\n", G_progname);
printf("OPTIONS are:\n");
printf(
--- 1246,1253 -----
if (dvifp == NULL) {
fprintf(stderr,"\nThis is the DVI to %s converter version %s",
PRINTER, VERSION);
! fprintf(stderr," (%s)\n", OS);
! fprintf(stderr,"usage: %s [OPTIONS] dvifile\n", G_progname);
fprintf(stderr,"OPTIONS are:\n");
fprintf(stderr,
***************
*** 1225,1232
printf(" (%s)\n", OS);
printf("usage: %s [OPTIONS] dvifile\n", G_progname);
! printf("OPTIONS are:\n");
! printf(
"\t-aX ..... X= searchpath leading to pixel-files (.pk or .pxl)\n");
#ifdef IBM3812
printf(
--- 1249,1256 -----
fprintf(stderr," (%s)\n", OS);
fprintf(stderr,"usage: %s [OPTIONS] dvifile\n", G_progname);
! fprintf(stderr,"OPTIONS are:\n");
! fprintf(stderr,
"\t-aX ..... X= searchpath leading to pixel-files (.pk or .pxl)\n");
#ifdef IBM3812
fprintf(stderr,
***************
*** 1229,1235
printf(
"\t-aX ..... X= searchpath leading to pixel-files (.pk or .pxl)\n");
#ifdef IBM3812
! printf(
"\t-b ..... take paper for first page from alternate casette\n");
#endif
printf("\t-cX ..... X= number of copies\n");
--- 1253,1259 -----
fprintf(stderr,
"\t-aX ..... X= searchpath leading to pixel-files (.pk or .pxl)\n");
#ifdef IBM3812
! fprintf(stderr,
"\t-b ..... take paper for first page from alternate casette\n");
#endif
fprintf(stderr,"\t-cX ..... X= number of copies\n");
***************
*** 1232,1238
printf(
"\t-b ..... take paper for first page from alternate casette\n");
#endif
! printf("\t-cX ..... X= number of copies\n");
#ifdef DEBUG
printf("\t-d ..... turns debug output on\n");
#endif
--- 1256,1262 -----
fprintf(stderr,
"\t-b ..... take paper for first page from alternate casette\n");
#endif
! fprintf(stderr,"\t-cX ..... X= number of copies\n");
#ifdef DEBUG
fprintf(stderr,"\t-d ..... turns debug output on\n");
#endif
***************
*** 1234,1240
#endif
printf("\t-cX ..... X= number of copies\n");
#ifdef DEBUG
! printf("\t-d ..... turns debug output on\n");
#endif
printf("\t-D ..... turns doublepage output on\n");
printf("\t-eX ..... X= outputfile\n");
--- 1258,1264 -----
#endif
fprintf(stderr,"\t-cX ..... X= number of copies\n");
#ifdef DEBUG
! fprintf(stderr,"\t-d ..... turns debug output on\n");
#endif
fprintf(stderr,"\t-D ..... turns doublepage output on\n");
#ifndef FILTER
***************
*** 1236,1244
#ifdef DEBUG
printf("\t-d ..... turns debug output on\n");
#endif
! printf("\t-D ..... turns doublepage output on\n");
! printf("\t-eX ..... X= outputfile\n");
! printf("\t-fX ..... print from begin of page number X\n");
#ifdef LJ
printf("\t-g ..... do not reset printer at begin of job (go)\n");
#endif
--- 1260,1270 -----
#ifdef DEBUG
fprintf(stderr,"\t-d ..... turns debug output on\n");
#endif
! fprintf(stderr,"\t-D ..... turns doublepage output on\n");
! #ifndef FILTER
! fprintf(stderr,"\t-eX ..... X= outputfile\n");
! #endif
! fprintf(stderr,"\t-fX ..... print from begin of page number X\n");
#ifdef LJ
fprintf(stderr,
"\t-g ..... do not reset printer at begin of job (go)\n");
***************
*** 1240,1246
printf("\t-eX ..... X= outputfile\n");
printf("\t-fX ..... print from begin of page number X\n");
#ifdef LJ
! printf("\t-g ..... do not reset printer at begin of job (go)\n");
#endif
printf("\t-hX ..... X= name of headerfile\n");
printf("\t-mX ..... magnification X=0;h;1;2;3;4;5;#xxxx\n");
--- 1266,1273 -----
#endif
fprintf(stderr,"\t-fX ..... print from begin of page number X\n");
#ifdef LJ
! fprintf(stderr,
! "\t-g ..... do not reset printer at begin of job (go)\n");
#endif
fprintf(stderr,"\t-hX ..... X= name of headerfile\n");
fprintf(stderr,"\t-mX ..... magnification X=0;h;1;2;3;4;5;#xxxx\n");
***************
*** 1242,1258
#ifdef LJ
printf("\t-g ..... do not reset printer at begin of job (go)\n");
#endif
! printf("\t-hX ..... X= name of headerfile\n");
! printf("\t-mX ..... magnification X=0;h;1;2;3;4;5;#xxxx\n");
! printf("\t-pX ..... print X pages\n");
! printf("\t-q ..... quiet operation\n");
! printf("\t-r ..... process pages in reverse order\n");
! printf("\t-tX ..... print to end of page number X\n");
! printf("\t-w ..... don't print out warnings\n");
! printf("\t-v ..... tell user which pixel-files are used\n");
! printf("\t-xX ..... X= x-offset on printout in mm\n");
! printf("\t-yX ..... X= y-offset on printout in mm\n");
! printf("\t-XO ..... O= x page origin in dots (default=%d)\n",
XDEFAULTOFF );
printf("\t-YO ..... O= y page origin in dots (default=%d)\n",
YDEFAULTOFF );
--- 1269,1285 -----
fprintf(stderr,
"\t-g ..... do not reset printer at begin of job (go)\n");
#endif
! fprintf(stderr,"\t-hX ..... X= name of headerfile\n");
! fprintf(stderr,"\t-mX ..... magnification X=0;h;1;2;3;4;5;#xxxx\n");
! fprintf(stderr,"\t-pX ..... print X pages\n");
! fprintf(stderr,"\t-q ..... quiet operation\n");
! fprintf(stderr,"\t-r ..... process pages in reverse order\n");
! fprintf(stderr,"\t-tX ..... print to end of page number X\n");
! fprintf(stderr,"\t-w ..... don't print out warnings\n");
! fprintf(stderr,"\t-v ..... tell user which pixel-files are used\n");
! fprintf(stderr,"\t-xX ..... X= x-offset on printout in mm\n");
! fprintf(stderr,"\t-yX ..... X= y-offset on printout in mm\n");
! fprintf(stderr,"\t-XO ..... O= x page origin in dots (default=%d)\n",
XDEFAULTOFF );
fprintf(stderr,"\t-YO ..... O= y page origin in dots (default=%d)\n",
YDEFAULTOFF );
***************
*** 1254,1260
printf("\t-yX ..... X= y-offset on printout in mm\n");
printf("\t-XO ..... O= x page origin in dots (default=%d)\n",
XDEFAULTOFF );
! printf("\t-YO ..... O= y page origin in dots (default=%d)\n",
YDEFAULTOFF );
#ifdef LJ
printf("\t-z ..... print test page with pagecounter after job\n");
--- 1281,1287 -----
fprintf(stderr,"\t-yX ..... X= y-offset on printout in mm\n");
fprintf(stderr,"\t-XO ..... O= x page origin in dots (default=%d)\n",
XDEFAULTOFF );
! fprintf(stderr,"\t-YO ..... O= y page origin in dots (default=%d)\n",
YDEFAULTOFF );
#ifdef LJ
#ifndef FILTER
***************
*** 1257,1263
printf("\t-YO ..... O= y page origin in dots (default=%d)\n",
YDEFAULTOFF );
#ifdef LJ
! printf("\t-z ..... print test page with pagecounter after job\n");
#endif
exit(1);
}
--- 1284,1292 -----
fprintf(stderr,"\t-YO ..... O= y page origin in dots (default=%d)\n",
YDEFAULTOFF );
#ifdef LJ
! #ifndef FILTER
! fprintf(stderr,
! "\t-z ..... print test page with pagecounter after job\n");
#endif
#endif
exit(1);
***************
*** 1259,1264
#ifdef LJ
printf("\t-z ..... print test page with pagecounter after job\n");
#endif
exit(1);
}
if (EQ(EmitFileName, "")) {
--- 1288,1294 -----
fprintf(stderr,
"\t-z ..... print test page with pagecounter after job\n");
#endif
+ #endif
exit(1);
}
#ifndef FILTER
***************
*** 1261,1266
#endif
exit(1);
}
if (EQ(EmitFileName, "")) {
(void) strcpy(EmitFileName, curname);
tcp1 = strchr(EmitFileName, '.');
--- 1291,1297 -----
#endif
exit(1);
}
+ #ifndef FILTER
if (EQ(EmitFileName, "")) {
(void) strcpy(EmitFileName, curname);
tcp1 = strchr(EmitFileName, '.');
***************
*** 1267,1272
*tcp1 = '\0';
strcat(EmitFileName, EMITFILE_EXTENSION);
}
}
--- 1298,1304 -----
*tcp1 = '\0';
strcat(EmitFileName, EMITFILE_EXTENSION);
}
+ #endif
}
***************
*** 1280,1288
int convResolution;
{
/*register*/ double conv;
- /* conv = ((double)den / (double)num) *
- (1000.0 / (double)mag) *
- (254000.0 / (double)convResolution) + 0.5; */
conv = ((double)num / (double)den) *
((double)mag / 1000.0) *
((double)convResolution/254000.0);
--- 1312,1317 -----
int convResolution;
{
/*register*/ double conv;
conv = ((double)num / (double)den) *
((double)mag / 1000.0) *
((double)convResolution/254000.0);
***************
*** 1443,1448
prevfont = fontptr;
}
if (fontptr->id == pk89) {
nbpl = ((ce->width) + 7) >> 3;
total = (long)ce->height * nbpl;
--- 1472,1478 -----
prevfont = fontptr;
}
+ #ifdef USEPXL
if (fontptr->id == pk89) {
nbpl = ((ce->width) + 7) >> 3;
total = (long)ce->height * nbpl;
***************
*** 1454,1460
nbpl = ((ce->width) + 7) >> 3;
total = (long)ce->height * nbpl;
}
!
/***************************************************************/
/*if ( ((char) c == 'a') && (fontptr->plusid == 8)) { */
/* printf("cols=%ld, ncols=%ld\n",nwpl,nbpl); */
--- 1484,1493 -----
nbpl = ((ce->width) + 7) >> 3;
total = (long)ce->height * nbpl;
}
! #else
! nbpl = (num_cols + 7) >> 3;
! total = num_rows * nbpl;
! #endif
/***************************************************************/
/*if ( ((char) c == 'a') && (fontptr->plusid == 8)) { */
/* printf("cols=%ld, ncols=%ld\n",nwpl,nbpl); */
***************
*** 1469,1475
/* printf("<- Now Emitting\n"); */
/* } */
/***************************************************************/
!
if ((short)(ce->height) - ce->yOffset > 55) {
ce->yyOffset = (short) ce->height - ce->yOffset;
ce->yOffset = (short) ce->height;
--- 1502,1508 -----
/* printf("<- Now Emitting\n"); */
/* } */
/***************************************************************/
! #ifdef USEPXL
if ((short)(ce->height) - ce->yOffset > 55) {
ce->yyOffset = (short) ce->height - ce->yOffset;
ce->yOffset = (short) ce->height;
***************
*** 1476,1481
} else {
ce->yyOffset = (short) 0;
}
/* ce->cw = (long)(((double)ce->tfmw / (double)hconv) +0.5); */
/* set active font to nn, load font pattern xx ... */
--- 1509,1515 -----
} else {
ce->yyOffset = (short) 0;
}
+ #endif
/* ce->cw = (long)(((double)ce->tfmw / (double)hconv) +0.5); */
/* set active font to nn, load font pattern xx ... */
#ifdef IBM3812
***************
*** 1478,1484
}
/* ce->cw = (long)(((double)ce->tfmw / (double)hconv) +0.5); */
/* set active font to nn, load font pattern xx ... */
-
#ifdef IBM3812
PMPcont(total + 9);
sprintf(PMPformat, "\323%c\360%c%c%c",
--- 1512,1517 -----
#endif
/* ce->cw = (long)(((double)ce->tfmw / (double)hconv) +0.5); */
/* set active font to nn, load font pattern xx ... */
#ifdef IBM3812
PMPcont(total + 9);
#ifdef USEPXL
***************
*** 1481,1486
#ifdef IBM3812
PMPcont(total + 9);
sprintf(PMPformat, "\323%c\360%c%c%c",
(unsigned char)fontptr->plusid,
(unsigned char)VisChar((char)c),
--- 1514,1520 -----
/* set active font to nn, load font pattern xx ... */
#ifdef IBM3812
PMPcont(total + 9);
+ #ifdef USEPXL
sprintf(PMPformat, "\323%c\360%c%c%c",
(unsigned char)fontptr->plusid,
(unsigned char)VisChar((char)c),
***************
*** 1490,1495
PMPoutC((char)(-(ce->xOffset)));
PMPoutC((char)(ce->cw - (-ce->xOffset + ce->width)));
PMPoutC((char)(ce->yOffset));
#endif
#ifdef LJ
EMIT(outfp, "\033*c%dd%dE\033(s%ldW", fontptr->plusid,
--- 1524,1539 -----
PMPoutC((char)(-(ce->xOffset)));
PMPoutC((char)(ce->cw - (-ce->xOffset + ce->width)));
PMPoutC((char)(ce->yOffset));
+ #else
+ sprintf(PMPformat, "\323%c\360%c%c%c",
+ (unsigned char)fontptr->plusid,
+ (unsigned char)VisChar((char)c),
+ (unsigned char)num_rows,
+ (unsigned char)num_cols);
+ PMPout(6, PMPformat);
+ PMPoutC((char)(-x_offset));
+ PMPoutC((char)(ce->cw - (-x_offset + num_cols)));
+ PMPoutC((char)num_rows-y_offset);
#endif
#endif
#ifdef LJ
***************
*** 1491,1496
PMPoutC((char)(ce->cw - (-ce->xOffset + ce->width)));
PMPoutC((char)(ce->yOffset));
#endif
#ifdef LJ
EMIT(outfp, "\033*c%dd%dE\033(s%ldW", fontptr->plusid,
(unsigned int)VisChar((char)c), (long)(total + 16));
--- 1535,1541 -----
PMPoutC((char)(ce->cw - (-x_offset + num_cols)));
PMPoutC((char)num_rows-y_offset);
#endif
+ #endif
#ifdef LJ
EMIT(outfp, "\033*c%dd%dE\033(s%ldW", fontptr->plusid,
(unsigned int)VisChar((char)c), (long)(total + 16));
***************
*** 1495,1500
EMIT(outfp, "\033*c%dd%dE\033(s%ldW", fontptr->plusid,
(unsigned int)VisChar((char)c), (long)(total + 16));
EMITB(6, "\4\0\016\1\0\0");
EMITWORD(-(ce->xOffset));
EMITWORD(ce->yOffset);
EMITWORD(ce->width);
--- 1540,1546 -----
EMIT(outfp, "\033*c%dd%dE\033(s%ldW", fontptr->plusid,
(unsigned int)VisChar((char)c), (long)(total + 16));
EMITB(6, "\4\0\016\1\0\0");
+ #ifdef USEPXL
EMITWORD(-(ce->xOffset));
EMITWORD(ce->yOffset);
EMITWORD(ce->width);
***************
*** 1499,1504
EMITWORD(ce->yOffset);
EMITWORD(ce->width);
EMITWORD(ce->height);
EMITWORD((int)ce->cw * 4);
#endif
if (fontptr->id == pk89)
--- 1545,1556 -----
EMITWORD(ce->yOffset);
EMITWORD(ce->width);
EMITWORD(ce->height);
+ #else
+ EMITWORD(-x_offset);
+ EMITWORD(num_rows-y_offset);
+ EMITWORD(num_cols);
+ EMITWORD(num_rows);
+ #endif
EMITWORD((int)ce->cw * 4);
#endif
#ifdef USEPXL
***************
*** 1501,1506
EMITWORD(ce->height);
EMITWORD((int)ce->cw * 4);
#endif
if (fontptr->id == pk89)
PkRaster(ce, FALSE);
else if (fontptr->id == id1002)
--- 1553,1559 -----
#endif
EMITWORD((int)ce->cw * 4);
#endif
+ #ifdef USEPXL
if (fontptr->id == pk89)
PkRaster(ce, FALSE);
else if (fontptr->id == id1002)
***************
*** 1515,1520
i * nwpl);
EMITL(nbpl, sl);
}
#ifdef IBM3812
used_fontstorage += (long)ce->height * ((ce->width + 15) >> 4)
*2 + 14;
--- 1568,1579 -----
i * nwpl);
EMITL(nbpl, sl);
}
+ #else
+ for (i = num_rows; i > 0; i--)
+ {
+ EMITL (nbpl, bits + (i-1) * nbpl);
+ }
+ #endif
#ifdef IBM3812
#ifdef USEPXL
used_fontstorage += (long)ce->height * ((ce->width + 15) >> 4)
***************
*** 1516,1521
EMITL(nbpl, sl);
}
#ifdef IBM3812
used_fontstorage += (long)ce->height * ((ce->width + 15) >> 4)
*2 + 14;
#endif
--- 1575,1581 -----
}
#endif
#ifdef IBM3812
+ #ifdef USEPXL
used_fontstorage += (long)ce->height * ((ce->width + 15) >> 4)
*2 + 14;
#else
***************
*** 1518,1523
#ifdef IBM3812
used_fontstorage += (long)ce->height * ((ce->width + 15) >> 4)
*2 + 14;
#endif
fontptr->ncdl += 1;
}
--- 1578,1586 -----
#ifdef USEPXL
used_fontstorage += (long)ce->height * ((ce->width + 15) >> 4)
*2 + 14;
+ #else
+ used_fontstorage += (long)num_rows * ((num_cols + 15) >> 4)
+ *2 + 14;
#endif
#endif
#ifdef LJ
***************
*** 1519,1524
used_fontstorage += (long)ce->height * ((ce->width + 15) >> 4)
*2 + 14;
#endif
fontptr->ncdl += 1;
}
--- 1582,1595 -----
used_fontstorage += (long)num_rows * ((num_cols + 15) >> 4)
*2 + 14;
#endif
+ #endif
+ #ifdef LJ
+ #ifdef USEPXL
+ used_fontstorage += 64 * ((((ce->height * ce->width) - 1) / 64) + 1);
+ #else
+ used_fontstorage += 64 * ((((num_rows * num_cols) - 1) / 64) + 1);
+ #endif
+ #endif
fontptr->ncdl += 1;
}
***************
*** 1538,1543
static unsigned short maxlines;
if (current_line == 0) {
maxlines = ce->height;
MoveVert(-ce->yOffset); /* move cursor up */
--- 1609,1615 -----
static unsigned short maxlines;
if (current_line == 0) {
+ #ifdef USEPXL
maxlines = ce->height;
MoveVert(-ce->yOffset); /* move cursor up */
***************
*** 1542,1547
MoveVert(-ce->yOffset); /* move cursor up */
MoveHor(-ce->xOffset); /* move cursor right */
last_ry = UNKNOWN; /* next time full positioning */
}
--- 1614,1625 -----
MoveVert(-ce->yOffset); /* move cursor up */
MoveHor(-ce->xOffset); /* move cursor right */
+ #else
+ maxlines = num_rows;
+
+ MoveVert(-(num_rows-y_offset)); /* move cursor up */
+ MoveHor(-x_offset); /* move cursor right */
+ #endif
last_ry = UNKNOWN; /* next time full positioning */
}
***************
*** 1550,1555
MoveVert(maxlines); /* move cursor down */
last_ry = UNKNOWN; /* next time full positioning */
}
total = (long)(ce->height - current_line) * (long)nbpl;
if ((total + 9) > 65535) {
maxlines = (unsigned short)((65535 - 9) / nbpl);
--- 1628,1634 -----
MoveVert(maxlines); /* move cursor down */
last_ry = UNKNOWN; /* next time full positioning */
}
+ #ifdef USEPXL
total = (long)(ce->height - current_line) * (long)nbpl;
#else
total = (long)(num_rows - current_line) * (long)nbpl;
***************
*** 1551,1556
last_ry = UNKNOWN; /* next time full positioning */
}
total = (long)(ce->height - current_line) * (long)nbpl;
if ((total + 9) > 65535) {
maxlines = (unsigned short)((65535 - 9) / nbpl);
total = (long)maxlines * (long)nbpl;
--- 1630,1638 -----
}
#ifdef USEPXL
total = (long)(ce->height - current_line) * (long)nbpl;
+ #else
+ total = (long)(num_rows - current_line) * (long)nbpl;
+ #endif
if ((total + 9) > 65535) {
maxlines = (unsigned short)((65535 - 9) / nbpl);
total = (long)maxlines * (long)nbpl;
***************
*** 1559,1564
PMPcont(total + 9);
PMPout(2, "\365\0");
EMITWORD(maxlines);
EMITWORD(ce->width);
PMPoutC((unsigned char) (total >> 16) & 0xFF);
PMPoutC((unsigned char) (total >> 8 ) & 0xFF);
--- 1641,1647 -----
PMPcont(total + 9);
PMPout(2, "\365\0");
EMITWORD(maxlines);
+ #ifdef USEPXL
EMITWORD(ce->width);
#else
EMITWORD(num_cols);
***************
*** 1560,1565
PMPout(2, "\365\0");
EMITWORD(maxlines);
EMITWORD(ce->width);
PMPoutC((unsigned char) (total >> 16) & 0xFF);
PMPoutC((unsigned char) (total >> 8 ) & 0xFF);
PMPoutC((unsigned char) total & 0xFF);
--- 1643,1651 -----
EMITWORD(maxlines);
#ifdef USEPXL
EMITWORD(ce->width);
+ #else
+ EMITWORD(num_cols);
+ #endif
PMPoutC((unsigned char) (total >> 16) & 0xFF);
PMPoutC((unsigned char) (total >> 8 ) & 0xFF);
PMPoutC((unsigned char) total & 0xFF);
***************
*** 1595,1601
#ifdef DEBUG
if (Debug)
! printf("Raster character <%c>... \n", (char) c);
#endif
--- 1681,1687 -----
#ifdef DEBUG
if (Debug)
! fprintf(stderr,"Raster character <%c>... \n", (char) c);
#endif
#ifdef USEPXL
***************
*** 1598,1604
printf("Raster character <%c>... \n", (char) c);
#endif
!
if (fontptr->id == pk89) {
nbpl = ((ce->width) + 7) >> 3;
} else if (fontptr->id == id1002) {
--- 1684,1690 -----
fprintf(stderr,"Raster character <%c>... \n", (char) c);
#endif
! #ifdef USEPXL
if (fontptr->id == pk89) {
nbpl = ((ce->width) + 7) >> 3;
} else if (fontptr->id == id1002) {
***************
*** 1607,1612
nwpl = ( ce->width + 31) >> 5;
nbpl = ( ce->width + 7) >> 3;
}
#ifdef LJ
EMIT(outfp, "\033*t300R\033*r1A");
--- 1693,1701 -----
nwpl = ( ce->width + 31) >> 5;
nbpl = ( ce->width + 7) >> 3;
}
+ #else
+ nbpl = (num_cols + 7) >> 3;
+ #endif
#ifdef LJ
EMIT(outfp, "\033*t300R\033*r1A");
***************
*** 1614,1619
if (ce->charsize == HUGE_SIZE) { /* read pixel from file */
OpenFontFile();
fseek(pxlfp, ce->where.address.fileOffset, 0);
}
--- 1703,1709 -----
if (ce->charsize == HUGE_SIZE) { /* read pixel from file */
OpenFontFile();
+ #ifdef USEPXL
fseek(pxlfp, ce->where.address.fileOffset, 0);
#else
fseek(gfin, ce->where.address.fileOffset, 0);
***************
*** 1615,1620
if (ce->charsize == HUGE_SIZE) { /* read pixel from file */
OpenFontFile();
fseek(pxlfp, ce->where.address.fileOffset, 0);
}
if (fontptr->id == pk89)
--- 1705,1715 -----
OpenFontFile();
#ifdef USEPXL
fseek(pxlfp, ce->where.address.fileOffset, 0);
+ #else
+ fseek(gfin, ce->where.address.fileOffset, 0);
+ gettochar();
+ readbits();
+ #endif
}
#ifdef USEPXL
***************
*** 1616,1622
OpenFontFile();
fseek(pxlfp, ce->where.address.fileOffset, 0);
}
!
if (fontptr->id == pk89)
PkRaster(ce, TRUE);
else if (fontptr->id == id1002) {
--- 1711,1718 -----
readbits();
#endif
}
!
! #ifdef USEPXL
if (fontptr->id == pk89)
PkRaster(ce, TRUE);
else if (fontptr->id == id1002) {
***************
*** 1650,1655
RasterLine(ce, (unsigned int)nbpl, i, sl);
}
}
#ifdef LJ
EMIT(outfp, "\033*rB");
#endif
--- 1746,1755 -----
RasterLine(ce, (unsigned int)nbpl, i, sl);
}
}
+ #else
+ for (i = num_rows; i > 0; i--)
+ RasterLine(ce, (unsigned int)nbpl, i, bits + (i-1) * nbpl);
+ #endif
#ifdef LJ
EMIT(outfp, "\033*rB");
#endif
***************
*** 1921,1927
#ifdef DEBUG
if (Debug)
! printf("open font file\n");
#endif
if (pfontptr == fontptr)
return; /* we need not have been called */
--- 2021,2027 -----
#ifdef DEBUG
if (Debug)
! fprintf(stderr,"open font file %d\n", fontptr->font_file_id);
#endif
if (pfontptr == fontptr)
return; /* we need not have been called */
***************
*** 1973,1979
}
#ifdef DEBUG
if (Debug)
! printf("\n__reuse slot %d\n", least_used);
#endif
current = least_used;
}
--- 2073,2079 -----
}
#ifdef DEBUG
if (Debug)
! fprintf(stderr,"\n__reuse slot %d\n", least_used);
#endif
current = least_used;
}
***************
*** 1983,1989
pxlfp = NO_FILE;
} else {
#ifdef DEBUG
! if (Debug) printf(
"Opening File <%s> /%x/, Size(font_entry)=%d\n",
fontptr->name, pxlfp, sizeof(struct font_entry ));
#endif
--- 2083,2089 -----
pxlfp = NO_FILE;
} else {
#ifdef DEBUG
! if (Debug) fprintf(stderr,
"Opening File <%s> /%x/, Size(font_entry)=%d\n",
fontptr->name, pxlfp, sizeof(struct font_entry ));
#endif
***************
*** 1994,1999
pfontptr = fontptr; /* make previous = current font */
fontptr->font_file_id = pxlfp; /* set file identifier */
pixel_files[current].use_count++; /* update reference count */
}
--- 2094,2102 -----
pfontptr = fontptr; /* make previous = current font */
fontptr->font_file_id = pxlfp; /* set file identifier */
pixel_files[current].use_count++; /* update reference count */
+ #ifndef USEPXL
+ gfin = pxlfp;
+ #endif
}
***************
*** 2006,2013
long x; /* in DVI units */
long conv; /* conversion factor */
{
- /* return((long)((((double)x + (double)(conv >> 1)) / (double)conv)
- + 0.5)); */
return((x + conv) / conv);
}
--- 2109,2114 -----
long x; /* in DVI units */
long conv; /* conversion factor */
{
return((x + conv) / conv);
}
***************
*** 2022,2028
{
long t;
unsigned short i;
! char n[STRSIZE];
struct font_entry *tfontptr; /* temporary font_entry pointer */
struct char_entry *tcharptr; /* temporary char_entry pointer */
static int plusid = 1;
--- 2123,2130 -----
{
long t;
unsigned short i;
! char nname[STRSIZE];
! int nmag;
struct font_entry *tfontptr; /* temporary font_entry pointer */
struct char_entry *tcharptr; /* temporary char_entry pointer */
static int plusid = 1;
***************
*** 2029,2035
bool font_found = FALSE;
#ifdef DEBUG
if (Debug)
! printf("Mallocating %d Bytes)...\n",
sizeof(struct font_entry ));
#endif
--- 2131,2137 -----
bool font_found = FALSE;
#ifdef DEBUG
if (Debug)
! fprintf(stderr,"Mallocating %d Bytes)...\n",
sizeof(struct font_entry ));
#endif
***************
*** 2049,2056
tfontptr->a = (int) NoSignExtend(dvifp, 1); /* length for font name */
tfontptr->l = (int) NoSignExtend(dvifp, 1); /* device length */
! GetBytes(dvifp, n, tfontptr->a + tfontptr->l);
! n[tfontptr->a+tfontptr->l] = '\0';
/* tfontptr->font_space = tfontptr->s/6;*/ /* never used */
tfontptr->font_mag = (long)((
--- 2151,2158 -----
tfontptr->a = (int) NoSignExtend(dvifp, 1); /* length for font name */
tfontptr->l = (int) NoSignExtend(dvifp, 1); /* device length */
! GetBytes(dvifp, tfontptr->n, tfontptr->a + tfontptr->l);
! tfontptr->n[tfontptr->a+tfontptr->l] = '\0';
/* tfontptr->font_space = tfontptr->s/6;*/ /* never used */
tfontptr->font_mag = (long)((
***************
*** 2056,2061
tfontptr->font_mag = (long)((
ActualFactor((long)(1000.0*tfontptr->s/(double)tfontptr->d+0.5))
* ActualFactor(mag)
* RESOLUTION * 5.0
) + 0.5);
/*
--- 2158,2164 -----
tfontptr->font_mag = (long)((
ActualFactor((long)(1000.0*tfontptr->s/(double)tfontptr->d+0.5))
* ActualFactor(mag)
+ #ifdef USEPXL
* RESOLUTION * 5.0
#else
* RESOLUTION
***************
*** 2057,2062
ActualFactor((long)(1000.0*tfontptr->s/(double)tfontptr->d+0.5))
* ActualFactor(mag)
* RESOLUTION * 5.0
) + 0.5);
/*
printf("[%ld]=%lf * %lf * %lf + 0.5 = %ld\n",
--- 2160,2168 -----
* ActualFactor(mag)
#ifdef USEPXL
* RESOLUTION * 5.0
+ #else
+ * RESOLUTION
+ #endif
) + 0.5);
/*
printf("[%ld]=%lf * %lf * %lf + 0.5 = %ld\n",
***************
*** 2067,2082
tfontptr->font_mag );
*/
! /*
! tfontptr->font_mag =
! (long)((ActualFactor((long)(((double)tfontptr->s
! /(double)tfontptr->d)
! *1000.0 ))
! *ActualFactor(mag) *
! (double)RESOLUTION * 5.0) + 0.5);
! */
! /* *1000.0 + 0.5)) */
!
if (!(font_found =
findfile(PXLpath, n, tfontptr->font_mag, tfontptr->name))) {
Warning(tfontptr->name); /* contains error messsage */
--- 2173,2179 -----
tfontptr->font_mag );
*/
! #ifdef unix
if (!(font_found =
findfile(&PXLpath, 1, "", tfontptr->n, tfontptr->font_mag,
tfontptr->name, nname, &nmag))) {
***************
*** 2078,2084
/* *1000.0 + 0.5)) */
if (!(font_found =
! findfile(PXLpath, n, tfontptr->font_mag, tfontptr->name))) {
Warning(tfontptr->name); /* contains error messsage */
tfontptr->font_file_id = NO_FILE;
}
--- 2175,2187 -----
#ifdef unix
if (!(font_found =
! findfile(&PXLpath, 1, "", tfontptr->n, tfontptr->font_mag,
! tfontptr->name, nname, &nmag))) {
! Warning("no font %s.d",tfontptr->n, mag);
! }
! #else
! if (!(font_found =
! findfile(PXLpath, tfontptr->n, tfontptr->fontmag, tfontptr->name))) {
Warning(tfontptr->name); /* contains error messsage */
tfontptr->font_file_id = NO_FILE;
}
***************
*** 2082,2087
Warning(tfontptr->name); /* contains error messsage */
tfontptr->font_file_id = NO_FILE;
}
else
if (!( (G_noverbatim) || (G_quiet) ) )
printf("%d: using font <%s>\n",
--- 2185,2191 -----
Warning(tfontptr->name); /* contains error messsage */
tfontptr->font_file_id = NO_FILE;
}
+ #endif
else
if (!( (G_noverbatim) || (G_quiet) ) )
fprintf(stderr,"%d: using font <%s>\n",
***************
*** 2084,2090
}
else
if (!( (G_noverbatim) || (G_quiet) ) )
! printf("%d: using font <%s>\n",
plusid,tfontptr->name);
/* sprintf(tfontptr->psname,"%s.%ld.%d",
--- 2188,2194 -----
#endif
else
if (!( (G_noverbatim) || (G_quiet) ) )
! fprintf(stderr,"%d: using font <%s>\n",
plusid,tfontptr->name);
/* sprintf(tfontptr->psname,"%s.%ld.%d",
***************
*** 2103,2108
else
pxlfp = NO_FILE;
}
if ( pxlfp == NO_FILE ) { /* allow missing pxl files */
tfontptr->magnification = 0;
tfontptr->designsize = 0;
--- 2207,2213 -----
else
pxlfp = NO_FILE;
}
+ #ifdef USEPXL
if ( pxlfp == NO_FILE ) { /* allow missing pxl files */
tfontptr->magnification = 0;
tfontptr->designsize = 0;
***************
*** 2106,2112
if ( pxlfp == NO_FILE ) { /* allow missing pxl files */
tfontptr->magnification = 0;
tfontptr->designsize = 0;
! for (i = FIRSTPXLCHAR; i <= LASTPXLCHAR; i++) {
tcharptr = &(tfontptr->ch[i]);
tcharptr->width = 0;
tcharptr->height = 0;
--- 2211,2220 -----
if ( pxlfp == NO_FILE ) { /* allow missing pxl files */
tfontptr->magnification = 0;
tfontptr->designsize = 0;
! for (i = FIRSTFNTCHAR; i <= LASTFNTCHAR; i++) {
! #else
! for (i = FIRSTFNTCHAR; i <= LASTFNTCHAR; i++) {
! #endif
tcharptr = &(tfontptr->ch[i]);
#ifdef USEPXL
tcharptr->width = 0;
***************
*** 2108,2113
tfontptr->designsize = 0;
for (i = FIRSTPXLCHAR; i <= LASTPXLCHAR; i++) {
tcharptr = &(tfontptr->ch[i]);
tcharptr->width = 0;
tcharptr->height = 0;
tcharptr->xOffset = 0;
--- 2216,2222 -----
for (i = FIRSTFNTCHAR; i <= LASTFNTCHAR; i++) {
#endif
tcharptr = &(tfontptr->ch[i]);
+ #ifdef USEPXL
tcharptr->width = 0;
tcharptr->height = 0;
tcharptr->xOffset = 0;
***************
*** 2112,2117
tcharptr->height = 0;
tcharptr->xOffset = 0;
tcharptr->yOffset = 0;
tcharptr->where.isloaded = FALSE;
tcharptr->where.address.fileOffset = NONEXISTANT;
tcharptr->tfmw = 0;
--- 2221,2227 -----
tcharptr->height = 0;
tcharptr->xOffset = 0;
tcharptr->yOffset = 0;
+ #endif
tcharptr->where.isloaded = FALSE;
tcharptr->where.address.fileOffset = NONEXISTANT;
tcharptr->tfmw = 0;
***************
*** 2116,2121
tcharptr->where.address.fileOffset = NONEXISTANT;
tcharptr->tfmw = 0;
}
return;
}
t = (long) NoSignExtend(pxlfp, 1);
--- 2226,2232 -----
tcharptr->where.address.fileOffset = NONEXISTANT;
tcharptr->tfmw = 0;
}
+ #ifdef USEPXL
return;
}
t = (long) NoSignExtend(pxlfp, 1);
***************
*** 2159,2165
else
fseek(pxlfp, (long) NoSignExtend(pxlfp, 4) , 0);
! for (i = FIRSTPXLCHAR; i <= LASTPXLCHAR; i++) {
tcharptr = &(tfontptr->ch[i]);
tcharptr->width =
(unsigned short) NoSignExtend(pxlfp, 2);
--- 2270,2276 -----
else
fseek(pxlfp, (long) NoSignExtend(pxlfp, 4) , 0);
! for (i = FIRSTFNTCHAR; i <= LASTFNTCHAR; i++) {
tcharptr = &(tfontptr->ch[i]);
tcharptr->width =
(unsigned short) NoSignExtend(pxlfp, 2);
***************
*** 2194,2200
long hppp, vppp, pkloc, packet_length, temp;
int car, ii;
! for (i = FIRSTPXLCHAR; i <= LASTPXLCHAR; i++) {
tcharptr = &(tfontptr->ch[i]);
tcharptr->width = 0;
tcharptr->height = 0;
--- 2305,2311 -----
long hppp, vppp, pkloc, packet_length, temp;
int car, ii;
! for (i = FIRSTFNTCHAR; i <= LASTFNTCHAR; i++) {
tcharptr = &(tfontptr->ch[i]);
tcharptr->width = 0;
tcharptr->height = 0;
***************
*** 2212,2218
1);
#ifdef DEBUG
if (Debug)
! fprintf(stdout, "%c", flag_byte ) ;
#endif
}
#ifdef DEBUG
--- 2323,2329 -----
1);
#ifdef DEBUG
if (Debug)
! fprintf(stderr, "%c", flag_byte ) ;
#endif
}
#ifdef DEBUG
***************
*** 2217,2223
}
#ifdef DEBUG
if (Debug)
! fprintf(stdout, "\n");
#endif
pkloc = 3 + (int)temp_byte;
--- 2328,2334 -----
}
#ifdef DEBUG
if (Debug)
! fprintf(stderr, "\n");
#endif
pkloc = 3 + (int)temp_byte;
***************
*** 2246,2252
"\7\7\7 This PK-Packet type is NOT IMPLEMENTED!\n");
} else if (flag_byte & 4) {
! /*fprintf(stdout,"Read extended short character preamble\n");*/
packet_length = ((long) flag_byte & 3) *
65536l +
--- 2357,2363 -----
"\7\7\7 This PK-Packet type is NOT IMPLEMENTED!\n");
} else if (flag_byte & 4) {
! /*fprintf(stderr,"Read extended short character preamble\n");*/
packet_length = ((long) flag_byte & 3) *
65536l +
***************
*** 2276,2282
(short) SignExtend(pxlfp, 2);
tcharptr ->where.isloaded = FALSE;
} else {
! /* fprintf(stdout,"<Read short character preamble@>\n");*/
packet_length = ((long)flag_byte & 3) *
256 +
NoSignExtend(pxlfp, 1) ;
--- 2387,2393 -----
(short) SignExtend(pxlfp, 2);
tcharptr ->where.isloaded = FALSE;
} else {
! /* fprintf(stderr,"<Read short character preamble@>\n");*/
packet_length = ((long)flag_byte & 3) *
256 +
NoSignExtend(pxlfp, 1) ;
***************
*** 2321,2327
tcharptr->flag_byte = flag_byte;
fseek(pxlfp, (long) pkloc, 0);
! /*fprintf(stdout,"new pkloc is %ld\n",pkloc);*/
flag_byte = skip_specials(&pkloc);
} /* end of while */
--- 2432,2438 -----
tcharptr->flag_byte = flag_byte;
fseek(pxlfp, (long) pkloc, 0);
! /*fprintf(stderr,"new pkloc is %ld\n",pkloc);*/
flag_byte = skip_specials(&pkloc);
} /* end of while */
***************
*** 2326,2332
} /* end of while */
!
/*****************************************************************************/
/*if (tcharptr->charsize==LARGE_SIZE) */
/* printf("%d:\t <%c> w=%d h=%d xO=%d yO=%d tfmw=%ld cw=%ld %d\n", */
--- 2437,2461 -----
} /* end of while */
! #else
! if ( pxlfp == NO_FILE ) /* allow missing pxl files */
! return;
!
! gfin = pxlfp;
! seekpost();
! readpost();
! if ((tfontptr->c != 0) && (checksum != 0) && (tfontptr->c != checksum))
! Warning("font = \"%s\",\n-->font checksum = %d,\n-->dvi checksum = %d",
! tfontptr->name, tfontptr->c, checksum);
!
! for(i=FIRSTFNTCHAR; i<=LASTFNTCHAR; i++) {
! if (char_exists[i]) {
! tcharptr = &(tfontptr->ch[i]);
! tcharptr->tfmw = ((float)tfm_wd[i]*(float)tfontptr->s) /
! (float)(1<<20);
! tcharptr->where.address.fileOffset = char_pointer[i];
! }
! #endif
/*****************************************************************************/
/*if (tcharptr->charsize==LARGE_SIZE) */
/* printf("%d:\t <%c> w=%d h=%d xO=%d yO=%d tfmw=%ld cw=%ld %d\n", */
***************
*** 2355,2361
case 242:
case 243 :
{
! /*fprintf(stdout,"flagbyte = %d\n",(int)flag_byte);*/
i = 0 ;
for (j = 240; j <= (long)flag_byte;
j++) {
--- 2484,2490 -----
case 242:
case 243 :
{
! /*fprintf(stderr,"flagbyte = %d\n",(int)flag_byte);*/
i = 0 ;
for (j = 240; j <= (long)flag_byte;
j++) {
***************
*** 2416,2422
Fatal ("POST missing at head of postamble");
#ifdef DEBUG
if (Debug)
! printf("got POST command\n");
#endif
ppagep = NoSignExtend(dvifp, 4);
num = NoSignExtend(dvifp, 4);
--- 2545,2551 -----
Fatal ("POST missing at head of postamble");
#ifdef DEBUG
if (Debug)
! fprintf(stderr,"got POST command\n");
#endif
ppagep = NoSignExtend(dvifp, 4);
num = NoSignExtend(dvifp, 4);
***************
*** 2437,2443
/* the DVI file */
#ifdef DEBUG
if (Debug)
! printf("now reading font defs");
#endif
if (load)
GetFontDef ();
--- 2566,2572 -----
/* the DVI file */
#ifdef DEBUG
if (Debug)
! fprintf(stderr,"now reading font defs");
#endif
if (load)
GetFontDef ();
***************
*** 2461,2467
ptr->where.isloaded = TRUE;
return;
}
!
OpenFontFile();
fseek(pxlfp, ptr->where.address.fileOffset, 0);
--- 2590,2596 -----
ptr->where.isloaded = TRUE;
return;
}
!
OpenFontFile();
#ifdef DEBUG
***************
*** 2463,2468
}
OpenFontFile();
fseek(pxlfp, ptr->where.address.fileOffset, 0);
/***************************************************/
--- 2592,2605 -----
}
OpenFontFile();
+
+ #ifdef DEBUG
+ if (Debug)
+ fprintf(stderr, "LoadAChar: <%c> from file at pos %ld\n",
+ (char)c,ptr->where.address.fileOffset);
+ #endif
+
+ #ifdef USEPXL
fseek(pxlfp, ptr->where.address.fileOffset, 0);
if (fontptr->id == pk89) {
***************
*** 2465,2475
OpenFontFile();
fseek(pxlfp, ptr->where.address.fileOffset, 0);
- /***************************************************/
- /*printf("LoadAChar: <%c> from file at pos %ld\n", */
- /* (char)c,ptr->where.address.fileOffset); */
- /***************************************************/
-
if (fontptr->id == pk89) {
#ifdef PARANOIA
unsigned char temp;
--- 2602,2607 -----
#ifdef USEPXL
fseek(pxlfp, ptr->where.address.fileOffset, 0);
if (fontptr->id == pk89) {
#ifdef PARANOIA
unsigned char temp;
***************
*** 2474,2480
#ifdef PARANOIA
unsigned char temp;
temp = (unsigned short) NoSignExtend(pxlfp, 1);
!
if ((int)ptr->flag_byte != (int)temp)
) {
Fatal("oh boy! old flag %d, new flag %d\n",
--- 2606,2612 -----
#ifdef PARANOIA
unsigned char temp;
temp = (unsigned short) NoSignExtend(pxlfp, 1);
!
if ((int)ptr->flag_byte != (int)temp)
) {
Fatal("oh boy! old flag %d, new flag %d\n",
***************
*** 2490,2496
* 256 + NoSignExtend(pxlfp, 1) - 8;
fseek(pxlfp, ptr->where.address.fileOffset + 10, 0);
}
! } else if (fontptr->id == id1002)
bytes = ((( (long)ptr->width + 7) >> 3) * (long) ptr->height);
else if (fontptr->id == id1001)
bytes = 4 * (((long)ptr->width + 31) >> 5) * (long)ptr->height;
--- 2622,2628 -----
* 256 + NoSignExtend(pxlfp, 1) - 8;
fseek(pxlfp, ptr->where.address.fileOffset + 10, 0);
}
! } else if (fontptr->id == id1002)
bytes = ((( (long)ptr->width + 7) >> 3) * (long) ptr->height);
else if (fontptr->id == id1001)
bytes = 4 * (((long)ptr->width + 31) >> 5) * (long)ptr->height;
***************
*** 2494,2499
bytes = ((( (long)ptr->width + 7) >> 3) * (long) ptr->height);
else if (fontptr->id == id1001)
bytes = 4 * (((long)ptr->width + 31) >> 5) * (long)ptr->height;
if (bytes > HUGE_CHAR_PATTERN) { /* do NOT load Huge characters */
--- 2626,2632 -----
bytes = ((( (long)ptr->width + 7) >> 3) * (long) ptr->height);
else if (fontptr->id == id1001)
bytes = 4 * (((long)ptr->width + 31) >> 5) * (long)ptr->height;
+
if (bytes > HUGE_CHAR_PATTERN) { /* do NOT load Huge characters */
qfprintf(stderr,"Huge Character <%c> (%ld Bytes)\n", (char)c, bytes);
***************
*** 2495,2501
else if (fontptr->id == id1001)
bytes = 4 * (((long)ptr->width + 31) >> 5) * (long)ptr->height;
-
if (bytes > HUGE_CHAR_PATTERN) { /* do NOT load Huge characters */
qprintf("Huge Character <%c> (%ld Bytes)\n", (char)c, bytes);
ptr->charsize = HUGE_SIZE;
--- 2628,2633 -----
bytes = 4 * (((long)ptr->width + 31) >> 5) * (long)ptr->height;
if (bytes > HUGE_CHAR_PATTERN) { /* do NOT load Huge characters */
qfprintf(stderr,"Huge Character <%c> (%ld Bytes)\n", (char)c, bytes);
ptr->charsize = HUGE_SIZE;
***************
*** 2497,2503
if (bytes > HUGE_CHAR_PATTERN) { /* do NOT load Huge characters */
! qprintf("Huge Character <%c> (%ld Bytes)\n", (char)c, bytes);
ptr->charsize = HUGE_SIZE;
ptr->where.isloaded = FALSE;
} else {
--- 2629,2635 -----
if (bytes > HUGE_CHAR_PATTERN) { /* do NOT load Huge characters */
! qfprintf(stderr,"Huge Character <%c> (%ld Bytes)\n", (char)c, bytes);
ptr->charsize = HUGE_SIZE;
ptr->where.isloaded = FALSE;
} else {
***************
*** 2505,2515
Fatal("Unable to allocate %ld bytes for char <%c>\n",
bytes, (char)c);
#ifdef DEBUG
! /* if (Debug) */
! printf(
! "Allocating Char <%c>, FileOffset=%lX, Bytes=%ld (%d) <%d>\n",
! (char) c, ptr->where.address.fileOffset, bytes,
! (int)bytes, (unsigned int)bytes);
#endif
allocated_storage += bytes;
fread(pr, 1, (int) bytes , pxlfp);
--- 2637,2647 -----
Fatal("Unable to allocate %ld bytes for char <%c>\n",
bytes, (char)c);
#ifdef DEBUG
! if (Debug)
! fprintf(stderr,
! "Allocating Char <%c>, FileOffset=%lX, Bytes=%ld (%d) <%d>\n",
! (char) c, ptr->where.address.fileOffset, bytes,
! (int)bytes, (unsigned int)bytes);
#endif
allocated_storage += bytes;
fread(pr, 1, (int) bytes , pxlfp);
***************
*** 2515,2521
fread(pr, 1, (int) bytes , pxlfp);
ptr->where.address.pixptr = pr;
}
!
ptr->where.isloaded = TRUE;
if ((ptr->charsize != SMALL_SIZE)
#ifdef LJ
--- 2647,2659 -----
fread(pr, 1, (int) bytes , pxlfp);
ptr->where.address.pixptr = pr;
}
! #else
! fseek(gfin, ptr->where.address.fileOffset, 0);
! gettochar();
! readbits();
! if (num_bytes > HUGE_CHAR_PATTERN)
! ptr->charsize = HUGE_SIZE;
! #endif
ptr->where.isloaded = TRUE;
if ((ptr->charsize != SMALL_SIZE)
#ifdef LJ
***************
*** 2524,2529
)
return;
EmitChar(c, ptr);
/* we should really free the space used by the PXL data after this
point, but it is not large, and besides, we may want to be
more clever in the future, about sending bitmaps. So keep
--- 2662,2668 -----
)
return;
EmitChar(c, ptr);
+ #ifdef USEPXL
/* we should really free the space used by the PXL data after this
point, but it is not large, and besides, we may want to be
more clever in the future, about sending bitmaps. So keep
***************
*** 2528,2533
point, but it is not large, and besides, we may want to be
more clever in the future, about sending bitmaps. So keep
the data around */
}
/*-->SetChar*/
/**********************************************************************/
--- 2667,2673 -----
point, but it is not large, and besides, we may want to be
more clever in the future, about sending bitmaps. So keep
the data around */
+ #endif
}
/*-->SetChar*/
/**********************************************************************/
***************
*** 2552,2558
if (do_posn) {
#ifdef IBM3812
if (CharStringPos>0) {
! printf("!!!! That should never happen!!!\n");
CharStringOut;
}
#endif
--- 2692,2698 -----
if (do_posn) {
#ifdef IBM3812
if (CharStringPos>0) {
! fprintf(stderr,"!!!! That should never happen!!!\n");
CharStringOut;
}
#endif
***************
*** 2586,2591
if (!do_posn)
SetPosn(h, v);
sign = '+';
tmp = (int) -ptr->yOffset;
if (tmp < 0)
sign = '-', tmp = -tmp;
--- 2726,2732 -----
if (!do_posn)
SetPosn(h, v);
sign = '+';
+ #ifdef USEPXL
tmp = (int) -ptr->yOffset;
#else
tmp = (int) num_rows-y_offset;
***************
*** 2587,2592
SetPosn(h, v);
sign = '+';
tmp = (int) -ptr->yOffset;
if (tmp < 0)
sign = '-', tmp = -tmp;
EMIT(outfp, "\033*p%c%dY", sign, tmp);
--- 2728,2736 -----
sign = '+';
#ifdef USEPXL
tmp = (int) -ptr->yOffset;
+ #else
+ tmp = (int) num_rows-y_offset;
+ #endif
if (tmp < 0)
sign = '-', tmp = -tmp;
EMIT(outfp, "\033*p%c%dY", sign, tmp);
***************
*** 2591,2596
sign = '-', tmp = -tmp;
EMIT(outfp, "\033*p%c%dY", sign, tmp);
sign = '+';
tmp = (int) -ptr->xOffset;
if (tmp < 0)
sign = '-', tmp = -tmp;
--- 2735,2741 -----
sign = '-', tmp = -tmp;
EMIT(outfp, "\033*p%c%dY", sign, tmp);
sign = '+';
+ #ifdef USEPXL
tmp = (int) -ptr->xOffset;
#else
tmp = (int) -x_offset;
***************
*** 2592,2597
EMIT(outfp, "\033*p%c%dY", sign, tmp);
sign = '+';
tmp = (int) -ptr->xOffset;
if (tmp < 0)
sign = '-', tmp = -tmp;
EMIT(outfp, "\033*p%c%dX", sign, tmp);
--- 2737,2745 -----
sign = '+';
#ifdef USEPXL
tmp = (int) -ptr->xOffset;
+ #else
+ tmp = (int) -x_offset;
+ #endif
if (tmp < 0)
sign = '-', tmp = -tmp;
EMIT(outfp, "\033*p%c%dX", sign, tmp);
***************
*** 2603,2608
pos_after = TRUE;
} else {
#ifdef IBM3812
if ( ptr->yyOffset || (!in_string) ) {
CharStringOut;
MoveVert(ptr->yyOffset);
--- 2751,2757 -----
pos_after = TRUE;
} else {
#ifdef IBM3812
+ #ifdef USEPXL
if ( ptr->yyOffset || (!in_string) ) {
CharStringOut;
MoveVert(ptr->yyOffset);
***************
*** 2610,2615
PMPout(2, PMPformat);
MoveVert((int)-(ptr->yyOffset));
} else {
if (CharStringPos==CHARSTRINGMAX)
CharStringOut;
--- 2759,2765 -----
PMPout(2, PMPformat);
MoveVert((int)-(ptr->yyOffset));
} else {
+ #endif
if (CharStringPos==CHARSTRINGMAX)
CharStringOut;
***************
*** 2615,2620
CharString[CharStringPos]=VisChar((char)c);
CharStringPos++;
}
#endif
#ifdef LJ
--- 2765,2771 -----
CharString[CharStringPos]=VisChar((char)c);
CharStringPos++;
+ #ifdef USEPXL
}
#endif
#endif
***************
*** 2617,2622
CharStringPos++;
}
#endif
#ifdef LJ
if (ptr->yyOffset) {
EMIT(outfp, "\033*p+%hdY", ptr->yyOffset);
--- 2768,2774 -----
#ifdef USEPXL
}
#endif
+ #endif
#ifdef LJ
#ifdef USEPXL
if (ptr->yyOffset) {
***************
*** 2618,2623
}
#endif
#ifdef LJ
if (ptr->yyOffset) {
EMIT(outfp, "\033*p+%hdY", ptr->yyOffset);
EMITC((char) VisChar((char)c));
--- 2770,2776 -----
#endif
#endif
#ifdef LJ
+ #ifdef USEPXL
if (ptr->yyOffset) {
EMIT(outfp, "\033*p+%hdY", ptr->yyOffset);
EMITC((char) VisChar((char)c));
***************
*** 2623,2628
EMITC((char) VisChar((char)c));
EMIT(outfp, "\033*p-%hdY", ptr->yyOffset);
} else
EMITC((char) VisChar((char)c));
#endif
}
--- 2776,2782 -----
EMITC((char) VisChar((char)c));
EMIT(outfp, "\033*p-%hdY", ptr->yyOffset);
} else
+ #endif
EMITC((char) VisChar((char)c));
#endif
}
***************
*** 2676,2682
;
#ifdef LJ
if (++fonts_used_on_this_page > MAX_FONTS_PER_PAGE) {
! qprintf("this is the %d. font on this page!",
fonts_used_on_this_page);
qprintf(" (max = %d) rastering characters!\n",
MAX_FONTS_PER_PAGE);
--- 2830,2836 -----
;
#ifdef LJ
if (++fonts_used_on_this_page > MAX_FONTS_PER_PAGE) {
! qfprintf(stderr,"this is the %d. font on this page!",
fonts_used_on_this_page);
qfprintf(stderr," (max = %d) rastering characters!\n",
MAX_FONTS_PER_PAGE);
***************
*** 2678,2684
if (++fonts_used_on_this_page > MAX_FONTS_PER_PAGE) {
qprintf("this is the %d. font on this page!",
fonts_used_on_this_page);
! qprintf(" (max = %d) rastering characters!\n",
MAX_FONTS_PER_PAGE);
rasterfont[fontptr->plusid] = TRUE;
}
--- 2832,2838 -----
if (++fonts_used_on_this_page > MAX_FONTS_PER_PAGE) {
qfprintf(stderr,"this is the %d. font on this page!",
fonts_used_on_this_page);
! qfprintf(stderr," (max = %d) rastering characters!\n",
MAX_FONTS_PER_PAGE);
rasterfont[fontptr->plusid] = TRUE;
}
***************
*** 2803,2809
#ifdef DEBUG
if (Debug)
! printf("Rule xx=%ld, yy=%ld\n", xx, yy);
#endif
#ifdef IBM3812
--- 2957,2963 -----
#ifdef DEBUG
if (Debug)
! fprintf(stderr,"Rule xx=%ld, yy=%ld\n", xx, yy);
#endif
#ifdef IBM3812
***************
*** 2903,2909
short c;
register unsigned short i;
! /* printf("SetString\n"); */
for (i = 0, c = firstch; c >= SETC_000 && c <= SETC_127; i++) {
SetChar((long)c, c, PassNo, (bool)(i==0),TRUE);
c = (short) NoSignExtend(dvifp, 1);
--- 3057,3066 -----
short c;
register unsigned short i;
! #ifdef DEBUG
! if (Debug)
! fprintf(stderr, "SetString ");
! #endif
for (i = 0, c = firstch; c >= SETC_000 && c <= SETC_127; i++) {
#ifdef DEBUG
if (Debug)
***************
*** 2905,2910
/* printf("SetString\n"); */
for (i = 0, c = firstch; c >= SETC_000 && c <= SETC_127; i++) {
SetChar((long)c, c, PassNo, (bool)(i==0),TRUE);
c = (short) NoSignExtend(dvifp, 1);
}
--- 3062,3071 -----
fprintf(stderr, "SetString ");
#endif
for (i = 0, c = firstch; c >= SETC_000 && c <= SETC_127; i++) {
+ #ifdef DEBUG
+ if (Debug)
+ fprintf (stderr, "%d ", c);
+ #endif
SetChar((long)c, c, PassNo, (bool)(i==0),TRUE);
c = (short) NoSignExtend(dvifp, 1);
}
***************
*** 2912,2918
#ifdef IBM3812
CharStringOut;
#endif
! /* printf("...SetString\n");*/
}
--- 3073,3082 -----
#ifdef IBM3812
CharStringOut;
#endif
! #ifdef DEBUG
! if (Debug)
! fprintf(stderr, "...SetString\n");
! #endif
}
***************
*** 2942,2948
x >>= 32 - 8 * n1; /* sign extend */
#ifdef DEBUG
if (Debug)
! printf("\tSignExtend(fp,%d)=%X\n", n1, x);
#endif
return(x);
}
--- 3106,3112 -----
x >>= 32 - 8 * n1; /* sign extend */
#ifdef DEBUG
if (Debug)
! fprintf(stderr,"\tSignExtend(fp,%d)=%X\n", n1, x);
#endif
return(x);
}
***************
*** 2981,2989
if ( G_nowarn || G_quiet )
return;
! printf("warning : ");
! printf(fmt, a, b, c, d);
! printf("\n");
}
--- 3145,3153 -----
if ( G_nowarn || G_quiet )
return;
! fprintf(stderr, "warning : ");
! fprintf(stderr, fmt, a, b, c, d);
! fprintf(stderr, "\n");
}
***************
*** 3133,3138
#endif
bool getbit ();
unsigned char getnyb ();
long pk_packed_num ();
--- 3297,3303 -----
#endif
+ #ifdef USEPXL
bool getbit ();
unsigned char getnyb ();
long pk_packed_num ();
***************
*** 3406,3411
return (pk_packed_num()) ; /* tail end recursion !! */
}
}
/*-->FormFeed*/
--- 3571,3577 -----
return (pk_packed_num()) ; /* tail end recursion !! */
}
}
+ #endif
/*-->FormFeed*/
/**********************************************************************/
***************
*** 3407,3413
}
}
-
/*-->FormFeed*/
/**********************************************************************/
/***************************** FormFeed ******************************/
--- 3573,3578 -----
}
#endif
/*-->FormFeed*/
/**********************************************************************/
/***************************** FormFeed ******************************/
***************
*** 3436,3438
}
--- 3601,3610 -----
}
+ #ifndef USEPXL
+ void bad_gf(n)
+ int n;
+ {
+ Fatal("Bad gf file, case %d\n",n); /* See gf.c */
+ }
+ #endif
Technical Details
Message-ID:
<230@zircon.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!uw-june!uw-entropy!dataio!pilchuck!pacer!joeReferences:
<858@hpuviea.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!uw-june!uw-entropy!dataio!pilchuck!pacer!joe From: joe@Pacer.UUCP (Joe Kelsey) Newsgroups: comp.text Subject: Re: New DVI-LaserJet Converter (Part 2 of 2) Keywords: dvi,LaserJet,MS-DOS,Unix Message-ID: <230@zircon.UUCP> Date: 23 Feb 89 19:03:13 GMT References: <858@hpuviea.UUCP> Reply-To: joe@Pacer.COM (Joe Kelsey) Organization: Pacer Corporation, Bothell, WA Lines: 2846