home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-11-11 | 33.8 KB | 1,211 lines |
- *** tmp/Makefile Mon May 20 19:05:45 1991
- --- Makefile Tue Oct 22 10:20:07 1991
- ***************
- *** 1,5
- # Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! # $Header: Makefile,v 1.24 91/05/20 20:05:44 hmgr Exp $
-
- CXX = CC
- .SUFFIXES: .C
-
- --- 1,5 -----
- # Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! # $Header: Makefile,v 1.28 91/10/22 11:20:05 hmgr Exp $
-
- CXX = CC
- .SUFFIXES: .C
- ***************
- *** 10,15
- # -DBSD for BSD derivatives
- # -DMSDOS for Zortech C++ - also run "make msdos-files"
- # -DFREE_TAKES_CHAR if you have a free(char*) instead of free(void*)
- # -DHP2686_FPATH=/path1:/path2:...
- # to modify the default font search path
- CFLAGS = -g
-
- --- 10,17 -----
- # -DBSD for BSD derivatives
- # -DMSDOS for Zortech C++ - also run "make msdos-files"
- # -DFREE_TAKES_CHAR if you have a free(char*) instead of free(void*)
- + # -DUSE_DIRENT use <dirent.h> instead of <ndir.h> or <sys/dir.h>
- + #
- # -DHP2686_FPATH=/path1:/path2:...
- # to modify the default font search path for your system
- #
- ***************
- *** 11,17
- # -DMSDOS for Zortech C++ - also run "make msdos-files"
- # -DFREE_TAKES_CHAR if you have a free(char*) instead of free(void*)
- # -DHP2686_FPATH=/path1:/path2:...
- ! # to modify the default font search path
- CFLAGS = -g
- LIBS = -lm
-
-
- --- 13,25 -----
- # -DUSE_DIRENT use <dirent.h> instead of <ndir.h> or <sys/dir.h>
- #
- # -DHP2686_FPATH=/path1:/path2:...
- ! # to modify the default font search path for your system
- ! #
- ! # -DMF_SCRIPT=\"script\"
- ! # where the usage is: script dpi bdpi magnification [mode]
- ! # script tries to build the needed font on-the-fly
- ! # you can use the "MakeTeXPK" script that comes with the dvips package
- ! #
- CFLAGS = -g
- LIBS = -lm
-
- ***************
- *** 19,25
- util.C global.C stack.C dirs.C dvi.C font.C readfont.C gffont.C \
- pkfont.C bitvec.C hp2684.h hp33440.h hp2686.h defs.h extern.h \
- dirs.h font.h dev.h darray.h boolean.h bitvec.h \
- ! ljdump.c
-
- OBJS = main.o dev.o hp2686.o hp33440.o hp2684.o util.o global.o stack.o \
- dirs.o dvi.o font.o readfont.o gffont.o pkfont.o bitvec.o
-
- --- 27,33 -----
- util.C global.C stack.C dirs.C dvi.C font.C readfont.C gffont.C \
- pkfont.C bitvec.C hp2684.h hp33440.h hp2686.h defs.h extern.h \
- dirs.h font.h dev.h darray.h boolean.h bitvec.h \
- ! ljdump.c MakeTeXPK
-
- OBJS = main.o dev.o hp2686.o hp33440.o hp2684.o util.o global.o stack.o \
- dirs.o dvi.o font.o readfont.o gffont.o pkfont.o bitvec.o
- *** tmp/README Thu May 23 10:45:10 1991
- --- README Tue Oct 22 10:42:57 1991
- ***************
- *** 1,4
- ! $Header: README,v 1.15 91/05/23 11:45:11 hmgr Exp $
-
- Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- You can do what you wish with this as long as
-
- --- 1,4 -----
- ! $Header: README,v 1.22 91/10/22 11:42:54 hmgr Exp $
-
- Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- You can do what you wish with this as long as
- ***************
- *** 59,64
- You will have to define -DMSDOS or -DBSD in the Makefile if you are on
- those systems. My Sparc also needed -DFREE_TAKES_CHAR.
-
- Use "make ljdump" to build the "ljdump" program. This is useful for
- debugging dvi by converting PCL to a semi-human-readable dump.
-
-
- --- 59,75 -----
- You will have to define -DMSDOS or -DBSD in the Makefile if you are on
- those systems. My Sparc also needed -DFREE_TAKES_CHAR.
-
- + You can make dvi run a script to build missing fonts on the fly. Add
- + the -DMF_SCRIPT="script" definition in the Makefile if you want this.
- + The script is run as "script dpi bdpi magnification [mode]".
- +
- + You can use the "MakeTeXPK" script that comes from the fine dvips
- + package by Tomas Rokicki at Stanford University. dvips, which converts
- + DVI output to PostScript, may be ftp-ed from labrea.stanford.edu. An
- + internal-HP version of MakeTeXPK is included with this package, though
- + it doubtless will need hacking to make it work on your system. This
- + feature is unlikely to work on MSDOS.
- +
- Use "make ljdump" to build the "ljdump" program. This is useful for
- debugging dvi by converting PCL to a semi-human-readable dump.
-
- ***************
- *** 72,78
- available to others too.
-
-
- -
- -- Parag Patel <parag@sde.hp.com>
-
-
-
- --- 83,88 -----
- available to others too.
-
-
- -- Parag Patel <parag@sde.hp.com>
-
-
- ***************
- *** 79,85
-
- --------------------REVISION-INFO----------------------
-
- ! 1.6 released on HP INTERX Contrib Tape and comp.sources.misc
-
- 1.7 first bug-fix release
- files modified: Makefile README extern.h main.C readfont.C hp2686.h
-
- --- 89,95 -----
-
- --------------------REVISION-INFO----------------------
-
- ! 1.6 released on HP INTEREX Contrib Tape and comp.sources.misc
-
- 1.7 first bug-fix release
- files modified: Makefile README extern.h main.C readfont.C hp2686.h
- ***************
- *** 87,89
- version string slightly modified so say_hello() in main.C works
- also look for fonts such as /path/cmr7.300pk and cmr7.300gf
- allow overriding default font search path from Makefile
-
- --- 97,108 -----
- version string slightly modified so say_hello() in main.C works
- also look for fonts such as /path/cmr7.300pk and cmr7.300gf
- allow overriding default font search path from Makefile
- +
- + 1.8 use DVIFONTPATH env var instead of FONTPATH to search for fonts
- + try running a script which runs Metafont to generate fonts on the fly
- + (this only works under Unix right now)
- + LaserJet+ cannot really handle 8-bit data - back to the old code
- + dvi -v runs properly when strings are put into read-only memory
- + Set -DUSE_DIRENT in the Makefile if you have <dirent.h> and not
- + <ndir.h> or <sys/dir.h>
- + dvi compiles and runs using C++ 3.0 now
- *** tmp/dirs.C Fri Feb 22 14:57:30 1991
- --- dirs.C Mon Aug 19 16:45:52 1991
- ***************
- *** 1,5
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: dirs.C,v 1.10 91/02/22 15:57:16 hmgr Exp $";
-
- // read font directory names into memory for fast traversal
- //
-
- --- 1,5 -----
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: dirs.C,v 1.11 91/08/19 17:45:50 hmgr Exp $";
-
- // read font directory names into memory for fast traversal
- //
- ***************
- *** 12,18
- #define d_name name
- #else
- #ifdef BSD
- ! #include <sys/dir.h>
- #else
- #include <ndir.h>
- #endif
-
- --- 12,18 -----
- #define d_name name
- #else
- #ifdef BSD
- ! # include <sys/dir.h>
- #else
- # ifdef USE_DIRENT
- # include <dirent.h>
- ***************
- *** 14,20
- #ifdef BSD
- #include <sys/dir.h>
- #else
- ! #include <ndir.h>
- #endif
- #endif
-
-
- --- 14,24 -----
- #ifdef BSD
- # include <sys/dir.h>
- #else
- ! # ifdef USE_DIRENT
- ! # include <dirent.h>
- ! # else
- ! # include <ndir.h>
- ! # endif
- #endif
- #endif
-
- ***************
- *** 82,88
- for (FIND *ent = findfirst(dos_dirpath, FA_DIREC); ent != NULL;
- ent = findnext())
- #else
- ! for (direct * ent = readdir(dir); ent != NULL; ent = readdir(dir))
- #endif
- {
- char *s = strchr(ent->d_name, '.');
-
- --- 86,96 -----
- for (FIND *ent = findfirst(dos_dirpath, FA_DIREC); ent != NULL;
- ent = findnext())
- #else
- ! # ifdef USE_DIRENT
- ! for (dirent *ent = readdir(dir); ent != NULL; ent = readdir(dir))
- ! # else
- ! for (direct *ent = readdir(dir); ent != NULL; ent = readdir(dir))
- ! # endif
- #endif
- {
- char *s = strchr(ent->d_name, '.');
- *** tmp/dvi.1 Fri Feb 22 14:53:53 1991
- --- dvi.1 Mon Aug 19 16:41:17 1991
- ***************
- *** 1,5
- .\" Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! .\" $Header: dvi.1,v 1.29 91/02/22 15:53:38 hmgr Exp $
- .TH DVI 1 unsupported
- .ad b
- .SH NAME
-
- --- 1,5 -----
- .\" Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! .\" $Header: dvi.1,v 1.30 91/08/19 17:41:15 hmgr Exp $
- .TH DVI 1 unsupported
- .ad b
- .SH NAME
- ***************
- *** 117,123
- should look for either the GF or PK format font files.
- The directories should have subdirectories for various magnifications.
- Overrides the value of the environment var
- ! .B FONTPATH
- if it exists.
- The separator between the various path is platform dependent.
- See the section on PLATFORM DEPENDENCIES for details.
-
- --- 117,123 -----
- should look for either the GF or PK format font files.
- The directories should have subdirectories for various magnifications.
- Overrides the value of the environment var
- ! .B DVIFONTPATH
- if it exists.
- The separator between the various path is platform dependent.
- See the section on PLATFORM DEPENDENCIES for details.
- ***************
- *** 196,202
- It searches along a default directory path for a printer
- to find the necessary fonts.
- The environment variable
- ! .B FONTPATH
- or the
- .B \-d
- option
-
- --- 196,202 -----
- It searches along a default directory path for a printer
- to find the necessary fonts.
- The environment variable
- ! .B DVIFONTPATH
- or the
- .B \-d
- option
- ***************
- *** 201,207
- .B \-d
- option
- may be used to override this if desired.
- ! The default FONTPATHs are listed in the PRINTER DEPENDENCIES section below.
- .PP
- The GF format is part of the normal output from the Metafont program.
- The PK format is a packed version of the GF file and is
-
- --- 201,207 -----
- .B \-d
- option
- may be used to override this if desired.
- ! The default DVIFONTPATHs are listed in the PRINTER DEPENDENCIES section below.
- .PP
- The GF format is part of the normal output from the Metafont program.
- The PK format is a packed version of the GF file and is
- ***************
- *** 307,313
- Other commands may be supported in the future.
- .SH PLATFORM DEPENDENCIES
- The separator between the component parts
- ! in either the FONTPATH environment variable
- or the optional fontpath specification is platform dependent.
- Default separator for UNIX is the colon character,
- for MSDOS it is the semicolon character.
-
- --- 307,313 -----
- Other commands may be supported in the future.
- .SH PLATFORM DEPENDENCIES
- The separator between the component parts
- ! in either the DVIFONTPATH environment variable
- or the optional fontpath specification is platform dependent.
- Default separator for UNIX is the colon character,
- for MSDOS it is the semicolon character.
- ***************
- *** 321,327
- .br
- Default options: page-reversal on, portrait
- .br
- ! Default FONTPATH for UNIX:
- /usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser
- .br
- Default FONTPATH for MSDOS:
-
- --- 321,327 -----
- .br
- Default options: page-reversal on, portrait
- .br
- ! Default DVIFONTPATH for UNIX:
- /usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser
- .br
- Default DVIFONTPATH for MSDOS:
- ***************
- *** 324,330
- Default FONTPATH for UNIX:
- /usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser
- .br
- ! Default FONTPATH for MSDOS:
- /usr/lib/tex/fontbits/laser;/usr/lib/tex/fnt;/usr/local/tex/fontbits/laser
- .TP
- .B HP33440 LaserJetII ljII lj2 laser2 laserII default
-
- --- 324,330 -----
- Default DVIFONTPATH for UNIX:
- /usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser
- .br
- ! Default DVIFONTPATH for MSDOS:
- /usr/lib/tex/fontbits/laser;/usr/lib/tex/fnt;/usr/local/tex/fontbits/laser
- .TP
- .B HP33440 LaserJetII ljII lj2 laser2 laserII default
- ***************
- *** 336,342
- .br
- Default options: page-reversal off, portrait
- .br
- ! Default FONTPATH: <same as LJ+>
- .TP
- .B HP33447 LaserJetIID ljIId lj2d laser2D laserIID
- HP LaserJetIID \-
-
- --- 336,342 -----
- .br
- Default options: page-reversal off, portrait
- .br
- ! Default DVIFONTPATH: <same as LJ+>
- .TP
- .B HP33447 LaserJetIID ljIId lj2d laser2D laserIID
- HP LaserJetIID \-
- ***************
- *** 344,350
- .br
- Default options: page-reversal off, portrait, double-sided vertical binding
- .br
- ! Default FONTPATH: <same as LJ+>
- .TP
- .B HP2684 JumboJet lj2000 laser2000 lj2k
- HP LaserJet 2000 \-
-
- --- 344,350 -----
- .br
- Default options: page-reversal off, portrait, double-sided vertical binding
- .br
- ! Default DVIFONTPATH: <same as LJ+>
- .TP
- .B HP2684 JumboJet lj2000 laser2000 lj2k
- HP LaserJet 2000 \-
- ***************
- *** 353,359
- .br
- Default options: page-reversal off, portrait, double-sided vertical binding
- .br
- ! Default FONTPATH: <same as LJ+>
- .SH FILES
- .nf
- /usr/lib/tex/fontbits/<printer>/<magdirs>/<PK fonts>
-
- --- 353,359 -----
- .br
- Default options: page-reversal off, portrait, double-sided vertical binding
- .br
- ! Default DVIFONTPATH: <same as LJ+>
- .SH FILES
- .nf
- /usr/lib/tex/fontbits/<printer>/<magdirs>/<PK fonts>
- *** tmp/dvi.C Fri Feb 22 14:57:47 1991
- --- dvi.C Mon Aug 19 16:46:03 1991
- ***************
- *** 1,5
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: dvi.C,v 1.24 91/02/22 15:57:33 hmgr Exp $";
-
- // dvi scanning routines
- //
-
- --- 1,5 -----
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: dvi.C,v 1.25 91/08/19 17:46:00 hmgr Exp $";
-
- // dvi scanning routines
- //
- *** tmp/extern.h Fri May 17 15:28:16 1991
- --- extern.h Thu Oct 10 10:15:55 1991
- ***************
- *** 1,5
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! // $Header: extern.h,v 1.25 91/05/17 16:28:17 hmgr Exp $
-
- // externs for various LaserJet+ DVI filter functions
- //
-
- --- 1,5 -----
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! // $Header: extern.h,v 1.26 91/09/13 16:14:20 hmgr Exp $
-
- // externs for various LaserJet+ DVI filter functions
- //
- ***************
- *** 94,100
- #if FREE_TAKES_CHAR
- inline void strfree(const char *s) { if (s != NULL) free((char *)s); }
- #else
- ! inline void strfree(const char *s) { if (s != NULL) free((const void *)s); }
- #endif
- inline char *strdup(const char *s)
- { return s != NULL ? strcpy((char*)malloc(strlen(s) + 1), s) : NULL; }
-
- --- 94,100 -----
- #if FREE_TAKES_CHAR
- inline void strfree(const char *s) { if (s != NULL) free((char *)s); }
- #else
- ! inline void strfree(const char *s) { if (s != NULL) free((void *)s); }
- #endif
- inline char *strdup(const char *s)
- { return s != NULL ? strcpy((char*)malloc(strlen(s) + 1), s) : NULL; }
- *** tmp/gffont.C Fri Feb 22 14:58:20 1991
- --- gffont.C Mon Aug 19 16:45:55 1991
- ***************
- *** 1,5
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: gffont.C,v 1.20 91/02/22 15:58:04 hmgr Exp $";
-
- // read font data from the METAFONT GF (generic font) files
- //
-
- --- 1,5 -----
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: gffont.C,v 1.21 91/08/19 17:45:52 hmgr Exp $";
-
- // read font data from the METAFONT GF (generic font) files
- //
- ***************
- *** 85,95
-
- long dsize = getsval(4, fp);
- debug(4, "GF designsize=%ld", dsize);
- ! if (f.basename != NULL && dsize >> 4 != f.designsize)
- ! if (dochecksum && dsize != 0 && f.designsize != 0)
- ! quit("Designsize in DVI and GF file %s does not match", f.path);
- ! else
- ! warn("Designsize in DVI and GF file %s does not match", f.path);
-
- // check the checksum (!)
- long check = getuval(4, fp);
-
- --- 85,91 -----
-
- long dsize = getsval(4, fp);
- debug(4, "GF designsize=%ld", dsize);
- ! // do not bother checking the designsize - it seems pointless
-
- // check the checksum (!)
- long check = getuval(4, fp);
- *** tmp/global.C Fri Feb 22 14:57:10 1991
- --- global.C Mon Aug 19 16:42:34 1991
- ***************
- *** 1,5
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: global.C,v 1.24 91/02/22 15:56:57 hmgr Exp $";
-
- // Global variables for DVI filter.
- // All globally visible variables are here.
-
- --- 1,5 -----
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: global.C,v 1.25 91/08/19 17:42:32 hmgr Exp $";
-
- // Global variables for DVI filter.
- // All globally visible variables are here.
- ***************
- *** 119,125
- char *str;
- if (fontpath == NULL)
- {
- ! str = getenv("FONTPATH");
- if (str != NULL && *str != '\0')
- fontpath = str;
- }
-
- --- 119,127 -----
- char *str;
- if (fontpath == NULL)
- {
- ! str = getenv("DVIFONTPATH");
- ! if (str == NULL || *str == '\0')
- ! str = getenv("FONTPATH"); // for backward-compatibility - sorry!
- if (str != NULL && *str != '\0')
- fontpath = str;
- }
- *** tmp/hp2686.C Fri Feb 22 14:56:06 1991
- --- hp2686.C Mon Aug 19 16:46:06 1991
- ***************
- *** 1,5
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: hp2686.C,v 1.20 91/02/22 15:55:21 hmgr Exp $";
-
- // HP2686 LaserJet+ and LaserJetII device-specific functions.
- // The various Reference Manuals should be consulted for more
-
- --- 1,5 -----
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: hp2686.C,v 1.21 91/08/19 17:46:04 hmgr Exp $";
-
- // HP2686 LaserJet+ and LaserJetII device-specific functions.
- // The various Reference Manuals should be consulted for more
- ***************
- *** 66,74
- //
- const char *HP2686::char2dev(int ch, int &len)
- {
- ! static char buf[20];
- ! if ((ch >= 32 && ch <= 127) || ch >= 160)
- ! sprintf(buf, "%c", ch);
- else
- sprintf(buf, "\033&p1X%c", ch);
- len = strlen(buf);
-
- --- 66,82 -----
- //
- const char *HP2686::char2dev(int ch, int &len)
- {
- ! static char buf[2];
- ! // the LaserJet Plus can't really handle full 8-bit fonts.
- ! // it can handle only character codes 33-127 and 160-255
- ! // we'll map as many of these as possible on a lowest-code first basis
- ! buf[0] = buf[1] = 0;
- ! if (ch <= 32)
- ! buf[0] = ch + 160;
- ! else if (ch > 32 && ch <= 127)
- ! buf[0] = ch;
- ! else if (ch <= 190)
- ! buf[0] = ch + 65;
- else
- quit("LaserJet+ cannot handle true 8-bit fonts -- Sorry");
- len = 1;
- ***************
- *** 70,79
- if ((ch >= 32 && ch <= 127) || ch >= 160)
- sprintf(buf, "%c", ch);
- else
- ! sprintf(buf, "\033&p1X%c", ch);
- ! len = strlen(buf);
- ! if (ch == 0)
- ! len++;
- return buf;
- }
-
-
- --- 78,85 -----
- else if (ch <= 190)
- buf[0] = ch + 65;
- else
- ! quit("LaserJet+ cannot handle true 8-bit fonts -- Sorry");
- ! len = 1;
- return buf;
- }
-
- ***************
- *** 219,227
- //
- void HP2686::downchar(font &f, fontchar &g, int ch)
- {
- ! // describe the character and its font to the LaserJet
- ! printf("\033*c%ldd%dE", f.num, ch);
- ! downljchar(f, g, ch);
- }
-
- // this sets up this character in the LaserJet memory so that
-
- --- 225,249 -----
- //
- void HP2686::downchar(font &f, fontchar &g, int ch)
- {
- ! // describe the character and its font to the LaserJet Plus
- ! // remember, only codes 33-127 and 160-255 can be sent
- ! if (ch <= 32)
- ! {
- ! printf("\033*c%ldd%dE", f.num, ch + 160);
- ! downljchar(f, g, ch + 160);
- ! }
- ! else if (ch > 32 && ch <= 127)
- ! {
- ! printf("\033*c%ldd%dE", f.num, ch);
- ! downljchar(f, g, ch);
- ! }
- ! else if (ch <= 190)
- ! {
- ! printf("\033*c%ldd%dE", f.num, ch + 65);
- ! downljchar(f, g, ch + 65);
- ! }
- ! else
- ! quit("LaserJet+ cannot handle true 8-bit fonts -- Sorry!");
- }
-
- // this sets up this character in the LaserJet memory so that
- *** tmp/hp33440.C Fri Feb 22 14:56:34 1991
- --- hp33440.C Mon Aug 19 16:45:57 1991
- ***************
- *** 1,5
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! // $Header: hp33440.C,v 1.13 91/02/22 15:56:21 hmgr Exp $
-
- // LaserJetII series device-specific functions.
- // The LaserJetII Reference Manual should be consulted for more
-
- --- 1,5 -----
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! // $Header: hp33440.C,v 1.15 91/08/19 17:45:54 hmgr Exp $
-
- // LaserJetII series device-specific functions.
- // The LaserJetII Reference Manual should be consulted for more
- ***************
- *** 16,22
-
- // initialize the LaserJet II
- HP33440::HP33440() :
- ! HP2686(257, 256, 32, 32, 300, HP2686_HOFFSET, HP2686_VOFFSET,
- -128, 127, -128, 127, 128, 128, HP2686_FPATH)
- {
- }
-
- --- 16,22 -----
-
- // initialize the LaserJet II
- HP33440::HP33440() :
- ! HP2686(257, 256, 16, 32, 300, HP2686_HOFFSET, HP2686_VOFFSET,
- -128, 127, -128, 127, 128, 128, HP2686_FPATH)
- {
- }
- ***************
- *** 19,24
- HP2686(257, 256, 32, 32, 300, HP2686_HOFFSET, HP2686_VOFFSET,
- -128, 127, -128, 127, 128, 128, HP2686_FPATH)
- {
- }
-
- // LaserJetIID:
-
- --- 19,49 -----
- HP2686(257, 256, 16, 32, 300, HP2686_HOFFSET, HP2686_VOFFSET,
- -128, 127, -128, 127, 128, 128, HP2686_FPATH)
- {
- + }
- +
- + // convert a character number to something that the device can deal with
- + // for a LaserJet II
- + //
- + const char *HP33440::char2dev(int ch, int &len)
- + {
- + static char buf[20];
- + if ((ch >= 32 && ch <= 127) || ch >= 160)
- + sprintf(buf, "%c", ch);
- + else
- + sprintf(buf, "\033&p1X%c", ch);
- + len = strlen(buf);
- + if (ch == 0)
- + len++;
- + return buf;
- + }
- +
- + // download a character for a particular font for the LaserJet II
- + //
- + void HP33440::downchar(font &f, fontchar &g, int ch)
- + {
- + // describe the character and its font to the LaserJet II
- + printf("\033*c%ldd%dE", f.num, ch);
- + downljchar(f, g, ch);
- }
-
- // LaserJetIID:
- *** tmp/hp33440.h Fri Feb 22 14:58:53 1991
- --- hp33440.h Mon Aug 19 16:46:12 1991
- ***************
- *** 1,5
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! // $Header: hp33440.h,v 1.8 91/02/22 15:58:41 hmgr Exp $
-
- // LaserJetII series device-specific definitions.
- // The LaserJetII Reference Manual should be consulted for more
-
- --- 1,5 -----
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! // $Header: hp33440.h,v 1.9 91/08/19 17:46:06 hmgr Exp $
-
- // LaserJetII series device-specific definitions.
- // The LaserJetII Reference Manual should be consulted for more
- ***************
- *** 16,23
- HP33440(int maxf, int maxc, int maxpg, int maxld, int res,
- int ho, int vo, int fhmn, int fhmx, int fvmn, int fvmx,
- int fwd, int fhg, char *deffp) :
- ! HP2686(maxf, maxc, maxpg, maxld, res, ho, vo,
- ! fhmn, fhmx, fvmn, fvmx, fwd, fhg, deffp) { }
- public:
- HP33440();
- };
-
- --- 16,23 -----
- HP33440(int maxf, int maxc, int maxpg, int maxld, int res,
- int ho, int vo, int fhmn, int fhmx, int fvmn, int fvmx,
- int fwd, int fhg, char *deffp) :
- ! HP2686(maxf, maxc, maxpg, maxld, res, ho, vo,
- ! fhmn, fhmx, fvmn, fvmx, fwd, fhg, deffp) { }
- public:
- const char *char2dev(int ch, int &len);
- void downchar(font &f, fontchar &g, int ch);
- ***************
- *** 19,24
- HP2686(maxf, maxc, maxpg, maxld, res, ho, vo,
- fhmn, fhmx, fvmn, fvmx, fwd, fhg, deffp) { }
- public:
- HP33440();
- };
-
-
- --- 19,26 -----
- HP2686(maxf, maxc, maxpg, maxld, res, ho, vo,
- fhmn, fhmx, fvmn, fvmx, fwd, fhg, deffp) { }
- public:
- + const char *char2dev(int ch, int &len);
- + void downchar(font &f, fontchar &g, int ch);
- HP33440();
- };
-
- *** tmp/main.C Fri May 17 15:28:21 1991
- --- main.C Fri Sep 27 15:13:37 1991
- ***************
- *** 1,5
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: main.C,v 1.32 91/05/17 16:28:22 hmgr Exp $";
-
- // TeX DVI filter main() - just parses arguments and calls functions
- //
-
- --- 1,5 -----
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: main.C,v 1.33 91/08/19 17:45:57 hmgr Exp $";
-
- // TeX DVI filter main() - just parses arguments and calls functions
- //
- ***************
- *** 7,13
-
- #include "defs.h"
-
- ! static char *const whatid = "@(#)dvi 1.7 (02 April 1991)";
-
- static void say_hello()
- {
-
- --- 7,13 -----
-
- #include "defs.h"
-
- ! static char *const whatid = "@(#)dvi 1.8 (19 August 1991)";
-
- static void say_hello()
- {
- ***************
- *** 13,18
- {
- // hello message like (but unlike) TeX - the following mess should
- // strip out the revision number out of the build ID string "whatid"
- char *s = strchr(whatid, ' ');
- while (*s == ' ')
- s++;
-
- --- 13,19 -----
- {
- // hello message like (but unlike) TeX - the following mess should
- // strip out the revision number out of the build ID string "whatid"
- + mesg("TeX DVI filter version ");
- char *s = strchr(whatid, ' ');
- while (*s == ' ')
- s++;
- ***************
- *** 16,26
- char *s = strchr(whatid, ' ');
- while (*s == ' ')
- s++;
- ! char *t = s;
- ! while (*t != ' ' && *t != '$' && *t != '\0')
- ! t++;
- ! *t = '\0';
- ! mesg("TeX DVI filter version %s for ", s);
- }
-
- static long strtonum(char *s, char **ptr)
-
- --- 17,25 -----
- char *s = strchr(whatid, ' ');
- while (*s == ' ')
- s++;
- ! while (*s != ' ' && *s != '$' && *s != '\0')
- ! mesg("%c", *s++);
- ! mesg(" for ");
- }
-
- static long strtonum(char *s, char **ptr)
- *** tmp/pkfont.C Fri Feb 22 14:58:33 1991
- --- pkfont.C Mon Aug 19 16:46:18 1991
- ***************
- *** 1,5
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: pkfont.C,v 1.21 91/02/22 15:58:17 hmgr Exp $";
-
- // read font data from the METAFONT PK (packed font) files
- //
-
- --- 1,5 -----
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: pkfont.C,v 1.22 91/08/19 17:46:14 hmgr Exp $";
-
- // read font data from the METAFONT PK (packed font) files
- //
- ***************
- *** 67,77
-
- long dsize = getsval(4, fp);
- debug(4, "PK designsize=%ld", dsize);
- ! if (f.basename != NULL && dsize >> 4 != f.designsize)
- ! if (dochecksum && dsize != 0 && f.designsize != 0)
- ! quit("Designsize in DVI and PK file %s does not match", f.path);
- ! else
- ! warn("Designsize in DVI and PK file %s does not match", f.path);
-
- // check the checksum
- long check = getuval(4, fp);
-
- --- 67,73 -----
-
- long dsize = getsval(4, fp);
- debug(4, "PK designsize=%ld", dsize);
- ! // do not bother checking the designsize - it seems pointless
-
- // check the checksum
- long check = getuval(4, fp);
- *** tmp/readfont.C Mon May 20 15:12:45 1991
- --- readfont.C Tue Oct 22 10:13:23 1991
- ***************
- *** 1,5
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: readfont.C,v 1.22 91/05/20 16:12:46 hmgr Exp $";
-
- // read font data from the METAFONT GF (generic font) files
- //
-
- --- 1,5 -----
- // Copyright (c) 1991 by Parag Patel. All Rights Reserved.
- ! static const char rcsid[] = "$Header: readfont.C,v 1.24 91/10/22 11:13:21 hmgr Exp $";
-
- // read font data from the METAFONT GF (generic font) files
- //
- ***************
- *** 4,9
- // read font data from the METAFONT GF (generic font) files
- //
- // by Parag Patel
-
- #include "defs.h"
-
-
- --- 4,11 -----
- // read font data from the METAFONT GF (generic font) files
- //
- // by Parag Patel
- + //
- + // MF_SCRIPT hacks by Peter Marvit
-
- #include "defs.h"
-
- ***************
- *** 90,96
- // the information from the DVI file - we now have to actually read the
- // font file (GF or PK) to get the rest of the font's description
- //
- ! void setupfont(font &f)
- {
- if (f.path != NULL)
- if (tryfile(f, f.path, "", f.basename, ""))
-
- --- 92,98 -----
- // the information from the DVI file - we now have to actually read the
- // font file (GF or PK) to get the rest of the font's description
- //
- ! static boolean trysetupfont(font &f)
- {
- if (f.path != NULL)
- if (tryfile(f, f.path, "", f.basename, ""))
- ***************
- *** 94,100
- {
- if (f.path != NULL)
- if (tryfile(f, f.path, "", f.basename, ""))
- ! return;
-
- // setup the font directory cache if we need to
- if (pathlist.size() < 1)
-
- --- 96,102 -----
- {
- if (f.path != NULL)
- if (tryfile(f, f.path, "", f.basename, ""))
- ! return TRUE;
-
- // setup the font directory cache if we need to
- if (pathlist.size() < 1)
- ***************
- *** 105,111
- Pathent & p = pathlist[i];
-
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ".pk"))
- ! return;
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ".gf"))
- return;
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
-
- --- 107,113 -----
- Pathent & p = pathlist[i];
-
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ".pk"))
- ! return TRUE;
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ".gf"))
- return TRUE;
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
- ***************
- *** 107,113
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ".pk"))
- return;
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ".gf"))
- ! return;
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
- return;
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ""))
-
- --- 109,115 -----
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ".pk"))
- return TRUE;
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ".gf"))
- ! return TRUE;
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
- return TRUE;
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ""))
- ***************
- *** 109,115
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ".gf"))
- return;
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
- ! return;
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ""))
- return;
-
-
- --- 111,117 -----
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ".gf"))
- return TRUE;
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
- ! return TRUE;
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ""))
- return TRUE;
-
- ***************
- *** 111,117
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
- return;
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ""))
- ! return;
-
- char ext[30];
- sprintf(ext, ".%dpk", RESOLUTION);
-
- --- 113,119 -----
- if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
- return TRUE;
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ""))
- ! return TRUE;
-
- char ext[30];
- sprintf(ext, ".%dpk", RESOLUTION);
- ***************
- *** 116,122
- char ext[30];
- sprintf(ext, ".%dpk", RESOLUTION);
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
- ! return;
- sprintf(ext, ".%dgf", RESOLUTION);
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
- return;
-
- --- 118,124 -----
- char ext[30];
- sprintf(ext, ".%dpk", RESOLUTION);
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
- ! return TRUE;
- sprintf(ext, ".%dgf", RESOLUTION);
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
- return TRUE;
- ***************
- *** 119,125
- return;
- sprintf(ext, ".%dgf", RESOLUTION);
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
- ! return;
- }
- quit("Cannot find font file \"%s\" (at or near magnification %ld.%03ld) anywhere",
- f.basename, f.mag / 1000, f.mag % 1000);
-
- --- 121,127 -----
- return TRUE;
- sprintf(ext, ".%dgf", RESOLUTION);
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
- ! return TRUE;
- }
- return FALSE;
- }
- ***************
- *** 121,126
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
- return;
- }
- quit("Cannot find font file \"%s\" (at or near magnification %ld.%03ld) anywhere",
- f.basename, f.mag / 1000, f.mag % 1000);
- }
-
- --- 123,245 -----
- if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
- return TRUE;
- }
- + return FALSE;
- + }
- +
- + #ifdef MF_SCRIPT
- + // The following routine is cribbed (with permission) from the fine "dvips"
- + // package by Tomas Rokicki at Stanford U.
- + //
- + static int magstep(int n, int bdpi)
- + {
- + register float t;
- + int neg = 0;
- + if (n < 0)
- + {
- + neg = 1;
- + n = -n;
- + }
- + if (n & 1)
- + {
- + n &= ~1;
- + t = 1.095445115;
- + }
- + else
- + t = 1.0;
- + while (n > 8)
- + {
- + n -= 8;
- + t = t * 2.0736;
- + }
- + while (n > 0)
- + {
- + n -= 2;
- + t = t * 1.2;
- + }
- + if (neg)
- + return (int)(0.5 + bdpi / t);
- + else
- + return (int)(0.5 + bdpi * t);
- + }
- + #endif
- +
- +
- + // Try to get and set the fonts we need. If it fails, it probably means
- + // we can't find the fonts and will have to make them. The #ifdef MF_SCRIPT
- + // allows an attempted creation of fonts, using an extrenal script which
- + // should call MetaFont, and then a retry of the [hopefully created] fonts.
- + //
- + void setupfont(font &f)
- + {
- + if (trysetupfont(f))
- + return;
- +
- + #ifdef MF_SCRIPT
- + // The following code is cribbed (with permission) from the fine "dvips"
- + // package by Tomas Rokicki at Stanford U.
- + //
- + // First, the computation of magstep, stolen from dvips (makefont.c).
- + // This entire routine carefully lifted, though it works fine.
- + //
- + int m, n, dpi, bdpi;
- + char magstepc[MAXPATHLEN + 1];
- + bdpi = RESOLUTION;
- + dpi = (int)f.mag * RESOLUTION / 1000;
- +
- + m = 0;
- + if (dpi < bdpi)
- + {
- + while (1)
- + {
- + m--;
- + n = magstep(m, bdpi);
- + if (n == dpi)
- + break;
- + if (n < dpi || m < -40)
- + {
- + m = 9999;
- + break;
- + }
- + }
- + }
- + else if (dpi > bdpi)
- + {
- + while (1)
- + {
- + m++;
- + n = magstep(m, bdpi);
- + if (n == dpi)
- + break;
- + if (n > dpi || m > 40)
- + {
- + m = 9999;
- + break;
- + }
- + }
- + }
- + if (m == 9999)
- + {
- + (void)sprintf(magstepc, "%d+%d/%d", dpi / bdpi, dpi % bdpi, bdpi);
- + }
- + else if (m >= 0)
- + {
- + (void)sprintf(magstepc, "magstep\\(%d.%d\\)", m / 2, (m & 1) * 5);
- + }
- + else
- + {
- + (void)sprintf(magstepc, "magstep\\(-%d.%d\\)", (-m) / 2, (m & 1) * 5);
- + }
- +
- + // Here is where we do the actually calling of the external script
- + //
- + char buf[MAXPATHLEN + 1];
- + sprintf(buf, "%s %s %d %d %s\n", MF_SCRIPT, f.basename,
- + dpi, bdpi, magstepc);
- + system(buf);
- + if (trysetupfont(f))
- + return;
- + #endif
- +
- quit("Cannot find font file \"%s\" (at or near magnification %ld.%03ld) anywhere",
- f.basename, f.mag / 1000, f.mag % 1000);
- }
-