bring in most up to date code; removes hardcoded printer resolution;
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Sun, 22 Sep 1985 07:21:47 +0000 (23:21 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Sun, 22 Sep 1985 07:21:47 +0000 (23:21 -0800)
adds 2 pixels to effective plotting resolution; parameterizes font and point size;
make linemod a hack to set font from plot file

SCCS-vsn: lib/libplot/imagen/imp.h 5.2
SCCS-vsn: lib/libplot/imagen/line.c 5.2
SCCS-vsn: lib/libplot/imagen/linemod.c 5.2
SCCS-vsn: lib/libplot/imagen/open.c 5.2
SCCS-vsn: lib/libplot/imagen/space.c 5.2

usr/src/lib/libplot/imagen/imp.h
usr/src/lib/libplot/imagen/line.c
usr/src/lib/libplot/imagen/linemod.c
usr/src/lib/libplot/imagen/open.c
usr/src/lib/libplot/imagen/space.c

index 564f5a0..f911c1b 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)imp.h       5.1 (Berkeley) %G%
+ *     @(#)imp.h       5.2 (Berkeley) %G%
  */
 
 #include <stdio.h>
  */
 
 #include <stdio.h>
@@ -14,3 +14,5 @@ extern float oboty;
 extern float scalex;
 extern float scaley;
 int imPx, imPy;
 extern float scalex;
 extern float scaley;
 int imPx, imPy;
+extern int imPcsize;
+extern char *imP_charset;
index 7810a85..0bd333e 100644 (file)
@@ -5,26 +5,25 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)line.c     5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)line.c     5.2 (Berkeley) %G%";
 #endif not lint
 
 #include "imp.h"
 #include "imPcodes.h"
 #endif not lint
 
 #include "imp.h"
 #include "imPcodes.h"
-
 float obotx = 0.;
 float oboty = 0.;
 float obotx = 0.;
 float oboty = 0.;
-float botx = 0.;
-float boty = 0.;
+float botx = 2.;
+float boty = 2.;
 float scalex = 1.;
 float scaley = 1.;
 line(x0,y0,x1,y1)
 {
        putch(imP_CREATE_PATH);
        putwd(2);               /* two coordinates follow */
 float scalex = 1.;
 float scaley = 1.;
 line(x0,y0,x1,y1)
 {
        putch(imP_CREATE_PATH);
        putwd(2);               /* two coordinates follow */
-       putwd((int)((x0-obotx)*scalex+botx+1)); 
-       putwd((int)((y0-oboty)*scaley+boty+1)); 
-       putwd((int)((x1-obotx)*scalex+botx+1)); 
-       putwd((int)((y1-oboty)*scaley+boty+1)); 
+       putwd((int)((x0-obotx)*scalex+botx));   
+       putwd((int)((y0-oboty)*scaley+boty));   
+       putwd((int)((x1-obotx)*scalex+botx));   
+       putwd((int)((y1-oboty)*scaley+boty));   
        putch(imP_DRAW_PATH);
        putch(15);              /* "black" lines */
        imPx = x1;
        putch(imP_DRAW_PATH);
        putch(15);              /* "black" lines */
        imPx = x1;
index 2175229..25fab02 100644 (file)
@@ -5,10 +5,36 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)linemod.c  5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)linemod.c  5.2 (Berkeley) %G%";
 #endif not lint
 
 #endif not lint
 
+/*
+ * Hack to set font.
+ */
 linemod(s)
 char *s;
 {
 linemod(s)
 char *s;
 {
+       register char *tit;
+       register char *nam;
+       int siz = 0;
+       nam = s;
+       for(tit = "charset="; *tit; )
+               if (*tit++ != *nam++)
+                       return;
+       s = nam;
+       while(*nam) 
+               switch(*nam++) {
+               case ',':
+               case '\n':
+                       *--nam = 0;
+               }
+       siz = atoi(++nam);
+       if (siz == 0) {
+               while (*--nam >= '0' && *nam <= '9')
+                       ;
+               siz = (atoi(++nam)*4)/3;
+       }
+       if (siz == 0)
+               siz = imPcsize;
+       setfont(s, siz);
 }
 }
index 68ce719..dabd852 100644 (file)
@@ -5,18 +5,19 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)open.c     5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)open.c     5.2 (Berkeley) %G%";
 #endif not lint
 
 #include "imPcodes.h"
 #include "imp.h"
 #endif not lint
 
 #include "imPcodes.h"
 #include "imp.h"
-int imPcsize = 12;
+
 openpl(){
 openpl(){
+
        putch(imP_SET_HV_SYSTEM);
          putch((3<<3)|5);
        putch(imP_SET_FAMILY);
          putch(2);
        putch(imP_SET_HV_SYSTEM);
          putch((3<<3)|5);
        putch(imP_SET_FAMILY);
          putch(2);
-       setfont("cmasc7",imPcsize);
+       setfont(imP_charset,imPcsize);
        putch(imP_SET_IL);
          putwd(imPcsize+3);
        putch(imP_SET_SP);
        putch(imP_SET_IL);
          putwd(imPcsize+3);
        putch(imP_SET_SP);
index d73d56f..81346c4 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)space.c    5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)space.c    5.2 (Berkeley) %G%";
 #endif not lint
 
 extern float botx;
 #endif not lint
 
 extern float botx;
@@ -14,14 +14,17 @@ extern float obotx;
 extern float oboty;
 extern float scalex;
 extern float scaley;
 extern float oboty;
 extern float scalex;
 extern float scaley;
+
+int PlotRes = DEFRES;
+
 int scaleflag;
 space(x0,y0,x1,y1){
 int scaleflag;
 space(x0,y0,x1,y1){
-       botx = 0.;
-       boty = 0.;
+       botx = 2.;
+       boty = 2.;
        obotx = x0;
        oboty = y0;
        if(scaleflag)
                return;
        obotx = x0;
        oboty = y0;
        if(scaleflag)
                return;
-       scalex = 2040./(x1-x0);
-       scaley = 2040./(y1-y0);
+       scalex = (8.0 * PlotRes)/(x1-x0);
+       scaley = (8.0 * PlotRes)/(y1-y0);
 }
 }