[net.sources.mac] MacWrite to troff conversion

sakw@cvaxa.UUCP (Sak Wathanasin) (10/19/85)

Bill Roberts (bill@hao) writes
> Have you been experiencing weird behavior with the conversion?
> For example, bold type face will degrade to plain and then turn to italics
> within a single word.  And tabs are not always recognized.

This is a fix for the above problem, and also one to do with saving space for
pictures. I have also added a -o option to offset the entire page so that you
can centre the page without having to adjust all your rulers. I have also
changed the single space leading from 4 to 2 pts, but you may not want this.

As for tabs: I thought there was a problem, but it turned out that the chars
in troff are wider than the chars in MacW (for the same font size), so that
tabulations that look right on the screen may in fact "overrun" into the next
tab position.

-------------cut here and feed to patch--------------   
16,17d15
<     version 1.2, sakw Sep 2, 85.  Bug fixes + new -o param for offsetting
< 		page.
26c24
< #define VERSION "1.2"
---
> #define VERSION "1.1"
32d29
< #ifdef bsd4
37,40d33
< #else
< #define SWAP(s)	;	/* null definition */
< #define SWAPL(s) ;
< #endif
42d34
<
68d59
< char *pg_offset = "1.0i";
113,115d103
< 		case 'o':
< 		    pg_offset = *argv + 2;
< 		    break;
117c105
< 		    printf("usage: %s [-r] [-p] [-d] [-w] [-s<pointadj>] [-o<offset>] files...\n",
---
> 		    printf("usage: %s [-r] [-p] [-d] [-w] [-s<pointadj>] files...\n",
196,197c184
< 		        if (curJust != LEFTJUST) printf(".pp\n");
< 			else printf(".br\n");
---
> 		        printf(".pp\n");
216c203
< 			if(td->nformats > 1)		/* bug fix by sakw: there is always 1 format info itm */
---
> 			if(td->nformats > 0)
250d236
<
260,262c246
< 		    printf(".br\n.(b\n.sv %.1fi\n.)b\n",
< 		           textInfo[j].paraHeight/80. );
< /*			   bug fix by sakw
---
> 		    printf(".sv %.1fi\n",
264d247
< */
410d392
<      * sakw: set leading to 2 point
412c394
<     newSpacing = ((ruler->flags & RF_6LPI? 1 : 2) * (ruler->spacing + 2)) / 2;
---
>     newSpacing = ((ruler->flags & RF_6LPI? 1 : 4) * (ruler->spacing + 2)) / 2;
439c421
< 	printf("%.1fi", -curParIndent);
---
> 	printf("%.1fi", -curParIndent );
455c437
<     printf(".po %s\n", pg_offset);
---
>     printf(".po 1i\n");
658,659c640
<     if ( (fp - dataBuf) & 1 )		/* bug fix by sakw: rounding applies to
< 					   ptr relative to start of buf */
---
>     if ( (int)fp & 1 )
-- 
Sak Wathanasin, U of Sussex, Cognitive Studies, Falmer, Sussex BN1 9QN, UK
uucp:...mcvax!ukc!cvaxa!sakw  arpa/janet: sakw%svga@uk.ac.ucl.cs