groff
[Top][All Lists]
Advanced

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

[Groff] inconsistencies with color specification


From: Bernd Warken
Subject: [Groff] inconsistencies with color specification
Date: Sun, 14 Oct 2001 15:54:52 +0200
User-agent: Mutt/1.2.5i

The color commands generated by gtroff (intermediate output) are inconsistent
with the specification (see groff_out(5)).

The actual manual page groff_out(5) describes the intermediate output
command m in 3 forms.

       m r g b
       m #rrggbb
       m ##rrrrggggbbbb

The same applies to the new command DF that is not yet documented.

1) The parser for the intermediate output cannot handle different numbers
of arguments for the same command.  This could be implemented with the
DF command because all graphics commands require a line break.
But this cannot be handled consistently with the single character m
because of the possible clustering of such commands.  To enforce some
different behavior for m would break compatibility in a very unreasonable
way.  The only reason for creating incompatibilites should be a better
logical infrastructure, not some random plundering.

2) The character '#' is defined as the comment command with the effect of
ignoring everything to the end of the line.  So it should not be used as 
part of the color string to enhance readability. Altho the parser accepts
that construction it would be better to find a different solution.

Fix:

I propose to require both commands m and DF to have 3 arguments each of
which can arbitrarily be specified as a float or a hex number in C style.
This could be naturally done by calling the parser's get_string() function
thrice.  Moreover there are standard C library functions to handle the
transformation.

To implement this is easy.  Only the corresponding troff escapes must be
adapted to create this output.

Bernd Warken


reply via email to

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