🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #4103

Re: Enhancements to Old Troff

#4103
From: edmoy
Date: Fri, 09 Oct 1987 00:15
53 lines
2044 bytes
>2.  Fixed the various ligature bugs.  Most of these haven't even been fixed
>	in the newest ditroff, by the way.  Getta loada these:
>
>	% troff -a
>	.nr f 1
>	xx\nfyy
>	.fl
>	xxy1y

In n4.c, function setn(), you see code like:

	if((i=getch() & CMASK) == '+')f = 1;
		else if(i == '-')f = -1;
			else ch = i;

Change this to:

	lgf++;
	if((i=getch() & CMASK) == '+')f = 1;
		else if(i == '-')f = -1;
			else ch = i;
	lgf--;

>	% troff -man
>	.TP
>	.BI \-f fontname
>	.TP
>	\fB\-f\fIfontname\fP
>
>	The above produces an ff ligature in bold instead of an f in bold
>	then an f in italics.  The bug apparently results from .TP's use
>	of the rare .it request.

Actually, it's not the .it request, but the diversion that .TP uses.  The
problem is in t6.c, in getlg().  What getlg() needs to do is check the size
and font bits of the next letter with the current letter (which was the
letter f) and fail if they don't match.  You need something like:

#define	SFMASK	077000
#define	fontmismatch(i,j)	(((i) & SFMASK) != ((j) & SFMASK))

In getlg(), each time you do a getch0(), do a fontmismatch() test on the new
character with the original (f) character.  If there is a mismatch, you stop
where you are (either with just an f, or with a two character ligature).
Remember to push back the new character into ch0.

Edward Moy
Academic Computing Services
University of California
Berkeley, CA  94720

edmoy@opal.Berkeley.EDU
ucbvax!opal!edmoy
Technical Details
Message-ID: <5368@jade.BERKELEY.EDU>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!ucbvax!jade!opal.berkeley.edu!edmoy

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!ucbvax!jade!opal.berkeley.edu!edmoy
From: edmoy@opal.berkeley.edu
Newsgroups: comp.text
Subject: Re: Enhancements to Old Troff
Message-ID: <5368@jade.BERKELEY.EDU>
Date: Thu, 8-Oct-87 20:15:56 EDT
Article-I.D.: jade.5368
Posted: Thu Oct  8 20:15:56 1987
Date-Received: Sun, 11-Oct-87 11:48:08 EDT
Sender: usenet@jade.BERKELEY.EDU
Reply-To: edmoy@opal.berkeley.edu()
Organization: University of California, Berkeley
Lines: 53