Help wanted on ASCII to graphics.

Help wanted on ASCII to graphics.

Post by Claus Langha » Fri, 07 Feb 1992 00:03:00



In einer Nachricht vom  Th 30-Jan-92 13:08, Joel Rosi-Schwartz schrieb:


 JRS> Newsgroups:
 JRS> comp.graphics,alt.graphics.pixutils,comp.lang.postscript,
 JRS> comp.text,comp.text.tex
 JRS>
 JRS> Hi,
 JRS>
 JRS> There is a particular problem I have trying to solve that I
 JRS> thought  some  guru out there might help with if I pleaded.
 JRS> What  I  want  to  do seems so simple to me in the world of
 JRS> high  tech graphics we live in, but everything I have tried
 JRS> has come up against a dead end.
 JRS>
 JRS> I  am  writing some manuals for my fax management software.
 JRS> I  have a program prtscrn, which can grab any tty on my SCO
 JRS> Unix box and put its image in ASCII form in a file.  So far
 JRS> so good.  The nice thing is that it is even 8-bit clean and
 JRS> handles  the  nice  boxes  around my menu's.  Now I want to
 JRS> include these in the manual.  I Personally use TeX and some
 JRS> others  on  the project use WordPerfect (internal political
 JRS> infighting) but it is not even important.  The problem lies
 JRS> in  that  I  have  to  turn  this  nice  8-bit  ASCII  into
 JRS> *ANYTHING*  graphical.   I  can  handle EPS, TIFF, GIFF, HP
 JRS> PLC,  ......  Every filter I have tried either barfs on the
 JRS> high order graphic chars or just politely ignores them.

 Hi Joel!

 Once  I  had  the same problem.  One solution I found was a
 programm called vga2mf.  It's a programm for PC-clones.  It
 computes  new  *.mf  files  from  the  VGA  fonts  of  Your
 VGA-card.   I  found  it  on  the  ftp-server  in Stuttgart
 rusmv1.rus.uni-stuttgart.de  [129.69.1.112].  The advantage
 of  solveing the problem this way, is that You can see Your
 screenshot  in  the  (La)TeX  source  and  change  it.  The
 disadvantage  is,  that  it  is impossible to show differnt
 colors.

 Here are some lines of README.TXT:

 EGA2MF is a utility to generate METAFONT code for                              
 8x14 bitmaps of the type used for EGA screen fonts                            
 on machines of the IBM pc/xt/at class.  The idea                              
 is that you may then produce a font which emulates                            
 the appearance of a video display screen with all                              
 the crudities appropriate for that medium.                                    
 There are some trivial changes necessary to make                              
 ega2mf work with some other bitmap type (e.g. 8x16                            
 for the VGA or Hercules Plus).  This is left as an                            
 exercise for the reader.                                                      
 % 4/25/90: a slightly modified version, vga2mf.c, is                          
 % now available wherein the necessary changes have been                        
 % made for doing VGA 8x16 fonts

 When  You  have computed the *.mf files You can use them on
 every  Computer,  not  only on PC-clones.  I hope this info
 might help You!

 Happy TeXing!

 Claus

  Mail    : Claus Langhans, U.d.Nussbaeumen 19,
            D-6233 Kelkheim, Germany                 ///
  Voice   : ++49-6195-8868  22:00 - 24:00 GMT+1     ///


 
 
 

Help wanted on ASCII to graphics.

Post by Brandon S. Allbery KF8 » Mon, 10 Feb 1992 12:29:55



+---------------
|  JRS> I  am  writing some manuals for my fax management software.
|  JRS> I  have a program prtscrn, which can grab any tty on my SCO
|  JRS> Unix box and put its image in ASCII form in a file.  So far
|  JRS> so good.  The nice thing is that it is even 8-bit clean and
|  JRS> handles  the  nice  boxes  around my menu's.  Now I want to
|  JRS> include these in the manual.  I Personally use TeX and some
|  JRS> others  on  the project use WordPerfect (internal political
|  JRS> infighting) but it is not even important.  The problem lies
|  JRS> in  that  I  have  to  turn  this  nice  8-bit  ASCII  into
|  JRS> *ANYTHING*  graphical.   I  can  handle EPS, TIFF, GIFF, HP
|  JRS> PLC,  ......  Every filter I have tried either barfs on the
|  JRS> high order graphic chars or just politely ignores them.
|  
|  Once  I  had  the same problem.  One solution I found was a
|  programm called vga2mf.  It's a programm for PC-clones.  It
|  computes  new  *.mf  files  from  the  VGA  fonts  of  Your
|  VGA-card.   I  found  it  on  the  ftp-server  in Stuttgart
|  rusmv1.rus.uni-stuttgart.de  [129.69.1.112].  The advantage
|  of  solveing the problem this way, is that You can see Your
|  screenshot  in  the  (La)TeX  source  and  change  it.  The
|  disadvantage  is,  that  it  is impossible to show differnt
|  colors.
+---------------

That last is true anyway, for the most part (how does TeX deal with color
printers and/or color fonts?).

I solved this (user manuals in TeX for which I wanted screendumps) by writing
a program that ran a shell through a pty and emulated an enhanced VT102-style
terminal using curses; upon receipt of a certain hot-key it would dump the
current curses screen *in*format*, including translating e.g. reverse
video and underline to corresponding "reverse" and "underline" fonts I created
by modifications to cmtt10.mf.  Color could be handled similarly, assuming you
have a color printer and corresponding color fonts you can tell TeX about.
Line-draw characters can not currently be handled that way, however, as it
constructs them using TeX rules.  (Actually, it calls macros \ACSul, etc.,
defined by the "screendump" environment, so you could build fonts of line-draw
characters and \chardef the "macros".  But font switching will likely be
problematic.)  You can also tell it what fonts to use for other curses
attributes, e.g. a grayscaled font, if you have one, for half-intensity.
The result is *very* nice looking, modulo some hairline spaces inserted
occasionally between reversed-font characters by something --- whether it's
(La)TeX or Metafont is unclear to me as yet --- between some character pairs,
even though cmtt10 shouldn't require any kerning and I couldn't find those
pairs in the ligature table for cmtt10.

Alas, it's not in a releaseable state; it's stuck halfway between its original
purpose and a general "screen"-like program (but with variable-sized windows
and the ability for a process in one window to create another window attached
either to an openable pty or independently running a program, if I ever get it
finished).  I may yank out the screendump code and hack that into iScreen,
however, if I get the time and get the current iScreen sources onto the
machine at some point.  In the meantime, you can use the basic idea to whip up
something that will do the job.

++Brandon
--

Senior Programmer, Telotech, Inc. (if I may call myself that...)