SCCS-vsn: local/ditroff/ditroff.old.okeeffe/grn/hgraph.c 1.6
-/* hgraph.c 1.5 (Berkeley) 83/09/19
+/* hgraph.c 1.6 (Berkeley) 83/10/07
*
* This file contains the graphics routines for converting gremlin
* pictures to troff input.
*
* This file contains the graphics routines for converting gremlin
* pictures to troff input.
dy((double) p1->y);
} /* end while */;
putchar('\'');
dy((double) p1->y);
} /* end while */;
putchar('\'');
break;
case VECTOR: length = 1; /* keep track of line length */
break;
case VECTOR: length = 1; /* keep track of line length */
dy((double) p1->y);
putchar('\'');
if (length++ > MAXVECT) {
dy((double) p1->y);
putchar('\'');
if (length++ > MAXVECT) {
tmove (p1);
length = 1;
}
} /* end while */
tmove (p1);
length = 1;
}
} /* end while */
break;
} /* end switch */
} /* end else Text */
break;
} /* end switch */
} /* end else Text */
int savelasty = lasty; /* vertical motion for text is to be */
/* ignored. save current y here */
int savelasty = lasty; /* vertical motion for text is to be */
/* ignored. save current y here */
- printf(".nr g8 \\n(.d\n", string); /* save current vertical position. */
- printf(".ds g9 \"%s", string); /* define string containing the text. */
+ printf(".nr g8 \\n(.d\n"); /* save current vertical position. */
+ printf(".ds g9 \"%s\n", string); /* define string containing the text. */
tmove(&pnt); /* move to positioning point */
switch (justify) {
/* local vertical motions */
tmove(&pnt); /* move to positioning point */
switch (justify) {
/* local vertical motions */
case CENTRIGHT:
case TOPRIGHT: printf("\\h'-\\w'\\*(g9'u'"); /* back whole */
}
case CENTRIGHT:
case TOPRIGHT: printf("\\h'-\\w'\\*(g9'u'"); /* back whole */
}
printf("\\*(g9\n"); /* now print the text. */
printf("\\*(g9\n"); /* now print the text. */
- printf(".sp |\\n(g8u"); /* restore vertical position */
- lasty = savelasty; /* vertical position is restored to */
- /* what it was before text was printed */
+ printf(".sp |\\n(g8u\n"); /* restore vertical position */
+ lasty = savelasty; /* vertical position restored to where it was */
+ lastx = xleft; /* before text, also horizontal is at left */
printf("\\D'c %du", (int) ((radius + radius) * troffscale));
}
putchar('\''); /* finish the command */
printf("\\D'c %du", (int) ((radius + radius) * troffscale));
}
putchar('\''); /* finish the command */
HGSetFont(font, size)
int font, size;
{
HGSetFont(font, size)
int font, size;
{
printf(".ft %s\n.ps %s\n", tfont[font-1], tsize[size-1]);
}
printf(".ft %s\n.ps %s\n", tfont[font-1], tsize[size-1]);
}
HGSetBrush(mode)
int mode;
{
HGSetBrush(mode)
int mode;
{
- if (linmod != style[--mode]) {
- cr();
+ if (linmod != style[--mode] || linethickness != thick[mode]) {
printf ("\\D's %du'",linmod = style[mode]);
printf ("\\D's %du'",linmod = style[mode]);
- }
- if (linethickness != thick[mode]) {
- cr();
printf ("\\D't %du'", linethickness = thick[mode]);
printf ("\\D't %du'", linethickness = thick[mode]);
| Routine: tmove (point_pointer)
|
| Results: produces horizontal and vertical moves for troff given the
| Routine: tmove (point_pointer)
|
| Results: produces horizontal and vertical moves for troff given the
- | pointer of a point to move to.
+ | pointer of a point to move to. Adds -1v to the movement to
+ | counteract the vertical space generated by input "lines"
*----------------------------------------------------------------------------*/
tmove(ptr)
*----------------------------------------------------------------------------*/
tmove(ptr)
register int dx;
register int dy;
register int dx;
register int dy;
if (dy = iy - lasty) {
printf(".sp %du\n", dy);
}
if (dy = iy - lasty) {
printf(".sp %du\n", dy);
}