(Replying to an old thread) On Jan 28 12:06:42, chrisbenn...@bennettconstruction.us wrote: > #define _PATH_VFONT "/usr/libdata/vfont/" > #define _PATH_VFONTB "/usr/libdata/vfont/B" > #define _PATH_VFONTI "/usr/libdata/vfont/I" > #define _PATH_VFONTR "/usr/libdata/vfont/R" > #define _PATH_VFONTS "/usr/libdata/vfont/S"
On Jan 28 11:18:58, todd.mil...@courtesan.com wrote: > The troff support in lpd is of the old phototypesetter variety. It > has no real value in today's world. The "ditroff" support is what > we would consider modern troff. > > I think we can safely remove the old font bits and the associated > control file bits. The diff below * removes the nonexistent font support from lpr and lpd * removes the -1234 options from the code and manpage * removes the BUGS section mentioning that the nonexistent fonts must be located at the printserver, where they are not implemented Jan Index: usr.sbin/lpd/printer.c =================================================================== RCS file: /cvs/src/usr.sbin/lpd/printer.c,v retrieving revision 1.2 diff -u -p -r1.2 printer.c --- usr.sbin/lpd/printer.c 3 Jul 2019 03:24:03 -0000 1.2 +++ usr.sbin/lpd/printer.c 9 Feb 2020 21:32:41 -0000 @@ -474,13 +474,6 @@ printjob(const char *cfname, int retry) log_warnx("strtonum: %s", errstr); break; - case '1': /* troff fonts */ - case '2': - case '3': - case '4': - /* XXX not implemented */ - break; - default: if (line[0] < 'a' || line[0] > 'z') break; Index: usr.sbin/lpr/common_source/pathnames.h =================================================================== RCS file: /cvs/src/usr.sbin/lpr/common_source/pathnames.h,v retrieving revision 1.6 diff -u -p -r1.6 pathnames.h --- usr.sbin/lpr/common_source/pathnames.h 28 Oct 2015 13:25:55 -0000 1.6 +++ usr.sbin/lpr/common_source/pathnames.h 9 Feb 2020 21:32:41 -0000 @@ -40,8 +40,3 @@ #define _PATH_PR "/usr/bin/pr" #define _PATH_PRINTCAP "/etc/printcap" #define _PATH_SOCKETNAME "/var/run/printer" -#define _PATH_VFONT "/usr/libdata/vfont/" -#define _PATH_VFONTB "/usr/libdata/vfont/B" -#define _PATH_VFONTI "/usr/libdata/vfont/I" -#define _PATH_VFONTR "/usr/libdata/vfont/R" -#define _PATH_VFONTS "/usr/libdata/vfont/S" Index: usr.sbin/lpr/lpd/lpd.8 =================================================================== RCS file: /cvs/src/usr.sbin/lpr/lpd/lpd.8,v retrieving revision 1.30 diff -u -p -r1.30 lpd.8 --- usr.sbin/lpr/lpd/lpd.8 8 Feb 2020 01:09:58 -0000 1.30 +++ usr.sbin/lpr/lpd/lpd.8 9 Feb 2020 21:32:41 -0000 @@ -261,18 +261,6 @@ The file contains a raster image. .It r The file contains text data with FORTRAN carriage control characters. -.It \&1 -Troff Font R. -Name of the font file to use instead of the default. -.It \&2 -Troff Font I. -Name of the font file to use instead of the default. -.It \&3 -Troff Font B. -Name of the font file to use instead of the default. -.It \&4 -Troff Font S. -Name of the font file to use instead of the default. .It W Width. Changes the page width (in characters) used by Index: usr.sbin/lpr/lpd/printjob.c =================================================================== RCS file: /cvs/src/usr.sbin/lpr/lpd/printjob.c,v retrieving revision 1.61 diff -u -p -r1.61 printjob.c --- usr.sbin/lpr/lpd/printjob.c 3 Jul 2019 03:24:03 -0000 1.61 +++ usr.sbin/lpr/lpd/printjob.c 9 Feb 2020 21:32:41 -0000 @@ -316,16 +316,6 @@ again: goto again; } -#define FONTLEN 50 -char fonts[4][FONTLEN]; /* fonts for troff */ - -char ifonts[4][40] = { - _PATH_VFONTR, - _PATH_VFONTI, - _PATH_VFONTB, - _PATH_VFONTS, -}; - /* * The remaining part is the reading of the control file (cf) * and performing the various actions. @@ -348,15 +338,6 @@ printit(char *file) return(OK); } /* - * Reset troff fonts. - */ - for (i = 0; i < 4; i++) - strlcpy(fonts[i], ifonts[i], FONTLEN); - (void)snprintf(&width[2], sizeof(width) - 2, "%ld", PW); - indent[2] = '0'; - indent[3] = '\0'; - - /* * read the control file for work to do * * file format -- first character in the line is a command @@ -381,10 +362,6 @@ printit(char *file) * g -- "file name" plot(1G) file to print * v -- "file name" plain raster file to print * c -- "file name" cifplot file to print - * 1 -- "R font file" for troff - * 2 -- "I font file" for troff - * 3 -- "B font file" for troff - * 4 -- "S font file" for troff * N -- "name" of file (used by lpq) * U -- "unlink" name of file to remove * (after we print it. (Pass 2 only)). @@ -450,14 +427,6 @@ printit(char *file) banner(line+1, jobname); continue; - case '1': /* troff fonts */ - case '2': - case '3': - case '4': - if (line[1] != '\0') - strlcpy(fonts[line[0]-'1'], line+1, FONTLEN); - continue; - case 'W': /* page width */ strlcpy(width+2, line+1, sizeof(width) - 2); continue; @@ -646,20 +615,6 @@ print(int format, char *file) case 't': /* print troff output */ case 'n': /* print ditroff output */ case 'd': /* print tex output */ - (void)unlink(".railmag"); - if ((fo = open(".railmag", O_CREAT|O_WRONLY|O_EXCL, FILMOD)) < 0) { - syslog(LOG_ERR, "%s: cannot create .railmag", printer); - (void)unlink(".railmag"); - } else { - for (n = 0; n < 4; n++) { - if (fonts[n][0] != '/') - (void)write(fo, _PATH_VFONT, - sizeof(_PATH_VFONT) - 1); - (void)write(fo, fonts[n], strlen(fonts[n])); - (void)write(fo, "\n", 1); - } - (void)close(fo); - } prog = (format == 't') ? TF : (format == 'n') ? NF : DF; av[1] = pxwidth; av[2] = pxlength; Index: usr.sbin/lpr/lpr/lpr.1 =================================================================== RCS file: /cvs/src/usr.sbin/lpr/lpr/lpr.1,v retrieving revision 1.16 diff -u -p -r1.16 lpr.1 --- usr.sbin/lpr/lpr/lpr.1 8 Feb 2020 01:09:58 -0000 1.16 +++ usr.sbin/lpr/lpr/lpr.1 9 Feb 2020 21:32:41 -0000 @@ -41,7 +41,6 @@ .Bk -words .Op Fl cdfghlmnpqrstv .Op Fl # Ns Ar num -.Op Fl 1234 Ar font .Op Fl C Ar class .Op Fl i Op Ar numcols .Op Fl J Ar job @@ -152,16 +151,6 @@ $ cat foo.c bar.c more.c | lpr -#3 will give three copies of the concatenation of the files. Often a site will disable this feature to encourage use of a photocopier instead. -.It Fl 1234 Ar font -Specifies a -.Ar font -to be mounted on font position -.Ar i . -The daemon -will construct a -.Li .railmag -file referencing -the font pathname. .It Fl C Ar class Job classification to use on the burst page. @@ -254,6 +243,3 @@ The .Nm command appeared in .At v5 . -.Sh BUGS -Fonts for troff and tex reside on the host with the printer. -It is currently not possible to use local font libraries. Index: usr.sbin/lpr/lpr/lpr.c =================================================================== RCS file: /cvs/src/usr.sbin/lpr/lpr/lpr.c,v retrieving revision 1.49 diff -u -p -r1.49 lpr.c --- usr.sbin/lpr/lpr/lpr.c 26 Apr 2018 12:42:51 -0000 1.49 +++ usr.sbin/lpr/lpr/lpr.c 9 Feb 2020 21:32:41 -0000 @@ -67,7 +67,6 @@ static char *cfname; /* daemon control files, linked from tf's */ static char *class = host; /* class title on header page */ static char *dfname; /* data files */ -static char *fonts[4]; /* troff font names */ static char format = 'f'; /* format char for printing files */ static int hdr = 1; /* print header or not (default is yes) */ static int iflag; /* indentation wanted */ @@ -140,7 +139,7 @@ main(int argc, char **argv) openlog("lpr", 0, LOG_LPR); while ((ch = getopt(argc, argv, - ":#:1:2:3:4:C:J:P:T:U:cdfghi:lmnpqrstvw:")) != -1) { + ":#:C:J:P:T:U:cdfghi:lmnpqrstvw:")) != -1) { switch (ch) { case '#': /* n copies */ @@ -151,13 +150,6 @@ main(int argc, char **argv) } break; - case '4': /* troff fonts */ - case '3': - case '2': - case '1': - fonts[ch - '1'] = optarg; - break; - case 'C': /* classification spec */ hdr++; class = optarg; @@ -304,10 +296,6 @@ main(int argc, char **argv) card('I', itoa(indent)); if (mailflg) card('M', person); - if (format == 't' || format == 'n' || format == 'd') - for (i = 0; i < 4; i++) - if (fonts[i] != NULL) - card('1'+i, fonts[i]); if (width != NULL) card('W', width); @@ -713,7 +701,7 @@ usage(void) extern char *__progname; fprintf(stderr, - "usage: %s [-cdfghlmnpqrstv] [-#num] [-1234 font] " + "usage: %s [-cdfghlmnpqrstv] [-#num] " "[-C class] [-i [numcols]]\n" "\t[-J job] [-Pprinter] [-T title] [-U user] " "[-wnum] [name ...]\n", __progname);