summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwlemb <wlemb>2002-10-20 07:29:13 +0000
committerwlemb <wlemb>2002-10-20 07:29:13 +0000
commitcf1102e7e26b6e02c5cbbda5e704c251a1460083 (patch)
tree95b5ad2408a50f3bbcd8a2c7a8b20255bcc14a7e /src
parentf4add35a69b82be62dd85c3c06fcf663aa44dbdd (diff)
downloadgroff-cf1102e7e26b6e02c5cbbda5e704c251a1460083.tar.gz
* src/devices/grops/ps.cc (cmyk_flag): New global variable.
(ps_printer::set_color): Set `cmyk_flag' for CMY and CMYK colors. (ps_printer::~ps_printer): Emit `%%Extensions: CMYK' if `cmyk_flag' is set. * font/devps/prologue.ps (Fk, Ck): Enclose definitions with a `where' construction since `cmyksetcolor' is a PS Level 2 operator.
Diffstat (limited to 'src')
-rw-r--r--src/devices/grops/ps.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/devices/grops/ps.cc b/src/devices/grops/ps.cc
index 47d1f657..97ae387a 100644
--- a/src/devices/grops/ps.cc
+++ b/src/devices/grops/ps.cc
@@ -49,6 +49,9 @@ static double user_paper_length = 0;
static int bflag = 0;
unsigned broken_flags = 0;
+// Non-zero means we need the CMYK extension for PostScript Level 1
+static int cmyk_flag = 0;
+
#define DEFAULT_LINEWIDTH 40 /* in ems/1000 */
#define MAX_LINE_LENGTH 72
#define FILL_MAX 1000
@@ -830,6 +833,7 @@ void ps_printer::set_color(color *col, int fill)
.put_color(Yellow)
.put_color(Black);
s[1] = 'k';
+ cmyk_flag = 1;
break;
case GRAY:
out.put_color(Gray);
@@ -1181,13 +1185,15 @@ ps_printer::~ps_printer()
fputs((broken_flags & USE_PS_ADOBE_2_0) ? "2.0" : "3.0", stdout);
putchar('\n');
out.set_file(stdout);
- {
- out.begin_comment("Creator:")
- .comment_arg("groff")
- .comment_arg("version")
- .comment_arg(Version_string)
+ if (cmyk_flag)
+ out.begin_comment("Extensions:")
+ .comment_arg("CMYK")
.end_comment();
- }
+ out.begin_comment("Creator:")
+ .comment_arg("groff")
+ .comment_arg("version")
+ .comment_arg(Version_string)
+ .end_comment();
{
fputs("%%CreationDate: ", out.get_file());
#ifdef LONG_FOR_TIME_T