summaryrefslogtreecommitdiff
path: root/src/preproc/pic/troff.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/preproc/pic/troff.cpp')
-rw-r--r--src/preproc/pic/troff.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/preproc/pic/troff.cpp b/src/preproc/pic/troff.cpp
index ddda45db..22bf897d 100644
--- a/src/preproc/pic/troff.cpp
+++ b/src/preproc/pic/troff.cpp
@@ -324,7 +324,7 @@ void troff_output::simple_circle(int filled, const position &cent, double rad)
position c = transform(cent);
printf("\\h'%.3fi'"
"\\v'%.3fi'"
- "\\D'%c%.3fi'"
+ "\\D'%c %.3fi'"
"\n.sp -1\n",
c.x - rad/scale,
c.y,
@@ -338,7 +338,7 @@ void troff_output::simple_ellipse(int filled, const position &cent,
position c = transform(cent);
printf("\\h'%.3fi'"
"\\v'%.3fi'"
- "\\D'%c%.3fi %.3fi'"
+ "\\D'%c %.3fi %.3fi'"
"\n.sp -1\n",
c.x - dim.x/(2.0*scale),
c.y,
@@ -355,7 +355,7 @@ void troff_output::simple_arc(const position &start, const distance &cent,
distance ev = transform(end) - c;
printf("\\h'%.3fi'"
"\\v'%.3fi'"
- "\\D'a%.3fi %.3fi %.3fi %.3fi'"
+ "\\D'a %.3fi %.3fi %.3fi %.3fi'"
"\n.sp -1\n",
s.x, s.y, cv.x, cv.y, ev.x, ev.y);
}
@@ -366,7 +366,7 @@ void troff_output::simple_line(const position &start, const position &end)
distance ev = transform(end) - s;
printf("\\h'%.3fi'"
"\\v'%.3fi'"
- "\\D'l%.3fi %.3fi'"
+ "\\D'l %.3fi %.3fi'"
"\n.sp -1\n",
s.x, s.y, ev.x, ev.y);
}
@@ -378,7 +378,7 @@ void troff_output::simple_spline(const position &start,
printf("\\h'%.3fi'"
"\\v'%.3fi'",
pos.x, pos.y);
- fputs("\\D'~", stdout);
+ fputs("\\D'~ ", stdout);
for (int i = 0; i < n; i++) {
position temp = transform(v[i]);
distance d = temp - pos;
@@ -398,7 +398,7 @@ void troff_output::simple_polygon(int filled, const position *v, int n)
printf("\\h'%.3fi'"
"\\v'%.3fi'",
pos.x, pos.y);
- printf("\\D'%c", (filled ? 'P' : 'p'));
+ printf("\\D'%c ", (filled ? 'P' : 'p'));
for (int i = 1; i < n; i++) {
position temp = transform(v[i]);
distance d = temp - pos;
@@ -480,13 +480,15 @@ void troff_output::line_thickness(double p)
void troff_output::set_fill(double f)
{
if (driver_extension_flag && f != last_fill) {
- printf("\\D'Fg %.3f'\n.sp -1\n", 1.0 - f);
+ // \D'Fg ...' emits a node only in compatibility mode,
+ // thus we add a dummy node
+ printf("\\&\\D'Fg %.3f'\n.sp -1\n", 1.0 - f);
last_fill = f;
}
if (last_filled) {
free(last_filled);
last_filled = 0;
- printf("\\M[]\n.sp -1\n");
+ printf("\\M[]\n");
}
}
@@ -496,12 +498,14 @@ void troff_output::set_color(char *color_fill, char *color_outlined)
if (last_filled || last_outlined) {
reset_color();
}
+ // \m and \M emit a node in compatibility mode only,
+ // but that won't work anyway
if (color_fill) {
- printf("\\M[%s]\n.sp -1\n", color_fill);
+ printf("\\M[%s]\n", color_fill);
last_filled = strsave(color_fill);
}
if (color_outlined) {
- printf("\\m[%s]\n.sp -1\n", color_outlined);
+ printf("\\m[%s]\n", color_outlined);
last_outlined = strsave(color_outlined);
}
}
@@ -511,12 +515,12 @@ void troff_output::reset_color()
{
if (driver_extension_flag) {
if (last_filled) {
- printf("\\M[]\n.sp -1\n");
+ printf("\\M[]\n");
a_delete last_filled;
last_filled = 0;
}
if (last_outlined) {
- printf("\\m[]\n.sp -1\n");
+ printf("\\m[]\n");
a_delete last_outlined;
last_outlined = 0;
}