1Only in .: Diff.ut
2Only in .: encoding
3Only in .: fil
4Only in .: fil1
5Only in .: font_lis.o
6diff -c /home/sisug/jonas/Dos/nenscript/fontwidt.c ./fontwidt.c
7*** /home/sisug/jonas/Dos/nenscript/fontwidt.c	Thu Oct  1 18:02:48 1992
8--- ./fontwidt.c	Thu Nov 19 18:42:59 1992
9***************
10*** 11,16 ****
11--- 11,17 ----
12   *   (or money, cheques, free trips =8^) !!!!! ) please contact me
13   *   care of geoffw@extro.ucc.oz.au
14   *
15+  *   Ugly fix for fractions of points by Jonas Lagerblad (jonas@sisu.se)
16   */
17
18  #include "machdep.h"
19***************
20*** 77,82 ****
21--- 78,84 ----
22  long  size;
23
24  {
25+   int rem = size % 100;
26    size /= 100;
27
28    if (strcmp (fontname, "Courier") != 0) {
29***************
30*** 84,93 ****
31      exit (1);
32    }
33
34!   if (size < 5 || size > 30) {
35      fprintf (stderr, "%s: %i not bwteen valid font sizes of 5 and 30 - sorry!!\n", progname, size);
36      exit (1);
37    }
38
39    return CourierFontWidths [size-5];
40  }
41--- 86,100 ----
42      exit (1);
43    }
44
45!   if (size < 5 || size > 30 || (size == 30 && rem > 0)) {
46      fprintf (stderr, "%s: %i not bwteen valid font sizes of 5 and 30 - sorry!!\n", progname, size);
47      exit (1);
48    }
49+   if (rem > 0) {
50+       /* make an linear approximation of font size */
51+       return CourierFontWidths [size-5] +
52+ 	  (CourierFontWidths [size-4] - CourierFontWidths [size-5]) * rem/100;
53+   }
54
55    return CourierFontWidths [size-5];
56  }
57Only in .: fontwidt.o
58Only in .: latin1.txt
59diff -c /home/sisug/jonas/Dos/nenscript/machdep.h ./machdep.h
60*** /home/sisug/jonas/Dos/nenscript/machdep.h	Thu Oct  1 16:06:22 1992
61--- ./machdep.h	Thu Nov 19 14:34:27 1992
62***************
63*** 45,51 ****
64  # define	LPR		"lpr -P "		/* spooler with option to set name of printer */
65
66  # define	STRICMP(s1,s2)	strcasecmp(s1,s2)
67! # define	STRDUP(str)	strdup(str)
68
69  # define	USERNAME	((getpwuid (getuid()))->pw_name)
70
71--- 45,55 ----
72  # define	LPR		"lpr -P "		/* spooler with option to set name of printer */
73
74  # define	STRICMP(s1,s2)	strcasecmp(s1,s2)
75! # ifdef ultrix
76! #  define	STRDUP(str)	strcpy(malloc(strlen(str)+1), str)
77! # else
78! #  define	STRDUP(str)	strdup(str)
79! # endif
80
81  # define	USERNAME	((getpwuid (getuid()))->pw_name)
82
83Only in .: main.o
84diff -c /home/sisug/jonas/Dos/nenscript/makefile ./makefile
85*** /home/sisug/jonas/Dos/nenscript/makefile	Thu Oct  1 18:03:16 1992
86--- ./makefile	Thu Nov 19 18:23:19 1992
87***************
88*** 33,38 ****
89--- 33,39 ----
90  CP	=	cp
91  RM	=	rm
92  INSTALL	=	/etc/install
93+ INSTALL	=	install
94
95  all debug:	$(PROG)
96
97***************
98*** 42,48 ****
99  main.$(OBJ):	main.c
100
101  install: $(PROG)
102! 	$(INSTALL) -f $(BININSTALLDIR) -s -m 555 $(PROG)
103
104  install.man: $(MAN)
105  	$(INSTALL) -f $(MAININSTALLDIR) -m 444 $(MAN)
106--- 43,50 ----
107  main.$(OBJ):	main.c
108
109  install: $(PROG)
110! 	$(INSTALL) -s -m 555 $(PROG) $(BININSTALLDIR)
111! 	$(INSTALL) -m 444 $(MAN) $(MANINSTALLDIR)
112
113  install.man: $(MAN)
114  	$(INSTALL) -f $(MAININSTALLDIR) -m 444 $(MAN)
115Only in .: nenscript
116diff -c /home/sisug/jonas/Dos/nenscript/nenscript.1 ./nenscript.1
117*** /home/sisug/jonas/Dos/nenscript/nenscript.1	Wed Oct  7 14:59:56 1992
118--- ./nenscript.1	Thu Nov 19 18:21:12 1992
119***************
120*** 48,54 ****
121
122  Font specifications are formed from the font name and the font size, i.e.
123  .B Courier10
124! specifies a 10 point Courier font, and Courier-Bold12 specifies a bold, 12 point Courier font.
125
126  The NENSCRIPT environment variable may be used to set default values for most
127  configurable attributes. Values set in this way will be overridden by any
128--- 48,58 ----
129
130  Font specifications are formed from the font name and the font size, i.e.
131  .B Courier10
132! specifies a 10 point Courier font, and Courier-Bold12 specifies a bold, 12 point Courier font. Sizes can also be given with a decimal point, i.e.
133! .B Courier7.5
134! specifies a 7.5 point font, this might however result in a marginal error in
135! the size calculations, since a linear approximation of the character width
136! is done.
137
138  The NENSCRIPT environment variable may be used to set default values for most
139  configurable attributes. Values set in this way will be overridden by any
140Only in .: nenscript.1.bak
141Only in .: paper.o
142diff -c /home/sisug/jonas/Dos/nenscript/postscri.c ./postscri.c
143*** /home/sisug/jonas/Dos/nenscript/postscri.c	Thu Oct  1 18:02:52 1992
144--- ./postscri.c	Thu Nov 19 18:41:52 1992
145***************
146*** 11,16 ****
147--- 11,18 ----
148   *   (or money, cheques, free trips =8^) !!!!! ) please contact me
149   *   care of geoffw@extro.ucc.oz.au
150   *
151+  *   Latin1 caracter set handling and fraction point sizes added by
152+  *   Jonas Lagerblad (jonas@sisu.se).
153   */
154
155  #include "machdep.h"
156***************
157*** 86,92 ****
158   */
159
160  #ifdef __STDC__
161! void          PrintPSString   (FILE *, char *, long);
162  void          EndPage         (FILE *);
163  void          StartPage       (FILE *);
164  void          PrintLine       (FILE *, char *, long, int);
165--- 88,94 ----
166   */
167
168  #ifdef __STDC__
169! void          PrintPSString   (FILE *, unsigned char *, long);
170  void          EndPage         (FILE *);
171  void          StartPage       (FILE *);
172  void          PrintLine       (FILE *, char *, long, int);
173***************
174*** 107,122 ****
175  void PrintPSString (stream, line, len)
176
177  FILE *stream;
178! char *line;
179  long len;
180
181  {
182    register long i;
183!   register char * str = line;
184
185    fprintf (stream, "(");
186    for (i = 0; i < len ; i++)
187!     fprintf (stream, "%s%c", str[i] == ')'  ||
188                               str[i] == '('  ||
189  			     str[i] == '\\' ? "\\" : "", str[i]);
190    fprintf (stream, ")");
191--- 109,127 ----
192  void PrintPSString (stream, line, len)
193
194  FILE *stream;
195! unsigned char *line;
196  long len;
197
198  {
199    register long i;
200!   register unsigned char * str = line;
201
202    fprintf (stream, "(");
203    for (i = 0; i < len ; i++)
204!       if ( str[i] & 0x80 )
205! 	  fprintf (stream, "\\%03o", str[i]);
206!       else
207! 	  fprintf (stream, "%s%c", str[i] == ')'  ||
208                               str[i] == '('  ||
209  			     str[i] == '\\' ? "\\" : "", str[i]);
210    fprintf (stream, ")");
211***************
212*** 136,151 ****
213  {
214    char *p, *s, *t;
215    int i;
216
217    /* get ptr to end of string */
218    p = &font[strlen(font)-1];
219
220    /* move backwards until we find a character that is not a digit */
221!   while (p > font && isdigit (*p))
222      p--;
223
224    /* extract the font size */
225!   *fontsize = atol (++p) * SCALE;
226
227    /* now duplicate and copy the font name */
228    t = s = (char *)malloc (p - font + 1);
229--- 141,157 ----
230  {
231    char *p, *s, *t;
232    int i;
233+   extern double atof();
234
235    /* get ptr to end of string */
236    p = &font[strlen(font)-1];
237
238    /* move backwards until we find a character that is not a digit */
239!   while (p > font && (isdigit (*p) || *p == '.'))
240      p--;
241
242    /* extract the font size */
243!   *fontsize = atof (++p) * SCALE;
244
245    /* now duplicate and copy the font name */
246    t = s = (char *)malloc (p - font + 1);
247***************
248*** 366,371 ****
249--- 372,438 ----
250      EndPage (stream);
251  }
252
253+     static char pspro_latin1_data[] = { "\
254+ /newcodes	% foreign character encodings\n\
255+ [\n\
256+ 160/space 161/exclamdown 162/cent 163/sterling 164/currency\n\
257+ 165/yen 166/brokenbar 167/section  168/dieresis 169/copyright\n\
258+ 170/ordfeminine 171/guillemotleft 172/logicalnot 173/hyphen 174/registered\n\
259+ 175/macron 176/degree 177/plusminus 178/twosuperior 179/threesuperior\n\
260+ 180/acute 181/mu 182/paragraph  183/periodcentered 184/cedilla\n\
261+ 185/onesuperior 186/ordmasculine 187/guillemotright 188/onequarter\n\
262+ 189/onehalf 190/threequarters 191/questiondown 192/Agrave 193/Aacute\n\
263+ 194/Acircumflex 195/Atilde 196/Adieresis 197/Aring 198/AE 199/Ccedilla\n\
264+ 200/Egrave 201/Eacute 202/Ecircumflex 203/Edieresis 204/Igrave  205/Iacute\n\
265+ 206/Icircumflex 207/Idieresis 208/Eth 209/Ntilde 210/Ograve 211/Oacute\n\
266+ 212/Ocircumflex 213/Otilde  214/Odieresis 215/multiply 216/Oslash\n\
267+ 217/Ugrave 218/Uacute 219/Ucircumflex 220/Udieresis 221/Yacute 222/Thorn\n\
268+ 223/germandbls 224/agrave 225/aacute 226/acircumflex 227/atilde\n\
269+ 228/adieresis 229/aring 230/ae 231/ccedilla  232/egrave 233/eacute\n\
270+ 234/ecircumflex 235/edieresis 236/igrave 237/iacute 238/icircumflex\n\
271+ 239/idieresis 240/eth 241/ntilde 242/ograve 243/oacute 244/ocircumflex\n\
272+ 245/otilde 246/odieresis 247/divide 248/oslash 249/ugrave  250/uacute\n\
273+ 251/ucircumflex 252/udieresis 253/yacute 254/thorn 255/ydieresis\n\
274+ ] def\n\
275+ \n\
276+ /reencdict 12 dict def\n\
277+ \n\
278+ " };
279+
280+     static char pspro_latin1_func[] = { "\n\
281+     % change fonts using ISO Latin1 characters\n\
282+ /ChgFnt		% size psname natname  =>  font\n\
283+ {\n\
284+     dup FontDirectory exch known	% is re-encoded name known?\n\
285+     { exch pop }			% yes, get rid of long name\n\
286+     { dup 3 1 roll ReEncode } ifelse	% no, re-encode it\n\
287+     findfont exch scalefont setfont\n\
288+ } def\n\
289+ \n\
290+ /ReEncode	%\n\
291+ {\n\
292+     reencdict begin\n\
293+ 	/newname exch def\n\
294+ 	/basename exch def\n\
295+ 	/basedict basename findfont def\n\
296+ 	/newfont basedict maxlength dict def\n\
297+ 	basedict\n\
298+ 	{ exch dup /FID ne\n\
299+ 	    { dup /Encoding eq\n\
300+ 		{ exch dup length array copy newfont 3 1 roll put }\n\
301+ 		{ exch newfont 3 1 roll put } ifelse\n\
302+ 	    }\n\
303+ 	    { pop pop } ifelse\n\
304+ 	} forall\n\
305+ 	newfont /FontName newname put\n\
306+ 	newcodes aload pop newcodes length 2 idiv\n\
307+ 	{ newfont /Encoding get 3 1 roll put } repeat\n\
308+ 	newname newfont definefont pop\n\
309+     end\n\
310+ } def\n\
311+ \n\
312+ " };
313+
314  /********************************
315    StartJob
316      Called when a new job is to be started. This performs all of the
317***************
318*** 480,485 ****
319--- 547,555 ----
320    /* End of header marker */
321    fprintf (stream, "%%%%EndComments\n");
322
323+   /* allow Latin-1 character set by remapping most characters above 127 */
324+   fprintf (stream, "%s\n%s", pspro_latin1_data, pspro_latin1_func);
325+
326    /* scale the coordinate system by SCALE so we can use integer arithmetic
327       without losing accuracy */
328    fprintf (stream, "1 %li div dup scale\n", SCALE);
329***************
330*** 551,565 ****
331    }
332
333    /* define a variable for our body font, and calculate the character width for later use */
334!   fprintf (stream, "/BodyF /%s findfont %li scalefont def\n", bodyfont, BFH);
335!   fprintf (stream, "/CW BodyF setfont ( ) stringwidth pop def\n");
336
337    /* define variables for various other font used - title, gaudy page number, gaudy date, gaudy title */
338!   fprintf (stream, "/Titlef  /%s findfont %li scalefont def\n", titlefont, TFH);
339    if (GaudyFlag) {
340!     fprintf (stream, "/Gpnf    /%s findfont %li scalefont def\n", gaudyPNfont,    gaudyPNfontsize);
341!     fprintf (stream, "/Gdatef  /%s findfont %li scalefont def\n", gaudydatefont,  gaudydatefontsize);
342!     fprintf (stream, "/Gtitlef /%s findfont %li scalefont def\n", gaudytitlefont, gaudytitlefontsize);
343    }
344
345    /* define procedures for drawing continuation line markers, continuation lines, normal lines, and performing indents */
346--- 621,640 ----
347    }
348
349    /* define a variable for our body font, and calculate the character width for later use */
350!   fprintf (stream, "/BodyF { %li /%s /%s-Latin1 ChgFnt } def\n", BFH, bodyfont,
351!      bodyfont, BFH);
352!   fprintf (stream, "/CW BodyF ( ) stringwidth pop def\n");
353
354    /* define variables for various other font used - title, gaudy page number, gaudy date, gaudy title */
355!   fprintf (stream, "/Titlef {  %li /%s /%s-Latin1 ChgFnt } def\n", TFH, titlefont,
356!      titlefont);
357    if (GaudyFlag) {
358!     fprintf (stream, "/Gpnf {  %li /%s /%s-Latin1 ChgFnt } def\n", gaudyPNfontsize,
359!      gaudyPNfont, gaudyPNfont);
360!     fprintf (stream, "/Gdatef { %li /%s /%s-Latin1 ChgFnt } def\n",
361!      gaudydatefontsize, gaudydatefont, gaudydatefont);
362!     fprintf (stream, "/Gtitlef { %li /%s /%s-Latin1 ChgFnt } def\n",
363!      gaudytitlefontsize, gaudytitlefont, gaudytitlefont);
364    }
365
366    /* define procedures for drawing continuation line markers, continuation lines, normal lines, and performing indents */
367***************
368*** 588,594 ****
369
370    /* define stuff for security strings */
371    if (Classification != NULL) {
372!     fprintf (stream, "/Classf  /%s findfont %li scalefont def\n", classfont, classfontsize);
373      fprintf (stream, "/ClassString ");
374      PrintPSString (stream, Classification, strlen(classification));
375      fprintf (stream, " def\n");
376--- 663,670 ----
377
378    /* define stuff for security strings */
379    if (Classification != NULL) {
380!     fprintf (stream, "/Classf {  %li /%s /%s-Latin1 ChgFnt } def\n", classfontsize,
381!      classfont, classfont);
382      fprintf (stream, "/ClassString ");
383      PrintPSString (stream, Classification, strlen(classification));
384      fprintf (stream, " def\n");
385***************
386*** 598,609 ****
387    /* define the start page procedure used to start every page */
388    fprintf (stream, "/StartPage { /SavedPage save def\n");
389    if (Classification != NULL)
390!       fprintf (stream, "  Classf setfont %li %li moveto ClassString Centre 0 setgray show\n", PW / 2, ClassY);
391
392    if (TitleEnabled) {
393      if (GaudyFlag) {
394        fprintf (stream, "  G\n");                                                   /* draw boxes */
395!       fprintf (stream, "  Gtitlef setfont %li %li moveto Centre 0 setgray show\n",   /* title */
396                                           ((LM + (papermetrics->GaudyBoxWidth  * SCALE)) +
397                                             (PW - RM - (papermetrics->GaudyBoxWidth  * SCALE))) / 2L,
398                                           TitleY - (papermetrics->GaudyBoxHeight * SCALE) +
399--- 674,685 ----
400    /* define the start page procedure used to start every page */
401    fprintf (stream, "/StartPage { /SavedPage save def\n");
402    if (Classification != NULL)
403!       fprintf (stream, "  Classf %li %li moveto ClassString Centre 0 setgray show\n", PW / 2, ClassY);
404
405    if (TitleEnabled) {
406      if (GaudyFlag) {
407        fprintf (stream, "  G\n");                                                   /* draw boxes */
408!       fprintf (stream, "  Gtitlef %li %li moveto Centre 0 setgray show\n",   /* title */
409                                           ((LM + (papermetrics->GaudyBoxWidth  * SCALE)) +
410                                             (PW - RM - (papermetrics->GaudyBoxWidth  * SCALE))) / 2L,
411                                           TitleY - (papermetrics->GaudyBoxHeight * SCALE) +
412***************
413*** 615,624 ****
414          PrintPSString (stream, title, strlen(title));
415          fprintf (stream, " Centre show\n");
416        }
417!       fprintf (stream, "  Gpnf    setfont %li %li moveto Centre 1 setgray show\n",   /* page number */
418                                           PW - RM - ((papermetrics->GaudyBoxWidth * SCALE) / 2L),
419                                           TitleY - ((papermetrics->GaudyBoxHeight * SCALE) / 2L) - gaudyPNfontsize * 7L / 20L);
420!       fprintf (stream, "  Gdatef  setfont %li %li moveto (%s) Centre 0 setgray show\n",
421  					 LM + ((papermetrics->GaudyBoxWidth * SCALE) / 2L),
422  					 TitleY - ((papermetrics->GaudyBoxHeight * SCALE) * 3L / 5L) - gaudydatefontsize * 7L / 10L, tm_string);
423        fprintf (stream, "                  %li %li moveto (%s) Centre show\n",
424--- 691,700 ----
425          PrintPSString (stream, title, strlen(title));
426          fprintf (stream, " Centre show\n");
427        }
428!       fprintf (stream, "  Gpnf    %li %li moveto Centre 1 setgray show\n",   /* page number */
429                                           PW - RM - ((papermetrics->GaudyBoxWidth * SCALE) / 2L),
430                                           TitleY - ((papermetrics->GaudyBoxHeight * SCALE) / 2L) - gaudyPNfontsize * 7L / 20L);
431!       fprintf (stream, "  Gdatef  %li %li moveto (%s) Centre 0 setgray show\n",
432  					 LM + ((papermetrics->GaudyBoxWidth * SCALE) / 2L),
433  					 TitleY - ((papermetrics->GaudyBoxHeight * SCALE) * 3L / 5L) - gaudydatefontsize * 7L / 10L, tm_string);
434        fprintf (stream, "                  %li %li moveto (%s) Centre show\n",
435***************
436*** 625,631 ****
437  					 LM + ((papermetrics->GaudyBoxWidth * SCALE) / 2L),
438  					 TitleY - ((papermetrics->GaudyBoxHeight * SCALE) * 3L / 5L) + gaudydatefontsize * 7L / 10L, dt_string);
439      } else {
440!       fprintf (stream, "  0 setgray Titlef setfont %li %li moveto ", LM, TitleY);
441        if (title != NULL) {
442          fprintf (stream, "pop pop ");
443          PrintPSString (stream, title, strlen(title));
444--- 701,707 ----
445  					 LM + ((papermetrics->GaudyBoxWidth * SCALE) / 2L),
446  					 TitleY - ((papermetrics->GaudyBoxHeight * SCALE) * 3L / 5L) + gaudydatefontsize * 7L / 10L, dt_string);
447      } else {
448!       fprintf (stream, "  0 setgray Titlef %li %li moveto ", LM, TitleY);
449        if (title != NULL) {
450          fprintf (stream, "pop pop ");
451          PrintPSString (stream, title, strlen(title));
452***************
453*** 637,643 ****
454        }
455      }
456    }
457!   fprintf (stream, "  BodyF setfont 0 setgray } def\n");
458
459    /* define end page procedure */
460    fprintf (stream, "/EndPage   {");
461--- 713,719 ----
462        }
463      }
464    }
465!   fprintf (stream, "  BodyF 0 setgray } def\n");
466
467    /* define end page procedure */
468    fprintf (stream, "/EndPage   {");
469***************
470*** 644,650 ****
471    if (GaudyFlag && Columns == 2)
472      fprintf (stream, " %li %li moveto %li -%li rlineto stroke ", LM + WW + (papermetrics->ColumnSep * SCALE / 2), StartY, 0L, StartY - EndY);
473    if (Classification != NULL)
474!       fprintf (stream, "  Classf setfont %li %li moveto ClassString Centre 0 setgray show\n", PW / 2, ClassBottomY);
475    fprintf (stream, "showpage SavedPage restore } def\n");
476
477    /* end of the header */
478--- 720,726 ----
479    if (GaudyFlag && Columns == 2)
480      fprintf (stream, " %li %li moveto %li -%li rlineto stroke ", LM + WW + (papermetrics->ColumnSep * SCALE / 2), StartY, 0L, StartY - EndY);
481    if (Classification != NULL)
482!       fprintf (stream, "  Classf %li %li moveto ClassString Centre 0 setgray show\n", PW / 2, ClassBottomY);
483    fprintf (stream, "showpage SavedPage restore } def\n");
484
485    /* end of the header */
486Only in .: postscri.o
487Only in .: print.o
488