summaryrefslogtreecommitdiff
path: root/tmac/tty.tmac
diff options
context:
space:
mode:
authorwlemb <wlemb>2002-02-07 08:36:51 +0000
committerwlemb <wlemb>2002-02-07 08:36:51 +0000
commitd0c923a77924549197bdc0721443d2234e147708 (patch)
tree7b1f728472c615aca71a84cef2ac4f55c3cef4ed /tmac/tty.tmac
parent667abc70b96432fdeb64dd899a85b5d4ccd24e13 (diff)
downloadgroff-d0c923a77924549197bdc0721443d2234e147708.tar.gz
Adding options -C (compatibility mode) and -c (grotty's old output
scheme) to nroff. * src/roff/nroff/nroff.sh: Implement it. Remove `-Wall'. * NEWS, src/roff/nroff/nroff.man: Updated. Implementing color support in grotty. The new switch -c activates the old drawing scheme, disabling color at the same time. The new switch `-i' selects italic instead of underlining (SGR only). * src/devices/grotty/tty.cc (putstring): New define instead of `fputs'. Updated all callers. (old_drawing_scheme): New global variable. (COLOR_CHANGE): New enum value. (SGR_*): New defines containing color handling escape sequences. (TTY_MAX_COLORS, DEFAULT_COLOR_IDX): New defines. (glyph): New members `back_color_idx' and `fore_color_idx'. (glyph::order): Add COLOR_CHANGE. (tty_printer): New members `cur_fore_idx', `curr_back_idx', `is_underline', `is_bold', `cu_flag', `tty_colors'. New methods `make_underline', `make_bold', `color_to_idx', `change_color', `put_color'. (cu_flag): Moved into `tty_printer' class. (tty_printer::tty_printer): Initialize colors. (tty_printer::add_char, tty_printer::set_char, tty_printer::special, tty_printer::draw, tty_printer::end_page): Handle colors also. (main): Add options `-c' and `-i'. (usage): Updated. * NEWS, src/devices/grotty/grotty.man: Updated. * src/include/errarg.h (errarg): Add support for `unsigned int'. * src/libs/libgroff/errarg.c: Implement it. * src/include/printer.h (printer): Add `change_color' method (currently used by grotty only). * src/libs/libdriver/printer.cc: Implement it. * src/libs/libdriver/input.cc (parse_D_command, do_file): Add call to `pr->change_color'. * src/roff/troff/node.cc (troff_output_file::fill_color, troff_output_file::glyph_color): Call `do_motion'. * tmac/tty.tmac: Add color definitions. * src/roff/groff/groff.man: Minor fixes.
Diffstat (limited to 'tmac/tty.tmac')
-rw-r--r--tmac/tty.tmac9
1 files changed, 9 insertions, 0 deletions
diff --git a/tmac/tty.tmac b/tmac/tty.tmac
index 5da0607d..1c3f14fa 100644
--- a/tmac/tty.tmac
+++ b/tmac/tty.tmac
@@ -46,6 +46,15 @@
.tty-char \(an -
.tty-char \(eu EUR
.tty-char \(Eu EUR
+.\" color definitions
+.defcolor black rgb #000000
+.defcolor red rgb #ff0000
+.defcolor green rgb #00ff00
+.defcolor blue rgb #0000ff
+.defcolor yellow rgb #ffff00
+.defcolor magenta rgb #ff00ff
+.defcolor cyan rgb #00ffff
+.defcolor white rgb #ffffff
.cp \n(_C
.\" If you want the character definitions in tty-char.tmac to be loaded
.\" automatically, remove the `\"' from the next line.