groff
[Top][All Lists]
Advanced

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

Re: [Groff] Huge fonts & colours


From: Ted Harding
Subject: Re: [Groff] Huge fonts & colours
Date: Wed, 28 Feb 2001 10:26:57 -0000 (GMT)

On 26-Feb-01 Werner LEMBERG wrote:
> What about implementing color support into troff's output language
> directly?  I don't know whether groff drivers like grolj4 or grolbp
> could be easily extended to support colors (I don't know enough about
> those printer languages)...

This could be useful. I don't see any logical objection to having
colour included as an attribute within groff itself -- it's really
on the same basis as font, point size, line thickness, etc., from
the point of view of the user.

However, one might have to be careful about things like text and
line-drawings possibly having different colours, though perhaps
the user could take responsibility for keeping track of this.

The main issue which the programmer would have to face is that,
if it is to be on the same footing as font, etc., then the "current
colour" has to be part of the current environment, and preserved in
diversions etc. This means that implementing colour in groff would
require code changes all over the place, including in macros.

So perhaps it is not for tomorrow ...

Meanwhile, I think that as far as PostScript output is concerned
the current mechanism of \X'ps:exec R G B setrgbcolor' works fine
for almost everything.

The main exception is filling of drawn closed regions.

If you do

  \X'ps: exec 1 0 0 setrgbcolor'text \D'C 1c'

you will get both "text" and the filled circle in red.

If you do

  \Z'\D'f 200u''\X'ps: exec 1 0 0 setrgbcolor'text \D'C 1c'

you will get the filling of the circle in grey (and something
nasty happens to the end of "text" as well, which looks like a
bug to me).

Likewise, the "filling" of circles, boxes, etc. done by
pic is also in shades of grey, not colour.

I think the most useful extension of groff on the colour front,
for the immediate future, would be to implement colour-filling.

A possible syntax extension for this in groff could be

  \D'F r g b'

on the lines of \D'f n' (where "r", "g" and "b" need to be in
the form Ru where "R" is an integer 0-1000 etc.). Then there needs
to be care about the implicit movement associated with ALL \D'...'
commands.

For pic, one could perhaps have

  cfill (r,g,b)

on the lines of "fill greylevel".

Just a few thoughts,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 284 7749
Date: 28-Feb-01                                       Time: 10:26:56
------------------------------ XFMail ------------------------------

reply via email to

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