🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by I.A.Utting Thu, 28 Feb 1985 13:31
Bug in (most) ditroff back-ends
#402
Author: I.A.Utting
Date: Thu, 28 Feb 1985 13:31
63 lines
2438 bytes
Subject: Problem with most distributed device independent troff back-ends.

Index: 	d202.c, daps.c, d8400.c etc.

Description:
	A combination of the use of non-standard fonts (font 0) and
thin-space characters (\| and \^) causes following charcters to be selected
from the wrong font.

Repeat-By:
	This rather depends on your font description files. IF:
	a)	Thin spaces are not declared in some font not named in DESC
		(say PO).
	b)	Both thin spaces and the character X (also in PO) are named
		in some standard font (say S).
	THEN:
		.ft PO
		X\|X
	will cause the first X to come from PO and the second from S. The
	width of both Xs will be the width in PO.

Fix:
*** dcan.c.OLD	Wed Feb 27 09:44:50 1985
--- dcan.c	Wed Feb 27 09:53:35 1985
***************
*** 884,890
  		for(k = smnt, j = 0; j <= nfonts; j++, k = (k + 1) % (nfonts+1))
  			if(fontbase[k] && ((i = fitab[k][c] & BMASK) != 0)) {
  				p = codetab[k];
- 				setfont(k);
  				break;
  			}
  	}

--- 884,889 -----
  		for(k = smnt, j = 0; j <= nfonts; j++, k = (k + 1) % (nfonts+1))
  			if(fontbase[k] && ((i = fitab[k][c] & BMASK) != 0)) {
  				p = codetab[k];
  				break;
  			}
  	}
***************
*** 893,898
  		if(dbg) fprintf(stderr,"0%o not found\n",c+32);
  		return;
  	}
  	if(dbg) fprintf(stderr,isprint(c+32)?"%c %d\n":"0%3o %d\n",c+32,code);
  	else xychar(code);
  	if(font != ofont) setfont(ofont);

--- 892,898 -----
  		if(dbg) fprintf(stderr,"0%o not found\n",c+32);
  		return;
  	}
+ 	if(k != font) setfont(k);
  	if(dbg) fprintf(stderr,isprint(c+32)?"%c %d\n":"0%3o %d\n",c+32,code);
  	else xychar(code);
  	if(font != ofont) setfont(ofont);
--
(PS.	The "fontbase[k] &&" in the test in the for loop is an old fix to stop
	nil-pointer de-referencing when there is no font 0)

		Ian Utting	(iau@ukc)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads