summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwlemb <wlemb>2001-12-06 10:03:21 +0000
committerwlemb <wlemb>2001-12-06 10:03:21 +0000
commit18b836fb33487d2277c0f9b4836ecd94d5a826d1 (patch)
treee9e2b01f7fd959add202e2cbe99d481329e11441
parent6cfe607b019766844a38f54dacd67745ddfe4412 (diff)
downloadgroff-18b836fb33487d2277c0f9b4836ecd94d5a826d1.tar.gz
* src/roff/troff/input.cc (get_delim_file_name): Removed since no
longer used. * src/devices/grohtml/post-html.cc (html_printer::html_printer): Fix order of initializers. * NEWS: Updated. * doc/groff.texinfo: Fix documentation of \O. * src/devices/grohtml/html-text.cc (html_text::do_indent, html_text::do_table, html_text::do_emittext, html_text::do_para): Use `const' for first argument. (html_text::do_table): Use cast. * src/devices/grohtml/html-text.h: Updated. * src/devices/grohtml/output.cc (simple_output::put_string): Add method for `const string &s'. * src/devices/grohtml/html.h: Updated. * src/devices/grohtml/post-html.cc (MAX_STRING_LENGTH): Removed. (ANCHOR_TEMPLATE): Modified. (manufacture_headings): New global variable to handle `-h' option. (is_subsection): Removed. (char_buffer::add_string): Add `const' to first argument. Protect against invalid string argument. Add method for `const string &s'. (text_glob): Completely redesigned. (page): Use `const' for strings and remove string length variable. (page::add_html): Removed. (page::add_end_encode): New member function. (to_unicode): Moved upwards. (title_desc, header_desc): Updated. (header_desc::write_headings): Updated to new ANCHOR_TEMPLATE definition. (html_printer::is_bold, html_printer::make_bold): New member functions. (html_printer::end_of_line): Updated. (generate_img_src, html_printer::do_auto_image, html_printer::do_title, html_printer::write_header, html_printer::determine_header_level, html_printer::do_heading, html_printer::do_linelength, html_printer::do_pageoffset, html_printer::do_indentation, html_printer::do_tempindent, html_printer::do_indentedparagraph, html_printer::do_break, html_printer::flush_sbuf, get_html_translation, html_printer::begin_page, html_printer::special): Rewritten to get rid of static string length limit. (html_printer::troff_tag): Added `.no-auto-rule'. (html_printer::flush_globs): Small fix. (html_printer::determine_space): Don't compute `space_width'. (html_printer::translate_to_html): Renamed to ... (html_printer::emit_html): This (with updates). (html_printer::write_header): Implement `-h' option. (html_printer::draw): Remove commented-out code. Handle `F' command. (html_printer::add_char_to_sbuf): Removed. (html_printer::add_to_sbuf): Rewritten. (html_printer::sbuf_continuation): Fixed. (html_printer::seen_backwards_escape, reverse, html_printer::remove_last_char_from_sbuf): Removed. (char_translate_to_html, str_translate_to_html): Removed. (html_printer::overstrike): New function member. (html_printer::set_char): Use it. (html_printer::do_body): New function member. (html_printer::~html_printer): Use it. (main): Handle `-h' option. (usage): Updated. * src/devices/grohtml/grohtml.man: Document -h switch. * src/preproc/html/pre-html.cc: Include searchpath.h Replace `POSTSCRIPTRES' macro with `postscriptRes' variable. (get_resolution): New function. (checkImageDir): Use `0777' permissions in mkdir() (write_start_image): Rewritten to use `\O[5...]'. (createImage, generateImages): Updated. (main): Handle `F' and `h' options. Use `get_resolution'. * src/roff/troff/input.cc (begin, end, image): Removed. (do_suppress): Take parameter. Handle modified syntax of `\O'. (token::next): Updated. (init_markup_requests): Removed. (main): Updated. * src/roff/troff/div.h: Add declaration for begin_page(). * tmac/color-html.tmac: Removed. Contents moved to... * tmac/html.tmac: Here. Set background color. * tmac/color.tmac: Removed. Contents moved to... * tmac/ps.tmac: Here. * tmac/www.tmac: Remove the title command when generating images for html. (NO_AUTO_RULE): New macro. (HTML_DO_IMAGE): Use revised `\O' escapes. * tmac/Makefile.sub, tmac/groff_www.man, tmac/troffrc: Updated.
-rw-r--r--ChangeLog101
-rw-r--r--NEWS10
-rw-r--r--doc/groff.texinfo19
-rw-r--r--src/devices/grohtml/grohtml.man11
-rw-r--r--src/devices/grohtml/html-text.cc12
-rw-r--r--src/devices/grohtml/html-text.h8
-rw-r--r--src/devices/grohtml/html.h1
-rw-r--r--src/devices/grohtml/output.cc6
-rw-r--r--src/devices/grohtml/post-html.cc1146
-rw-r--r--src/preproc/html/pre-html.cc104
-rw-r--r--src/roff/troff/div.h1
-rw-r--r--src/roff/troff/input.cc198
-rw-r--r--tmac/Makefile.sub3
-rwxr-xr-xtmac/color-html.tmac482
-rwxr-xr-xtmac/color.tmac549
-rw-r--r--tmac/groff_mdoc.man2
-rw-r--r--tmac/groff_www.man5
-rw-r--r--tmac/html.tmac491
-rw-r--r--tmac/ps.tmac550
-rw-r--r--tmac/troffrc4
-rw-r--r--tmac/www.tmac29
21 files changed, 1857 insertions, 1875 deletions
diff --git a/ChangeLog b/ChangeLog
index 724799c2..37fe4e9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,104 @@
+2001-12-05 Werner LEMBERG <wl@gnu.org>
+
+ * src/roff/troff/input.cc (get_delim_file_name): Removed since no
+ longer used.
+ * src/devices/grohtml/post-html.cc (html_printer::html_printer): Fix
+ order of initializers.
+ * NEWS: Updated.
+
+2001-12-05 Gaius Mulley <gaius@glam.ac.uk>
+
+ * doc/groff.texinfo: Fix documentation of \O.
+
+ * src/devices/grohtml/html-text.cc (html_text::do_indent,
+ html_text::do_table, html_text::do_emittext, html_text::do_para):
+ Use `const' for first argument.
+ (html_text::do_table): Use cast.
+ * src/devices/grohtml/html-text.h: Updated.
+ * src/devices/grohtml/output.cc (simple_output::put_string): Add
+ method for `const string &s'.
+ * src/devices/grohtml/html.h: Updated.
+ * src/devices/grohtml/post-html.cc (MAX_STRING_LENGTH): Removed.
+ (ANCHOR_TEMPLATE): Modified.
+ (manufacture_headings): New global variable to handle `-h' option.
+ (is_subsection): Removed.
+ (char_buffer::add_string): Add `const' to first argument.
+ Protect against invalid string argument.
+ Add method for `const string &s'.
+ (text_glob): Completely redesigned.
+ (page): Use `const' for strings and remove string length variable.
+ (page::add_html): Removed.
+ (page::add_end_encode): New member function.
+ (to_unicode): Moved upwards.
+ (title_desc, header_desc): Updated.
+ (header_desc::write_headings): Updated to new ANCHOR_TEMPLATE
+ definition.
+ (html_printer::is_bold, html_printer::make_bold): New member
+ functions.
+ (html_printer::end_of_line): Updated.
+ (generate_img_src, html_printer::do_auto_image,
+ html_printer::do_title, html_printer::write_header,
+ html_printer::determine_header_level, html_printer::do_heading,
+ html_printer::do_linelength, html_printer::do_pageoffset,
+ html_printer::do_indentation, html_printer::do_tempindent,
+ html_printer::do_indentedparagraph, html_printer::do_break,
+ html_printer::flush_sbuf, get_html_translation,
+ html_printer::begin_page, html_printer::special): Rewritten to get
+ rid of static string length limit.
+ (html_printer::troff_tag): Added `.no-auto-rule'.
+ (html_printer::flush_globs): Small fix.
+ (html_printer::determine_space): Don't compute `space_width'.
+ (html_printer::translate_to_html): Renamed to ...
+ (html_printer::emit_html): This (with updates).
+ (html_printer::write_header): Implement `-h' option.
+ (html_printer::draw): Remove commented-out code. Handle `F'
+ command.
+ (html_printer::add_char_to_sbuf): Removed.
+ (html_printer::add_to_sbuf): Rewritten.
+ (html_printer::sbuf_continuation): Fixed.
+ (html_printer::seen_backwards_escape, reverse,
+ html_printer::remove_last_char_from_sbuf): Removed.
+ (char_translate_to_html, str_translate_to_html): Removed.
+ (html_printer::overstrike): New function member.
+ (html_printer::set_char): Use it.
+ (html_printer::do_body): New function member.
+ (html_printer::~html_printer): Use it.
+ (main): Handle `-h' option.
+ (usage): Updated.
+ * src/devices/grohtml/grohtml.man: Document -h switch.
+
+ * src/preproc/html/pre-html.cc: Include searchpath.h
+ Replace `POSTSCRIPTRES' macro with `postscriptRes' variable.
+ (get_resolution): New function.
+ (checkImageDir): Use `0777' permissions in mkdir()
+ (write_start_image): Rewritten to use `\O[5...]'.
+ (createImage, generateImages): Updated.
+ (main): Handle `F' and `h' options.
+ Use `get_resolution'.
+
+ * src/roff/troff/input.cc (begin, end, image): Removed.
+ (do_suppress): Take parameter.
+ Handle modified syntax of `\O'.
+ (token::next): Updated.
+ (init_markup_requests): Removed.
+ (main): Updated.
+
+ * src/roff/troff/div.h: Add declaration for begin_page().
+
+ * tmac/color-html.tmac: Removed. Contents moved to...
+ * tmac/html.tmac: Here. Set background color.
+ * tmac/color.tmac: Removed. Contents moved to...
+ * tmac/ps.tmac: Here.
+ * tmac/www.tmac: Remove the title command when generating images
+ for html.
+ (NO_AUTO_RULE): New macro.
+ (HTML_DO_IMAGE): Use revised `\O' escapes.
+ * tmac/Makefile.sub, tmac/groff_www.man, tmac/troffrc: Updated.
+
+2001-12-02 Werner LEMBERG <wl@gnu.org>
+
+ * tmac/groff_mdoc.man: Fix typo.
+
2001-12-01 Colin Watson <cjwatson@debian.org>
* man/roff.man: Fix typo.
diff --git a/NEWS b/NEWS
index 7d448d8e..0eae7b2c 100644
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,9 @@ o It is now possible to have whitespace between the first and second dot (or
. !
..
+o A new escape sequence `\O' is available (mainly for internal use with
+ grohtml). Please see groff_diff.man and groff.texinfo for more details.
+
o Two macros `AT' (AT&T) and `UC' (Univ. of California) have been added to
the man macros for compatibility with older BSD releases.
@@ -55,6 +58,9 @@ o `troff.man' has been split. Differences to UNIX troff are now documented
o `groff_mwww.man' has been renamed to `groff_www.man'. The file mwww.tmac
has been removed.
+o The macro `NO-AUTO-RULE' has been added to www.tmac; it suppresses the
+ generation of top and bottom rules which grohtml emits by default.
+
groff
-----
@@ -87,7 +93,9 @@ o Color support has been added.
grohtml
-------
-o Color support for glyphs has been added (no fill color support yet).
+o Color support for glyphs has been added.
+
+o New option `-h' to select the style of headings in HTML output.
Miscellaneous
-------------
diff --git a/doc/groff.texinfo b/doc/groff.texinfo
index 531508ea..fbdc2013 100644
--- a/doc/groff.texinfo
+++ b/doc/groff.texinfo
@@ -7414,7 +7414,7 @@ The @code{als} request can make a macro have more than one name.
This would be called as
@Example
-.vl $Id: groff.texinfo,v 1.84 2001/11/26 21:53:28 wlemb Exp $
+.vl $Id: groff.texinfo,v 1.85 2001/12/06 10:03:22 wlemb Exp $
@endExample
@endDefesc
@@ -8340,16 +8340,23 @@ registers encompassing the glyphs previously written since the last call
to @code{\O}.
@item \O3
-Begin a nesting level.
+Begin a nesting level. This is really an internal mechanism for
+@code{grohtml} while producing images. They are generated by running
+the troff source through troff to the postscript device and ghostscript
+to produce images in PNG format. The @code{\O3} escape will start a new
+page if the device is not html (to reduce the possibility of images
+crossing a page boundary).
@item \O4
End a nesting level.
-@item \O[5 filename]
+@item \O[5Pfilename]
This escape is @code{grohtml} specific. Provided that this escape
-occurs at the outer nesting level write the filename to @code{stderr}.
-This filename will be associated with the production of the next inline
-image.
+occurs at the outer nesting level write the @code{filename} to
+@code{stderr}. The position of the image, @var{P}, must be specified
+and must be one of @code{l}, @code{r}, @code{c}, or @code{i} (left,
+right, centered, inline). @var{filename} will be associated with the
+production of the next inline image.
@end table
@endDefesc
diff --git a/src/devices/grohtml/grohtml.man b/src/devices/grohtml/grohtml.man
index 7525ae6a..b39194a4 100644
--- a/src/devices/grohtml/grohtml.man
+++ b/src/devices/grohtml/grohtml.man
@@ -36,7 +36,7 @@ grohtml \- html driver for groff
.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
.el .RB "[\ " "\\$1" "\ ]"
..
-.OP \-vlrn
+.OP \-vhlrn
.OP \-D dir
.OP \-F dir
.OP \-i resolution
@@ -81,6 +81,15 @@ using
option.
.SH OPTIONS
.TP
+.B -h
+Generates section and number headings by using
+.BR <B> .\|.\|. </B>
+and increasing the font size, rather than using the
+.BI <H n >\c
+\&.\|.\|.\c
+.BI </H n >
+tags.
+.TP
.B -l
Turns off the production of automatic section links at the top of the document.
.TP
diff --git a/src/devices/grohtml/html-text.cc b/src/devices/grohtml/html-text.cc
index f0c6dcd2..e78bddad 100644
--- a/src/devices/grohtml/html-text.cc
+++ b/src/devices/grohtml/html-text.cc
@@ -289,7 +289,7 @@ void html_text::push_para (HTML_TAG t)
* then we start a html table to implement the indentation.
*/
-void html_text::do_indent (char *arg, int indent, int pageoff, int linelen)
+void html_text::do_indent (const char *arg, int indent, int pageoff, int linelen)
{
if ((current_indentation != -1) &&
(pageoffset+current_indentation != indent+pageoff)) {
@@ -304,7 +304,7 @@ void html_text::do_indent (char *arg, int indent, int pageoff, int linelen)
linelength = linelen;
}
-void html_text::do_table (char *arg)
+void html_text::do_table (const char *arg)
{
int in_pre = is_in_pre();
// char *para_type = done_para();
@@ -315,7 +315,7 @@ void html_text::do_table (char *arg)
do_pre();
}
// do_para(para_type);
- push_para(TABLE_TAG, arg);
+ push_para(TABLE_TAG, (void *)arg);
}
/*
@@ -604,7 +604,7 @@ void html_text::check_emit_text (tag_definition *t)
* do_emittext - tells the class that text was written during the current tag.
*/
-void html_text::do_emittext (char *s, int length)
+void html_text::do_emittext (const char *s, int length)
{
if ((! is_present(P_TAG)) && (! is_present(PRE_TAG)))
do_para("");
@@ -630,7 +630,7 @@ void html_text::do_emittext (char *s, int length)
* do_para- starts a new paragraph
*/
-void html_text::do_para (char *arg)
+void html_text::do_para (const char *arg)
{
done_pre();
if (! is_present(P_TAG)) {
@@ -701,7 +701,7 @@ void html_text::do_newline (void)
int html_text::emitted_text (void)
{
- return( ! space_emitted);
+ return !space_emitted;
}
/*
diff --git a/src/devices/grohtml/html-text.h b/src/devices/grohtml/html-text.h
index c59b4646..9cf02311 100644
--- a/src/devices/grohtml/html-text.h
+++ b/src/devices/grohtml/html-text.h
@@ -53,7 +53,7 @@ public:
html_text (simple_output *op);
~html_text (void);
void flush_text (void);
- void do_emittext (char *s, int length);
+ void do_emittext (const char *s, int length);
void do_italic (void);
void do_bold (void);
void do_roman (void);
@@ -61,13 +61,13 @@ public:
void do_pre (void);
void do_small (void);
void do_big (void);
- void do_para (char *arg1);
+ void do_para (const char *arg1);
void do_sup (void);
void do_sub (void);
void do_space (void);
void do_break (void);
void do_newline (void);
- void do_table (char *arg);
+ void do_table (const char *arg);
void done_bold (void);
void done_italic (void);
char *done_para (void);
@@ -77,7 +77,7 @@ public:
void done_pre (void);
void done_small (void);
void done_big (void);
- void do_indent (char *arg, int indent, int pageoff, int linelen);
+ void do_indent (const char *arg, int indent, int pageoff, int linelen);
void do_color (color *c);
void done_color (void);
int emitted_text (void);
diff --git a/src/devices/grohtml/html.h b/src/devices/grohtml/html.h
index 69b6e35e..8d9e34c2 100644
--- a/src/devices/grohtml/html.h
+++ b/src/devices/grohtml/html.h
@@ -53,6 +53,7 @@ public:
simple_output(FILE *, int max_line_length);
simple_output &put_string(const char *, int);
simple_output &put_string(const char *s);
+ simple_output &put_string(const string &s);
simple_output &put_troffps_char (const char *s);
simple_output &put_translated_string(const char *s);
simple_output &put_number(int);
diff --git a/src/devices/grohtml/output.cc b/src/devices/grohtml/output.cc
index 88ab7d6c..01a249de 100644
--- a/src/devices/grohtml/output.cc
+++ b/src/devices/grohtml/output.cc
@@ -283,6 +283,12 @@ simple_output &simple_output::put_string(const char *s)
return *this;
}
+simple_output &simple_output::put_string(const string &s)
+{
+ last_word.add_word(s.contents(), s.length());
+ return *this;
+}
+
simple_output &simple_output::put_number(int n)
{
char buf[1 + INT_DIGITS + 1];
diff --git a/src/devices/grohtml/post-html.cc b/src/devices/grohtml/post-html.cc
index 754ed9d5..ecc2ba0a 100644
--- a/src/devices/grohtml/post-html.cc
+++ b/src/devices/grohtml/post-html.cc
@@ -47,12 +47,11 @@ extern "C" const char *Version_string;
# define FALSE (1==0)
#endif
-#define MAX_STRING_LENGTH 4096
#define MAX_LINE_LENGTH 60 /* maximum characters we want in a line */
#define SIZE_INCREMENT 2 /* font size increment <big> = +2 */
#define BASE_POINT_SIZE 10 /* 10 points is the base size ie html size 3 */
#define CENTER_TOLERANCE 2 /* how many pixels off center will we still */
-#define ANCHOR_TEMPLATE "heading%d" /* if simple anchor is set we use this */
+#define ANCHOR_TEMPLATE "heading" /* if simple anchor is set we use this */
#define UNICODE_DESC_START 0x80 /* all character entities above this are */
/* either encoded by their glyph names or if */
/* there is no name then we use &#nnn; */
@@ -64,8 +63,8 @@ typedef enum {CENTERED, LEFT, RIGHT, INLINE} TAG_ALIGNMENT;
* prototypes
*/
-void str_translate_to_html (font *f, char *buf, int buflen, char *str, int len, int and_single, int is_special);
-char *get_html_translation (font *f, const char *name);
+char *get_html_translation (font *f, const string &name);
+int char_translate_to_html (font *f, char *buf, int buflen, unsigned char ch, int b, int and_single);
static int auto_links = TRUE; /* by default we enable automatic links at */
@@ -73,6 +72,8 @@ static int auto_links = TRUE; /* by default we enable aut
static int auto_rule = TRUE; /* by default we enable an automatic rule */
/* at the top and bottom of the document */
static int simple_anchors = FALSE; /* default to anchors with heading text */
+static int manufacture_headings = FALSE; /* default is to use the Hn html headings, */
+ /* rather than manufacture our own. */
/*
@@ -100,18 +101,6 @@ static int max (int a, int b)
}
/*
- * is_subsection - returns TRUE if a1..a2 is within b1..b2
- */
-
-#if 0
-static int is_subsection (int a1, int a2, int b1, int b2)
-{
- // easier to see whether this is not the case
- return( !((a1 < b1) || (a1 > b2) || (a2 < b1) || (a2 > b2)) );
-}
-#endif
-
-/*
* is_intersection - returns TRUE if range a1..a2 intersects with b1..b2
*/
@@ -280,7 +269,8 @@ class char_buffer {
public:
char_buffer();
~char_buffer();
- char *add_string(char *, unsigned int);
+ char *add_string(const char *, unsigned int);
+ char *add_string(const string &);
private:
char_block *head;
char_block *tail;
@@ -300,11 +290,14 @@ char_buffer::~char_buffer()
}
}
-char *char_buffer::add_string (char *s, unsigned int length)
+char *char_buffer::add_string (const char *s, unsigned int length)
{
int i=0;
unsigned int old_used;
+ if (s == NULL || length == 0)
+ return NULL;
+
if (tail == 0) {
tail = new char_block;
head = tail;
@@ -337,55 +330,78 @@ char *char_buffer::add_string (char *s, unsigned int length)
return( &tail->buffer[old_used] );
}
+char *char_buffer::add_string (const string &s)
+{
+ return add_string(s.contents(), s.length());
+}
+
/*
* the classes and methods for maintaining glyph positions.
*/
class text_glob {
public:
- text_glob (style *s, char *string, unsigned int length,
- int min_vertical , int min_horizontal,
- int max_vertical , int max_horizontal,
- int is_html , int is_troff_command,
- int is_auto_image,
- int is_a_line , int thickness);
- text_glob (void);
- ~text_glob (void);
- int is_a_line (void);
- int is_a_tag (void);
- int is_raw (void);
- int is_eol (void);
- int is_auto_img (void);
- int is_br (void);
- int is_eol_ce (void);
+ void text_glob_html (style *s, char *str, int length,
+ int min_vertical, int min_horizontal,
+ int max_vertical, int max_horizontal);
+ void text_glob_special (style *s, char *str, int length,
+ int min_vertical, int min_horizontal,
+ int max_vertical, int max_horizontal);
+ void text_glob_line (style *s,
+ int min_vertical, int min_horizontal,
+ int max_vertical, int max_horizontal,
+ int thickness);
+ void text_glob_auto_image(style *s, char *str, int length,
+ int min_vertical, int min_horizontal,
+ int max_vertical, int max_horizontal);
+ void text_glob_tag (style *s, char *str, int length,
+ int min_vertical, int min_horizontal,
+ int max_vertical, int max_horizontal);
+
+ text_glob (void);
+ ~text_glob (void);
+ int is_a_line (void);
+ int is_a_tag (void);
+ int is_eol (void);
+ int is_auto_img (void);
+ int is_br (void);
+ int is_eol_ce (void);
style text_style;
- char *text_string;
+ const char *text_string;
unsigned int text_length;
int minv, minh, maxv, maxh;
- int is_raw_command; // should the text be sent directly to the device?
int is_tag; // is this a .br, .sp, .tl etc
int is_img_auto; // image created by eqn delim
+ int is_special; // text has come via 'x X html:'
int is_line; // is the command a <line>?
int thickness; // the thickness of a line
+
+private:
+ text_glob (style *s, char *str, int length,
+ int min_vertical , int min_horizontal,
+ int max_vertical , int max_horizontal,
+ bool is_troff_command,
+ bool is_auto_image, bool is_special_command,
+ bool is_a_line , int thickness);
};
-text_glob::text_glob (style *s, char *string, unsigned int length,
+text_glob::text_glob (style *s, char *str, int length,
int min_vertical, int min_horizontal,
int max_vertical, int max_horizontal,
- int is_html, int is_troff_command,
- int is_auto_image,
- int is_a_line, int line_thickness)
- : text_style(*s), text_string(string), text_length(length),
+ bool is_troff_command,
+ bool is_auto_image, bool is_special_command,
+ bool is_a_line, int line_thickness)
+ : text_style(*s), text_string(str), text_length(length),
minv(min_vertical), minh(min_horizontal), maxv(max_vertical), maxh(max_horizontal),
- is_raw_command(is_html), is_tag(is_troff_command), is_img_auto(is_auto_image),
+ is_tag(is_troff_command), is_img_auto(is_auto_image), is_special(is_special_command),
is_line(is_a_line), thickness(line_thickness)
{
}
text_glob::text_glob ()
: text_string(0), text_length(0), minv(-1), minh(-1), maxv(-1), maxh(-1),
- is_raw_command(FALSE), is_tag(FALSE), is_line(FALSE), thickness(0)
+ is_tag(FALSE), is_special(FALSE), is_line(FALSE), thickness(0)
{
}
@@ -394,12 +410,105 @@ text_glob::~text_glob ()
}
/*
+ * text_glob_html - used to place html text into the glob buffer.
+ */
+
+void text_glob::text_glob_html (style *s, char *str, int length,
+ int min_vertical , int min_horizontal,
+ int max_vertical , int max_horizontal)
+{
+ text_glob *g = new text_glob(s, str, length,
+ min_vertical, min_horizontal, max_vertical, max_horizontal,
+ FALSE, FALSE, FALSE, FALSE, 0);
+ *this = *g;
+}
+
+/*
+ * text_glob_html - used to place html specials into the glob buffer.
+ * This text is essentially html commands coming through
+ * from the macro sets, with special designated sequences of
+ * characters translated into html. See add_and_encode.
+ */
+
+void text_glob::text_glob_special (style *s, char *str, int length,
+ int min_vertical , int min_horizontal,
+ int max_vertical , int max_horizontal)
+{
+ text_glob *g = new text_glob(s, str, length,
+ min_vertical, min_horizontal, max_vertical, max_horizontal,
+ FALSE, FALSE, TRUE, FALSE, 0);
+ *this = *g;
+}
+
+/*
+ * text_glob_line - record horizontal draw line commands.
+ */
+
+void text_glob::text_glob_line (style *s,
+ int min_vertical , int min_horizontal,
+ int max_vertical , int max_horizontal,
+ int thickness)
+{
+ text_glob *g = new text_glob(s, "", 0,
+ min_vertical, min_horizontal, max_vertical, max_horizontal,
+ FALSE, FALSE, FALSE, TRUE, thickness);
+ *this = *g;
+}
+
+/*
+ * text_glob_auto_image - record the presence of a .auto-image tag command.
+ * Used to mark that an image has been created automatically
+ * by a preprocessor and (pre-grohtml/troff) combination.
+ * Under some circumstances images may not be created.
+ * (consider .EQ
+ * delim $$
+ * .EN
+ * .TS
+ * tab(!), center;
+ * l!l.
+ * $1 over x$!recripical of x
+ * .TE
+ *
+ * the first auto-image marker is created via .EQ/.EN pair
+ * and no image is created.
+ * The second auto-image marker occurs at $1 over x$
+ * Currently this image will not be created
+ * as the whole of the table is created as an image.
+ * (Once html tables are handled by grohtml this will change.
+ * Shortly this will be the case).
+ */
+
+void text_glob::text_glob_auto_image(style *s, char *str, int length,
+ int min_vertical, int min_horizontal,
+ int max_vertical, int max_horizontal)
+{
+ text_glob *g = new text_glob(s, str, length,
+ min_vertical, min_horizontal, max_vertical, max_horizontal,
+ TRUE, TRUE, FALSE, FALSE, 0);
+ *this = *g;
+}
+
+/*
+ * text_glob_tag - records a troff tag.
+ */
+
+void text_glob::text_glob_tag (style *s, char *str, int length,
+ int min_vertical, int min_horizontal,
+ int max_vertical, int max_horizontal)
+{
+ text_glob *g = new text_glob(s, str, length,
+ min_vertical, min_horizontal, max_vertical, max_horizontal,
+ TRUE, FALSE, FALSE, FALSE, 0);
+ *this = *g;
+}
+
+/*
* is_a_line - returns TRUE if glob should be converted into an <hr>
*/
int text_glob::is_a_line (void)
{
- return( is_line );
+ return is_line;
}
/*
@@ -408,7 +517,7 @@ int text_glob::is_a_line (void)
int text_glob::is_a_tag (void)
{
- return( is_tag );
+ return is_tag;
}
/*
@@ -430,22 +539,13 @@ int text_glob::is_eol_ce (void)
}
/*
- * is_raw - returns TRUE if glob contains raw html.
- */
-
-int text_glob::is_raw (void)
-{
- return( is_raw_command );
-}
-
-/*
* is_auto_img - returns TRUE if the glob contains an automatically
* generated image.
*/
int text_glob::is_auto_img (void)
{
- return( is_img_auto );
+ return is_img_auto;
}
/*
@@ -455,9 +555,10 @@ int text_glob::is_auto_img (void)
int text_glob::is_br (void)
{
- return( is_a_tag() && ((strcmp("html-tag:.br", text_string) == 0) ||
- (strcmp("html-tag:.ce", text_string) == 0) ||
- (strcmp("html-tag:.nf", text_string) == 0)) );
+ return( is_a_tag() && ((strcmp ("html-tag:.br", text_string) == 0) ||
+ (strncmp("html-tag:.sp", text_string, 11) == 0) ||
+ (strcmp ("html-tag:.ce", text_string) == 0) ||
+ (strcmp ("html-tag:.nf", text_string) == 0)) );
}
/*
@@ -753,15 +854,15 @@ text_glob* list::move_left_get_data (void)
class page {
public:
page (void);
- void add (style *s, char *string, unsigned int length,
+ void add (style *s, const string &str,
int line_number,
int min_vertical, int min_horizontal,
int max_vertical, int max_horizontal);
- void add_html (style *s, char *string, unsigned int length,
+ void add_tag (style *s, const string &str,
int line_number,
int min_vertical, int min_horizontal,
int max_vertical, int max_horizontal);
- void add_tag (style *s, char *string, unsigned int length,
+ void add_and_encode (style *s, const string &str,
int line_number,
int min_vertical, int min_horizontal,
int max_vertical, int max_horizontal);
@@ -781,32 +882,19 @@ page::page()
{
}
-void page::add (style *s, char *string, unsigned int length,
- int line_number,
- int min_vertical, int min_horizontal,
- int max_vertical, int max_horizontal)
-{
- if (length > 0) {
- text_glob *g=new text_glob(s, buffer.add_string(string, length), length,
- min_vertical, min_horizontal, max_vertical, max_horizontal,
- FALSE, FALSE, FALSE, FALSE, 0);
- glyphs.add(g, line_number, min_vertical, min_horizontal, max_vertical, max_horizontal);
- }
-}
-
/*
- * add_html - add a raw html command, for example mailto, line, background, image etc.
+ * add - add html text to the list of glyphs.
*/
-void page::add_html (style *s, char *string, unsigned int length,
- int line_number,
- int min_vertical, int min_horizontal,
- int max_vertical, int max_horizontal)
+void page::add (style *s, const string &str,
+ int line_number,
+ int min_vertical, int min_horizontal,
+ int max_vertical, int max_horizontal)
{
- if (length > 0) {
- text_glob *g=new text_glob(s, buffer.add_string(string, length), length,
- min_vertical, min_horizontal, max_vertical, max_horizontal,
- TRUE, FALSE, FALSE, FALSE, 0);
+ if (str.length() > 0) {
+ text_glob *g=new text_glob();
+ g->text_glob_html(s, buffer.add_string(str), str.length(),
+ min_vertical, min_horizontal, max_vertical, max_horizontal);
glyphs.add(g, line_number, min_vertical, min_horizontal, max_vertical, max_horizontal);
}
}
@@ -815,17 +903,23 @@ void page::add_html (style *s, char *string, unsigned int length,
* add_tag - adds a troff tag, for example: .tl .sp .br
*/
-void page::add_tag (style *s, char *string, unsigned int length,
+void page::add_tag (style *s, const string &str,
int line_number,
int min_vertical, int min_horizontal,
int max_vertical, int max_horizontal)
{
- if (length > 0) {
- text_glob *g=new text_glob(s, buffer.add_string(string, length), length,
- min_vertical, min_horizontal, max_vertical, max_horizontal,
- FALSE, TRUE,
- (strncmp(string, "html-tag:.auto-image", 20) == 0),
- FALSE, 0);
+ if (str.length() > 0) {
+ text_glob *g;
+
+ if (strncmp((str+'\0').contents(), "html-tag:.auto-image", 20) == 0) {
+ g = new text_glob();
+ g->text_glob_auto_image(s, buffer.add_string(str), str.length(),
+ min_vertical, min_horizontal, max_vertical, max_horizontal);
+ } else {
+ g = new text_glob();
+ g->text_glob_tag(s, buffer.add_string(str), str.length(),
+ min_vertical, min_horizontal, max_vertical, max_horizontal);
+ }
glyphs.add(g, line_number, min_vertical, min_horizontal, max_vertical, max_horizontal);
}
}
@@ -840,14 +934,86 @@ void page::add_line (style *s,
int thickness)
{
if (y1 == y2) {
- text_glob *g = new text_glob(s, "", 0,
- min(y1, y2), min(x1, y2), max(y1, y2), max(x1, x2),
- FALSE, TRUE, FALSE, FALSE, thickness);
+ text_glob *g = new text_glob();
+ g->text_glob_line(s,
+ min(y1, y2), min(x1, y2), max(y1, y2), max(x1, x2),
+ thickness);
glyphs.add(g, line_number, min(y1, y2), min(x1, y2), max(y1, y2), max(x1, x2));
}
}
/*
+ * to_unicode - returns a unicode translation of char, ch.
+ */
+
+static char *to_unicode (unsigned char ch)
+{
+ static char buf[20];
+
+ sprintf(buf, "&#%u;", (unsigned int)ch);
+ return buf;
+}
+
+/*
+ * add_and_encode - adds a special string to the page, it translates the string
+ * into html glyphs. The special string will have come from x X html:
+ * and can contain troff character encodings which appear as
+ * \(char\). A sequence of \\ represents \.
+ * So for example we can write:
+ * "cost = \(Po\)3.00 file = \\foo\\bar"
+ * which is translated into:
+ * "cost = &pound;3.00 file = \foo\bar"
+ */
+
+void page::add_and_encode (style *s, const string &str,
+ int line_number,
+ int min_vertical, int min_horizontal,
+ int max_vertical, int max_horizontal)
+{
+ string html_string;
+ char *html_glyph;
+ int i=0;
+
+ if (s->f == NULL)
+ return;
+ while (i < str.length()) {
+ if ((i+1<str.length()) && (str.substring(i, 2) == string("\\("))) {
+ // start of escape
+ i += 2; // move over \(
+ int a = i;
+ string troff_charname;
+ while ((i+1<str.length()) && (str.substring(i, 2) != string("\\)"))) {
+ i++;
+ }
+ int n = i;
+ if ((i+1<str.length()) && (str.substring(i, 2) == string("\\)")))
+ i++;
+ else
+ n = -1;
+ if (n > 0) {
+ html_glyph = get_html_translation(s->f, str.substring(a, n-a));
+ if (html_glyph)
+ html_string += html_glyph;
+ else {
+ int index=s->f->name_to_index((troff_charname + '\0').contents());
+
+ if (s->f->contains(index) && (index != 0))
+ html_string += s->f->get_code(index);
+ }
+ }
+ } else
+ html_string += str[i];
+ i++;
+ }
+ if (html_string.length() > 0) {
+ text_glob *g=new text_glob();
+ g->text_glob_special(s, buffer.add_string(html_string), html_string.length(),
+ min_vertical, min_horizontal, max_vertical, max_horizontal);
+ glyphs.add(g, line_number, min_vertical, min_horizontal, max_vertical, max_horizontal);
+ }
+}
+
+/*
* dump_page - dump the page contents for debugging purposes.
*/
@@ -909,7 +1075,7 @@ public:
int has_been_written;
int has_been_found;
- char text[MAX_STRING_LENGTH];
+ string text;
};
@@ -932,7 +1098,7 @@ public:
list headers; // list of headers built from .NH and .SH
int header_level; // current header level
int written_header; // have we written the header yet?
- char header_buffer[MAX_STRING_LENGTH]; // current header text
+ string header_buffer; // current header text
void write_headings (FILE *f, int force);
};
@@ -962,9 +1128,12 @@ void header_desc::write_headings (FILE *f, int force)
do {
g = headers.get_data();
fputs("<a href=\"#", f);
- if (simple_anchors)
- fprintf(f, ANCHOR_TEMPLATE, h);
- else
+ if (simple_anchors) {
+ string buffer(ANCHOR_TEMPLATE);
+
+ buffer += as_string(h);
+ fprintf(f, buffer.contents());
+ } else
fputs(g->text_string, f);
h++;
fputs("\">", f);
@@ -982,16 +1151,17 @@ class html_printer : public printer {
simple_output html;
int res;
int space_char_index;
+ int space_width;
int no_of_printed_pages;
int paper_length;
- enum { SBUF_SIZE = 8192 };
- char sbuf[SBUF_SIZE];
- int sbuf_len;
+ string sbuf;
int sbuf_start_hpos;
int sbuf_vpos;
int sbuf_end_hpos;
int sbuf_kern;
style sbuf_style;
+ int last_sbuf_length;
+ int overstrike_detected;
style output_style;
int output_hpos;
int output_vpos;
@@ -1000,7 +1170,6 @@ class html_printer : public printer {
int line_thickness;
int output_line_thickness;
unsigned char output_space_code;
- string defs;
char *inside_font_style;
int page_number;
title_desc title;
@@ -1022,6 +1191,7 @@ class html_printer : public printer {
int pointsize;
int vertical_spacing;
int line_number;
+ color *background;
void flush_sbuf ();
void set_style (const style &);
@@ -1034,8 +1204,7 @@ class html_printer : public printer {
void set_line_thickness (const environment *);
void terminate_current_font (void);
void flush_font (void);
- void add_char_to_sbuf (unsigned char code);
- void add_to_sbuf (unsigned char code, const char *name);
+ void add_to_sbuf (unsigned char code, const string &s);
void write_title (int in_head);
void determine_diacritical_mark (const char *name, const environment *env);
int sbuf_continuation (unsigned char code, const char *name, const environment *env, int w);
@@ -1046,7 +1215,7 @@ class html_printer : public printer {
void flush_globs (void);
void emit_line (text_glob *g);
void emit_raw (text_glob *g);
- void translate_to_html (text_glob *g);
+ void emit_html (text_glob *g);
void determine_space (text_glob *g);
void start_font (const char *name);
void end_font (const char *name);
@@ -1082,6 +1251,10 @@ class html_printer : public printer {
int start_superscript (text_glob *g);
int end_superscript (text_glob *g);
void outstanding_eol (int n);
+ int is_bold (font *f);
+ font *make_bold (font *f);
+ int overstrike (unsigned char code, const char *name, const environment *env, int w);
+ void do_body (void);
// ADD HERE
@@ -1107,7 +1280,7 @@ static void usage(FILE *stream);
void html_printer::set_style(const style &sty)
{
const char *fontname = sty.f->get_name();
- if (fontname == 0)
+ if (fontname == NULL)
fatal("no internalname specified for font");
#if 0
@@ -1115,6 +1288,33 @@ void html_printer::set_style(const style &sty)
#endif
}
+/*
+ * is_bold - returns TRUE if font, f, is bold.
+ */
+
+int html_printer::is_bold (font *f)
+{
+ const char *fontname = f->get_name();
+ return (strcmp(fontname, "B") == 0) || (strcmp(fontname, "BI") == 0);
+}
+
+/*
+ * make_bold - if a bold font of, f, exists then return it.
+ */
+
+font *html_printer::make_bold (font *f)
+{
+ const char *fontname = f->get_name();
+
+ if (strcmp(fontname, "B") == 0)
+ return f;
+ if (strcmp(fontname, "I") == 0)
+ return font::load_font("BI");
+ if (strcmp(fontname, "BI") == 0)
+ return f;
+ return NULL;
+}
+
void html_printer::end_of_line()
{
flush_sbuf();
@@ -1165,9 +1365,8 @@ void html_printer::emit_raw (text_glob *g)
supress_sub_sup = TRUE;
#if defined(INDENTATION)
if (in_table) {
- stop();
current_paragraph->do_indent(NULL, 0, pageoffset, linelength);
- current_paragraph->do_indent(indent.text, indentation, pageoffset, linelength);
+ current_paragraph->do_indent(page_contents->buffer.add_string(indent.text), indentation, pageoffset, linelength);
}
#endif
}
@@ -1244,23 +1443,16 @@ static int exists (const char *filename)
* providing that the image exists.
*/
-static char *generate_img_src (const char *filename)
+static string &generate_img_src (const char *filename)
{
- static char buffer[MAX_STRING_LENGTH];
+ string *s = new string("");
while (filename && (filename[0] == ' ')) {
filename++;
}
- if (exists(filename)) {
- strcpy(buffer, "<img src=\"");
- strncat(buffer, filename, MAX_STRING_LENGTH-strlen("<img src=\"")-1);
- if (strlen(buffer) < MAX_STRING_LENGTH-3) {
- strncat(buffer, "\">", 3);
- }
- return( (char *)&buffer );
- } else {
- return( 0 );
- }
+ if (exists(filename))
+ *s += string("<img src=\"") + filename + "\">";
+ return *s;
}
/*
@@ -1273,20 +1465,19 @@ static char *generate_img_src (const char *filename)
void html_printer::do_auto_image (text_glob *g, const char *filename)
{
- char *buffer = generate_img_src(filename);
+ string buffer = generate_img_src(filename);
- if (buffer) {
+ if (! buffer.empty()) {
/*
* utilize emit_raw by creating a new text_glob.
*/
text_glob h = *g;
- h.text_string = buffer;
- h.text_length = strlen(buffer);
+ h.text_string = buffer.contents();
+ h.text_length = buffer.length();
emit_raw(&h);
- } else {
+ } else
next_tag = INLINE;
- }
}
/*
@@ -1310,7 +1501,6 @@ void html_printer::do_title (void)
text_glob *t;
int removed_from_head;
int eol_ce = 0;
- char buf[MAX_STRING_LENGTH];
if (page_number == 1) {
int found_title_start = FALSE;
@@ -1320,23 +1510,18 @@ void html_printer::do_title (void)
t = page_contents->glyphs.get_data();
removed_from_head = FALSE;
if (t->is_auto_img()) {
- char *img=generate_img_src((char *)(t->text_string + 20));
+ string img = generate_img_src((char *)(t->text_string + 20));
- if (img) {
- if (found_title_start) {
- strcat(title.text, " ");
- }
+ if (! img.empty()) {
+ if (found_title_start)
+ title.text += " ";
found_title_start = TRUE;
title.has_been_found = TRUE;
- strcat(title.text, img);
+ title.text += img;
}
page_contents->glyphs.sub_move_right(); /* move onto next word */
removed_from_head = ((!page_contents->glyphs.is_empty()) &&
(page_contents->glyphs.is_equal_to_head()));
- } else if (t->is_raw_command) {
- /* skip raw commands
- */
- page_contents->glyphs.sub_move_right(); /* move onto next word */
} else if (t->is_eol_ce()) {
/* process the eol associated with .ce
*/
@@ -1356,15 +1541,12 @@ void html_printer::do_title (void)
outstanding_eol(eol_ce);
return;
} else if (found_title_start) {
- strcat(title.text, " ");
- str_translate_to_html(t->text_style.f, buf, MAX_STRING_LENGTH, t->text_string, t->text_length, TRUE, FALSE);
- strcat(title.text, buf);
- page_contents->glyphs.sub_move_right(); /* move onto next word */
- removed_from_head = ((!page_contents->glyphs.is_empty()) &&
- (page_contents->glyphs.is_equal_to_head()));
+ title.text += " " + string(t->text_string, t->text_length);
+ page_contents->glyphs.sub_move_right(); /* move onto next word */
+ removed_from_head = ((!page_contents->glyphs.is_empty()) &&
+ (page_contents->glyphs.is_equal_to_head()));
} else {
- str_translate_to_html(t->text_style.f, buf, MAX_STRING_LENGTH, t->text_string, t->text_length, TRUE, FALSE);
- strcpy((char *)title.text, buf);
+ title.text += string(t->text_string, t->text_length);
found_title_start = TRUE;
title.has_been_found = TRUE;
page_contents->glyphs.sub_move_right(); /* move onto next word */
@@ -1379,7 +1561,7 @@ void html_printer::do_title (void)
void html_printer::write_header (void)
{
- if (strlen(header.header_buffer) > 0) {
+ if (! header.header_buffer.empty()) {
if (header.header_level > 7) {
header.header_level = 7;
}
@@ -1394,12 +1576,13 @@ void html_printer::write_header (void)
header.no_of_headings++;
style st;
- text_glob *h=new text_glob(&st,
- header.headings.add_string(header.header_buffer, strlen(header.header_buffer)),
- strlen(header.header_buffer),
- header.no_of_headings, header.header_level,
- header.no_of_headings, header.header_level,
- FALSE, FALSE, FALSE, FALSE, FALSE);
+ text_glob *h=new text_glob();
+ h->text_glob_html(&st,
+ header.headings.add_string(header.header_buffer),
+ header.header_buffer.length(),
+ header.no_of_headings, header.header_level,
+ header.no_of_headings, header.header_level);
+
header.headers.add(h,
header.no_of_headings,
header.no_of_headings, header.no_of_headings,
@@ -1409,24 +1592,42 @@ void html_printer::write_header (void)
html.nl().put_string("<a name=\"");
if (simple_anchors) {
- char buffer[MAX_LINE_LENGTH];
+ string buffer(ANCHOR_TEMPLATE);
- sprintf(buffer, ANCHOR_TEMPLATE, header.no_of_headings);
- html.put_string(buffer);
+ buffer += as_string(header.no_of_headings);
+ html.put_string(buffer.contents());
} else {
html.put_string(header.header_buffer);
}
html.put_string("\"></a>").nl();
}
- // and now we issue the real header
- html.put_string("<h");
- html.put_number(header.header_level);
- html.put_string(">");
- html.put_string(header.header_buffer);
- html.put_string("</h");
- html.put_number(header.header_level);
- html.put_string(">").nl();
+ if (manufacture_headings) {
+ // line break before a header
+ if (!current_paragraph->emitted_text())
+ current_paragraph->do_space();
+ // user wants manufactured headings which look better than <Hn></Hn>
+ if (header.header_level<4) {
+ html.put_string("<b><font size=\"+1\">");
+ html.put_string(header.header_buffer);
+ html.put_string("</font></b>").nl();
+ }
+ else {
+ html.put_string("<b>");
+ html.put_string(header.header_buffer);
+ html.put_string("</b>").nl();
+ }
+ }
+ else {
+ // and now we issue the real header
+ html.put_string("<h");
+ html.put_number(header.header_level);
+ html.put_string(">");
+ html.put_string(header.header_buffer);
+ html.put_string("</h");
+ html.put_number(header.header_level);
+ html.put_string(">").nl();
+ }
current_paragraph->do_para("");
}
@@ -1436,9 +1637,10 @@ void html_printer::determine_header_level (int level)
{
if (level == 0) {
int i;
- int l=strlen(header.header_buffer);
- for (i=0; ((i<l) && ((header.header_buffer[i] == '.') || is_digit(header.header_buffer[i]))) ; i++) {
+ for (i=0; ((i<header.header_buffer.length())
+ && ((header.header_buffer[i] == '.')
+ || is_digit(header.header_buffer[i]))) ; i++) {
if (header.header_buffer[i] == '.') {
level++;
}
@@ -1455,35 +1657,33 @@ void html_printer::do_heading (char *arg)
{
text_glob *g;
text_glob *l = 0;
- char buf[MAX_STRING_LENGTH];
int level=atoi(arg);
- strcpy(header.header_buffer, "");
+ header.header_buffer.clear();
page_contents->glyphs.move_right();
if (! page_contents->glyphs.is_equal_to_head()) {
g = page_contents->glyphs.get_data();
do {
if (g->is_auto_img()) {
- char *img=generate_img_src((char *)(g->text_string + 20));
+ string img=generate_img_src((char *)(g->text_string + 20));
- if (img) {
+ if (! img.empty()) {
simple_anchors = TRUE; // we cannot use full heading anchors with images
- if (l != 0) {
- strcat(header.header_buffer, " ");
- }
+ if (l != 0)
+ header.header_buffer += " ";
+
l = g;
- strcat(header.header_buffer, img);
+ header.header_buffer += img;
}
- } else if (! (g->is_a_line() || g->is_a_tag() || g->is_raw())) {
+ } else if (! (g->is_a_line() || g->is_a_tag())) {
/*
- * we ignore raw commands when constructing a heading
+ * we ignore tags commands when constructing a heading
*/
- if (l != 0) {
- strcat(header.header_buffer, " ");
- }
+ if (l != 0)
+ header.header_buffer += " ";
l = g;
- str_translate_to_html(g->text_style.f, buf, MAX_STRING_LENGTH, g->text_string, g->text_length, TRUE, FALSE);
- strcat(header.header_buffer, (char *)buf);
+
+ header.header_buffer += string(g->text_string, g->text_length);
}
page_contents->glyphs.move_right();
g = page_contents->glyphs.get_data();
@@ -1540,7 +1740,7 @@ void html_printer::do_linelength (char *arg)
#if defined(INDENTATION)
if (fill_on) {
linelength = atoi(arg);
- current_paragraph->do_indent(indent.text, indentation, pageoffset, linelength);
+ current_paragraph->do_indent(page_contents->buffer.add_string(indent.text), indentation, pageoffset, linelength);
}
#endif
}
@@ -1554,7 +1754,7 @@ void html_printer::do_pageoffset (char *arg)
#if defined(INDENTATION)
pageoffset = atoi(arg);
if (fill_on) {
- current_paragraph->do_indent(indent.text, indentation, pageoffset, linelength);
+ current_paragraph->do_indent(page_contents->buffer.add_string(indent.text), indentation, pageoffset, linelength);
}
#endif
}
@@ -1568,7 +1768,7 @@ void html_printer::do_indentation (char *arg)
#if defined(INDENTATION)
if (fill_on) {
indentation = atoi(arg);
- current_paragraph->do_indent(indent.text, indentation, pageoffset, linelength);
+ current_paragraph->do_indent(page_contents->buffer.add_string(indent.text), indentation, pageoffset, linelength);
}
#endif
}
@@ -1584,7 +1784,7 @@ void html_printer::do_tempindent (char *arg)
end_tempindent = 1;
prev_indent = indentation;
indentation = atoi(arg);
- current_paragraph->do_indent(indent.text, indentation, pageoffset, linelength);
+ current_paragraph->do_indent(page_contents->buffer.add_string(indent.text), indentation, pageoffset, linelength);
}
#endif
}
@@ -1600,11 +1800,10 @@ void html_printer::do_indentedparagraph (void)
#if defined(INDENTATION)
text_glob *t;
int removed_from_head;
- char buf[MAX_STRING_LENGTH];
int found_indent_start = FALSE;
indent.has_been_found = FALSE;
- indent.text[0] = (char)0;
+ indent.text.clear();
if (! page_contents->glyphs.is_empty()) {
page_contents->glyphs.sub_move_right(); /* move onto next word */
@@ -1612,20 +1811,16 @@ void html_printer::do_indentedparagraph (void)
t = page_contents->glyphs.get_data();
removed_from_head = FALSE;
if (t->is_auto_img()) {
- char *img=generate_img_src((char *)(t->text_string + 20));
+ string img = generate_img_src((char *)(t->text_string + 20));
+
+ if (! img.empty()) {
+ if (found_indent_start)
+ indent.text += " ";
- if (img) {
- if (found_indent_start) {
- strcat(indent.text, " ");
- }
found_indent_start = TRUE;
- strcat(indent.text, img);
+ indent.text += img;
}
page_contents->glyphs.sub_move_right(); /* move onto next word */
- } else if (t->is_raw_command) {
- /* skip raw commands
- */
- page_contents->glyphs.sub_move_right(); /* move onto next word */
} else if (t->is_a_tag() && (strncmp(t->text_string, "html-tag:.br", 12) == 0)) {
/* end of indented para found, but move back so that we read this tag and process it
*/
@@ -1633,17 +1828,18 @@ void html_printer::do_indentedparagraph (void)
indent.has_been_found = TRUE;
return;
} else if (t->is_a_tag()) {
+ if (strncmp(t->text_string, "html-tag:.ti", 12) == 0) {
+ char *a = (char *)t->text_string+12;
+ do_tempindent(a);
+ }
page_contents->glyphs.sub_move_right(); /* move onto next word */
} else if (found_indent_start) {
- strcat(indent.text, " ");
- str_translate_to_html(t->text_style.f, buf, MAX_STRING_LENGTH, t->text_string, t->text_length, TRUE, FALSE);
- strcat(indent.text, buf);
+ indent.text += " " + string(t->text_string, t->text_length);
page_contents->glyphs.sub_move_right(); /* move onto next word */
removed_from_head = ((!page_contents->glyphs.is_empty()) &&
(page_contents->glyphs.is_equal_to_head()));
} else {
- str_translate_to_html(t->text_style.f, buf, MAX_STRING_LENGTH, t->text_string, t->text_length, TRUE, FALSE);
- strcpy((char *)indent.text, buf);
+ indent.text += string(t->text_string, t->text_length);
found_indent_start = TRUE;
indent.has_been_found = TRUE;
page_contents->glyphs.sub_move_right(); /* move onto next word */
@@ -1755,7 +1951,7 @@ void html_printer::do_break (void)
end_tempindent--;
if (end_tempindent == 0) {
indentation = prev_indent;
- current_paragraph->do_indent(indent.text, indentation, pageoffset, linelength);
+ current_paragraph->do_indent(page_contents->buffer.add_string(indent.text), indentation, pageoffset, linelength);
}
}
#endif
@@ -1825,6 +2021,8 @@ void html_printer::troff_tag (text_glob *g)
do_indentedparagraph();
} else if (strcmp(t, ".links") == 0) {
do_links();
+ } else if (strcmp(t, ".no-auto-rule") == 0) {
+ auto_rule = FALSE;
}
}
@@ -1854,14 +2052,12 @@ void html_printer::flush_globs (void)
stop();
}
- if (g->is_raw()) {
- emit_raw(g);
- } else if (g->is_a_tag()) {
+ if (g->is_a_tag()) {
troff_tag(g);
} else if (g->is_a_line()) {
emit_line(g);
} else {
- translate_to_html(g);
+ emit_html(g);
}
/*
* after processing the title (and removing it) the glyph list might be empty
@@ -1889,13 +2085,12 @@ void html_printer::flush_page (void)
/*
* determine_space - works out whether we need to write a space.
- * If last glyth is ajoining then no space emitted.
+ * If last glyph is ajoining then no space emitted.
*/
void html_printer::determine_space (text_glob *g)
{
if (current_paragraph->is_in_pre()) {
- int space_width = sbuf_style.f->get_space_width(sbuf_style.point_size);
/*
* .nf has been specified
*/
@@ -2113,18 +2308,14 @@ void html_printer::do_sup_or_sub (text_glob *g)
}
/*
- * translate_to_html - translates a textual string into html text
+ * emit_html - write out the html text
*/
-void html_printer::translate_to_html (text_glob *g)
+void html_printer::emit_html (text_glob *g)
{
- char buf[MAX_STRING_LENGTH];
-
do_font(g);
determine_space(g);
- str_translate_to_html(g->text_style.f, buf, MAX_STRING_LENGTH,
- g->text_string, g->text_length, TRUE, FALSE);
- current_paragraph->do_emittext(buf, strlen(buf));
+ current_paragraph->do_emittext(g->text_string, g->text_length);
output_vpos = g->minv;
output_hpos = g->maxh;
output_vpos_max = g->maxv;
@@ -2137,18 +2328,25 @@ void html_printer::translate_to_html (text_glob *g)
void html_printer::flush_sbuf()
{
- if (sbuf_len > 0) {
+ if (sbuf.length() > 0) {
int r=font::res; // resolution of the device
set_style(sbuf_style);
+ if (overstrike_detected && (! is_bold(sbuf_style.f))) {
+ font *bold_font = make_bold(sbuf_style.f);
+ if (bold_font != NULL)
+ sbuf_style.f = bold_font;
+ }
- page_contents->add(&sbuf_style, sbuf, sbuf_len,
+ page_contents->add(&sbuf_style, sbuf,
line_number,
sbuf_vpos-sbuf_style.point_size*r/72, sbuf_start_hpos,
sbuf_vpos , sbuf_end_hpos);
output_hpos = sbuf_end_hpos;
output_vpos = sbuf_vpos;
- sbuf_len = 0;
+ last_sbuf_length = 0;
+ overstrike_detected = FALSE;
+ sbuf.clear();
}
}
@@ -2186,127 +2384,26 @@ void html_printer::draw(int code, int *p, int np, const environment *env)
}
case 'P':
- // fall through
+ break;
case 'p':
- {
-#if 0
- if (np & 1) {
- error("even number of arguments required for polygon");
- break;
- }
- if (np == 0) {
- error("no arguments for polygon");
- break;
- }
- // firstly lets add our current position to polygon
- int oh=env->hpos;
- int ov=env->vpos;
- int i=0;
-
- while (i<np) {
- p[i+0] += oh;
- p[i+1] += ov;
- oh = p[i+0];
- ov = p[i+1];
- i += 2;
- }
- // now store polygon in page
- page_contents->add_polygon(code, np, p, env->hpos, env->vpos, env->size, fill);
-#endif
- }
break;
case 'E':
- // fall through
+ break;
case 'e':
-#if 0
- if (np != 2) {
- error("2 arguments required for ellipse");
- break;
- }
- page_contents->add_line(code,
- env->hpos, env->vpos-p[1]/2, env->hpos+p[0], env->vpos+p[1]/2,
- env->size, fill);
-#endif
break;
case 'C':
- // fill circle
-
+ break;
case 'c':
- {
-#if 0
- // troff adds an extra argument to C
- if (np != 1 && !(code == 'C' && np == 2)) {
- error("1 argument required for circle");
- break;
- }
- page_contents->add_line(code,
- env->hpos, env->vpos-p[0]/2, env->hpos+p[0], env->vpos+p[0]/2,
- env->size, fill);
-#endif
- }
break;
case 'a':
- {
-#if 0
- if (np == 4) {
- double c[2];
-
- if (adjust_arc_center(p, c)) {
- page_contents->add_arc('a', env->hpos, env->vpos, p, c, env->size, fill);
- } else {
- // a straignt line
- page_contents->add_line('l', env->hpos, env->vpos, p[0]+p[2], p[1]+p[3], env->size, fill);
- }
- } else {
- error("4 arguments required for arc");
- }
-#endif
- }
break;
case '~':
- {
-#if 0
- if (np & 1) {
- error("even number of arguments required for spline");
- break;
- }
- if (np == 0) {
- error("no arguments for spline");
- break;
- }
- // firstly lets add our current position to spline
- int oh=env->hpos;
- int ov=env->vpos;
- int i=0;
-
- while (i<np) {
- p[i+0] += oh;
- p[i+1] += ov;
- oh = p[i+0];
- ov = p[i+1];
- i += 2;
- }
- page_contents->add_spline('~', env->hpos, env->vpos, np, p, env->size, fill);
-#endif
- }
break;
case 'f':
- {
-#if 0
- if (np != 1 && np != 2) {
- error("1 argument required for fill");
- break;
- }
- fill = p[0];
- if (fill < 0 || fill > FILL_MAX) {
- // This means fill with the current color.
- fill = FILL_MAX + 1;
- }
-#endif
- break;
- }
+ break;
case 'F':
// fill with color env->fill
+ background = env->fill;
break;
default:
@@ -2318,7 +2415,8 @@ void html_printer::draw(int code, int *p, int np, const environment *env)
html_printer::html_printer()
: html(0, MAX_LINE_LENGTH),
no_of_printed_pages(0),
- sbuf_len(0),
+ last_sbuf_length(0),
+ overstrike_detected(FALSE),
output_hpos(-1),
output_vpos(-1),
output_vpos_max(-1),
@@ -2336,7 +2434,8 @@ html_printer::html_printer()
pageoffset(0),
indentation(0),
prev_indent(0),
- line_number(0)
+ line_number(0),
+ background(NULL)
{
#if defined(DEBUGGING)
file_list.add_new_file(stdout);
@@ -2362,6 +2461,7 @@ html_printer::html_printer()
res = r;
html.set_fixed_point(point);
space_char_index = font::name_to_index("space");
+ space_width = font::hor;
paper_length = font::paperlength;
linelength = font::res*13/2;
if (paper_length == 0)
@@ -2371,48 +2471,26 @@ html_printer::html_printer()
}
/*
- * add_char_to_sbuf - adds a single character to the sbuf.
- */
-
-void html_printer::add_char_to_sbuf (unsigned char code)
-{
- if (sbuf_len < SBUF_SIZE) {
- sbuf[sbuf_len] = code;
- sbuf_len++;
- } else {
- fatal("need to increase SBUF_SIZE");
- }
-}
-
-/*
* add_to_sbuf - adds character code or name to the sbuf.
*/
-void html_printer::add_to_sbuf (unsigned char code, const char *name)
+void html_printer::add_to_sbuf (unsigned char code, const string &s)
{
- if (name == 0) {
- add_char_to_sbuf(code);
- } else {
- if (sbuf_style.f != NULL) {
- char *html_glyph = get_html_translation(sbuf_style.f, name);
+ char *html_glyph;
- if (html_glyph == NULL) {
- add_char_to_sbuf(code);
- } else {
- int l = strlen(html_glyph);
- int i;
+ if (s.empty()) {
+ html_glyph = get_html_translation(sbuf_style.f, string(code));
+ if ((html_glyph == NULL) && (code >= UNICODE_DESC_START))
+ html_glyph = to_unicode(code);
+ } else
+ if (sbuf_style.f != NULL)
+ html_glyph = get_html_translation(sbuf_style.f, s);
- // Escape the name, so that "&" doesn't get expanded to "&amp;"
- // later during translate_to_html.
- add_char_to_sbuf('\\'); add_char_to_sbuf('(');
-
- for (i=0; i<l; i++) {
- add_char_to_sbuf(html_glyph[i]);
- }
- add_char_to_sbuf('\\'); add_char_to_sbuf(')');
- }
- }
- }
+ last_sbuf_length = sbuf.length();
+ if (html_glyph == NULL)
+ sbuf += code;
+ else
+ sbuf += html_glyph;
}
int html_printer::sbuf_continuation (unsigned char code, const char *name,
@@ -2421,124 +2499,22 @@ int html_printer::sbuf_continuation (unsigned char code, const char *name,
if (sbuf_end_hpos == env->hpos) {
add_to_sbuf(code, name);
sbuf_end_hpos += w + sbuf_kern;
- return( TRUE );
+ return TRUE;
} else {
- if ((sbuf_len < SBUF_SIZE-1) && (env->hpos >= sbuf_end_hpos) &&
+ if ((env->hpos >= sbuf_end_hpos) &&
((sbuf_kern == 0) || (sbuf_end_hpos - sbuf_kern != env->hpos))) {
/*
* lets see whether a space is needed or not
*/
- int space_width = sbuf_style.f->get_space_width(sbuf_style.point_size);
- if (env->hpos-sbuf_end_hpos < space_width/2) {
+ if (env->hpos-sbuf_end_hpos < space_width) {
add_to_sbuf(code, name);
sbuf_end_hpos = env->hpos + w;
- return( TRUE );
+ return TRUE;
}
}
}
- return( FALSE );
-}
-
-/*
- * seen_backwards_escape - returns TRUE if we can see a escape at position i..l in s
- */
-
-int html_printer::seen_backwards_escape (char *s, int l)
-{
- /*
- * this is tricky so it is broken into components for clarity
- * (we let the compiler put in all back into a complex expression)
- */
- if ((l>0) && (sbuf[l] == '(') && (sbuf[l-1] == '\\')) {
- /*
- * ok seen '\(' but we must now check for '\\('
- */
- if ((l>1) && (sbuf[l-2] == '\\')) {
- /*
- * escaped the escape
- */
- return( FALSE );
- } else {
- return( TRUE );
- }
- } else {
- return( FALSE );
- }
-}
-
-/*
- * reverse - return reversed string.
- */
-
-char *reverse (char *s)
-{
- int i=0;
- int j=strlen(s)-1;
- char t;
-
- while (i<j) {
- t = s[i];
- s[i] = s[j];
- s[j] = t;
- i++;
- j--;
- }
- return( s );
-}
-
-/*
- * remove_last_char_from_sbuf - removes the last character from sbuf.
- */
-
-char *html_printer::remove_last_char_from_sbuf ()
-{
- int l=sbuf_len;
- static char last[MAX_STRING_LENGTH];
-
- if (l>0) {
- l--;
- if ((sbuf[l] == ')') && (l>0) && (sbuf[l-1] == '\\')) {
- /*
- * found terminating escape
- */
- int i=0;
-
- l -= 2;
- while ((l>0) && (! seen_backwards_escape(sbuf, l))) {
- if (sbuf[l] == '\\') {
- if (sbuf[l-1] == '\\') {
- last[i] = sbuf[l];
- i++;
- l--;
- }
- } else {
- last[i] = sbuf[l];
- i++;
- }
- l--;
- }
- last[i] = (char)0;
- sbuf_len = l;
- if (seen_backwards_escape(sbuf, l)) {
- sbuf_len--;
- }
- return( reverse(last) );
- } else {
- if ((sbuf[l] == '\\') && (l>0) && (sbuf[l-1] == '\\')) {
- l -= 2;
- sbuf_len = l;
- return( "\\" );
- } else {
- sbuf_len--;
- last[0] = sbuf[sbuf_len];
- last[1] = (char)0;
- return( last );
- }
- }
- } else {
- return( NULL );
- }
+ return FALSE ;
}
/*
@@ -2546,144 +2522,57 @@ char *html_printer::remove_last_char_from_sbuf ()
* return the device encoding for such character.
*/
-char *get_html_translation (font *f, const char *name)
+char *get_html_translation (font *f, const string &name)
{
- int index;
+ int index;
- if ((f == 0) || (name == 0) || (strcmp(name, "") == 0)) {
- return( NULL );
- } else {
- index = f->name_to_index((char *)name);
+ if ((f == 0) || name.empty())
+ return NULL;
+ else {
+ index = f->name_to_index((char *)(name + '\0').contents());
if (index == 0) {
- error("character `%s' not found", name);
- return( NULL );
- } else {
- if (f->contains(index)) {
- return( (char *)f->get_special_device_encoding(index) );
- } else {
- return( NULL );
- }
- }
+ error("character `%s' not found", (name + '\0').contents());
+ return NULL;
+ } else
+ if (f->contains(index))
+ return (char *)f->get_special_device_encoding(index);
+ else
+ return NULL;
}
}
/*
- * to_unicode - returns a unicode translation of char, ch.
- */
-
-static char *to_unicode (unsigned char ch)
-{
- static char buf[20];
-
- sprintf(buf, "&#%u;", (unsigned int)ch);
- return( buf );
-}
-
-/*
- * char_translate_to_html - convert a single non escaped character
- * into the appropriate html character.
+ * overstrike - returns TRUE if the glyph (i, name) is going to overstrike
+ * a previous glyph in sbuf.
+ * If TRUE the font is changed to bold and the previous sbuf
+ * is flushed.
*/
-int char_translate_to_html (font *f, char *buf, int buflen, unsigned char ch, int b, int and_single)
+int html_printer::overstrike(unsigned char code, const char *name, const environment *env, int w)
{
- if (and_single) {
- int t, l;
- char *translation;
- char name[2];
-
- name[0] = ch;
- name[1] = (char)0;
- translation = get_html_translation(f, name);
- if ((translation == NULL) && (ch >= UNICODE_DESC_START)) {
- translation = to_unicode(ch);
- }
- if (translation) {
- l = strlen(translation);
- t = max(0, min(l, buflen-b));
- strncpy(&buf[b], translation, t);
- b += t;
- } else {
- if (b<buflen) {
- buf[b] = ch;
- b++;
- }
- }
- } else {
+ if ((env->hpos < sbuf_end_hpos)
+ || ((sbuf_kern != 0) && (sbuf_end_hpos - sbuf_kern < env->hpos))) {
/*
- * do not attempt to encode single characters
+ * at this point we have detected an overlap
*/
- if (b<buflen) {
- buf[b] = ch;
- b++;
- }
- }
- return( b );
-}
-
-/*
- * str_translate_to_html - converts a string, str, into html text. It places
- * the output input buffer, buf. It truncates string, str, if
- * there is not enough space in buf.
- * It looks up the html character encoding of single characters
- * if, and_single, is TRUE. Characters such as < > & etc.
- * If is_special then we will decode special characters from an escape sequence.
- */
-
-void str_translate_to_html (font *f, char *buf, int buflen, char *str, int len, int and_single, int is_special)
-{
- char *translation;
- int e;
- char escaped_char[MAX_STRING_LENGTH];
- int l;
- int i=0;
- int b=0;
- int t=0;
-
-#if 0
- if (strcmp(str, "``@,;:\\\\()[]''") == 0) {
- stop();
- }
-#endif
- while (str[i] != (char)0) {
- if ((str[i]=='\\') && (i+1<len) && (str[i+1] == '(') && is_special) {
- // start of escape
- i += 2; // move over \(
- e = 0;
- while ((str[i] != (char)0) &&
- (! ((str[i] == '\\') && (i+1<len) && (str[i+1] == ')')))) {
- if (str[i] == '\\') {
- i++;
- }
- escaped_char[e] = str[i];
- e++;
- i++;
- }
- if ((str[i] == '\\') && (i+1<len) && (str[i+1] == ')')) {
- i += 2;
- }
- escaped_char[e] = (char)0;
- if (e > 0) {
- translation = get_html_translation(f, escaped_char);
- if (translation) {
- l = strlen(translation);
- t = max(0, min(l, buflen-b));
- strncpy(&buf[b], translation, t);
- b += t;
- } else {
- int index=f->name_to_index(escaped_char);
-
- if (f->contains(index) && (index != 0)) {
- buf[b] = f->get_code(index);
- b++;
- }
- }
- }
+ if (overstrike_detected) {
+ /* already detected, remove previous glyph and use this glyph */
+ sbuf.set_length(last_sbuf_length);
+ add_to_sbuf(code, name);
+ sbuf_end_hpos = env->hpos + w;
+ return TRUE;
} else {
- b = char_translate_to_html(f, buf, buflen, str[i], b, and_single);
- i++;
+ /* first time we have detected an overstrike in the sbuf */
+ sbuf.set_length(last_sbuf_length); /* remove previous glyph */
+ if (! is_bold(sbuf_style.f))
+ flush_sbuf();
+ overstrike_detected = TRUE;
+ add_to_sbuf(code, name);
+ sbuf_end_hpos = env->hpos + w;
+ return TRUE;
}
}
- buf[min(b, buflen)] = (char)0;
+ return FALSE ;
}
/*
@@ -2695,11 +2584,6 @@ void html_printer::set_char(int i, font *f, const environment *env, int w, const
{
unsigned char code = f->get_code(i);
-#if 0
- if (code == ' ') {
- stop();
- }
-#endif
style sty(f, env->size, env->height, env->slant, env->fontno, env->col);
if (sty.slant != 0) {
if (sty.slant > 80 || sty.slant < -80) {
@@ -2707,19 +2591,17 @@ void html_printer::set_char(int i, font *f, const environment *env, int w, const
sty.slant = 0;
}
}
- if ((sbuf_len > 0) && (sbuf_len < SBUF_SIZE) && (sty == sbuf_style) &&
- (sbuf_vpos == env->vpos) && (sbuf_continuation(code, name, env, w))) {
+ if (((! sbuf.empty()) && (sty == sbuf_style) && (sbuf_vpos == env->vpos))
+ && (sbuf_continuation(code, name, env, w) || overstrike(code, name, env, w)))
return;
- } else {
- flush_sbuf();
- sbuf_len = 0;
- add_to_sbuf(code, name);
- sbuf_end_hpos = env->hpos + w;
- sbuf_start_hpos = env->hpos;
- sbuf_vpos = env->vpos;
- sbuf_style = sty;
- sbuf_kern = 0;
- }
+
+ flush_sbuf();
+ add_to_sbuf(code, name);
+ sbuf_end_hpos = env->hpos + w;
+ sbuf_start_hpos = env->hpos;
+ sbuf_vpos = env->vpos;
+ sbuf_style = sty;
+ sbuf_kern = 0;
}
/*
@@ -2773,7 +2655,7 @@ void html_printer::begin_page(int n)
output_vpos_max = -1;
current_paragraph = new html_text(&html);
#if defined(INDENTATION)
- current_paragraph->do_indent(indent.text, indentation, pageoffset, linelength);
+ current_paragraph->do_indent(page_contents->buffer.add_string(indent.text), indentation, pageoffset, linelength);
#endif
current_paragraph->do_para("");
}
@@ -2789,6 +2671,26 @@ font *html_printer::make_font(const char *nm)
return html_font::load_html_font(nm);
}
+void html_printer::do_body (void)
+{
+ if (background == NULL)
+ fputs("<body>\n\n", stdout);
+ else {
+ double r, g, b;
+ char buf[6+1];
+
+ background->get_rgb(&r, &g, &b);
+ sprintf(buf, "%.2X%.2X%.2X",
+ (unsigned int)(((double) 0xff)*r),
+ (unsigned int)(((double) 0xff)*g),
+ (unsigned int)(((double) 0xff)*b));
+
+ fputs("<body bgcolor=\"#", stdout);
+ fputs(buf, stdout);
+ fputs("\">\n\n", stdout);
+ }
+}
+
html_printer::~html_printer()
{
current_paragraph->flush_text();
@@ -2808,7 +2710,8 @@ html_printer::~html_printer()
fputs("<meta name=\"Content-Style\" content=\"text/css\">\n", stdout);
write_title(TRUE);
fputs("</head>\n", stdout);
- fputs("<body>\n\n", stdout);
+ do_body();
+
write_title(FALSE);
header.write_headings(stdout, FALSE);
write_rule();
@@ -2873,7 +2776,6 @@ void html_printer::special(char *s, const environment *env, char type)
if (strncmp(s, "html:", 5) == 0) {
int r=font::res; /* resolution of the device */
- char buf[MAX_STRING_LENGTH];
font *f=sbuf_style.f;
if (f == NULL) {
@@ -2881,28 +2783,26 @@ void html_printer::special(char *s, const environment *env, char type)
f = font::load_font("TR", &found);
}
- str_translate_to_html(f, buf, MAX_STRING_LENGTH,
- &s[5], strlen(s)-5, FALSE, TRUE);
/*
* need to pass rest of string through to html output during flush
*/
- page_contents->add_html(&sbuf_style, buf, strlen(buf),
- line_number,
- env->vpos-env->size*r/72, env->hpos,
- env->vpos , env->hpos);
+ page_contents->add_and_encode(&sbuf_style, string(&s[5]),
+ line_number,
+ env->vpos-env->size*r/72, env->hpos,
+ env->vpos , env->hpos);
/*
* assume that the html command has no width, if it does then hopefully troff
* will have fudged this in a macro by requesting that the formatting move right by
- * the appropriate width.
+ * the appropriate amount.
*/
} else if (strncmp(s, "index:", 6) == 0) {
cutoff_heading = atoi(&s[6]);
} else if (strncmp(s, "html-tag:", 9) == 0) {
int r=font::res; /* resolution of the device */
- page_contents->add_tag(&sbuf_style, s, strlen(s),
+ page_contents->add_tag(&sbuf_style, string(s),
line_number,
env->vpos-env->size*r/72, env->hpos,
env->vpos , env->hpos);
@@ -2921,7 +2821,7 @@ int main(int argc, char **argv)
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
- while ((c = getopt_long(argc, argv, "o:i:I:D:F:vdlrn", long_options, NULL))
+ while ((c = getopt_long(argc, argv, "o:i:I:D:F:vdhlrn", long_options, NULL))
!= EOF)
switch(c) {
case 'v':
@@ -2940,6 +2840,10 @@ int main(int argc, char **argv)
case 'd':
/* handled by pre-html */
break;
+ case 'h':
+ /* do not use the Hn headings of html, but manufacture our own */
+ manufacture_headings = TRUE;
+ break;
case 'o':
/* handled by pre-html */
break;
@@ -2978,6 +2882,6 @@ int main(int argc, char **argv)
static void usage(FILE *stream)
{
- fprintf(stream, "usage: %s [-vln] [-D dir] [-I image_stem] [-F dir] [files ...]\n",
+ fprintf(stream, "usage: %s [-vlnh] [-D dir] [-I image_stem] [-F dir] [files ...]\n",
program_name);
}
diff --git a/src/preproc/html/pre-html.cc b/src/preproc/html/pre-html.cc
index 2e8de446..001f9d59 100644
--- a/src/preproc/html/pre-html.cc
+++ b/src/preproc/html/pre-html.cc
@@ -32,6 +32,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "stringclass.h"
#include "posix.h"
#include "defs.h"
+#include "searchpath.h"
#include <errno.h>
#include <sys/types.h>
@@ -56,7 +57,6 @@ extern "C" const char *Version_string;
#include "pushback.h"
#include "html-strings.h"
-#define POSTSCRIPTRES 72000 // maybe there is a better way to find this? --fixme--
#define DEFAULT_IMAGE_RES 80 // 80 pixels per inch resolution
#ifdef PAGEA4
# define DEFAULT_VERTICAL_OFFSET 0 // DEFAULT_VERTICAL_OFFSET/72 of an inch
@@ -91,6 +91,7 @@ extern "C" const char *Version_string;
typedef enum {CENTERED, LEFT, RIGHT, INLINE} IMAGE_ALIGNMENT;
+static int postscriptRes =-1; // postscript resolution, dots per inch
static int stdoutfd = 1; // output file descriptor - normally 1 but might move
// -1 means closed
static int copyofstdoutfd =-1; // a copy of stdout, so we can restore stdout when
@@ -110,6 +111,10 @@ static char *troffFileName = NULL; // output of pre-html output whi
static char *htmlFileName = NULL; // output of pre-html output which is sent to troff -Thtml
#endif
+const char *const FONT_ENV_VAR = "GROFF_FONT_PATH";
+static search_path font_path(FONT_ENV_VAR, FONTPATH, 0, 0);
+
+
/*
* Images are generated via postscript, gs and the pnm utilities.
*/
@@ -132,8 +137,34 @@ void sys_fatal (const char *s)
}
/*
+ * get_resolution - returns the postscript resolution from devps/DESC
+ */
+
+static int get_resolution (void)
+{
+ char *pathp;
+ FILE *f;
+ unsigned long int res;
+ int n;
+ int c;
+ f = font_path.open_file("devps/DESC", &pathp);
+ if (f == 0) sys_fatal("fopen");
+ while (1) {
+ n = fscanf(f, " res %lu", &res);
+ if (n < 0) sys_fatal("EOF");
+ if (n >= 1) {
+ fclose(f);
+ return res;
+ }
+ while (( c = getc(f) ) != '\n')
+ if (c == EOF) sys_fatal("EOF");
+ }
+}
+
+/*
* html_system - a wrapper for system()
*/
+
void html_system(const char *s, int redirect_stdout)
{
// Redirect standard error to the null device. This is more
@@ -371,7 +402,7 @@ static void makeFileName (void)
static void checkImageDir (void)
{
if ((image_dir != NULL) && (strcmp(image_dir, "") != 0))
- if (! ((mkdir(image_dir, 0700) == 0) || (errno == EEXIST))) {
+ if (! ((mkdir(image_dir, 0777) == 0) || (errno == EEXIST))) {
error("cannot create directory `%1'", image_dir);
exit(1);
}
@@ -383,17 +414,16 @@ static void checkImageDir (void)
static void write_end_image (int is_html)
{
- if (is_html) {
+ if (is_html)
/*
* emit image name and enable output
*/
writeString("\\O[2]\\O[1]\\O[4]\n");
- } else {
+ else
/*
* postscript, therefore emit image boundaries
*/
writeString("\\O[2]\\O[4]\n");
- }
}
/*
@@ -406,36 +436,29 @@ static void write_end_image (int is_html)
static void write_start_image (IMAGE_ALIGNMENT pos, int is_html)
{
- if (pos == INLINE) {
- writeString("\\O[3]\\O[5 ");
- writeString(image_template); writeString(".png]");
- } else {
- writeString(".begin \\{\\\n");
- switch (pos) {
-
- case LEFT:
- writeString(". image l ");
- break;
- case RIGHT:
- writeString(". image r ");
- break;
- case CENTERED:
- default:
- writeString(". image c ");
- }
- writeString(image_template); writeString(".png\n");
- if (! is_html) {
- writeString(".bp\n");
- writeString(".tl ''''\n");
- }
- writeString("\\}\n");
+ writeString("\\O[3]\\O[5");
+ switch (pos) {
+
+ case INLINE:
+ writeString("i");
+ break;
+ case LEFT:
+ writeString("l");
+ break;
+ case RIGHT:
+ writeString("r");
+ break;
+ case CENTERED:
+ default:
+ writeString("c");
+ break;
}
- if (is_html) {
+ writeString(image_template); writeString(".png]");
+ if (is_html)
writeString("\\O[0]\n");
- } else {
+ else
// reset min/max registers
writeString("\\O[0]\\O[1]\n");
- }
}
/*
@@ -786,10 +809,10 @@ static void createImage (imageItem *i)
{
if (i->X1 != -1) {
char *s;
- int x1 = max(min(i->X1, i->X2)*image_res/POSTSCRIPTRES-1*IMAGE_BOARDER_PIXELS, 0);
- int y1 = max((image_res*vertical_offset/72)+min(i->Y1, i->Y2)*image_res/POSTSCRIPTRES-IMAGE_BOARDER_PIXELS, 0);
- int x2 = max(i->X1, i->X2)*image_res/POSTSCRIPTRES+1*IMAGE_BOARDER_PIXELS;
- int y2 = (image_res*vertical_offset/72)+(max(i->Y1, i->Y2)*image_res/POSTSCRIPTRES)+1+IMAGE_BOARDER_PIXELS;
+ int x1 = max(min(i->X1, i->X2)*image_res/postscriptRes-1*IMAGE_BOARDER_PIXELS, 0);
+ int y1 = max((image_res*vertical_offset/72)+min(i->Y1, i->Y2)*image_res/postscriptRes-IMAGE_BOARDER_PIXELS, 0);
+ int x2 = max(i->X1, i->X2)*image_res/postscriptRes+1*IMAGE_BOARDER_PIXELS;
+ int y2 = (image_res*vertical_offset/72)+(max(i->Y1, i->Y2)*image_res/postscriptRes)+1+IMAGE_BOARDER_PIXELS;
s = make_message("pnmcut%s %d %d %d %d < %s/%d | pnmcrop | pnmtopng%s %s > %s \n",
EXE_EXT,
@@ -899,7 +922,7 @@ static void generateImages (char *regionFileName)
int y2 = f->readInt();
int maxx = max(f->readInt(), MAX_WIDTH*image_res);
char *name = f->readString();
- int res = POSTSCRIPTRES; // --fixme-- prefer (f->readInt()) providing that troff can discover the value
+ int res = postscriptRes;
listOfImages.add(x1, y1, x2, y2, page, res, maxx, name);
while ((f->putPB(f->getPB()) != '\n') &&
(f->putPB(f->getPB()) != eof)) {
@@ -1185,7 +1208,7 @@ int scanArguments (int argc, char **argv)
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
- while ((c = getopt_long(argc, argv, "+o:i:I:D:F:vdlrn", long_options, NULL))
+ while ((c = getopt_long(argc, argv, "+o:i:I:D:F:vdhlrn", long_options, NULL))
!= EOF)
switch(c) {
case 'v':
@@ -1200,6 +1223,9 @@ int scanArguments (int argc, char **argv)
case 'i':
image_res = atoi(optarg);
break;
+ case 'F':
+ font_path.command_line_dir(optarg);
+ break;
case 'o':
vertical_offset = atoi(optarg);
break;
@@ -1208,6 +1234,9 @@ int scanArguments (int argc, char **argv)
debug = TRUE;
#endif
break;
+ case 'h':
+ // handled by post-grohtml
+ break;
case CHAR_MAX + 1: // --help
usage(stdout);
exit(0);
@@ -1288,6 +1317,7 @@ int main(int argc, char **argv)
int ok=1;
i = scanArguments(argc, argv);
+ postscriptRes = get_resolution();
checkImageDir();
makeFileName();
while (i < argc) {
diff --git a/src/roff/troff/div.h b/src/roff/troff/div.h
index 3b726c37..37ec3fa6 100644
--- a/src/roff/troff/div.h
+++ b/src/roff/troff/div.h
@@ -152,5 +152,6 @@ void push_page_ejector();
void continue_page_eject();
void handle_first_page_transition();
void blank_line();
+void begin_page(void);
extern void cleanup_and_exit(int);
diff --git a/src/roff/troff/input.cc b/src/roff/troff/input.cc
index f2916b0f..b145a218 100644
--- a/src/roff/troff/input.cc
+++ b/src/roff/troff/input.cc
@@ -138,7 +138,6 @@ static void interpolate_arg(symbol);
static request_or_macro *lookup_request(symbol);
static int get_delim_number(units *, int);
static int get_delim_number(units *, int, units);
-static symbol get_delim_file_name();
static int get_line_arg(units *res, int si, charinfo **cp);
static int read_size(int *);
static symbol get_delim_name();
@@ -1011,7 +1010,7 @@ int non_interpreted_char_node::interpret(macro *mac)
static void do_width();
static node *do_non_interpreted();
static node *do_special();
-static node *do_suppress();
+static node *do_suppress(symbol nm);
static void do_register();
dictionary color_dictionary(501);
@@ -1879,7 +1878,7 @@ void token::next()
type = TOKEN_NODE;
return;
case 'O':
- nd = do_suppress();
+ nd = do_suppress(read_escape_name());
if (!nd)
break;
type = TOKEN_NODE;
@@ -4357,70 +4356,6 @@ static symbol get_delim_name()
}
}
-static symbol get_delim_file_name()
-{
- token start;
- start.next();
- if (start.eof()) {
- error("end of input at start of delimited file name");
- return NULL_SYMBOL;
- }
- if (start.newline()) {
- error("can't delimit file name with a newline");
- return NULL_SYMBOL;
- }
- int start_level = input_stack::get_level();
- char abuf[ABUF_SIZE];
- char *buf = abuf;
- int buf_size = ABUF_SIZE;
- int i = 0;
- // move over initial spaces
- while (tok.ch() == 0)
- tok.next();
- if ((buf[i] = start.ch()) != 0)
- i++;
- for (;;) {
- if (i + 1 > buf_size) {
- if (buf == abuf) {
- buf = new char[ABUF_SIZE*2];
- memcpy(buf, abuf, buf_size);
- buf_size = ABUF_SIZE*2;
- }
- else {
- char *old_buf = buf;
- buf = new char[buf_size*2];
- memcpy(buf, old_buf, buf_size);
- buf_size *= 2;
- a_delete old_buf;
- }
- }
- if ((buf[i] = tok.ch()) == 0) {
- error("missing delimiter (got %1)", tok.description());
- if (buf != abuf)
- a_delete buf;
- return NULL_SYMBOL;
- }
- i++;
- tok.next();
- if (tok.ch() == ']' && input_stack::get_level() == start_level)
- break;
- }
- buf[i] = '\0';
- if (buf == abuf) {
- if (i == 0) {
- error("empty delimited file name");
- return NULL_SYMBOL;
- }
- else
- return symbol(buf);
- }
- else {
- symbol s(buf);
- a_delete buf;
- return s;
- }
-}
-
// Implement \R
static void do_register()
@@ -4657,19 +4592,14 @@ node *do_special()
return new special_node(mac);
}
-node *do_suppress()
+static node *do_suppress(symbol nm)
{
- tok.next();
- int c = tok.ch();
- if (c != '[') {
- error("argument(s) of \\O must be enclosed in brackets (got %1)",
- char(c));
+ if (nm.is_null()) {
+ error("expecting an argument to escape \\O");
return 0;
}
- tok.next();
- c = tok.ch();
- tok.next();
- switch (c) {
+ const char *s = nm.contents();
+ switch (*s) {
case '0':
if (begin_level == 1)
return new suppress_node(0, 0);
@@ -4684,23 +4614,60 @@ node *do_suppress()
break;
case '3':
begin_level++;
+ if ((begin_level == 1) && (! is_html)) {
+ if (curdiv == topdiv) {
+ if (topdiv->before_first_page) {
+ if (!break_flag) {
+ if (!topdiv->no_space_mode)
+ topdiv->begin_page();
+ }
+ else if (topdiv->no_space_mode)
+ topdiv->begin_page();
+ else {
+ push_page_ejector();
+ topdiv->begin_page();
+ topdiv->set_ejecting();
+ }
+ }
+ else {
+ push_page_ejector();
+ if (break_flag)
+ curenv->do_break();
+ if (!topdiv->no_space_mode)
+ topdiv->set_ejecting();
+ }
+ }
+ }
break;
case '4':
begin_level--;
break;
case '5':
{
- symbol filename = get_delim_file_name();
- if (filename.is_null()) {
- error("missing filename as second argument to \\O");
+ s++; // move over '5'
+ char position = *s;
+ if (*s == (char)0) {
+ error("missing position and filename in \\O");
+ return 0;
+ }
+ if (!(position == 'l'
+ || position == 'r'
+ || position == 'c'
+ || position == 'i')) {
+ error("l, r, c, or i position expected (got %1 in \\O)", position);
+ return 0;
+ }
+ s++; // onto image name
+ if (s == (char *)0) {
+ error("missing image name for \\O");
return 0;
}
if (begin_level == 1)
- return new suppress_node(filename, 'i');
+ return new suppress_node(symbol(s), position);
}
break;
default:
- error("`%1' is an invalid argument to \\O", char(c));
+ error("`%1' is an invalid argument to \\O", *s);
}
return 0;
}
@@ -4945,65 +4912,6 @@ void else_request()
}
}
-/*
- * begin - if this is the outermost html_begin request then execute the
- * rest of the line, else skip line
- */
-
-void begin()
-{
- begin_level++;
- if (begin_level == 1)
- begin_alternative();
- else
- skip_alternative();
-}
-
-/*
- * end - if this is the outermost html_end request then execute the
- * rest of the line, else skip line
- */
-
-void end()
-{
- begin_level--;
- if (begin_level == 0)
- begin_alternative();
- else
- skip_alternative();
- if (begin_level < 0)
- begin_level = 0;
-}
-
-/*
- * image - implements the directive `.image {l|r|c|i} filename'
- * which places the filename into a node which is later
- * written out
- *
- * . either as a special in the form of an image tag for -Thtml
- * . or as an image region definition for all other devices
- *
- */
-
-void image()
-{
- if (has_arg()) {
- char position = tok.ch();
- if (!(position == 'l'
- || position == 'r'
- || position == 'c'
- || position == 'i')) {
- error("l, r, c, or i expected (got %1)", tok.description());
- position = 'c';
- }
- tok.next();
- symbol filename = get_long_name(1);
- if (!filename.is_null())
- curenv->add_node(new suppress_node(filename, position));
- }
- skip_line();
-}
-
static int while_depth = 0;
static int while_break_flag = 0;
@@ -6636,7 +6544,6 @@ int main(int argc, char **argv)
init_column_requests();
#endif /* COLUMN */
init_node_requests();
- init_markup_requests();
number_reg_dictionary.define(".T", new constant_reg(tflag ? "1" : "0"));
init_registers();
init_reg_requests();
@@ -6747,13 +6654,6 @@ void get_output_registers(int *minx, int *miny, int *maxx, int *maxy)
*maxy = output_reg_maxy_contents;
}
-void init_markup_requests()
-{
- init_request("begin", begin);
- init_request("end", end);
- init_request("image", image);
-}
-
void init_input_requests()
{
init_request("ds", define_string);
diff --git a/tmac/Makefile.sub b/tmac/Makefile.sub
index ea1e0ed7..07609dec 100644
--- a/tmac/Makefile.sub
+++ b/tmac/Makefile.sub
@@ -21,8 +21,7 @@ NORMALFILES=\
X.tmac Xps.tmac \
lj4.tmac \
lbp.tmac \
- html.tmac www.tmac color-html.tmac \
- color.tmac \
+ html.tmac www.tmac \
eqnrc \
troffrc troffrc-end \
hyphen.us
diff --git a/tmac/color-html.tmac b/tmac/color-html.tmac
deleted file mode 100755
index 3f986591..00000000
--- a/tmac/color-html.tmac
+++ /dev/null
@@ -1,482 +0,0 @@
-.\"
-.\" these colors are compliant with html-3.0 and above
-.\"
-.do defcolor aliceblue rgb #eff7ff
-.do defcolor antiquewhite rgb #f9e8d2
-.do defcolor antiquewhite1 rgb #feedd6
-.do defcolor antiquewhite2 rgb #ebdbc5
-.do defcolor antiquewhite3 rgb #c8b9a6
-.do defcolor antiquewhite4 rgb #817468
-.do defcolor aquamarine rgb #43b7ba
-.do defcolor aquamarine1 rgb #87fdce
-.do defcolor aquamarine2 rgb #7deabe
-.do defcolor aquamarine3 rgb #69c69f
-.do defcolor aquamarine4 rgb #417c64
-.do defcolor azure rgb #efffff
-.do defcolor azure2 rgb #deecec
-.do defcolor azure3 rgb #bcc7c7
-.do defcolor azure4 rgb #7a7d7d
-.do defcolor beige rgb #f5f3d7
-.do defcolor bisque rgb #fde0bc
-.do defcolor bisque2 rgb #ead0ae
-.do defcolor bisque3 rgb #c7af92
-.do defcolor bisque4 rgb #816e59
-.do defcolor black rgb #000000
-.do defcolor blanchedalmond rgb #fee8c6
-.do defcolor blue rgb #0000ff
-.do defcolor blue1 rgb #1535ff
-.do defcolor blue2 rgb #1531ec
-.do defcolor blue3 rgb #1528c7
-.do defcolor blue4 rgb #151b7e
-.do defcolor blueviolet rgb #7931df
-.do defcolor brown rgb #980517
-.do defcolor brown1 rgb #f63526
-.do defcolor brown2 rgb #e42d17
-.do defcolor brown3 rgb #c22217
-.do defcolor burlywood1 rgb #fcce8e
-.do defcolor burlywood2 rgb #eabe83
-.do defcolor burlywood3 rgb #c6a06d
-.do defcolor burlywood4 rgb #806341
-.do defcolor cadetblue rgb #578693
-.do defcolor cadetblue1 rgb #99f3ff
-.do defcolor cadetblue2 rgb #8ee2ec
-.do defcolor cadetblue3 rgb #77bfc7
-.do defcolor cadetblue4 rgb #4c787e
-.do defcolor chartreuse rgb #8afb17
-.do defcolor chartreuse2 rgb #7fe817
-.do defcolor chartreuse3 rgb #6cc417
-.do defcolor chartreuse4 rgb #437c17
-.do defcolor chocolate rgb #c85a17
-.do defcolor coral rgb #f76541
-.do defcolor coral2 rgb #e55b3c
-.do defcolor coral3 rgb #c34a2c
-.do defcolor coral4 rgb #7e2817
-.do defcolor cornflowerblue rgb #151b8d
-.do defcolor cornsilk rgb #fff7d7
-.do defcolor cornsilk2 rgb #ece5c6
-.do defcolor cornsilk3 rgb #c8c2a7
-.do defcolor cornsilk4 rgb #817a68
-.do defcolor cyan rgb #00ffff
-.do defcolor cyan1 rgb #57feff
-.do defcolor cyan2 rgb #50ebec
-.do defcolor cyan3 rgb #46c7c7
-.do defcolor cyan4 rgb #307d7e
-.do defcolor darkgoldenrod rgb #af7817
-.do defcolor darkgoldenrod1 rgb #fbb117
-.do defcolor darkgoldenrod2 rgb #e8a317
-.do defcolor darkgoldenrod3 rgb #c58917
-.do defcolor darkgoldenrod4 rgb #7f5217
-.do defcolor darkgreen rgb #254117
-.do defcolor darkkhaki rgb #b7ad59
-.do defcolor darkolivegreen rgb #4a4117
-.do defcolor darkolivegreen1 rgb #ccfb5d
-.do defcolor darkolivegreen2 rgb #bce954
-.do defcolor darkolivegreen3 rgb #a0c544
-.do defcolor darkolivegreen4 rgb #667c26
-.do defcolor darkorange rgb #f88017
-.do defcolor darkorange1 rgb #f87217
-.do defcolor darkorange2 rgb #e56717
-.do defcolor darkorange3 rgb #c35617
-.do defcolor darkorange4 rgb #7e3117
-.do defcolor darkorchid rgb #7d1b7e
-.do defcolor darkorchid1 rgb #b041ff
-.do defcolor darkorchid2 rgb #a23bec
-.do defcolor darkorchid3 rgb #8b31c7
-.do defcolor darkorchid4 rgb #571b7e
-.do defcolor darksalmon rgb #e18b6b
-.do defcolor darkseagreen rgb #8bb381
-.do defcolor darkseagreen1 rgb #c3fdb8
-.do defcolor darkseagreen2 rgb #b5eaaa
-.do defcolor darkseagreen3 rgb #99c68e
-.do defcolor darkseagreen4 rgb #617c58
-.do defcolor darkslateblue rgb #2b3856
-.do defcolor darkslategray rgb #25383c
-.do defcolor darkslategray1 rgb #9afeff
-.do defcolor darkslategray2 rgb #8eebec
-.do defcolor darkslategray3 rgb #78c7c7
-.do defcolor darkslategray4 rgb #4c7d7e
-.do defcolor darkturquoise rgb #3b9c9c
-.do defcolor darkviolet rgb #842dce
-.do defcolor deeppink rgb #f52887
-.do defcolor deeppink2 rgb #e4287c
-.do defcolor deeppink3 rgb #c12267
-.do defcolor deeppink4 rgb #7d053f
-.do defcolor deepskyblue rgb #3bb9ff
-.do defcolor deepskyblue2 rgb #38acec
-.do defcolor deepskyblue3 rgb #3090c7
-.do defcolor deepskyblue4 rgb #25587e
-.do defcolor dimgray rgb #463e41
-.do defcolor dodgerblue rgb #1589ff
-.do defcolor dodgerblue2 rgb #157dec
-.do defcolor dodgerblue3 rgb #1569c7
-.do defcolor dodgerblue4 rgb #153e7e
-.do defcolor firebrick rgb #800517
-.do defcolor firebrick1 rgb #f62817
-.do defcolor firebrick2 rgb #e42217
-.do defcolor firebrick3 rgb #c11b17
-.do defcolor floralwhite rgb #fff9ee
-.do defcolor forestgreen rgb #4e9258
-.do defcolor gainsboro rgb #d8d9d7
-.do defcolor ghostwhite rgb #f7f7ff
-.do defcolor gold rgb #d4a017
-.do defcolor gold1 rgb #fdd017
-.do defcolor gold2 rgb #eac117
-.do defcolor gold3 rgb #c7a317
-.do defcolor gold4 rgb #806517
-.do defcolor goldenrod rgb #edda74
-.do defcolor goldenrod1 rgb #fbb917
-.do defcolor goldenrod2 rgb #e9ab17
-.do defcolor goldenrod3 rgb #c68e17
-.do defcolor goldenrod4 rgb #805817
-.do defcolor gray rgb #736f6e
-.do defcolor gray0 rgb #150517
-.do defcolor gray100 rgb #ffffff
-.do defcolor gray18 rgb #250517
-.do defcolor gray21 rgb #2b1b17
-.do defcolor gray23 rgb #302217
-.do defcolor gray24 rgb #302226
-.do defcolor gray25 rgb #342826
-.do defcolor gray26 rgb #34282c
-.do defcolor gray27 rgb #382d2c
-.do defcolor gray28 rgb #3b3131
-.do defcolor gray29 rgb #3e3535
-.do defcolor gray30 rgb #413839
-.do defcolor gray31 rgb #41383c
-.do defcolor gray32 rgb #463e3f
-.do defcolor gray34 rgb #4a4344
-.do defcolor gray35 rgb #4c4646
-.do defcolor gray36 rgb #4e4848
-.do defcolor gray37 rgb #504a4b
-.do defcolor gray38 rgb #544e4f
-.do defcolor gray39 rgb #565051
-.do defcolor gray40 rgb #595454
-.do defcolor gray41 rgb #5c5858
-.do defcolor gray42 rgb #5f5a59
-.do defcolor gray43 rgb #625d5d
-.do defcolor gray44 rgb #646060
-.do defcolor gray45 rgb #666362
-.do defcolor gray46 rgb #696565
-.do defcolor gray47 rgb #6d6968
-.do defcolor gray48 rgb #6e6a6b
-.do defcolor gray49 rgb #726e6d
-.do defcolor gray50 rgb #747170
-.do defcolor gray51 rgb #787473
-.do defcolor gray52 rgb #7a7777
-.do defcolor gray53 rgb #7c7979
-.do defcolor gray54 rgb #807d7c
-.do defcolor gray55 rgb #82807e
-.do defcolor gray56 rgb #858381
-.do defcolor gray57 rgb #878583
-.do defcolor gray58 rgb #8b8987
-.do defcolor gray59 rgb #8d8b89
-.do defcolor gray60 rgb #8f8e8d
-.do defcolor gray61 rgb #939190
-.do defcolor gray62 rgb #959492
-.do defcolor gray63 rgb #999795
-.do defcolor gray64 rgb #9a9998
-.do defcolor gray65 rgb #9e9c9b
-.do defcolor gray66 rgb #a09f9d
-.do defcolor gray67 rgb #a3a2a0
-.do defcolor gray68 rgb #a5a4a3
-.do defcolor gray69 rgb #a9a8a6
-.do defcolor gray70 rgb #acaba9
-.do defcolor gray71 rgb #aeadac
-.do defcolor gray72 rgb #b1b1af
-.do defcolor gray73 rgb #b3b3b1
-.do defcolor gray74 rgb #b7b6b4
-.do defcolor gray75 rgb #b9b8b6
-.do defcolor gray76 rgb #bcbbba
-.do defcolor gray77 rgb #bebebc
-.do defcolor gray78 rgb #c1c1bf
-.do defcolor gray79 rgb #c3c4c2
-.do defcolor gray80 rgb #c7c7c5
-.do defcolor gray81 rgb #cacac9
-.do defcolor gray82 rgb #cccccb
-.do defcolor gray83 rgb #d0cfcf
-.do defcolor gray84 rgb #d2d2d1
-.do defcolor gray85 rgb #d5d5d4
-.do defcolor gray86 rgb #d7d7d7
-.do defcolor gray87 rgb #dbdbd9
-.do defcolor gray88 rgb #dddddc
-.do defcolor gray89 rgb #e0e0e0
-.do defcolor gray90 rgb #e2e3e1
-.do defcolor gray91 rgb #e5e6e4
-.do defcolor gray92 rgb #e8e9e8
-.do defcolor gray93 rgb #ebebea
-.do defcolor gray94 rgb #eeeeee
-.do defcolor gray95 rgb #f0f1f0
-.do defcolor gray96 rgb #f4f4f3
-.do defcolor gray97 rgb #f6f6f5
-.do defcolor gray98 rgb #f9f9fa
-.do defcolor gray99 rgb #fbfbfb
-.do defcolor green rgb #00ff00
-.do defcolor green1 rgb #5ffb17
-.do defcolor green2 rgb #59e817
-.do defcolor green3 rgb #4cc417
-.do defcolor green4 rgb #347c17
-.do defcolor greenyellow rgb #b1fb17
-.do defcolor honeydew rgb #f0feee
-.do defcolor honeydew2 rgb #deebdc
-.do defcolor honeydew3 rgb #bcc7b9
-.do defcolor honeydew4 rgb #7a7d74
-.do defcolor hotpink rgb #f660ab
-.do defcolor hotpink1 rgb #f665ab
-.do defcolor hotpink2 rgb #e45e9d
-.do defcolor hotpink3 rgb #c25283
-.do defcolor hotpink4 rgb #7d2252
-.do defcolor indianred rgb #5e2217
-.do defcolor indianred1 rgb #f75d59
-.do defcolor indianred2 rgb #e55451
-.do defcolor indianred3 rgb #c24641
-.do defcolor indianred4 rgb #7e2217
-.do defcolor ivory rgb #ffffee
-.do defcolor ivory2 rgb #ececdc
-.do defcolor ivory3 rgb #c9c7b9
-.do defcolor ivory4 rgb #817d74
-.do defcolor khaki rgb #ada96e
-.do defcolor khaki1 rgb #fff380
-.do defcolor khaki2 rgb #ede275
-.do defcolor khaki3 rgb #c9be62
-.do defcolor khaki4 rgb #827839
-.do defcolor lavender rgb #e3e4fa
-.do defcolor lavenderblush rgb #fdeef4
-.do defcolor lavenderblush2 rgb #ebdde2
-.do defcolor lavenderblush3 rgb #c8bbbe
-.do defcolor lavenderblush4 rgb #817679
-.do defcolor lawngreen rgb #87f717
-.do defcolor lemonchiffon rgb #fff8c6
-.do defcolor lemonchiffon2 rgb #ece5b6
-.do defcolor lemonchiffon3 rgb #c9c299
-.do defcolor lemonchiffon4 rgb #827b60
-.do defcolor lightblue rgb #addfff
-.do defcolor lightblue1 rgb #bdedff
-.do defcolor lightblue2 rgb #afdcec
-.do defcolor lightblue3 rgb #95b9c7
-.do defcolor lightblue4 rgb #5e767e
-.do defcolor lightcoral rgb #e77471
-.do defcolor lightcyan rgb #e0ffff
-.do defcolor lightcyan2 rgb #cfecec
-.do defcolor lightcyan3 rgb #afc7c7
-.do defcolor lightcyan4 rgb #717d7d
-.do defcolor lightgoldenrod rgb #ecd872
-.do defcolor lightgoldenrod1 rgb #ffe87c
-.do defcolor lightgoldenrod2 rgb #ecd672
-.do defcolor lightgoldenrod3 rgb #c8b560
-.do defcolor lightgoldenrod4 rgb #817339
-.do defcolor lightgoldenrodyellow rgb #faf8cc
-.do defcolor lightpink rgb #faafba
-.do defcolor lightpink1 rgb #f9a7b0
-.do defcolor lightpink2 rgb #e799a3
-.do defcolor lightpink3 rgb #c48189
-.do defcolor lightpink4 rgb #7f4e52
-.do defcolor lightsalmon rgb #f9966b
-.do defcolor lightsalmon2 rgb #e78a61
-.do defcolor lightsalmon3 rgb #c47451
-.do defcolor lightsalmon4 rgb #7f462c
-.do defcolor lightseagreen rgb #3ea99f
-.do defcolor lightskyblue rgb #82cafa
-.do defcolor lightskyblue2 rgb #a0cfec
-.do defcolor lightskyblue3 rgb #87afc7
-.do defcolor lightskyblue4 rgb #566d7e
-.do defcolor lightslateblue rgb #736aff
-.do defcolor lightslategray rgb #6d7b8d
-.do defcolor lightsteelblue rgb #728fce
-.do defcolor lightsteelblue1 rgb #c6deff
-.do defcolor lightsteelblue2 rgb #b7ceec
-.do defcolor lightsteelblue3 rgb #9aadc7
-.do defcolor lightsteelblue4 rgb #646d7e
-.do defcolor lightyellow rgb #fffedc
-.do defcolor lightyellow2 rgb #edebcb
-.do defcolor lightyellow3 rgb #c9c7aa
-.do defcolor lightyellow4 rgb #827d6b
-.do defcolor limegreen rgb #41a317
-.do defcolor linen rgb #f9eee2
-.do defcolor magenta rgb #ff00ff
-.do defcolor magenta1 rgb #f43eff
-.do defcolor magenta2 rgb #e238ec
-.do defcolor magenta3 rgb #c031c7
-.do defcolor maroon rgb #810541
-.do defcolor maroon1 rgb #f535aa
-.do defcolor maroon2 rgb #e3319d
-.do defcolor maroon3 rgb #c12283
-.do defcolor maroon4 rgb #7d0552
-.do defcolor mediumaquamarine rgb #348781
-.do defcolor mediumblue rgb #152dc6
-.do defcolor mediumforestgreen rgb #347235
-.do defcolor mediumgoldenrod rgb #ccb954
-.do defcolor mediumorchid rgb #b048b5
-.do defcolor mediumorchid1 rgb #d462ff
-.do defcolor mediumorchid2 rgb #c45aec
-.do defcolor mediumorchid3 rgb #a74ac7
-.do defcolor mediumorchid4 rgb #6a287e
-.do defcolor mediumpurple rgb #8467d7
-.do defcolor mediumpurple1 rgb #9e7bff
-.do defcolor mediumpurple2 rgb #9172ec
-.do defcolor mediumpurple3 rgb #7a5dc7
-.do defcolor mediumpurple4 rgb #4e387e
-.do defcolor mediumseagreen rgb #306754
-.do defcolor mediumslateblue rgb #5e5a80
-.do defcolor mediumspringgreen rgb #348017
-.do defcolor mediumturquoise rgb #48cccd
-.do defcolor mediumvioletred rgb #ca226b
-.do defcolor midnightblue rgb #151b54
-.do defcolor mintcream rgb #f5fff9
-.do defcolor mistyrose rgb #fde1dd
-.do defcolor mistyrose2 rgb #ead0cc
-.do defcolor mistyrose3 rgb #c6afac
-.do defcolor mistyrose4 rgb #806f6c
-.do defcolor moccasin rgb #fde0ac
-.do defcolor navajowhite rgb #fddaa3
-.do defcolor navajowhite2 rgb #eac995
-.do defcolor navajowhite3 rgb #c7aa7d
-.do defcolor navajowhite4 rgb #806a4b
-.do defcolor navy rgb #150567
-.do defcolor oldlace rgb #fcf3e2
-.do defcolor olivedrab rgb #658017
-.do defcolor olivedrab1 rgb #c3fb17
-.do defcolor olivedrab2 rgb #b5e917
-.do defcolor olivedrab3 rgb #99c517
-.do defcolor olivedrab4 rgb #617c17
-.do defcolor orange rgb #f87a17
-.do defcolor orange1 rgb #fa9b17
-.do defcolor orange2 rgb #e78e17
-.do defcolor orange3 rgb #c57717
-.do defcolor orange4 rgb #7f4817
-.do defcolor orangered rgb #f63817
-.do defcolor orangered2 rgb #e43117
-.do defcolor orangered3 rgb #c22817
-.do defcolor orangered4 rgb #7e0517
-.do defcolor orchid rgb #e57ded
-.do defcolor orchid1 rgb #f67dfa
-.do defcolor orchid2 rgb #e473e7
-.do defcolor orchid3 rgb #c160c3
-.do defcolor orchid4 rgb #7d387c
-.do defcolor palegoldenrod rgb #ede49e
-.do defcolor palegreen rgb #79d867
-.do defcolor palegreen1 rgb #a0fc8d
-.do defcolor palegreen2 rgb #94e981
-.do defcolor palegreen3 rgb #7dc56c
-.do defcolor palegreen4 rgb #4e7c41
-.do defcolor paleturquoise rgb #aeebec
-.do defcolor paleturquoise1 rgb #bcfeff
-.do defcolor paleturquoise2 rgb #adebec
-.do defcolor paleturquoise3 rgb #92c7c7
-.do defcolor paleturquoise4 rgb #5e7d7e
-.do defcolor palevioletred rgb #d16587
-.do defcolor palevioletred1 rgb #f778a1
-.do defcolor palevioletred2 rgb #e56e94
-.do defcolor palevioletred3 rgb #c25a7c
-.do defcolor palevioletred4 rgb #7e354d
-.do defcolor papayawhip rgb #feeccf
-.do defcolor peachpuff rgb #fcd5b0
-.do defcolor peachpuff2 rgb #eac5a3
-.do defcolor peachpuff3 rgb #c6a688
-.do defcolor peachpuff4 rgb #806752
-.do defcolor peru rgb #c57726
-.do defcolor pink rgb #faafbe
-.do defcolor pink2 rgb #e7a1b0
-.do defcolor pink3 rgb #c48793
-.do defcolor pink4 rgb #7f525d
-.do defcolor plum rgb #b93b8f
-.do defcolor plum1 rgb #f9b7ff
-.do defcolor plum2 rgb #e6a9ec
-.do defcolor plum3 rgb #c38ec7
-.do defcolor plum4 rgb #7e587e
-.do defcolor powderblue rgb #addce3
-.do defcolor purple rgb #8e35ef
-.do defcolor purple1 rgb #893bff
-.do defcolor purple2 rgb #7f38ec
-.do defcolor purple3 rgb #6c2dc7
-.do defcolor purple4 rgb #461b7e
-.do defcolor red rgb #ff0000
-.do defcolor red1 rgb #f62217
-.do defcolor red2 rgb #e41b17
-.do defcolor rosybrown rgb #b38481
-.do defcolor rosybrown1 rgb #fbbbb9
-.do defcolor rosybrown2 rgb #e8adaa
-.do defcolor rosybrown3 rgb #c5908e
-.do defcolor rosybrown4 rgb #7f5a58
-.do defcolor royalblue rgb #2b60de
-.do defcolor royalblue1 rgb #306eff
-.do defcolor royalblue2 rgb #2b65ec
-.do defcolor royalblue3 rgb #2554c7
-.do defcolor royalblue4 rgb #15317e
-.do defcolor salmon1 rgb #f88158
-.do defcolor salmon2 rgb #e67451
-.do defcolor salmon3 rgb #c36241
-.do defcolor salmon4 rgb #7e3817
-.do defcolor sandybrown rgb #ee9a4d
-.do defcolor seagreen rgb #4e8975
-.do defcolor seagreen1 rgb #6afb92
-.do defcolor seagreen2 rgb #64e986
-.do defcolor seagreen3 rgb #54c571
-.do defcolor seagreen4 rgb #387c44
-.do defcolor seashell rgb #fef3eb
-.do defcolor seashell2 rgb #ebe2d9
-.do defcolor seashell3 rgb #c8bfb6
-.do defcolor seashell4 rgb #817873
-.do defcolor sienna rgb #8a4117
-.do defcolor sienna1 rgb #f87431
-.do defcolor sienna2 rgb #e66c2c
-.do defcolor sienna3 rgb #c35817
-.do defcolor sienna4 rgb #7e3517
-.do defcolor skyblue rgb #6698ff
-.do defcolor skyblue1 rgb #82caff
-.do defcolor skyblue2 rgb #79baec
-.do defcolor skyblue3 rgb #659ec7
-.do defcolor skyblue4 rgb #41627e
-.do defcolor slateblue rgb #737ca1
-.do defcolor slateblue1 rgb #7369ff
-.do defcolor slateblue2 rgb #6960ec
-.do defcolor slateblue3 rgb #574ec7
-.do defcolor slateblue4 rgb #342d7e
-.do defcolor slategray rgb #657383
-.do defcolor slategray1 rgb #c2dfff
-.do defcolor slategray2 rgb #b4cfec
-.do defcolor slategray3 rgb #98afc7
-.do defcolor slategray4 rgb #616d7e
-.do defcolor snow rgb #fff9fa
-.do defcolor snow2 rgb #ece7e6
-.do defcolor snow3 rgb #c8c4c2
-.do defcolor snow4 rgb #817c7b
-.do defcolor springgreen rgb #4aa02c
-.do defcolor springgreen1 rgb #5efb6e
-.do defcolor springgreen2 rgb #57e964
-.do defcolor springgreen3 rgb #4cc552
-.do defcolor springgreen4 rgb #347c2c
-.do defcolor steelblue rgb #4863a0
-.do defcolor steelblue1 rgb #5cb3ff
-.do defcolor steelblue2 rgb #56a5ec
-.do defcolor steelblue3 rgb #488ac7
-.do defcolor steelblue4 rgb #2b547e
-.do defcolor tan rgb #d8af79
-.do defcolor tan1 rgb #fa9b3c
-.do defcolor tan2 rgb #e78e35
-.do defcolor thistle rgb #d2b9d3
-.do defcolor thistle1 rgb #fcdfff
-.do defcolor thistle2 rgb #e9cfec
-.do defcolor thistle3 rgb #c6aec7
-.do defcolor thistle4 rgb #806d7e
-.do defcolor tomato rgb #f75431
-.do defcolor tomato2 rgb #e54c2c
-.do defcolor tomato3 rgb #c23e17
-.do defcolor turquoise rgb #43c6db
-.do defcolor turquoise1 rgb #52f3ff
-.do defcolor turquoise2 rgb #4ee2ec
-.do defcolor turquoise3 rgb #43bfc7
-.do defcolor turquoise4 rgb #30787e
-.do defcolor violet rgb #8d38c9
-.do defcolor violetred rgb #e9358a
-.do defcolor violetred1 rgb #f6358a
-.do defcolor violetred2 rgb #e4317f
-.do defcolor violetred3 rgb #c12869
-.do defcolor violetred4 rgb #7d0541
-.do defcolor wheat rgb #f3daa9
-.do defcolor wheat1 rgb #fee4b1
-.do defcolor wheat2 rgb #ebd3a3
-.do defcolor wheat3 rgb #c8b189
-.do defcolor wheat4 rgb #816f54
-.do defcolor yellow rgb #ffff00
-.do defcolor yellow1 rgb #fffc17
-.do defcolor yellowgreen rgb #52d017
-.\" make sure that no blank lines creep in at the end of this file.
diff --git a/tmac/color.tmac b/tmac/color.tmac
deleted file mode 100755
index 34abe541..00000000
--- a/tmac/color.tmac
+++ /dev/null
@@ -1,549 +0,0 @@
-.\"
-.\" this is a composite of MIT's X Consortium red/green/blue (rgb) color
-.\" specifications, X Consortium version 10.41, 1994.
-.\"
-.do defcolor black rgb #000000
-.do defcolor grey rgb #bebebe
-.do defcolor dimgrey rgb #696969
-.do defcolor lightgray rgb #d3d3d3
-.do defcolor lightslategrey rgb #778899
-.do defcolor slategray rgb #708090
-.do defcolor slategray1 rgb #c6e2ff
-.do defcolor slategray2 rgb #b9d3ee
-.do defcolor slategray3 rgb #9fb6cd
-.do defcolor slategray4 rgb #6c7b8b
-.do defcolor slategrey rgb #708090
-.do defcolor grey0 rgb #000000
-.do defcolor grey1 rgb #030303
-.do defcolor grey2 rgb #050505
-.do defcolor grey3 rgb #080808
-.do defcolor grey4 rgb #0a0a0a
-.do defcolor grey5 rgb #0d0d0d
-.do defcolor grey6 rgb #0f0f0f
-.do defcolor grey7 rgb #121212
-.do defcolor grey8 rgb #141414
-.do defcolor grey9 rgb #171717
-.do defcolor grey10 rgb #1a1a1a
-.do defcolor grey11 rgb #1c1c1c
-.do defcolor grey12 rgb #1f1f1f
-.do defcolor grey13 rgb #212121
-.do defcolor grey14 rgb #242424
-.do defcolor grey15 rgb #262626
-.do defcolor grey16 rgb #292929
-.do defcolor grey17 rgb #2b2b2b
-.do defcolor grey18 rgb #2e2e2e
-.do defcolor grey19 rgb #303030
-.do defcolor grey20 rgb #333333
-.do defcolor grey21 rgb #363636
-.do defcolor grey22 rgb #383838
-.do defcolor grey23 rgb #3b3b3b
-.do defcolor grey24 rgb #3d3d3d
-.do defcolor grey25 rgb #404040
-.do defcolor grey26 rgb #424242
-.do defcolor grey27 rgb #454545
-.do defcolor grey28 rgb #474747
-.do defcolor grey29 rgb #4a4a4a
-.do defcolor grey30 rgb #4d4d4d
-.do defcolor grey31 rgb #4f4f4f
-.do defcolor grey32 rgb #525252
-.do defcolor grey33 rgb #545454
-.do defcolor grey34 rgb #575757
-.do defcolor grey35 rgb #595959
-.do defcolor grey36 rgb #5c5c5c
-.do defcolor grey37 rgb #5e5e5e
-.do defcolor grey38 rgb #616161
-.do defcolor grey39 rgb #636363
-.do defcolor grey40 rgb #666666
-.do defcolor grey41 rgb #696969
-.do defcolor grey42 rgb #6b6b6b
-.do defcolor grey43 rgb #6e6e6e
-.do defcolor grey44 rgb #707070
-.do defcolor grey45 rgb #737373
-.do defcolor grey46 rgb #757575
-.do defcolor grey47 rgb #787878
-.do defcolor grey48 rgb #7a7a7a
-.do defcolor grey49 rgb #7d7d7d
-.do defcolor grey50 rgb #7f7f7f
-.do defcolor grey51 rgb #828282
-.do defcolor grey52 rgb #858585
-.do defcolor grey53 rgb #878787
-.do defcolor grey54 rgb #8a8a8a
-.do defcolor grey55 rgb #8c8c8c
-.do defcolor grey56 rgb #8f8f8f
-.do defcolor grey57 rgb #919191
-.do defcolor grey58 rgb #949494
-.do defcolor grey59 rgb #969696
-.do defcolor grey60 rgb #999999
-.do defcolor grey61 rgb #9c9c9c
-.do defcolor grey62 rgb #9e9e9e
-.do defcolor grey63 rgb #a1a1a1
-.do defcolor grey64 rgb #a3a3a3
-.do defcolor grey65 rgb #a6a6a6
-.do defcolor grey66 rgb #a8a8a8
-.do defcolor grey67 rgb #ababab
-.do defcolor grey68 rgb #adadad
-.do defcolor grey69 rgb #b0b0b0
-.do defcolor grey70 rgb #b3b3b3
-.do defcolor grey71 rgb #b5b5b5
-.do defcolor grey72 rgb #b8b8b8
-.do defcolor grey73 rgb #bababa
-.do defcolor grey74 rgb #bdbdbd
-.do defcolor grey75 rgb #bfbfbf
-.do defcolor grey76 rgb #c2c2c2
-.do defcolor grey77 rgb #c4c4c4
-.do defcolor grey78 rgb #c7c7c7
-.do defcolor grey79 rgb #c9c9c9
-.do defcolor grey80 rgb #cccccc
-.do defcolor grey81 rgb #cfcfcf
-.do defcolor grey82 rgb #d1d1d1
-.do defcolor grey83 rgb #d4d4d4
-.do defcolor grey84 rgb #d6d6d6
-.do defcolor grey85 rgb #d9d9d9
-.do defcolor grey86 rgb #dbdbdb
-.do defcolor grey87 rgb #dedede
-.do defcolor grey88 rgb #e0e0e0
-.do defcolor grey89 rgb #e3e3e3
-.do defcolor grey90 rgb #e5e5e5
-.do defcolor grey91 rgb #e8e8e8
-.do defcolor grey92 rgb #ebebeb
-.do defcolor grey93 rgb #ededed
-.do defcolor grey94 rgb #f0f0f0
-.do defcolor grey95 rgb #f2f2f2
-.do defcolor grey96 rgb #f5f5f5
-.do defcolor grey97 rgb #f7f7f7
-.do defcolor grey98 rgb #fafafa
-.do defcolor grey99 rgb #fcfcfc
-.do defcolor grey100 rgb #ffffff
-.do defcolor aliceblue rgb #f0f8ff
-.do defcolor blueviolet rgb #8a2be2
-.do defcolor cadetblue rgb #5f9ea0
-.do defcolor cadetblue1 rgb #98f5ff
-.do defcolor cadetblue2 rgb #8ee5ee
-.do defcolor cadetblue3 rgb #7ac5cd
-.do defcolor cadetblue4 rgb #53868b
-.do defcolor cornflowerblue rgb #6495ed
-.do defcolor darkslateblue rgb #483d8b
-.do defcolor darkturquoise rgb #00ced1
-.do defcolor deepskyblue rgb #00bfff
-.do defcolor deepskyblue1 rgb #00bfff
-.do defcolor deepskyblue2 rgb #00b2ee
-.do defcolor deepskyblue3 rgb #009acd
-.do defcolor deepskyblue4 rgb #00688b
-.do defcolor dodgerblue rgb #1e90ff
-.do defcolor dodgerblue1 rgb #1e90ff
-.do defcolor dodgerblue2 rgb #1c86ee
-.do defcolor dodgerblue3 rgb #1874cd
-.do defcolor dodgerblue4 rgb #104e8b
-.do defcolor lightblue rgb #add8e6
-.do defcolor lightblue1 rgb #bfefff
-.do defcolor lightblue2 rgb #b2dfee
-.do defcolor lightblue3 rgb #9ac0cd
-.do defcolor lightblue4 rgb #68838b
-.do defcolor lightcyan rgb #e0ffff
-.do defcolor lightcyan1 rgb #e0ffff
-.do defcolor lightcyan2 rgb #d1eeee
-.do defcolor lightcyan3 rgb #b4cdcd
-.do defcolor lightcyan4 rgb #7a8b8b
-.do defcolor lightskyblue rgb #87cefa
-.do defcolor lightskyblue1 rgb #b0e2ff
-.do defcolor lightskyblue2 rgb #a4d3ee
-.do defcolor lightskyblue3 rgb #8db6cd
-.do defcolor lightskyblue4 rgb #607b8b
-.do defcolor lightslateblue rgb #8470ff
-.do defcolor lightsteelblue rgb #b0c4de
-.do defcolor lightsteelblue1 rgb #cae1ff
-.do defcolor lightsteelblue2 rgb #bcd2ee
-.do defcolor lightsteelblue3 rgb #a2b5cd
-.do defcolor lightsteelblue4 rgb #6e7b8b
-.do defcolor mediumaquamarine rgb #66cdaa
-.do defcolor mediumblue rgb #0000cd
-.do defcolor mediumslateblue rgb #7b68ee
-.do defcolor mediumturquoise rgb #48d1cc
-.do defcolor midnightblue rgb #191970
-.do defcolor navyblue rgb #000080
-.do defcolor paleturquoise rgb #afeeee
-.do defcolor paleturquoise1 rgb #bbffff
-.do defcolor paleturquoise2 rgb #aeeeee
-.do defcolor paleturquoise3 rgb #96cdcd
-.do defcolor paleturquoise4 rgb #668b8b
-.do defcolor powderblue rgb #b0e0e6
-.do defcolor royalblue rgb #4169e1
-.do defcolor royalblue1 rgb #4876ff
-.do defcolor royalblue2 rgb #436eee
-.do defcolor royalblue3 rgb #3a5fcd
-.do defcolor royalblue4 rgb #27408b
-.do defcolor skyblue rgb #87ceeb
-.do defcolor skyblue1 rgb #87ceff
-.do defcolor skyblue2 rgb #7ec0ee
-.do defcolor skyblue3 rgb #6ca6cd
-.do defcolor skyblue4 rgb #4a708b
-.do defcolor slateblue rgb #6a5acd
-.do defcolor slateblue1 rgb #836fff
-.do defcolor slateblue2 rgb #7a67ee
-.do defcolor slateblue3 rgb #6959cd
-.do defcolor slateblue4 rgb #473c8b
-.do defcolor steelblue rgb #4682b4
-.do defcolor steelblue1 rgb #63b8ff
-.do defcolor steelblue2 rgb #5cacee
-.do defcolor steelblue3 rgb #4f94cd
-.do defcolor steelblue4 rgb #36648b
-.do defcolor aquamarine rgb #7fffd4
-.do defcolor aquamarine1 rgb #7fffd4
-.do defcolor aquamarine2 rgb #76eec6
-.do defcolor aquamarine3 rgb #66cdaa
-.do defcolor aquamarine4 rgb #458b74
-.do defcolor azure rgb #f0ffff
-.do defcolor azure1 rgb #f0ffff
-.do defcolor azure2 rgb #e0eeee
-.do defcolor azure3 rgb #c1cdcd
-.do defcolor azure4 rgb #838b8b
-.do defcolor blue rgb #0000ff
-.do defcolor blue1 rgb #0000ff
-.do defcolor blue2 rgb #0000ee
-.do defcolor blue3 rgb #0000cd
-.do defcolor blue4 rgb #00008b
-.do defcolor cyan rgb #00ffff
-.do defcolor cyan1 rgb #00ffff
-.do defcolor cyan2 rgb #00eeee
-.do defcolor cyan3 rgb #00cdcd
-.do defcolor cyan4 rgb #008b8b
-.do defcolor navy rgb #000080
-.do defcolor turquoise rgb #40e0d0
-.do defcolor turquoise1 rgb #00f5ff
-.do defcolor turquoise2 rgb #00e5ee
-.do defcolor turquoise3 rgb #00c5cd
-.do defcolor turquoise4 rgb #00868b
-.do defcolor darkslategray rgb #2f4f4f
-.do defcolor darkslategray1 rgb #97ffff
-.do defcolor darkslategray2 rgb #8deeee
-.do defcolor darkslategray3 rgb #79cdcd
-.do defcolor darkslategray4 rgb #528b8b
-.do defcolor rosybrown rgb #bc8f8f
-.do defcolor rosybrown1 rgb #ffc1c1
-.do defcolor rosybrown2 rgb #eeb4b4
-.do defcolor rosybrown3 rgb #cd9b9b
-.do defcolor rosybrown4 rgb #8b6969
-.do defcolor saddlebrown rgb #8b4513
-.do defcolor sandybrown rgb #f4a460
-.do defcolor beige rgb #f5f5dc
-.do defcolor brown rgb #a52a2a
-.do defcolor brown1 rgb #ff4040
-.do defcolor brown2 rgb #ee3b3b
-.do defcolor brown3 rgb #cd3333
-.do defcolor brown4 rgb #8b2323
-.do defcolor burlywood rgb #deb887
-.do defcolor burlywood1 rgb #ffd39b
-.do defcolor burlywood2 rgb #eec591
-.do defcolor burlywood3 rgb #cdaa7d
-.do defcolor burlywood4 rgb #8b7355
-.do defcolor chocolate rgb #d2691e
-.do defcolor chocolate1 rgb #ff7f24
-.do defcolor chocolate2 rgb #ee7621
-.do defcolor chocolate3 rgb #cd661d
-.do defcolor chocolate4 rgb #8b4513
-.do defcolor peru rgb #cd853f
-.do defcolor tan rgb #d2b48c
-.do defcolor tan1 rgb #ffa54f
-.do defcolor tan2 rgb #ee9a49
-.do defcolor tan3 rgb #cd853f
-.do defcolor tan4 rgb #8b5a2b
-.do defcolor darkgreen rgb #006400
-.do defcolor darkkhaki rgb #bdb76b
-.do defcolor darkolivegreen rgb #556b2f
-.do defcolor darkolivegreen1 rgb #caff70
-.do defcolor darkolivegreen2 rgb #bcee68
-.do defcolor darkolivegreen3 rgb #a2cd5a
-.do defcolor darkolivegreen4 rgb #6e8b3d
-.do defcolor darkseagreen rgb #8fbc8f
-.do defcolor darkseagreen1 rgb #c1ffc1
-.do defcolor darkseagreen2 rgb #b4eeb4
-.do defcolor darkseagreen3 rgb #9bcd9b
-.do defcolor darkseagreen4 rgb #698b69
-.do defcolor forestgreen rgb #228b22
-.do defcolor greenyellow rgb #adff2f
-.do defcolor lawngreen rgb #7cfc00
-.do defcolor lightseagreen rgb #20b2aa
-.do defcolor limegreen rgb #32cd32
-.do defcolor mediumseagreen rgb #3cb371
-.do defcolor mediumspringgreen rgb #00fa9a
-.do defcolor mintcream rgb #f5fffa
-.do defcolor olivedrab rgb #6b8e23
-.do defcolor olivedrab1 rgb #c0ff3e
-.do defcolor olivedrab2 rgb #b3ee3a
-.do defcolor olivedrab3 rgb #9acd32
-.do defcolor olivedrab4 rgb #698b22
-.do defcolor palegreen rgb #98fb98
-.do defcolor palegreen1 rgb #9aff9a
-.do defcolor palegreen2 rgb #90ee90
-.do defcolor palegreen3 rgb #7ccd7c
-.do defcolor palegreen4 rgb #548b54
-.do defcolor seagreen rgb #2e8b57
-.do defcolor seagreen1 rgb #54ff9f
-.do defcolor seagreen2 rgb #4eee94
-.do defcolor seagreen3 rgb #43cd80
-.do defcolor seagreen4 rgb #2e8b57
-.do defcolor springgreen rgb #00ff7f
-.do defcolor springgreen1 rgb #00ff7f
-.do defcolor springgreen2 rgb #00ee76
-.do defcolor springgreen3 rgb #00cd66
-.do defcolor springgreen4 rgb #008b45
-.do defcolor yellowgreen rgb #9acd32
-.do defcolor chartreuse rgb #7fff00
-.do defcolor chartreuse1 rgb #7fff00
-.do defcolor chartreuse2 rgb #76ee00
-.do defcolor chartreuse3 rgb #66cd00
-.do defcolor chartreuse4 rgb #458b00
-.do defcolor green rgb #00ff00
-.do defcolor green1 rgb #00ff00
-.do defcolor green2 rgb #00ee00
-.do defcolor green3 rgb #00cd00
-.do defcolor green4 rgb #008b00
-.do defcolor khaki rgb #f0e68c
-.do defcolor khaki1 rgb #fff68f
-.do defcolor khaki2 rgb #eee685
-.do defcolor khaki3 rgb #cdc673
-.do defcolor khaki4 rgb #8b864e
-.do defcolor darkorange rgb #ff8c00
-.do defcolor darkorange1 rgb #ff7f00
-.do defcolor darkorange2 rgb #ee7600
-.do defcolor darkorange3 rgb #cd6600
-.do defcolor darkorange4 rgb #8b4500
-.do defcolor darksalmon rgb #e9967a
-.do defcolor lightcoral rgb #f08080
-.do defcolor lightsalmon rgb #ffa07a
-.do defcolor lightsalmon1 rgb #ffa07a
-.do defcolor lightsalmon2 rgb #ee9572
-.do defcolor lightsalmon3 rgb #cd8162
-.do defcolor lightsalmon4 rgb #8b5742
-.do defcolor peachpuff rgb #ffdab9
-.do defcolor peachpuff1 rgb #ffdab9
-.do defcolor peachpuff2 rgb #eecbad
-.do defcolor peachpuff3 rgb #cdaf95
-.do defcolor peachpuff4 rgb #8b7765
-.do defcolor bisque rgb #ffe4c4
-.do defcolor bisque1 rgb #ffe4c4
-.do defcolor bisque2 rgb #eed5b7
-.do defcolor bisque3 rgb #cdb79e
-.do defcolor bisque4 rgb #8b7d6b
-.do defcolor coral rgb #ff7f50
-.do defcolor coral1 rgb #ff7256
-.do defcolor coral2 rgb #ee6a50
-.do defcolor coral3 rgb #cd5b45
-.do defcolor coral4 rgb #8b3e2f
-.do defcolor honeydew rgb #f0fff0
-.do defcolor honeydew1 rgb #f0fff0
-.do defcolor honeydew2 rgb #e0eee0
-.do defcolor honeydew3 rgb #c1cdc1
-.do defcolor honeydew4 rgb #838b83
-.do defcolor orange rgb #ffa500
-.do defcolor orange1 rgb #ffa500
-.do defcolor orange2 rgb #ee9a00
-.do defcolor orange3 rgb #cd8500
-.do defcolor orange4 rgb #8b5a00
-.do defcolor salmon rgb #fa8072
-.do defcolor salmon1 rgb #ff8c69
-.do defcolor salmon2 rgb #ee8262
-.do defcolor salmon3 rgb #cd7054
-.do defcolor salmon4 rgb #8b4c39
-.do defcolor sienna rgb #a0522d
-.do defcolor sienna1 rgb #ff8247
-.do defcolor sienna2 rgb #ee7942
-.do defcolor sienna3 rgb #cd6839
-.do defcolor sienna4 rgb #8b4726
-.do defcolor deeppink rgb #ff1493
-.do defcolor deeppink1 rgb #ff1493
-.do defcolor deeppink2 rgb #ee1289
-.do defcolor deeppink3 rgb #cd1076
-.do defcolor deeppink4 rgb #8b0a50
-.do defcolor hotpink rgb #ff69b4
-.do defcolor hotpink1 rgb #ff6eb4
-.do defcolor hotpink2 rgb #ee6aa7
-.do defcolor hotpink3 rgb #cd6090
-.do defcolor hotpink4 rgb #8b3a62
-.do defcolor indianred rgb #cd5c5c
-.do defcolor indianred1 rgb #ff6a6a
-.do defcolor indianred2 rgb #ee6363
-.do defcolor indianred3 rgb #cd5555
-.do defcolor indianred4 rgb #8b3a3a
-.do defcolor lightpink rgb #ffb6c1
-.do defcolor lightpink1 rgb #ffaeb9
-.do defcolor lightpink2 rgb #eea2ad
-.do defcolor lightpink3 rgb #cd8c95
-.do defcolor lightpink4 rgb #8b5f65
-.do defcolor mediumvioletred rgb #c71585
-.do defcolor mistyrose rgb #ffe4e1
-.do defcolor mistyrose1 rgb #ffe4e1
-.do defcolor mistyrose2 rgb #eed5d2
-.do defcolor mistyrose3 rgb #cdb7b5
-.do defcolor mistyrose4 rgb #8b7d7b
-.do defcolor orangered rgb #ff4500
-.do defcolor orangered1 rgb #ff4500
-.do defcolor orangered2 rgb #ee4000
-.do defcolor orangered3 rgb #cd3700
-.do defcolor orangered4 rgb #8b2500
-.do defcolor palevioletred rgb #db7093
-.do defcolor palevioletred1 rgb #ff82ab
-.do defcolor palevioletred2 rgb #ee799f
-.do defcolor palevioletred3 rgb #cd6889
-.do defcolor palevioletred4 rgb #8b475d
-.do defcolor violetred rgb #d02090
-.do defcolor violetred1 rgb #ff3e96
-.do defcolor violetred2 rgb #ee3a8c
-.do defcolor violetred3 rgb #cd3278
-.do defcolor violetred4 rgb #8b2252
-.do defcolor firebrick rgb #b22222
-.do defcolor firebrick1 rgb #ff3030
-.do defcolor firebrick2 rgb #ee2c2c
-.do defcolor firebrick3 rgb #cd2626
-.do defcolor firebrick4 rgb #8b1a1a
-.do defcolor pink rgb #ffc0cb
-.do defcolor pink1 rgb #ffb5c5
-.do defcolor pink2 rgb #eea9b8
-.do defcolor pink3 rgb #cd919e
-.do defcolor pink4 rgb #8b636c
-.do defcolor red rgb #ff0000
-.do defcolor red1 rgb #ff0000
-.do defcolor red2 rgb #ee0000
-.do defcolor red3 rgb #cd0000
-.do defcolor red4 rgb #8b0000
-.do defcolor tomato rgb #ff6347
-.do defcolor tomato1 rgb #ff6347
-.do defcolor tomato2 rgb #ee5c42
-.do defcolor tomato3 rgb #cd4f39
-.do defcolor tomato4 rgb #8b3626
-.do defcolor darkorchid rgb #9932cc
-.do defcolor darkorchid1 rgb #bf3eff
-.do defcolor darkorchid2 rgb #b23aee
-.do defcolor darkorchid3 rgb #9a32cd
-.do defcolor darkorchid4 rgb #68228b
-.do defcolor darkviolet rgb #9400d3
-.do defcolor lavenderblush rgb #fff0f5
-.do defcolor lavenderblush1 rgb #fff0f5
-.do defcolor lavenderblush2 rgb #eee0e5
-.do defcolor lavenderblush3 rgb #cdc1c5
-.do defcolor lavenderblush4 rgb #8b8386
-.do defcolor mediumorchid rgb #ba55d3
-.do defcolor mediumorchid1 rgb #e066ff
-.do defcolor mediumorchid2 rgb #d15fee
-.do defcolor mediumorchid3 rgb #b452cd
-.do defcolor mediumorchid4 rgb #7a378b
-.do defcolor mediumpurple rgb #9370db
-.do defcolor mediumpurple1 rgb #ab82ff
-.do defcolor mediumpurple2 rgb #9f79ee
-.do defcolor mediumpurple3 rgb #8968cd
-.do defcolor mediumpurple4 rgb #5d478b
-.do defcolor lavender rgb #e6e6fa
-.do defcolor magenta rgb #ff00ff
-.do defcolor magenta1 rgb #ff00ff
-.do defcolor magenta2 rgb #ee00ee
-.do defcolor magenta3 rgb #cd00cd
-.do defcolor magenta4 rgb #8b008b
-.do defcolor maroon rgb #b03060
-.do defcolor maroon1 rgb #ff34b3
-.do defcolor maroon2 rgb #ee30a7
-.do defcolor maroon3 rgb #cd2990
-.do defcolor maroon4 rgb #8b1c62
-.do defcolor orchid rgb #da70d6
-.do defcolor orchid1 rgb #ff83fa
-.do defcolor orchid2 rgb #ee7ae9
-.do defcolor orchid3 rgb #cd69c9
-.do defcolor orchid4 rgb #8b4789
-.do defcolor plum rgb #dda0dd
-.do defcolor plum1 rgb #ffbbff
-.do defcolor plum2 rgb #eeaeee
-.do defcolor plum3 rgb #cd96cd
-.do defcolor plum4 rgb #8b668b
-.do defcolor purple rgb #a020f0
-.do defcolor purple1 rgb #9b30ff
-.do defcolor purple2 rgb #912cee
-.do defcolor purple3 rgb #7d26cd
-.do defcolor purple4 rgb #551a8b
-.do defcolor thistle rgb #d8bfd8
-.do defcolor thistle1 rgb #ffe1ff
-.do defcolor thistle2 rgb #eed2ee
-.do defcolor thistle3 rgb #cdb5cd
-.do defcolor thistle4 rgb #8b7b8b
-.do defcolor violet rgb #ee82ee
-.do defcolor antiquewhite rgb #faebd7
-.do defcolor antiquewhite1 rgb #ffefdb
-.do defcolor antiquewhite2 rgb #eedfcc
-.do defcolor antiquewhite3 rgb #cdc0b0
-.do defcolor antiquewhite4 rgb #8b8378
-.do defcolor floralwhite rgb #fffaf0
-.do defcolor ghostwhite rgb #f8f8ff
-.do defcolor navajowhite rgb #ffdead
-.do defcolor navajowhite1 rgb #ffdead
-.do defcolor navajowhite2 rgb #eecfa1
-.do defcolor navajowhite3 rgb #cdb38b
-.do defcolor navajowhite4 rgb #8b795e
-.do defcolor oldlace rgb #fdf5e6
-.do defcolor whitesmoke rgb #f5f5f5
-.do defcolor gainsboro rgb #dcdcdc
-.do defcolor ivory rgb #fffff0
-.do defcolor ivory1 rgb #fffff0
-.do defcolor ivory2 rgb #eeeee0
-.do defcolor ivory3 rgb #cdcdc1
-.do defcolor ivory4 rgb #8b8b83
-.do defcolor linen rgb #faf0e6
-.do defcolor seashell rgb #fff5ee
-.do defcolor seashell1 rgb #fff5ee
-.do defcolor seashell2 rgb #eee5de
-.do defcolor seashell3 rgb #cdc5bf
-.do defcolor seashell4 rgb #8b8682
-.do defcolor snow rgb #fffafa
-.do defcolor snow1 rgb #fffafa
-.do defcolor snow2 rgb #eee9e9
-.do defcolor snow3 rgb #cdc9c9
-.do defcolor snow4 rgb #8b8989
-.do defcolor wheat rgb #f5deb3
-.do defcolor wheat1 rgb #ffe7ba
-.do defcolor wheat2 rgb #eed8ae
-.do defcolor wheat3 rgb #cdba96
-.do defcolor wheat4 rgb #8b7e66
-.do defcolor white rgb #ffffff
-.do defcolor blanchedalmond rgb #ffebcd
-.do defcolor darkgoldenrod rgb #b8860b
-.do defcolor darkgoldenrod1 rgb #ffb90f
-.do defcolor darkgoldenrod2 rgb #eead0e
-.do defcolor darkgoldenrod3 rgb #cd950c
-.do defcolor darkgoldenrod4 rgb #8b6508
-.do defcolor lemonchiffon rgb #fffacd
-.do defcolor lemonchiffon1 rgb #fffacd
-.do defcolor lemonchiffon2 rgb #eee9bf
-.do defcolor lemonchiffon3 rgb #cdc9a5
-.do defcolor lemonchiffon4 rgb #8b8970
-.do defcolor lightgoldenrod rgb #eedd82
-.do defcolor lightgoldenrod1 rgb #ffec8b
-.do defcolor lightgoldenrod2 rgb #eedc82
-.do defcolor lightgoldenrod3 rgb #cdbe70
-.do defcolor lightgoldenrod4 rgb #8b814c
-.do defcolor lightgoldenrodyellow rgb #fafad2
-.do defcolor lightyellow rgb #ffffe0
-.do defcolor lightyellow1 rgb #ffffe0
-.do defcolor lightyellow2 rgb #eeeed1
-.do defcolor lightyellow3 rgb #cdcdb4
-.do defcolor lightyellow4 rgb #8b8b7a
-.do defcolor palegoldenrod rgb #eee8aa
-.do defcolor papayawhip rgb #ffefd5
-.do defcolor cornsilk rgb #fff8dc
-.do defcolor cornsilk1 rgb #fff8dc
-.do defcolor cornsilk2 rgb #eee8cd
-.do defcolor cornsilk3 rgb #cdc8b1
-.do defcolor cornsilk4 rgb #8b8878
-.do defcolor gold rgb #ffd700
-.do defcolor gold1 rgb #ffd700
-.do defcolor gold2 rgb #eec900
-.do defcolor gold3 rgb #cdad00
-.do defcolor gold4 rgb #8b7500
-.do defcolor goldenrod rgb #daa520
-.do defcolor goldenrod1 rgb #ffc125
-.do defcolor goldenrod2 rgb #eeb422
-.do defcolor goldenrod3 rgb #cd9b1d
-.do defcolor goldenrod4 rgb #8b6914
-.do defcolor moccasin rgb #ffe4b5
-.do defcolor yellow rgb #ffff00
-.do defcolor yellow1 rgb #ffff00
-.do defcolor yellow2 rgb #eeee00
-.do defcolor yellow3 rgb #cdcd00
-.do defcolor yellow4 rgb #8b8b00
-.\" make sure that no blank lines creep in at the end of this file.
diff --git a/tmac/groff_mdoc.man b/tmac/groff_mdoc.man
index 2d4c49e9..b4b5430c 100644
--- a/tmac/groff_mdoc.man
+++ b/tmac/groff_mdoc.man
@@ -2336,7 +2336,7 @@ macro always invokes the
macro after eliminating the space unless another macro name follows it.
If used as a request (i.e., the second form above in the
.Sq Usage
-line,
+line),
.Ql .Ns
is identical to
.Ql .No .
diff --git a/tmac/groff_www.man b/tmac/groff_www.man
index 3aded4c2..5ce157de 100644
--- a/tmac/groff_www.man
+++ b/tmac/groff_www.man
@@ -205,6 +205,11 @@ The fourth argument is the height in pixels (default is the width value if
absent).
.sp
.TP
+.B NO-AUTO-RULE
+suppresses generation of the top and bottom rules which grohtml emits
+by default.
+.sp
+.TP
.B HTML
all text after this macro is treated as raw html.
If the document is processed \fIwithout\fP \fC-Thtml\fP then
diff --git a/tmac/html.tmac b/tmac/html.tmac
index c5591c8d..cb4cc2f6 100644
--- a/tmac/html.tmac
+++ b/tmac/html.tmac
@@ -44,4 +44,493 @@
.\" avoid line breaks after hyphen-like characters.
.cflags 0 -\(hy\(em\(en\[shc]
.pl 99999
-.\" eof of file, make sure this is the last time
+.\" now for the color definitions
+.\"
+.\" html-4.0 colors
+.\"
+.defcolor white rgb #ffffff
+.defcolor fuchsia rgb #ff00ff
+.\"
+.\" these colors are compliant with html-3.0 and above
+.\"
+.defcolor aliceblue rgb #eff7ff
+.defcolor antiquewhite rgb #f9e8d2
+.defcolor antiquewhite1 rgb #feedd6
+.defcolor antiquewhite2 rgb #ebdbc5
+.defcolor antiquewhite3 rgb #c8b9a6
+.defcolor antiquewhite4 rgb #817468
+.defcolor aquamarine rgb #43b7ba
+.defcolor aquamarine1 rgb #87fdce
+.defcolor aquamarine2 rgb #7deabe
+.defcolor aquamarine3 rgb #69c69f
+.defcolor aquamarine4 rgb #417c64
+.defcolor azure rgb #efffff
+.defcolor azure2 rgb #deecec
+.defcolor azure3 rgb #bcc7c7
+.defcolor azure4 rgb #7a7d7d
+.defcolor beige rgb #f5f3d7
+.defcolor bisque rgb #fde0bc
+.defcolor bisque2 rgb #ead0ae
+.defcolor bisque3 rgb #c7af92
+.defcolor bisque4 rgb #816e59
+.defcolor black rgb #000000
+.defcolor blanchedalmond rgb #fee8c6
+.defcolor blue rgb #0000ff
+.defcolor blue1 rgb #1535ff
+.defcolor blue2 rgb #1531ec
+.defcolor blue3 rgb #1528c7
+.defcolor blue4 rgb #151b7e
+.defcolor blueviolet rgb #7931df
+.defcolor brown rgb #980517
+.defcolor brown1 rgb #f63526
+.defcolor brown2 rgb #e42d17
+.defcolor brown3 rgb #c22217
+.defcolor burlywood1 rgb #fcce8e
+.defcolor burlywood2 rgb #eabe83
+.defcolor burlywood3 rgb #c6a06d
+.defcolor burlywood4 rgb #806341
+.defcolor cadetblue rgb #578693
+.defcolor cadetblue1 rgb #99f3ff
+.defcolor cadetblue2 rgb #8ee2ec
+.defcolor cadetblue3 rgb #77bfc7
+.defcolor cadetblue4 rgb #4c787e
+.defcolor chartreuse rgb #8afb17
+.defcolor chartreuse2 rgb #7fe817
+.defcolor chartreuse3 rgb #6cc417
+.defcolor chartreuse4 rgb #437c17
+.defcolor chocolate rgb #c85a17
+.defcolor coral rgb #f76541
+.defcolor coral2 rgb #e55b3c
+.defcolor coral3 rgb #c34a2c
+.defcolor coral4 rgb #7e2817
+.defcolor cornflowerblue rgb #151b8d
+.defcolor cornsilk rgb #fff7d7
+.defcolor cornsilk2 rgb #ece5c6
+.defcolor cornsilk3 rgb #c8c2a7
+.defcolor cornsilk4 rgb #817a68
+.defcolor cyan rgb #00ffff
+.defcolor cyan1 rgb #57feff
+.defcolor cyan2 rgb #50ebec
+.defcolor cyan3 rgb #46c7c7
+.defcolor cyan4 rgb #307d7e
+.defcolor darkgoldenrod rgb #af7817
+.defcolor darkgoldenrod1 rgb #fbb117
+.defcolor darkgoldenrod2 rgb #e8a317
+.defcolor darkgoldenrod3 rgb #c58917
+.defcolor darkgoldenrod4 rgb #7f5217
+.defcolor darkgreen rgb #254117
+.defcolor darkkhaki rgb #b7ad59
+.defcolor darkolivegreen rgb #4a4117
+.defcolor darkolivegreen1 rgb #ccfb5d
+.defcolor darkolivegreen2 rgb #bce954
+.defcolor darkolivegreen3 rgb #a0c544
+.defcolor darkolivegreen4 rgb #667c26
+.defcolor darkorange rgb #f88017
+.defcolor darkorange1 rgb #f87217
+.defcolor darkorange2 rgb #e56717
+.defcolor darkorange3 rgb #c35617
+.defcolor darkorange4 rgb #7e3117
+.defcolor darkorchid rgb #7d1b7e
+.defcolor darkorchid1 rgb #b041ff
+.defcolor darkorchid2 rgb #a23bec
+.defcolor darkorchid3 rgb #8b31c7
+.defcolor darkorchid4 rgb #571b7e
+.defcolor darksalmon rgb #e18b6b
+.defcolor darkseagreen rgb #8bb381
+.defcolor darkseagreen1 rgb #c3fdb8
+.defcolor darkseagreen2 rgb #b5eaaa
+.defcolor darkseagreen3 rgb #99c68e
+.defcolor darkseagreen4 rgb #617c58
+.defcolor darkslateblue rgb #2b3856
+.defcolor darkslategray rgb #25383c
+.defcolor darkslategray1 rgb #9afeff
+.defcolor darkslategray2 rgb #8eebec
+.defcolor darkslategray3 rgb #78c7c7
+.defcolor darkslategray4 rgb #4c7d7e
+.defcolor darkturquoise rgb #3b9c9c
+.defcolor darkviolet rgb #842dce
+.defcolor deeppink rgb #f52887
+.defcolor deeppink2 rgb #e4287c
+.defcolor deeppink3 rgb #c12267
+.defcolor deeppink4 rgb #7d053f
+.defcolor deepskyblue rgb #3bb9ff
+.defcolor deepskyblue2 rgb #38acec
+.defcolor deepskyblue3 rgb #3090c7
+.defcolor deepskyblue4 rgb #25587e
+.defcolor dimgray rgb #463e41
+.defcolor dodgerblue rgb #1589ff
+.defcolor dodgerblue2 rgb #157dec
+.defcolor dodgerblue3 rgb #1569c7
+.defcolor dodgerblue4 rgb #153e7e
+.defcolor firebrick rgb #800517
+.defcolor firebrick1 rgb #f62817
+.defcolor firebrick2 rgb #e42217
+.defcolor firebrick3 rgb #c11b17
+.defcolor floralwhite rgb #fff9ee
+.defcolor forestgreen rgb #4e9258
+.defcolor gainsboro rgb #d8d9d7
+.defcolor ghostwhite rgb #f7f7ff
+.defcolor gold rgb #d4a017
+.defcolor gold1 rgb #fdd017
+.defcolor gold2 rgb #eac117
+.defcolor gold3 rgb #c7a317
+.defcolor gold4 rgb #806517
+.defcolor goldenrod rgb #edda74
+.defcolor goldenrod1 rgb #fbb917
+.defcolor goldenrod2 rgb #e9ab17
+.defcolor goldenrod3 rgb #c68e17
+.defcolor goldenrod4 rgb #805817
+.defcolor gray rgb #736f6e
+.defcolor gray0 rgb #150517
+.defcolor gray100 rgb #ffffff
+.defcolor gray18 rgb #250517
+.defcolor gray21 rgb #2b1b17
+.defcolor gray23 rgb #302217
+.defcolor gray24 rgb #302226
+.defcolor gray25 rgb #342826
+.defcolor gray26 rgb #34282c
+.defcolor gray27 rgb #382d2c
+.defcolor gray28 rgb #3b3131
+.defcolor gray29 rgb #3e3535
+.defcolor gray30 rgb #413839
+.defcolor gray31 rgb #41383c
+.defcolor gray32 rgb #463e3f
+.defcolor gray34 rgb #4a4344
+.defcolor gray35 rgb #4c4646
+.defcolor gray36 rgb #4e4848
+.defcolor gray37 rgb #504a4b
+.defcolor gray38 rgb #544e4f
+.defcolor gray39 rgb #565051
+.defcolor gray40 rgb #595454
+.defcolor gray41 rgb #5c5858
+.defcolor gray42 rgb #5f5a59
+.defcolor gray43 rgb #625d5d
+.defcolor gray44 rgb #646060
+.defcolor gray45 rgb #666362
+.defcolor gray46 rgb #696565
+.defcolor gray47 rgb #6d6968
+.defcolor gray48 rgb #6e6a6b
+.defcolor gray49 rgb #726e6d
+.defcolor gray50 rgb #747170
+.defcolor gray51 rgb #787473
+.defcolor gray52 rgb #7a7777
+.defcolor gray53 rgb #7c7979
+.defcolor gray54 rgb #807d7c
+.defcolor gray55 rgb #82807e
+.defcolor gray56 rgb #858381
+.defcolor gray57 rgb #878583
+.defcolor gray58 rgb #8b8987
+.defcolor gray59 rgb #8d8b89
+.defcolor gray60 rgb #8f8e8d
+.defcolor gray61 rgb #939190
+.defcolor gray62 rgb #959492
+.defcolor gray63 rgb #999795
+.defcolor gray64 rgb #9a9998
+.defcolor gray65 rgb #9e9c9b
+.defcolor gray66 rgb #a09f9d
+.defcolor gray67 rgb #a3a2a0
+.defcolor gray68 rgb #a5a4a3
+.defcolor gray69 rgb #a9a8a6
+.defcolor gray70 rgb #acaba9
+.defcolor gray71 rgb #aeadac
+.defcolor gray72 rgb #b1b1af
+.defcolor gray73 rgb #b3b3b1
+.defcolor gray74 rgb #b7b6b4
+.defcolor gray75 rgb #b9b8b6
+.defcolor gray76 rgb #bcbbba
+.defcolor gray77 rgb #bebebc
+.defcolor gray78 rgb #c1c1bf
+.defcolor gray79 rgb #c3c4c2
+.defcolor gray80 rgb #c7c7c5
+.defcolor gray81 rgb #cacac9
+.defcolor gray82 rgb #cccccb
+.defcolor gray83 rgb #d0cfcf
+.defcolor gray84 rgb #d2d2d1
+.defcolor gray85 rgb #d5d5d4
+.defcolor gray86 rgb #d7d7d7
+.defcolor gray87 rgb #dbdbd9
+.defcolor gray88 rgb #dddddc
+.defcolor gray89 rgb #e0e0e0
+.defcolor gray90 rgb #e2e3e1
+.defcolor gray91 rgb #e5e6e4
+.defcolor gray92 rgb #e8e9e8
+.defcolor gray93 rgb #ebebea
+.defcolor gray94 rgb #eeeeee
+.defcolor gray95 rgb #f0f1f0
+.defcolor gray96 rgb #f4f4f3
+.defcolor gray97 rgb #f6f6f5
+.defcolor gray98 rgb #f9f9fa
+.defcolor gray99 rgb #fbfbfb
+.defcolor green rgb #00ff00
+.defcolor green1 rgb #5ffb17
+.defcolor green2 rgb #59e817
+.defcolor green3 rgb #4cc417
+.defcolor green4 rgb #347c17
+.defcolor greenyellow rgb #b1fb17
+.defcolor honeydew rgb #f0feee
+.defcolor honeydew2 rgb #deebdc
+.defcolor honeydew3 rgb #bcc7b9
+.defcolor honeydew4 rgb #7a7d74
+.defcolor hotpink rgb #f660ab
+.defcolor hotpink1 rgb #f665ab
+.defcolor hotpink2 rgb #e45e9d
+.defcolor hotpink3 rgb #c25283
+.defcolor hotpink4 rgb #7d2252
+.defcolor indianred rgb #5e2217
+.defcolor indianred1 rgb #f75d59
+.defcolor indianred2 rgb #e55451
+.defcolor indianred3 rgb #c24641
+.defcolor indianred4 rgb #7e2217
+.defcolor ivory rgb #ffffee
+.defcolor ivory2 rgb #ececdc
+.defcolor ivory3 rgb #c9c7b9
+.defcolor ivory4 rgb #817d74
+.defcolor khaki rgb #ada96e
+.defcolor khaki1 rgb #fff380
+.defcolor khaki2 rgb #ede275
+.defcolor khaki3 rgb #c9be62
+.defcolor khaki4 rgb #827839
+.defcolor lavender rgb #e3e4fa
+.defcolor lavenderblush rgb #fdeef4
+.defcolor lavenderblush2 rgb #ebdde2
+.defcolor lavenderblush3 rgb #c8bbbe
+.defcolor lavenderblush4 rgb #817679
+.defcolor lawngreen rgb #87f717
+.defcolor lemonchiffon rgb #fff8c6
+.defcolor lemonchiffon2 rgb #ece5b6
+.defcolor lemonchiffon3 rgb #c9c299
+.defcolor lemonchiffon4 rgb #827b60
+.defcolor lightblue rgb #addfff
+.defcolor lightblue1 rgb #bdedff
+.defcolor lightblue2 rgb #afdcec
+.defcolor lightblue3 rgb #95b9c7
+.defcolor lightblue4 rgb #5e767e
+.defcolor lightcoral rgb #e77471
+.defcolor lightcyan rgb #e0ffff
+.defcolor lightcyan2 rgb #cfecec
+.defcolor lightcyan3 rgb #afc7c7
+.defcolor lightcyan4 rgb #717d7d
+.defcolor lightgoldenrod rgb #ecd872
+.defcolor lightgoldenrod1 rgb #ffe87c
+.defcolor lightgoldenrod2 rgb #ecd672
+.defcolor lightgoldenrod3 rgb #c8b560
+.defcolor lightgoldenrod4 rgb #817339
+.defcolor lightgoldenrodyellow rgb #faf8cc
+.defcolor lightpink rgb #faafba
+.defcolor lightpink1 rgb #f9a7b0
+.defcolor lightpink2 rgb #e799a3
+.defcolor lightpink3 rgb #c48189
+.defcolor lightpink4 rgb #7f4e52
+.defcolor lightsalmon rgb #f9966b
+.defcolor lightsalmon2 rgb #e78a61
+.defcolor lightsalmon3 rgb #c47451
+.defcolor lightsalmon4 rgb #7f462c
+.defcolor lightseagreen rgb #3ea99f
+.defcolor lightskyblue rgb #82cafa
+.defcolor lightskyblue2 rgb #a0cfec
+.defcolor lightskyblue3 rgb #87afc7
+.defcolor lightskyblue4 rgb #566d7e
+.defcolor lightslateblue rgb #736aff
+.defcolor lightslategray rgb #6d7b8d
+.defcolor lightsteelblue rgb #728fce
+.defcolor lightsteelblue1 rgb #c6deff
+.defcolor lightsteelblue2 rgb #b7ceec
+.defcolor lightsteelblue3 rgb #9aadc7
+.defcolor lightsteelblue4 rgb #646d7e
+.defcolor lightyellow rgb #fffedc
+.defcolor lightyellow2 rgb #edebcb
+.defcolor lightyellow3 rgb #c9c7aa
+.defcolor lightyellow4 rgb #827d6b
+.defcolor limegreen rgb #41a317
+.defcolor linen rgb #f9eee2
+.defcolor magenta rgb #ff00ff
+.defcolor magenta1 rgb #f43eff
+.defcolor magenta2 rgb #e238ec
+.defcolor magenta3 rgb #c031c7
+.defcolor maroon rgb #810541
+.defcolor maroon1 rgb #f535aa
+.defcolor maroon2 rgb #e3319d
+.defcolor maroon3 rgb #c12283
+.defcolor maroon4 rgb #7d0552
+.defcolor mediumaquamarine rgb #348781
+.defcolor mediumblue rgb #152dc6
+.defcolor mediumforestgreen rgb #347235
+.defcolor mediumgoldenrod rgb #ccb954
+.defcolor mediumorchid rgb #b048b5
+.defcolor mediumorchid1 rgb #d462ff
+.defcolor mediumorchid2 rgb #c45aec
+.defcolor mediumorchid3 rgb #a74ac7
+.defcolor mediumorchid4 rgb #6a287e
+.defcolor mediumpurple rgb #8467d7
+.defcolor mediumpurple1 rgb #9e7bff
+.defcolor mediumpurple2 rgb #9172ec
+.defcolor mediumpurple3 rgb #7a5dc7
+.defcolor mediumpurple4 rgb #4e387e
+.defcolor mediumseagreen rgb #306754
+.defcolor mediumslateblue rgb #5e5a80
+.defcolor mediumspringgreen rgb #348017
+.defcolor mediumturquoise rgb #48cccd
+.defcolor mediumvioletred rgb #ca226b
+.defcolor midnightblue rgb #151b54
+.defcolor mintcream rgb #f5fff9
+.defcolor mistyrose rgb #fde1dd
+.defcolor mistyrose2 rgb #ead0cc
+.defcolor mistyrose3 rgb #c6afac
+.defcolor mistyrose4 rgb #806f6c
+.defcolor moccasin rgb #fde0ac
+.defcolor navajowhite rgb #fddaa3
+.defcolor navajowhite2 rgb #eac995
+.defcolor navajowhite3 rgb #c7aa7d
+.defcolor navajowhite4 rgb #806a4b
+.defcolor navy rgb #150567
+.defcolor oldlace rgb #fcf3e2
+.defcolor olivedrab rgb #658017
+.defcolor olivedrab1 rgb #c3fb17
+.defcolor olivedrab2 rgb #b5e917
+.defcolor olivedrab3 rgb #99c517
+.defcolor olivedrab4 rgb #617c17
+.defcolor orange rgb #f87a17
+.defcolor orange1 rgb #fa9b17
+.defcolor orange2 rgb #e78e17
+.defcolor orange3 rgb #c57717
+.defcolor orange4 rgb #7f4817
+.defcolor orangered rgb #f63817
+.defcolor orangered2 rgb #e43117
+.defcolor orangered3 rgb #c22817
+.defcolor orangered4 rgb #7e0517
+.defcolor orchid rgb #e57ded
+.defcolor orchid1 rgb #f67dfa
+.defcolor orchid2 rgb #e473e7
+.defcolor orchid3 rgb #c160c3
+.defcolor orchid4 rgb #7d387c
+.defcolor palegoldenrod rgb #ede49e
+.defcolor palegreen rgb #79d867
+.defcolor palegreen1 rgb #a0fc8d
+.defcolor palegreen2 rgb #94e981
+.defcolor palegreen3 rgb #7dc56c
+.defcolor palegreen4 rgb #4e7c41
+.defcolor paleturquoise rgb #aeebec
+.defcolor paleturquoise1 rgb #bcfeff
+.defcolor paleturquoise2 rgb #adebec
+.defcolor paleturquoise3 rgb #92c7c7
+.defcolor paleturquoise4 rgb #5e7d7e
+.defcolor palevioletred rgb #d16587
+.defcolor palevioletred1 rgb #f778a1
+.defcolor palevioletred2 rgb #e56e94
+.defcolor palevioletred3 rgb #c25a7c
+.defcolor palevioletred4 rgb #7e354d
+.defcolor papayawhip rgb #feeccf
+.defcolor peachpuff rgb #fcd5b0
+.defcolor peachpuff2 rgb #eac5a3
+.defcolor peachpuff3 rgb #c6a688
+.defcolor peachpuff4 rgb #806752
+.defcolor peru rgb #c57726
+.defcolor pink rgb #faafbe
+.defcolor pink2 rgb #e7a1b0
+.defcolor pink3 rgb #c48793
+.defcolor pink4 rgb #7f525d
+.defcolor plum rgb #b93b8f
+.defcolor plum1 rgb #f9b7ff
+.defcolor plum2 rgb #e6a9ec
+.defcolor plum3 rgb #c38ec7
+.defcolor plum4 rgb #7e587e
+.defcolor powderblue rgb #addce3
+.defcolor purple rgb #8e35ef
+.defcolor purple1 rgb #893bff
+.defcolor purple2 rgb #7f38ec
+.defcolor purple3 rgb #6c2dc7
+.defcolor purple4 rgb #461b7e
+.defcolor red rgb #ff0000
+.defcolor red1 rgb #f62217
+.defcolor red2 rgb #e41b17
+.defcolor rosybrown rgb #b38481
+.defcolor rosybrown1 rgb #fbbbb9
+.defcolor rosybrown2 rgb #e8adaa
+.defcolor rosybrown3 rgb #c5908e
+.defcolor rosybrown4 rgb #7f5a58
+.defcolor royalblue rgb #2b60de
+.defcolor royalblue1 rgb #306eff
+.defcolor royalblue2 rgb #2b65ec
+.defcolor royalblue3 rgb #2554c7
+.defcolor royalblue4 rgb #15317e
+.defcolor salmon1 rgb #f88158
+.defcolor salmon2 rgb #e67451
+.defcolor salmon3 rgb #c36241
+.defcolor salmon4 rgb #7e3817
+.defcolor sandybrown rgb #ee9a4d
+.defcolor seagreen rgb #4e8975
+.defcolor seagreen1 rgb #6afb92
+.defcolor seagreen2 rgb #64e986
+.defcolor seagreen3 rgb #54c571
+.defcolor seagreen4 rgb #387c44
+.defcolor seashell rgb #fef3eb
+.defcolor seashell2 rgb #ebe2d9
+.defcolor seashell3 rgb #c8bfb6
+.defcolor seashell4 rgb #817873
+.defcolor sienna rgb #8a4117
+.defcolor sienna1 rgb #f87431
+.defcolor sienna2 rgb #e66c2c
+.defcolor sienna3 rgb #c35817
+.defcolor sienna4 rgb #7e3517
+.defcolor skyblue rgb #6698ff
+.defcolor skyblue1 rgb #82caff
+.defcolor skyblue2 rgb #79baec
+.defcolor skyblue3 rgb #659ec7
+.defcolor skyblue4 rgb #41627e
+.defcolor slateblue rgb #737ca1
+.defcolor slateblue1 rgb #7369ff
+.defcolor slateblue2 rgb #6960ec
+.defcolor slateblue3 rgb #574ec7
+.defcolor slateblue4 rgb #342d7e
+.defcolor slategray rgb #657383
+.defcolor slategray1 rgb #c2dfff
+.defcolor slategray2 rgb #b4cfec
+.defcolor slategray3 rgb #98afc7
+.defcolor slategray4 rgb #616d7e
+.defcolor snow rgb #fff9fa
+.defcolor snow2 rgb #ece7e6
+.defcolor snow3 rgb #c8c4c2
+.defcolor snow4 rgb #817c7b
+.defcolor springgreen rgb #4aa02c
+.defcolor springgreen1 rgb #5efb6e
+.defcolor springgreen2 rgb #57e964
+.defcolor springgreen3 rgb #4cc552
+.defcolor springgreen4 rgb #347c2c
+.defcolor steelblue rgb #4863a0
+.defcolor steelblue1 rgb #5cb3ff
+.defcolor steelblue2 rgb #56a5ec
+.defcolor steelblue3 rgb #488ac7
+.defcolor steelblue4 rgb #2b547e
+.defcolor tan rgb #d8af79
+.defcolor tan1 rgb #fa9b3c
+.defcolor tan2 rgb #e78e35
+.defcolor thistle rgb #d2b9d3
+.defcolor thistle1 rgb #fcdfff
+.defcolor thistle2 rgb #e9cfec
+.defcolor thistle3 rgb #c6aec7
+.defcolor thistle4 rgb #806d7e
+.defcolor tomato rgb #f75431
+.defcolor tomato2 rgb #e54c2c
+.defcolor tomato3 rgb #c23e17
+.defcolor turquoise rgb #43c6db
+.defcolor turquoise1 rgb #52f3ff
+.defcolor turquoise2 rgb #4ee2ec
+.defcolor turquoise3 rgb #43bfc7
+.defcolor turquoise4 rgb #30787e
+.defcolor violet rgb #8d38c9
+.defcolor violetred rgb #e9358a
+.defcolor violetred1 rgb #f6358a
+.defcolor violetred2 rgb #e4317f
+.defcolor violetred3 rgb #c12869
+.defcolor violetred4 rgb #7d0541
+.defcolor wheat rgb #f3daa9
+.defcolor wheat1 rgb #fee4b1
+.defcolor wheat2 rgb #ebd3a3
+.defcolor wheat3 rgb #c8b189
+.defcolor wheat4 rgb #816f54
+.defcolor yellow rgb #ffff00
+.defcolor yellow1 rgb #fffc17
+.defcolor yellowgreen rgb #52d017
+.\" background color defaults to white and glyph color to black
+\M[white]\m[black]\c
+.\" end of file, make sure this is the last line
diff --git a/tmac/ps.tmac b/tmac/ps.tmac
index 1aeacfd1..9d1bd554 100644
--- a/tmac/ps.tmac
+++ b/tmac/ps.tmac
@@ -52,3 +52,553 @@
.nr 0p 1
.cp \n(_C
.if !\n(.C .mso pspic.tmac
+.\" now for color definitions
+.\"
+.\" this is a composite of MIT's X Consortium red/green/blue (rgb) color
+.\" specifications, X Consortium version 10.41, 1994.
+.\"
+.defcolor black rgb #000000
+.defcolor grey rgb #bebebe
+.defcolor dimgrey rgb #696969
+.defcolor lightgray rgb #d3d3d3
+.defcolor lightslategrey rgb #778899
+.defcolor slategray rgb #708090
+.defcolor slategray1 rgb #c6e2ff
+.defcolor slategray2 rgb #b9d3ee
+.defcolor slategray3 rgb #9fb6cd
+.defcolor slategray4 rgb #6c7b8b
+.defcolor slategrey rgb #708090
+.defcolor grey0 rgb #000000
+.defcolor grey1 rgb #030303
+.defcolor grey2 rgb #050505
+.defcolor grey3 rgb #080808
+.defcolor grey4 rgb #0a0a0a
+.defcolor grey5 rgb #0d0d0d
+.defcolor grey6 rgb #0f0f0f
+.defcolor grey7 rgb #121212
+.defcolor grey8 rgb #141414
+.defcolor grey9 rgb #171717
+.defcolor grey10 rgb #1a1a1a
+.defcolor grey11 rgb #1c1c1c
+.defcolor grey12 rgb #1f1f1f
+.defcolor grey13 rgb #212121
+.defcolor grey14 rgb #242424
+.defcolor grey15 rgb #262626
+.defcolor grey16 rgb #292929
+.defcolor grey17 rgb #2b2b2b
+.defcolor grey18 rgb #2e2e2e
+.defcolor grey19 rgb #303030
+.defcolor grey20 rgb #333333
+.defcolor grey21 rgb #363636
+.defcolor grey22 rgb #383838
+.defcolor grey23 rgb #3b3b3b
+.defcolor grey24 rgb #3d3d3d
+.defcolor grey25 rgb #404040
+.defcolor grey26 rgb #424242
+.defcolor grey27 rgb #454545
+.defcolor grey28 rgb #474747
+.defcolor grey29 rgb #4a4a4a
+.defcolor grey30 rgb #4d4d4d
+.defcolor grey31 rgb #4f4f4f
+.defcolor grey32 rgb #525252
+.defcolor grey33 rgb #545454
+.defcolor grey34 rgb #575757
+.defcolor grey35 rgb #595959
+.defcolor grey36 rgb #5c5c5c
+.defcolor grey37 rgb #5e5e5e
+.defcolor grey38 rgb #616161
+.defcolor grey39 rgb #636363
+.defcolor grey40 rgb #666666
+.defcolor grey41 rgb #696969
+.defcolor grey42 rgb #6b6b6b
+.defcolor grey43 rgb #6e6e6e
+.defcolor grey44 rgb #707070
+.defcolor grey45 rgb #737373
+.defcolor grey46 rgb #757575
+.defcolor grey47 rgb #787878
+.defcolor grey48 rgb #7a7a7a
+.defcolor grey49 rgb #7d7d7d
+.defcolor grey50 rgb #7f7f7f
+.defcolor grey51 rgb #828282
+.defcolor grey52 rgb #858585
+.defcolor grey53 rgb #878787
+.defcolor grey54 rgb #8a8a8a
+.defcolor grey55 rgb #8c8c8c
+.defcolor grey56 rgb #8f8f8f
+.defcolor grey57 rgb #919191
+.defcolor grey58 rgb #949494
+.defcolor grey59 rgb #969696
+.defcolor grey60 rgb #999999
+.defcolor grey61 rgb #9c9c9c
+.defcolor grey62 rgb #9e9e9e
+.defcolor grey63 rgb #a1a1a1
+.defcolor grey64 rgb #a3a3a3
+.defcolor grey65 rgb #a6a6a6
+.defcolor grey66 rgb #a8a8a8
+.defcolor grey67 rgb #ababab
+.defcolor grey68 rgb #adadad
+.defcolor grey69 rgb #b0b0b0
+.defcolor grey70 rgb #b3b3b3
+.defcolor grey71 rgb #b5b5b5
+.defcolor grey72 rgb #b8b8b8
+.defcolor grey73 rgb #bababa
+.defcolor grey74 rgb #bdbdbd
+.defcolor grey75 rgb #bfbfbf
+.defcolor grey76 rgb #c2c2c2
+.defcolor grey77 rgb #c4c4c4
+.defcolor grey78 rgb #c7c7c7
+.defcolor grey79 rgb #c9c9c9
+.defcolor grey80 rgb #cccccc
+.defcolor grey81 rgb #cfcfcf
+.defcolor grey82 rgb #d1d1d1
+.defcolor grey83 rgb #d4d4d4
+.defcolor grey84 rgb #d6d6d6
+.defcolor grey85 rgb #d9d9d9
+.defcolor grey86 rgb #dbdbdb
+.defcolor grey87 rgb #dedede
+.defcolor grey88 rgb #e0e0e0
+.defcolor grey89 rgb #e3e3e3
+.defcolor grey90 rgb #e5e5e5
+.defcolor grey91 rgb #e8e8e8
+.defcolor grey92 rgb #ebebeb
+.defcolor grey93 rgb #ededed
+.defcolor grey94 rgb #f0f0f0
+.defcolor grey95 rgb #f2f2f2
+.defcolor grey96 rgb #f5f5f5
+.defcolor grey97 rgb #f7f7f7
+.defcolor grey98 rgb #fafafa
+.defcolor grey99 rgb #fcfcfc
+.defcolor grey100 rgb #ffffff
+.defcolor aliceblue rgb #f0f8ff
+.defcolor blueviolet rgb #8a2be2
+.defcolor cadetblue rgb #5f9ea0
+.defcolor cadetblue1 rgb #98f5ff
+.defcolor cadetblue2 rgb #8ee5ee
+.defcolor cadetblue3 rgb #7ac5cd
+.defcolor cadetblue4 rgb #53868b
+.defcolor cornflowerblue rgb #6495ed
+.defcolor darkslateblue rgb #483d8b
+.defcolor darkturquoise rgb #00ced1
+.defcolor deepskyblue rgb #00bfff
+.defcolor deepskyblue1 rgb #00bfff
+.defcolor deepskyblue2 rgb #00b2ee
+.defcolor deepskyblue3 rgb #009acd
+.defcolor deepskyblue4 rgb #00688b
+.defcolor dodgerblue rgb #1e90ff
+.defcolor dodgerblue1 rgb #1e90ff
+.defcolor dodgerblue2 rgb #1c86ee
+.defcolor dodgerblue3 rgb #1874cd
+.defcolor dodgerblue4 rgb #104e8b
+.defcolor lightblue rgb #add8e6
+.defcolor lightblue1 rgb #bfefff
+.defcolor lightblue2 rgb #b2dfee
+.defcolor lightblue3 rgb #9ac0cd
+.defcolor lightblue4 rgb #68838b
+.defcolor lightcyan rgb #e0ffff
+.defcolor lightcyan1 rgb #e0ffff
+.defcolor lightcyan2 rgb #d1eeee
+.defcolor lightcyan3 rgb #b4cdcd
+.defcolor lightcyan4 rgb #7a8b8b
+.defcolor lightskyblue rgb #87cefa
+.defcolor lightskyblue1 rgb #b0e2ff
+.defcolor lightskyblue2 rgb #a4d3ee
+.defcolor lightskyblue3 rgb #8db6cd
+.defcolor lightskyblue4 rgb #607b8b
+.defcolor lightslateblue rgb #8470ff
+.defcolor lightsteelblue rgb #b0c4de
+.defcolor lightsteelblue1 rgb #cae1ff
+.defcolor lightsteelblue2 rgb #bcd2ee
+.defcolor lightsteelblue3 rgb #a2b5cd
+.defcolor lightsteelblue4 rgb #6e7b8b
+.defcolor mediumaquamarine rgb #66cdaa
+.defcolor mediumblue rgb #0000cd
+.defcolor mediumslateblue rgb #7b68ee
+.defcolor mediumturquoise rgb #48d1cc
+.defcolor midnightblue rgb #191970
+.defcolor navyblue rgb #000080
+.defcolor paleturquoise rgb #afeeee
+.defcolor paleturquoise1 rgb #bbffff
+.defcolor paleturquoise2 rgb #aeeeee
+.defcolor paleturquoise3 rgb #96cdcd
+.defcolor paleturquoise4 rgb #668b8b
+.defcolor powderblue rgb #b0e0e6
+.defcolor royalblue rgb #4169e1
+.defcolor royalblue1 rgb #4876ff
+.defcolor royalblue2 rgb #436eee
+.defcolor royalblue3 rgb #3a5fcd
+.defcolor royalblue4 rgb #27408b
+.defcolor skyblue rgb #87ceeb
+.defcolor skyblue1 rgb #87ceff
+.defcolor skyblue2 rgb #7ec0ee
+.defcolor skyblue3 rgb #6ca6cd
+.defcolor skyblue4 rgb #4a708b
+.defcolor slateblue rgb #6a5acd
+.defcolor slateblue1 rgb #836fff
+.defcolor slateblue2 rgb #7a67ee
+.defcolor slateblue3 rgb #6959cd
+.defcolor slateblue4 rgb #473c8b
+.defcolor steelblue rgb #4682b4
+.defcolor steelblue1 rgb #63b8ff
+.defcolor steelblue2 rgb #5cacee
+.defcolor steelblue3 rgb #4f94cd
+.defcolor steelblue4 rgb #36648b
+.defcolor aquamarine rgb #7fffd4
+.defcolor aquamarine1 rgb #7fffd4
+.defcolor aquamarine2 rgb #76eec6
+.defcolor aquamarine3 rgb #66cdaa
+.defcolor aquamarine4 rgb #458b74
+.defcolor azure rgb #f0ffff
+.defcolor azure1 rgb #f0ffff
+.defcolor azure2 rgb #e0eeee
+.defcolor azure3 rgb #c1cdcd
+.defcolor azure4 rgb #838b8b
+.defcolor blue rgb #0000ff
+.defcolor blue1 rgb #0000ff
+.defcolor blue2 rgb #0000ee
+.defcolor blue3 rgb #0000cd
+.defcolor blue4 rgb #00008b
+.defcolor cyan rgb #00ffff
+.defcolor cyan1 rgb #00ffff
+.defcolor cyan2 rgb #00eeee
+.defcolor cyan3 rgb #00cdcd
+.defcolor cyan4 rgb #008b8b
+.defcolor navy rgb #000080
+.defcolor turquoise rgb #40e0d0
+.defcolor turquoise1 rgb #00f5ff
+.defcolor turquoise2 rgb #00e5ee
+.defcolor turquoise3 rgb #00c5cd
+.defcolor turquoise4 rgb #00868b
+.defcolor darkslategray rgb #2f4f4f
+.defcolor darkslategray1 rgb #97ffff
+.defcolor darkslategray2 rgb #8deeee
+.defcolor darkslategray3 rgb #79cdcd
+.defcolor darkslategray4 rgb #528b8b
+.defcolor rosybrown rgb #bc8f8f
+.defcolor rosybrown1 rgb #ffc1c1
+.defcolor rosybrown2 rgb #eeb4b4
+.defcolor rosybrown3 rgb #cd9b9b
+.defcolor rosybrown4 rgb #8b6969
+.defcolor saddlebrown rgb #8b4513
+.defcolor sandybrown rgb #f4a460
+.defcolor beige rgb #f5f5dc
+.defcolor brown rgb #a52a2a
+.defcolor brown1 rgb #ff4040
+.defcolor brown2 rgb #ee3b3b
+.defcolor brown3 rgb #cd3333
+.defcolor brown4 rgb #8b2323
+.defcolor burlywood rgb #deb887
+.defcolor burlywood1 rgb #ffd39b
+.defcolor burlywood2 rgb #eec591
+.defcolor burlywood3 rgb #cdaa7d
+.defcolor burlywood4 rgb #8b7355
+.defcolor chocolate rgb #d2691e
+.defcolor chocolate1 rgb #ff7f24
+.defcolor chocolate2 rgb #ee7621
+.defcolor chocolate3 rgb #cd661d
+.defcolor chocolate4 rgb #8b4513
+.defcolor peru rgb #cd853f
+.defcolor tan rgb #d2b48c
+.defcolor tan1 rgb #ffa54f
+.defcolor tan2 rgb #ee9a49
+.defcolor tan3 rgb #cd853f
+.defcolor tan4 rgb #8b5a2b
+.defcolor darkgreen rgb #006400
+.defcolor darkkhaki rgb #bdb76b
+.defcolor darkolivegreen rgb #556b2f
+.defcolor darkolivegreen1 rgb #caff70
+.defcolor darkolivegreen2 rgb #bcee68
+.defcolor darkolivegreen3 rgb #a2cd5a
+.defcolor darkolivegreen4 rgb #6e8b3d
+.defcolor darkseagreen rgb #8fbc8f
+.defcolor darkseagreen1 rgb #c1ffc1
+.defcolor darkseagreen2 rgb #b4eeb4
+.defcolor darkseagreen3 rgb #9bcd9b
+.defcolor darkseagreen4 rgb #698b69
+.defcolor forestgreen rgb #228b22
+.defcolor greenyellow rgb #adff2f
+.defcolor lawngreen rgb #7cfc00
+.defcolor lightseagreen rgb #20b2aa
+.defcolor limegreen rgb #32cd32
+.defcolor mediumseagreen rgb #3cb371
+.defcolor mediumspringgreen rgb #00fa9a
+.defcolor mintcream rgb #f5fffa
+.defcolor olivedrab rgb #6b8e23
+.defcolor olivedrab1 rgb #c0ff3e
+.defcolor olivedrab2 rgb #b3ee3a
+.defcolor olivedrab3 rgb #9acd32
+.defcolor olivedrab4 rgb #698b22
+.defcolor palegreen rgb #98fb98
+.defcolor palegreen1 rgb #9aff9a
+.defcolor palegreen2 rgb #90ee90
+.defcolor palegreen3 rgb #7ccd7c
+.defcolor palegreen4 rgb #548b54
+.defcolor seagreen rgb #2e8b57
+.defcolor seagreen1 rgb #54ff9f
+.defcolor seagreen2 rgb #4eee94
+.defcolor seagreen3 rgb #43cd80
+.defcolor seagreen4 rgb #2e8b57
+.defcolor springgreen rgb #00ff7f
+.defcolor springgreen1 rgb #00ff7f
+.defcolor springgreen2 rgb #00ee76
+.defcolor springgreen3 rgb #00cd66
+.defcolor springgreen4 rgb #008b45
+.defcolor yellowgreen rgb #9acd32
+.defcolor chartreuse rgb #7fff00
+.defcolor chartreuse1 rgb #7fff00
+.defcolor chartreuse2 rgb #76ee00
+.defcolor chartreuse3 rgb #66cd00
+.defcolor chartreuse4 rgb #458b00
+.defcolor green rgb #00ff00
+.defcolor green1 rgb #00ff00
+.defcolor green2 rgb #00ee00
+.defcolor green3 rgb #00cd00
+.defcolor green4 rgb #008b00
+.defcolor khaki rgb #f0e68c
+.defcolor khaki1 rgb #fff68f
+.defcolor khaki2 rgb #eee685
+.defcolor khaki3 rgb #cdc673
+.defcolor khaki4 rgb #8b864e
+.defcolor darkorange rgb #ff8c00
+.defcolor darkorange1 rgb #ff7f00
+.defcolor darkorange2 rgb #ee7600
+.defcolor darkorange3 rgb #cd6600
+.defcolor darkorange4 rgb #8b4500
+.defcolor darksalmon rgb #e9967a
+.defcolor lightcoral rgb #f08080
+.defcolor lightsalmon rgb #ffa07a
+.defcolor lightsalmon1 rgb #ffa07a
+.defcolor lightsalmon2 rgb #ee9572
+.defcolor lightsalmon3 rgb #cd8162
+.defcolor lightsalmon4 rgb #8b5742
+.defcolor peachpuff rgb #ffdab9
+.defcolor peachpuff1 rgb #ffdab9
+.defcolor peachpuff2 rgb #eecbad
+.defcolor peachpuff3 rgb #cdaf95
+.defcolor peachpuff4 rgb #8b7765
+.defcolor bisque rgb #ffe4c4
+.defcolor bisque1 rgb #ffe4c4
+.defcolor bisque2 rgb #eed5b7
+.defcolor bisque3 rgb #cdb79e
+.defcolor bisque4 rgb #8b7d6b
+.defcolor coral rgb #ff7f50
+.defcolor coral1 rgb #ff7256
+.defcolor coral2 rgb #ee6a50
+.defcolor coral3 rgb #cd5b45
+.defcolor coral4 rgb #8b3e2f
+.defcolor honeydew rgb #f0fff0
+.defcolor honeydew1 rgb #f0fff0
+.defcolor honeydew2 rgb #e0eee0
+.defcolor honeydew3 rgb #c1cdc1
+.defcolor honeydew4 rgb #838b83
+.defcolor orange rgb #ffa500
+.defcolor orange1 rgb #ffa500
+.defcolor orange2 rgb #ee9a00
+.defcolor orange3 rgb #cd8500
+.defcolor orange4 rgb #8b5a00
+.defcolor salmon rgb #fa8072
+.defcolor salmon1 rgb #ff8c69
+.defcolor salmon2 rgb #ee8262
+.defcolor salmon3 rgb #cd7054
+.defcolor salmon4 rgb #8b4c39
+.defcolor sienna rgb #a0522d
+.defcolor sienna1 rgb #ff8247
+.defcolor sienna2 rgb #ee7942
+.defcolor sienna3 rgb #cd6839
+.defcolor sienna4 rgb #8b4726
+.defcolor deeppink rgb #ff1493
+.defcolor deeppink1 rgb #ff1493
+.defcolor deeppink2 rgb #ee1289
+.defcolor deeppink3 rgb #cd1076
+.defcolor deeppink4 rgb #8b0a50
+.defcolor hotpink rgb #ff69b4
+.defcolor hotpink1 rgb #ff6eb4
+.defcolor hotpink2 rgb #ee6aa7
+.defcolor hotpink3 rgb #cd6090
+.defcolor hotpink4 rgb #8b3a62
+.defcolor indianred rgb #cd5c5c
+.defcolor indianred1 rgb #ff6a6a
+.defcolor indianred2 rgb #ee6363
+.defcolor indianred3 rgb #cd5555
+.defcolor indianred4 rgb #8b3a3a
+.defcolor lightpink rgb #ffb6c1
+.defcolor lightpink1 rgb #ffaeb9
+.defcolor lightpink2 rgb #eea2ad
+.defcolor lightpink3 rgb #cd8c95
+.defcolor lightpink4 rgb #8b5f65
+.defcolor mediumvioletred rgb #c71585
+.defcolor mistyrose rgb #ffe4e1
+.defcolor mistyrose1 rgb #ffe4e1
+.defcolor mistyrose2 rgb #eed5d2
+.defcolor mistyrose3 rgb #cdb7b5
+.defcolor mistyrose4 rgb #8b7d7b
+.defcolor orangered rgb #ff4500
+.defcolor orangered1 rgb #ff4500
+.defcolor orangered2 rgb #ee4000
+.defcolor orangered3 rgb #cd3700
+.defcolor orangered4 rgb #8b2500
+.defcolor palevioletred rgb #db7093
+.defcolor palevioletred1 rgb #ff82ab
+.defcolor palevioletred2 rgb #ee799f
+.defcolor palevioletred3 rgb #cd6889
+.defcolor palevioletred4 rgb #8b475d
+.defcolor violetred rgb #d02090
+.defcolor violetred1 rgb #ff3e96
+.defcolor violetred2 rgb #ee3a8c
+.defcolor violetred3 rgb #cd3278
+.defcolor violetred4 rgb #8b2252
+.defcolor firebrick rgb #b22222
+.defcolor firebrick1 rgb #ff3030
+.defcolor firebrick2 rgb #ee2c2c
+.defcolor firebrick3 rgb #cd2626
+.defcolor firebrick4 rgb #8b1a1a
+.defcolor pink rgb #ffc0cb
+.defcolor pink1 rgb #ffb5c5
+.defcolor pink2 rgb #eea9b8
+.defcolor pink3 rgb #cd919e
+.defcolor pink4 rgb #8b636c
+.defcolor red rgb #ff0000
+.defcolor red1 rgb #ff0000
+.defcolor red2 rgb #ee0000
+.defcolor red3 rgb #cd0000
+.defcolor red4 rgb #8b0000
+.defcolor tomato rgb #ff6347
+.defcolor tomato1 rgb #ff6347
+.defcolor tomato2 rgb #ee5c42
+.defcolor tomato3 rgb #cd4f39
+.defcolor tomato4 rgb #8b3626
+.defcolor darkorchid rgb #9932cc
+.defcolor darkorchid1 rgb #bf3eff
+.defcolor darkorchid2 rgb #b23aee
+.defcolor darkorchid3 rgb #9a32cd
+.defcolor darkorchid4 rgb #68228b
+.defcolor darkviolet rgb #9400d3
+.defcolor lavenderblush rgb #fff0f5
+.defcolor lavenderblush1 rgb #fff0f5
+.defcolor lavenderblush2 rgb #eee0e5
+.defcolor lavenderblush3 rgb #cdc1c5
+.defcolor lavenderblush4 rgb #8b8386
+.defcolor mediumorchid rgb #ba55d3
+.defcolor mediumorchid1 rgb #e066ff
+.defcolor mediumorchid2 rgb #d15fee
+.defcolor mediumorchid3 rgb #b452cd
+.defcolor mediumorchid4 rgb #7a378b
+.defcolor mediumpurple rgb #9370db
+.defcolor mediumpurple1 rgb #ab82ff
+.defcolor mediumpurple2 rgb #9f79ee
+.defcolor mediumpurple3 rgb #8968cd
+.defcolor mediumpurple4 rgb #5d478b
+.defcolor lavender rgb #e6e6fa
+.defcolor magenta rgb #ff00ff
+.defcolor magenta1 rgb #ff00ff
+.defcolor magenta2 rgb #ee00ee
+.defcolor magenta3 rgb #cd00cd
+.defcolor magenta4 rgb #8b008b
+.defcolor maroon rgb #b03060
+.defcolor maroon1 rgb #ff34b3
+.defcolor maroon2 rgb #ee30a7
+.defcolor maroon3 rgb #cd2990
+.defcolor maroon4 rgb #8b1c62
+.defcolor orchid rgb #da70d6
+.defcolor orchid1 rgb #ff83fa
+.defcolor orchid2 rgb #ee7ae9
+.defcolor orchid3 rgb #cd69c9
+.defcolor orchid4 rgb #8b4789
+.defcolor plum rgb #dda0dd
+.defcolor plum1 rgb #ffbbff
+.defcolor plum2 rgb #eeaeee
+.defcolor plum3 rgb #cd96cd
+.defcolor plum4 rgb #8b668b
+.defcolor purple rgb #a020f0
+.defcolor purple1 rgb #9b30ff
+.defcolor purple2 rgb #912cee
+.defcolor purple3 rgb #7d26cd
+.defcolor purple4 rgb #551a8b
+.defcolor thistle rgb #d8bfd8
+.defcolor thistle1 rgb #ffe1ff
+.defcolor thistle2 rgb #eed2ee
+.defcolor thistle3 rgb #cdb5cd
+.defcolor thistle4 rgb #8b7b8b
+.defcolor violet rgb #ee82ee
+.defcolor antiquewhite rgb #faebd7
+.defcolor antiquewhite1 rgb #ffefdb
+.defcolor antiquewhite2 rgb #eedfcc
+.defcolor antiquewhite3 rgb #cdc0b0
+.defcolor antiquewhite4 rgb #8b8378
+.defcolor floralwhite rgb #fffaf0
+.defcolor ghostwhite rgb #f8f8ff
+.defcolor navajowhite rgb #ffdead
+.defcolor navajowhite1 rgb #ffdead
+.defcolor navajowhite2 rgb #eecfa1
+.defcolor navajowhite3 rgb #cdb38b
+.defcolor navajowhite4 rgb #8b795e
+.defcolor oldlace rgb #fdf5e6
+.defcolor whitesmoke rgb #f5f5f5
+.defcolor gainsboro rgb #dcdcdc
+.defcolor ivory rgb #fffff0
+.defcolor ivory1 rgb #fffff0
+.defcolor ivory2 rgb #eeeee0
+.defcolor ivory3 rgb #cdcdc1
+.defcolor ivory4 rgb #8b8b83
+.defcolor linen rgb #faf0e6
+.defcolor seashell rgb #fff5ee
+.defcolor seashell1 rgb #fff5ee
+.defcolor seashell2 rgb #eee5de
+.defcolor seashell3 rgb #cdc5bf
+.defcolor seashell4 rgb #8b8682
+.defcolor snow rgb #fffafa
+.defcolor snow1 rgb #fffafa
+.defcolor snow2 rgb #eee9e9
+.defcolor snow3 rgb #cdc9c9
+.defcolor snow4 rgb #8b8989
+.defcolor wheat rgb #f5deb3
+.defcolor wheat1 rgb #ffe7ba
+.defcolor wheat2 rgb #eed8ae
+.defcolor wheat3 rgb #cdba96
+.defcolor wheat4 rgb #8b7e66
+.defcolor white rgb #ffffff
+.defcolor blanchedalmond rgb #ffebcd
+.defcolor darkgoldenrod rgb #b8860b
+.defcolor darkgoldenrod1 rgb #ffb90f
+.defcolor darkgoldenrod2 rgb #eead0e
+.defcolor darkgoldenrod3 rgb #cd950c
+.defcolor darkgoldenrod4 rgb #8b6508
+.defcolor lemonchiffon rgb #fffacd
+.defcolor lemonchiffon1 rgb #fffacd
+.defcolor lemonchiffon2 rgb #eee9bf
+.defcolor lemonchiffon3 rgb #cdc9a5
+.defcolor lemonchiffon4 rgb #8b8970
+.defcolor lightgoldenrod rgb #eedd82
+.defcolor lightgoldenrod1 rgb #ffec8b
+.defcolor lightgoldenrod2 rgb #eedc82
+.defcolor lightgoldenrod3 rgb #cdbe70
+.defcolor lightgoldenrod4 rgb #8b814c
+.defcolor lightgoldenrodyellow rgb #fafad2
+.defcolor lightyellow rgb #ffffe0
+.defcolor lightyellow1 rgb #ffffe0
+.defcolor lightyellow2 rgb #eeeed1
+.defcolor lightyellow3 rgb #cdcdb4
+.defcolor lightyellow4 rgb #8b8b7a
+.defcolor palegoldenrod rgb #eee8aa
+.defcolor papayawhip rgb #ffefd5
+.defcolor cornsilk rgb #fff8dc
+.defcolor cornsilk1 rgb #fff8dc
+.defcolor cornsilk2 rgb #eee8cd
+.defcolor cornsilk3 rgb #cdc8b1
+.defcolor cornsilk4 rgb #8b8878
+.defcolor gold rgb #ffd700
+.defcolor gold1 rgb #ffd700
+.defcolor gold2 rgb #eec900
+.defcolor gold3 rgb #cdad00
+.defcolor gold4 rgb #8b7500
+.defcolor goldenrod rgb #daa520
+.defcolor goldenrod1 rgb #ffc125
+.defcolor goldenrod2 rgb #eeb422
+.defcolor goldenrod3 rgb #cd9b1d
+.defcolor goldenrod4 rgb #8b6914
+.defcolor moccasin rgb #ffe4b5
+.defcolor yellow rgb #ffff00
+.defcolor yellow1 rgb #ffff00
+.defcolor yellow2 rgb #eeee00
+.defcolor yellow3 rgb #cdcd00
+.defcolor yellow4 rgb #8b8b00
+.\" make sure that no blank lines creep in at the end of this file.
diff --git a/tmac/troffrc b/tmac/troffrc
index dd5597db..09ed3a28 100644
--- a/tmac/troffrc
+++ b/tmac/troffrc
@@ -24,10 +24,6 @@
.do rm troffrc!ps troffrc!Xps troffrc!dvi troffrc!X75 troffrc!X75-12 \
troffrc!X100 troffrc!X100-12 troffrc!lj4 troff!lbp troffrc!html
.
-.\" now load up the color definitions
-.do if '\*[.T]'html' .do mso color-html.tmac
-.do if !'\*[.T]'html' .do mso color.tmac
-.
.ie '\*(.T'cp1047' .do tr \[char65]\~
.el .do tr \[char160]\~
.
diff --git a/tmac/www.tmac b/tmac/www.tmac
index 004c351a..a226a68d 100644
--- a/tmac/www.tmac
+++ b/tmac/www.tmac
@@ -1,12 +1,20 @@
.\" www.tmac
.\"
.\" A simple set of macros to provide HTML documents with basic
-.\" www functionality. It will work with any macro set.
+.\" www functionality. It should work with any macro set.
.\"
.nr _C \n(.C
.cp 0
.nr www-html 0
.if '\*(.T'html' .nr www-html 1
+.if r ps4html \{\
+. \" remove the title command when we are generating images for html
+. \" (stops a title accidentally appearing inside an image)
+. tl ````
+. rm tl
+. de tl
+..
+.\}
.\"
.\"
.\"
@@ -151,6 +159,13 @@
. HTML <hr>
..
.\"
+.\" NO-AUTO-RULE - suppresses the generation of the top and bottom rules
+.\" which grohtml emits by default.
+.\"
+.de NO-AUTO-RULE
+. HTML-TAG ".no-auto-rule"
+..
+.\"
.\" supplimentary macros used by other macro sets
.\"
.\" here are some tags specially for -Tps or -Thtml when invoked by pre-html
@@ -160,16 +175,8 @@
.\" read back by pre-html
.\"
.de HTML-DO-IMAGE
-. if r ps4html .begin \{\
-. image \\$2 \\$1.png
-. bp
-. tl ''''
-\O[0]\O[1]
-. \}
-. if \\n[www-html] .begin \{\
-. image \\$2 \\$1.png
-\O[0]
-. \}
+. if r ps4html \O[3]\O[5\\$2\\$1.png]\O[0]\O[1]
+. if \\n[www-html] \O[3]\O[5\\$2\\$1.png]\O[0]
..
.\"
.\" HTML-IMAGE-END - terminates an image for html