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

defontifying program



    Date: Fri, 3 Aug 90 14:06:16 EDT
    From: cstacy@ai.mit.edu (Christopher C. Stacy)

    I guess you could make a trivial pipe something like this:


    /* ff - flush fonts
      Copies standard input to standard output removing Genera font information. */

    #include <stdio.h>
    #define FONT_START ''

I'd use '\006' rather than embed a control character in a source file.

    main ()
    { int c;
      int flag = 0;
      while ((c = getchar()) != EOF) {
	      if ((c == FONT_START) || flag) flag = !flag;
	      else putchar(c);
      }
     }

This only removes one character following each epsilon.  An epsilon may
be followed by a digit, an asterisk, the "password" that indicates that
Symbolics-style font information is embedded in the stream (a bunch of
control characters followed by something like "[Begin using 006 escape
sequences]", or a Lisp list (the first time a character style is used,
this specifies the association between the digit and the style, and it
might also be used when the style number is greater than 9).

The program I made available isn't currently implemented as a filter (it
has a required input file argument, and it either replaces the input
file or writes to a specified output file), but it could easily be
turned into a filter.

                                                barmar