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
* 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%
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;
-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;
-static char sccsid[] = "@(#)linemod.c 5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)linemod.c 5.2 (Berkeley) %G%";
+/*
+ * Hack to set font.
+ */
+ 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);
-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"
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);
-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;
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);