Date: Wed, 16 May 2001 09:20:22 -0700 From: John Reynolds~ <jreynold@sedona.ch.intel.com> To: Nik Clayton <nik@FreeBSD.ORG> Cc: Randy Pratt <rpratt@ezwv.com>, freebsd-docs@FreeBSD.ORG Subject: Re: Automatic text screenshots Message-ID: <15106.43206.209457.832317@hip186.ch.intel.com> In-Reply-To: <20010516103515.A38101@catkin.nothing-going-on.org> References: <01051513051703.00373@k6-2.weeble.com> <200105151727.f4FHRos64816@bmah-freebsd-0.cisco.com> <01051515135804.00373@k6-2.weeble.com> <20010516103515.A38101@catkin.nothing-going-on.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[ On Wednesday, May 16, Nik Clayton wrote: ] > > It would be possible to add a new ioctl to syscons that dumped this text > video memory out to a userland program. > BOFFO idea! > This approach offers a couple of benefits over your current approach > of taking snapshots in X. > > 1. shot2gif can parse syscons font files -- the fonts that appear in > the GIF file are identical to the ones that will appear on the > user's screen. excellent! > > 2. If someone goes and writes shot2txt then we can include plain text > snapshots very, very easily. This is essential when producing the definitely. > 3. Someone who knows Postscript better than I could put together > shot2ps -- since the font and colour information is taken direct > from the source, the fidelity of any produced Postscript can be > better than that acheived by converting GIFs or PNGs to EPS. The main contributor to the original "printing" section of the handbook, Sean Kelly, is very good in PostScript. Perhaps he could take a stab at this one (hint, hint, wink, Sean!). > Currently unwritten (although it would be trivial to do so) would be a > shot2txt program, which would write out just the text from the snapshot, > ignoring the colours. I've not tested this on an "actual" screen dump since I haven't got my machine here to try the syscons patches. But, please accept this Perl as my humble contribution to this very cool effort. It "should work." #!/usr/bin/perl # # Copyright (c) 2001 John Reynolds # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # This program takes a "screen shot" produced by scrshot(1) and strips out # the color code bytes used to represent foreground and background colors in # PC display memory. It simply leaves the character itself which is useful for # creating text-only documentation that relies on "screen shots" to convey # information. # while (! eof(STDIN)) { $character = getc; $color = getc; printf ("%s", $character); } -Jr -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | John Reynolds WCCG, CCE, (space for rent, cheap!) | | Intel Corporation MS: CH6-210 Phone: 480-554-9092 pgr: 602-868-6512 | | jreynold@sedona.ch.intel.com http://www-aec.ch.intel.com/~jreynold/ | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15106.43206.209457.832317>