Discussion:
troff fonts and their path wrong
Chris Bennett
2016-01-28 18:06:42 UTC
Permalink
These paths do not exist. Locate vfont brings up nothing

What should be done here?
Fix it or remove it?
I know nothing about troff, so need help from someone who does.

Chris


In lpr/common_source/pathnames.h

#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"

---------------------------------------------------

for lpr/lpd/printjob.c

in sub printjob

#define FONTLEN 50
char fonts[4][FONTLEN]; /* fonts for troff */

char ifonts[4][40] = {
_PATH_VFONTR,
_PATH_VFONTI,
_PATH_VFONTB,
_PATH_VFONTS,
};

...

/*
* read the control file for work to do
*
* file format -- first character in the line is a command
* rest of the line is the argument.
* valid commands are:
...
* 1 -- "R font file" for troff
* 2 -- "I font file" for troff
* 3 -- "B font file" for troff
* 4 -- "S font file" for troff
...




while (get_line(cfp))
switch (line[0]) {
...

case '1': /* troff fonts */
case '2':
case '3':
case '4':
if (line[1] != '\0')
strlcpy(fonts[line[0]-'1'], line+1, FONTLEN);
continue;
----------------------------------------

in sub print

switch (format) {
...
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;
n = 3;
break;
---------------------------------
Todd C. Miller
2016-01-28 18:18:58 UTC
Permalink
Post by Chris Bennett
These paths do not exist. Locate vfont brings up nothing
What should be done here?
Fix it or remove it?
I know nothing about troff, so need help from someone who does.
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.

- todd
Chris Bennett
2016-01-28 19:00:11 UTC
Permalink
First diff


Index: 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
--- pathnames.h 28 Oct 2015 13:25:55 -0000 1.6
+++ pathnames.h 28 Jan 2016 18:57:21 -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"
Theo Buehler
2016-01-28 19:22:38 UTC
Permalink
Post by Chris Bennett
First diff
But this won't compile as long as these #defines are still used in
printjobs.c. The code should compile and be correct at all stages, so
this will probably be the last part of your intended troff removal.

Before you submit a diff, please test whether the entire directory lpr
still compiles.

Loading...