[Top][All Lists]

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

Re: [Groff] chess font?

From: Gaius Mulley
Subject: Re: [Groff] chess font?
Date: 03 Feb 2007 21:38:03 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

"Eric S. Raymond" <address@hidden> writes:

> Gaius Mulley <address@hidden>:
> > many thanks for the pointers - have found the chess postscript adobe
> > fonts!
> When I heard this request, there sprang into my head full-blown a design
> for a troff facility that takes sections like this:
> .CH
> rnbqkbnr
> pppppppp
> . . . . 
> . . . . 
> . . . . 
> . . . . 
> . . . . 
> . . . . 
> .CE
> and turns them into chess diagrams.  First I imagined a preprocessor 
> generating pic, then I realized this could probably be written as a macro
> using .tr.
> I conclude from this that I've been thinking about Troff too much.  


I've sometimes wondered whether it might be profitable to modify
soelim and troff such that one might embed a filter script inside a
troff source file.  So for example:

.SCRIPT-BEGIN  sometag
#!/usr/bin/env python

"a useful and trivial script which translates chess pieces into
 font changes and glyphs.  This script is cut out by soelim and
 saved safely to a temporary file somewhere."

normal troff text etc

.SCRIPT-INPUT-BEGIN sometag    .\" following text is fed through the 
rnbqkbnr                       .\" trivial script and its output is
pppppppp                       .\" placed here.   This is run by troff
........                       .\" in a similar way as .SY.
........                       .\" The script is referenced by sometag
........                       .\" and troff removes the script and
........                       .\" any associated temporary files at
PPPPPPPP                       .\" the end of input.

implemented as macros which map onto a similar escape technique as the
suppression escapes \O etc.  In any event the obvious advantage to
this approach is that one can harness the ability of a scripting
language to manipulate raw text rather than fight .tr et al and
diversions.  It would also mean one could distribute filters hidden
inside macro sets.  Potentially with mechanisms such as swig it might
be possible for, say Python to import more runtime information from
the troff parent.  Which would be fun - and _might_ enable easier
experimentation with micro typography to take place, possibly.  Or you
could include the knights tour program inside the troff source.

Of course this could all be regarded as several steps too far :-)


reply via email to

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