[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Writing in gray with groff... possible?

From: Ted Harding
Subject: Re: [Groff] Writing in gray with groff... possible?
Date: Sun, 25 Jun 2000 01:06:07 +0100 (BST)

On 25-Jun-00 baruchel wrote:
> Brest, le samedi 24 juin
>> Yes in principle, but not all easily.
>> There is no provision at present in tbl for cell-background-filling,
>> so
>> you would have to fake it.
> Thank you for this. Is it possible to do the second thing I asked
> (write with gray characters)? I am not afraid of doing some job in the
> troff output
> ;-)
> -- 
>    .~.   Thomas Baruchel

This one is easy (if the output device is PostScript). You don't need
to edit the output. The following is an entire input file:

  .ps 36
  .vs 36p
  .ce 3
  \X'ps: exec 0.7 setgray'GREY
  \X'ps: exec 0 setgray'BLACK
  \X'ps: exec 0.4 setgray'DARK GREY

(Note that in PostScript gray = 0 means "black", gray = 1 means "white").

You could define strings or macros for this, e.g.

  .de grch
  .ds ngr \\$1
  \X'ps: exec \\*[ngr] setgray'\\$*
  .ps 36
  .vs 36p
  .ce 3
  .grch 0.7 GREY
  .grch 0 BLACK
  .grch 0.4 DARK GREY

This also works for coloured text, e.g.

  .ds RED "\X'ps: exec 1 0 0 setrgbcolor'
  .ds BLACK "\X'ps: exec 0 0 0 setrgbcolor'
  .ps 36
  .vs 36p
  .ce 3

  .nr bwd \w'\0WHITE ON GREY\0'u
  \D'f 400u'\h'-400u'\
  \Z'\v'0.5m'\D'P 0 -1.7m \n[bwd]u 0 0 1.7m -\n[bwd]u 0'\v'-0.5m''\
  \X'ps: exec 1 1 1 setgray'\0WHITE ON GREY\0

If you view the output in a colour PostScript renderer such
as ghostscript or ghostview, you should see the colour changes.

The last item above shows how to print white on grey.


E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 284 7749
Date: 25-Jun-00                                       Time: 01:06:07
------------------------------ XFMail ------------------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]