"Eric S. Raymond" <[EMAIL PROTECTED]> writes: > Gaius Mulley <[EMAIL PROTECTED]>: > > 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 > . . . . > . . . . > . . . . > . . . . > . . . . > . . . . > PPPPPPPP > RNBQKBNR > .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.
Hi, 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." .SCRIPT-END 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. RNBQKBNR .SCRIPT-INPUT-END I suspect the .SCRIPT-INPUT-BEGIN .SCRIPT-INPUT-END could be 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 :-) regards, Gaius