home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / s / stex2-18.zip / SeeTeX / libtex / dvistuff.h < prev    next >
C/C++ Source or Header  |  1990-07-10  |  4KB  |  146 lines

  1. /*
  2.  * Copyright 1989 Dirk Grunwald
  3.  * 
  4.  * Permission to use, copy, modify, distribute, and sell this software
  5.  * and its documentation for any purpose is hereby granted without fee,
  6.  * provided that the above copyright notice appear in all copies and that
  7.  * both that copyright notice and this permission notice appear in
  8.  * supporting documentation, and that the name of Dirk Grunwald or M.I.T.
  9.  * not be used in advertising or publicity pertaining to distribution of
  10.  * the software without specific, written prior permission.  Dirk
  11.  * Grunwald and M.I.T. makes no representations about the suitability of
  12.  * this software for any purpose.  It is provided "as is" without express
  13.  * or implied warranty.
  14.  * 
  15.  * DIRK GRUNWALD AND M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
  16.  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  17.  * FITNESS, IN NO EVENT SHALL M.I.T.  BE LIABLE FOR ANY SPECIAL, INDIRECT
  18.  * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  19.  * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  20.  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  21.  * OR PERFORMANCE OF THIS SOFTWARE.
  22.  * 
  23.  * Author:
  24.  *     Dr. Dirk Grunwald
  25.  *     Dept. of Computer Science
  26.  *     Campus Box 430
  27.  *     Univ. of Colorado, Boulder
  28.  *     Boulder, CO 80309
  29.  * 
  30.  *     grunwald@colorado.edu
  31.  *     
  32.  */ 
  33.  
  34. static char *dvistuff_header_rcsid="$Header: /home/reed/grunwald/Iptex/drivers/RCS/dvistuff.h,v 1.11 89/02/15 16:31:56 grunwald Exp $" ;
  35.  
  36. /*
  37.  *    Include the following from the CTex distribution
  38.  */
  39.  
  40. #include <stdio.h>
  41.  
  42. #include "types.h"
  43. #include "font.h"
  44. #include "conv.h"
  45.  
  46. /*
  47.  *    We use the following flags to keep track of shrunk fonts
  48.  */
  49.  
  50. #define    GF_SHRUNK    GF_USR0
  51.  
  52. #define    GLYPH_SHRUNK(g) ((g) -> g_flags & GF_SHRUNK)
  53.  
  54. #define SHRUNK_GLYPH_BYTES_WIDE(g) ((((g) -> g_width + 15) >> 4) * 2)
  55.  
  56. typedef struct font DviFont;
  57. typedef struct glyph DviGlyph;
  58.  
  59. #define MAX_GLYPH    128
  60. #define MAX_FONTFAMILY    128
  61.  
  62. #define DEFAULT_DPI    300
  63. #define DEFAULT_HHMARGIN    DEFAULT_DPI
  64. #define DEFAULT_VVMARGIN    DEFAULT_DPI
  65. #define DEFAULT_MAX_DRIFT    3
  66.  
  67. #define DEFAULT_BLACKNESS 3
  68.  
  69.  
  70. struct fontinfo {
  71.     struct font *f;        /* the font */
  72.     i32 pspace;        /* boundary between `small & `large spaces
  73.                    (for positive horizontal motion) */
  74.     i32 nspace;        /* -4 * pspace, for negative motion */
  75.     i32 vspace;        /* 5 * pspace, for vertical motion */
  76.     int family;        /* Imagen family number (we pick one) */
  77. };
  78.  
  79. typedef struct fontinfo DviFontInfo;
  80.  
  81. /* DVI file info */
  82.  
  83. /*
  84.  * Units of distance are stored in scaled points, but we can convert to
  85.  * units of 10^-7 meters by multiplying by the numbers in the preamble.
  86.  */
  87.  
  88. /* the structure of the stack used to hold the values (h,v,w,x,y,z) */
  89.  
  90. typedef struct dvi_stack {
  91.     i32    h;        /* the saved h */
  92.     i32    v;        /* the saved v */
  93.     i32    w;        /* etc */
  94.     i32    x;
  95.     i32    y;
  96.     i32    z;
  97. } DviStack;
  98.  
  99. extern DviStack dvi_current;    /* the current values of h, v, etc */
  100. extern int    dvi_f;            /* the current font */
  101.  
  102. #define dvi_h dvi_current.h
  103. #define dvi_v dvi_current.v
  104. #define dvi_w dvi_current.w
  105. #define dvi_x dvi_current.x
  106. #define dvi_y dvi_current.y
  107. #define dvi_z dvi_current.z
  108.  
  109.  
  110.  
  111. extern int    dviHH;        /* current horizontal position, in DEVs */
  112. extern int    dviVV;        /* current vertical position, in DEVs */
  113. #define DVI_COUNT    10    /* count0 .. count9 */
  114. extern long    *dviCount[DVI_COUNT];    /* values of count */
  115.  
  116. extern Conv Conversion;
  117.  
  118. extern int    dviHHMargin;
  119. extern int    dviVVMargin;
  120. extern int    dviDPI;
  121. extern int    dviTallestPage;
  122. extern int    dviWidestPage;
  123. extern int    dviTotalPages;
  124. extern int    dviCurrentPage;
  125. extern int    dviMaxDrift;
  126. extern char     *dviPrintEngine;
  127. extern int      dviBlackness;
  128. extern int    dviFontRotation;
  129. extern int    dviUserMag;
  130.  
  131. extern DviFontInfo *dviCurrentFont;
  132. extern char    *DVIFileName;
  133. extern FILE    *dviFile;                /* user's file */
  134. extern char    *ProgName;
  135.  
  136. extern int dviInit();
  137. extern void dviFini();
  138. extern void dviPreparePage( /* int */ );
  139. extern struct glyph *dviShrinkGlyph();
  140.  
  141. void applicationPutChar( /* hh, vv, charCode */ );
  142. DviFont *applicationNewFont( /* font structure */);
  143. void applicationResetFont(/* font info, key */);
  144. void applicationSetRule( /* hh, vv, height, width  : long*/ );
  145. void applicationDoSpecial();
  146.