On 30-Mar-10 19:48:49, Srdjan Todorovic wrote:
Hi,
On 29/03/2010, Ted Harding Ted.Harding@manchester.ac.uk wrote:
As illutration, I've done your second one http://www.wtcs.org/snmp4tpc/images/TCP-Header.jpg using pic+groff. I've put the results on
http://www.zen89632.zen.co.uk/Misc
files: tcpheader.tr (text input troff, almost entirely pic language) tcpheader.ps (PostScript output from the first, produced by groff) tcpheader.pdf (PDF converted from PS using pstopdf)
Wow! You did a great job of duplicating that. How long did it take? Did you just manually type the text into the .tr file or was there a tool you used?
It tokk something like an hour to an hour and a half all told. It was typed in by hand. I did it piece-meal, looking at the original graphic, identifying its component objects (mainly "box"es) with different attributes, and typing in a description of them one by one. Hence all the repetition. Then there was a certain amount of tweaking of detail to improve the result. It was all done "by eye" with a little trial and error to get proportions and layout looking roughly right.
Reminds me a little of LaTeX...
Only a little (likewise for troff). The pic stuff is more like Turtle Graphics!
This was not the neatest way to do it. There is a lot of repetition in the ".tr" file (and there's quite a bit in the graphic as well). If I were doing this for a repeated type of job job (or just to make the source look nicer), I'd encapsulate much of it in macros.
Yes macros would be nice. So would perhaps some form of introspection in a program that can generate troff from a struct would be great.
I'll have to study your troff source more to figure out exactly how that works.
Thanks for the idea! :)
Srdjan
I'll send you (privately) the .tr file with explanatory comments later. I'm happy you were pleased with the result!
Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@manchester.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 31-Mar-10 Time: 17:21:52 ------------------------------ XFMail ------------------------------