home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume24 / psroff3.0 / part09 / MISC < prev   
Encoding:
Text File  |  1991-10-09  |  9.8 KB  |  237 lines

  1.         Miscellaneous Tuning/Customization
  2.             2.9 91/03/26
  3.  
  4.     - Postscript spooling:  Theoretically speaking, it is better
  5.       to have psxlate in your Postscript printer spooler interface
  6.       than as a pipeline in psroff.  For System V, you might want
  7.       to insert psxlate as the filter (instead of the more-usual
  8.       cat) in the interface file when you're passing postscript through
  9.       to the printer.  On lpr-type spoolers, make psxlate the filter
  10.       program in /etc/printcap.  Then you'll be able to use psxlate's
  11.       processing on all of your postscript output.
  12.  
  13.       Notes: psxlate does NOTHING to files without a "%!PS-Adobe-"
  14.       header.  In other words, psxlate doesn't do anything to files
  15.       that don't conform to the Document Structuring Conventions.
  16.       Eventually psxlate will probably permit you to do n-up (but
  17.       not page flipping) on any file that has a "%!" at the front,
  18.       and do automatic ASCII to Postscript conversions on files that
  19.       don't have "%!", further, page flipping and n-up *will* work.
  20.  
  21.     - psfig: If you have psfig, copy the psfig Postscript prolog
  22.       to LIBDIR/lib/psfig.ps, and insert the following line at
  23.       the end of ps.lib:
  24.     %%%include psfig
  25.       (psfig.ps is a subset of the psdit prolog fragment given in the
  26.       "patch" subdirectory in the psfig release - the README tells
  27.       you which part)
  28.  
  29.       Psfig works perfectly with ditroff, and should work reasonably
  30.       well with CAT troff.  Note: most ditroff's have a bug where
  31.       the horizontal position is not emitted before a \X'...'
  32.       sequence.  This is seen by diagrams that aren't quite where
  33.       they should be horizontally - often at the left margin when
  34.       they should really be centered.  This can be rectified if
  35.       you have source with a patch for ditroff that comes bundled with
  36.       psfig.  If you do not have ditroff source, the psfig option "-fts"
  37.       (not mentioned in the man page for psfig) will compensate for the
  38.       problem, at the expense of losing the ability to use the \(ts character.
  39.       The -fts option is ALWAYS required with CAT troff.  See "catconv"
  40.       below.
  41.  
  42.       (Note: In the psfig document under the "doc" directory in the
  43.       psfig release, page 10 contains a MACWrite generated figure.
  44.       Near the end of page 10 there is a bit of postscript that
  45.       most postscript printers don't like (a findfont) - print aborts
  46.       at this point are NOT the fault of psroff, but a fault in the
  47.       postscript that psfig has included).
  48.  
  49.     - catconv: catconv converts ditroff-only-isms into something handled
  50.       by psroff.  In order for you to use this, you have to have a copy
  51.       of perl installed on your machine.  This isn't completely
  52.       integrated into psroff, so here are a few things to consider:
  53.     - the catconv script's startup (the #!/usr/bin/perl stuff)
  54.       may have to be changed to reflect your perl install configuration.
  55.     - If you specify "v=1" in the psrofflib entry, psroff will
  56.       arrange to invoke catconv properly, so that you don't have
  57.       to manually invoke catconv - the "cdps" entry has an example.
  58.       If you are using CAT troff, if you cannot use catconv, you will
  59.       not be able to use psfig, \X'...' commands, \D'....' commands
  60.       (PIC) or the extended character set.
  61.  
  62.     - HPLJ tuning:
  63.     bestmatch: in lj.c's bestmatch function there is are arrays
  64.         "bigtry" and "smalltry".  These arrays provide a scan
  65.         sequence finding a font size "close" to a requested font
  66.         size that lj.fonts indicates isn't present.  If there
  67.         are holes in your fonts, you may want to experiment with
  68.         these arrays.
  69.     tbl box corners: depending on where you got your fonts from,
  70.         you may have to slightly adjust the box drawing characters
  71.         to match up at the corners of tbl boxes.  To do this,
  72.         append to lj.fonts:
  73.  
  74.         normal
  75.         ru N _ 0 -200
  76.         symbol
  77.         br N | -220 0
  78.  
  79.         The two numbers are the X and Y shifts of the corresponding
  80.         characters, where the numbers are scaled by (.01 * pointsize)
  81.         to get a shift in 1/720'ds.  Adjust these (carefully examine
  82.         tbl output to decide whether you want to move ru or br).
  83.  
  84.         The distributed defaults (which are shown here) are suitable
  85.         for HP Times-Roman font floppies.
  86.  
  87.     - performance: you can preload commonly used fonts into your
  88.       laserjet and thereby greatly reduce transmission time.
  89.       Consult the manual page for pk2sfp about the -P, -i, -S and -p
  90.       options (don't forget to mark the pointsizes you've downloaded
  91.       as "b" in the lj.fonts file).
  92.  
  93.     - ditroff tuning: Many of the ditroff converters have slightly
  94.       different correspondences between what character is in what
  95.       font.  You may want to modify the *.fonts file that you're
  96.       using to make sure that every character you want is being
  97.       printed correctly.  As an example, with tpscript "@" and
  98.       "^" aren't S font characters - they're in the normal fonts,
  99.       but the dt.c table says they're "symbol".  To tune for
  100.       tpscript:
  101.  
  102.         - modify psrofflib to have "-ptp" option to troff2ps (t2arg).
  103.         - copy dt.fonts to tp.fonts (in LIBDIR/lib).
  104.         - append to tp.fonts the following font override sequence:
  105.  
  106.         symbol
  107.         ^    N
  108.         @    N
  109.  
  110.       psdit and xtroff appear to require the same things to be done
  111.       for "^" and "@" (psdit prints nothing without these, and xtroff
  112.       prints some other characters instead).
  113.  
  114.       Jetroff requires similar things, and jt.fonts has a more
  115.       extensive example of this.  Font overrides are documented
  116.       more completely next:
  117.  
  118.     - If you want to play around with character mappings.....
  119.       Eg: adding accents for your own language (ie: German)
  120.       The most important thing to remember is that you cannot extend
  121.       the CAT's character sets without modifying troff - unlike ditroff
  122.       where you can add them by changing the makedev files.  This
  123.       is how you do overrides (see troff2ps(1) for more details):
  124.  
  125.         - Put in a map override in the appropriate *.fonts file that
  126.           emits the character you want in place of a character you
  127.           don't need in the appropriate *.fonts file.  Eg: for
  128.           "germandbls" in ditroff, emit "ss" instead of "ct" for
  129.           the cent character.  Your override (in dt.fonts) would
  130.           look like:
  131.  
  132.         ct N ss
  133.  
  134.           The complete override format is:
  135.  
  136.         <troffchar> N|S|n <sequence> <x adjust> <y adjust> <scale>
  137.  
  138.           x adjust, y adjust, scale default to 0, 0 and 100 respectively.
  139.           x and y adjust are multiplied by .01, then the pointsize
  140.           and of the output driver to give the shift factor in
  141.           1/resolution units.  Scale allows you to change the size
  142.           of that one character (eg: you think bullet is too small), but
  143.           it isn't recommended too much (it may not work reasonably
  144.           on non-postscript drivers).  Again, scale is prescaled by
  145.           .01 first, so 100 is 1-1.
  146.  
  147.           <sequence> defaults to <troffchar>.  N means normal mapping
  148.           (eg: for fonts other than S with no cross font jumping),
  149.           S means symbol font, and "n" means specific font (usually >3 -
  150.           eg: special bracket fonts).
  151.  
  152.         - Modify the width table for the character you're replacing
  153.           to have the width for the character you're emitting.
  154.           Eg: for germandbls in ditroff, replace the "ct" entry's
  155.           width in widths/widthps/R with the width for "ss".  This
  156.           latter step is not necessary with laserjets because the
  157.           build procedure builds a new width table using the
  158.           remapping.
  159.  
  160.       With ditroff input (or the use of the "C" special directives - see
  161.       troff2ps(1)), you can extend the character set as much as you want.
  162.       You find the entry in the appropriate width files and add in the
  163.       width entries for your character, and then add them to the
  164.       "extensions" section of the ??.fonts file.  See ps.fonts for
  165.       an example.  At present there's no way of getting the width
  166.       information into CAT troff, but with ditroff everything works well.
  167.       By adding the entry into the width file, the widths/Makefile
  168.       will generate a complete set of extension characters in
  169.       width??/??.ext, which can be appended onto the *.fonts file.
  170.  
  171.     - Adding fonts after installation:
  172.     - New Laserjet fonts should be installed in the $LJF directory.
  173.     - Non-laserjet fonts should have their ditroff width table placed
  174.       in the proper widths/width?? directory.
  175.     - Ensure that the appropriate lib/*.fonts file contains the fonts
  176.       you're adding.
  177.     - at the top level, type:
  178.         make register
  179.     - then
  180.         su root
  181.         make installwidths
  182.  
  183.     - Display Postscript: My display postscript came with the source for
  184.       a utility called "dpsexec", which is a simple Postscript previewer
  185.       front end.  The source on a IBM RS/6000 was in:
  186.     /usr/lpp/DPS/examples/dpsexec/dpsexec.c
  187.       For best results, you may want to apply the following patch
  188.       to it (it redefines the initial window to be big enough
  189.       to contain a standard page, as well as adding a "!" escape to
  190.       shell in the interrupt handler):
  191.  
  192. =========== DPSEXEC.C PATCH START ==============
  193. *** dpsexec.c.orig    Sat Mar  9 02:00:45 1991
  194. --- dpsexec.c    Mon Mar 11 23:27:32 1991
  195. ***************
  196. *** 65,72 ****
  197.   #include <DPS/XDPSlib.h>
  198.   #include <DPS/dpsXclient.h>
  199.  
  200. ! #define W_HEIGHT    512
  201. ! #define W_WIDTH        512
  202.  
  203.   static int quitFlag = 0;
  204.   static unsigned long int enable, next, disable;
  205. --- 65,72 ----
  206.   #include <DPS/XDPSlib.h>
  207.   #include <DPS/dpsXclient.h>
  208.  
  209. ! #define W_HEIGHT    (11*72)
  210. ! #define W_WIDTH        (9*72)
  211.  
  212.   static int quitFlag = 0;
  213.   static unsigned long int enable, next, disable;
  214. ***************
  215. *** 195,200 ****
  216. --- 195,201 ----
  217.       printf("\tq\tquit\n");
  218.       printf("\ti\tinterrupt\n");
  219.       printf("\tk\tkill\n");
  220. +     printf("\t!\tshell\n");
  221.       printf("Command: ");
  222.       c = getchar(); getchar(); /* eat the newline */
  223.       switch (c)
  224. ***************
  225. *** 215,220 ****
  226. --- 216,224 ----
  227.           case 'k':
  228.               command = 6;
  229.               break;
  230. +     case '!':
  231. +         system("/bin/sh");
  232. +         break;
  233.       default:;
  234.           }
  235.  
  236. =========== DPSEXEC.C PATCH END ======================
  237.