Home | History | Annotate | Download | only in postdaisy
      1 /*
      2  * CDDL HEADER START
      3  *
      4  * The contents of this file are subject to the terms of the
      5  * Common Development and Distribution License, Version 1.0 only
      6  * (the "License").  You may not use this file except in compliance
      7  * with the License.
      8  *
      9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10  * or http://www.opensolaris.org/os/licensing.
     11  * See the License for the specific language governing permissions
     12  * and limitations under the License.
     13  *
     14  * When distributing Covered Code, include this CDDL HEADER in each
     15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16  * If applicable, add the following below this CDDL HEADER, with the
     17  * fields enclosed by brackets "[]" replaced with your own identifying
     18  * information: Portions Copyright [yyyy] [name of copyright owner]
     19  *
     20  * CDDL HEADER END
     21  */
     22 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
     23 /*	  All Rights Reserved  	*/
     24 
     25 
     26 #ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.1	*/
     27 
     28 /*
     29  *
     30  * Definitions used by the PostScript translator for Diablo 1640 files.
     31  *
     32  * Diablo printers have horizontal and vertical resolutions of 120 and 48 dpi.
     33  * We'll use a single resolution of 240 dpi and let the program scale horizontal
     34  * and vertical positions by HSCALE and VSCALE.
     35  *
     36  */
     37 
     38 #define RES		240
     39 #define HSCALE		2
     40 #define VSCALE		5
     41 
     42 /*
     43  *
     44  * HMI is the default character spacing and VMI is the line spacing. Both values
     45  * are in terms of the 240 dpi resolution.
     46  *
     47  */
     48 
     49 #define HMI		(12 * HSCALE)
     50 #define VMI		(8 * VSCALE)
     51 
     52 /*
     53  *
     54  * Paper dimensions don't seem to be all that important. They're just used to
     55  * set the right and bottom margins. Both are given in terms of the 240 dpi
     56  * resolution.
     57  *
     58  */
     59 
     60 #define LEFTMARGIN	0
     61 #define RIGHTMARGIN	3168
     62 #define TOPMARGIN	0
     63 #define BOTTOMMARGIN	2640
     64 
     65 /*
     66  *
     67  * ROWS and COLUMNS set the dimensions of the horizontal and vertical tab arrays.
     68  * The way I've implemented both kinds of tabs leaves something to be desired, but
     69  * it was simple and should be good enough for now. If arrays are going to be used
     70  * to mark tab stops I probably should use malloc() to get enough space once the
     71  * initial hmi and vmi are know.
     72  *
     73  */
     74 
     75 #define ROWS		400
     76 #define COLUMNS		200
     77 
     78 /*
     79  *
     80  * An array of type Fontmap helps convert font names requested by users into
     81  * legitimate PostScript names. The array is initialized using FONTMAP, which must
     82  * end with an entry that has NULL defined as its name field.
     83  *
     84  */
     85 
     86 typedef struct {
     87 
     88 	char	*name;			/* user's font name */
     89 	char	*val;			/* corresponding PostScript name */
     90 
     91 } Fontmap;
     92 
     93 #define FONTMAP								\
     94 									\
     95 	{								\
     96 	    "R", "Courier",						\
     97 	    "I", "Courier-Oblique",					\
     98 	    "B", "Courier-Bold",					\
     99 	    "CO", "Courier",						\
    100 	    "CI", "Courier-Oblique",					\
    101 	    "CB", "Courier-Bold",					\
    102 	    "CW", "Courier",						\
    103 	    "PO", "Courier",						\
    104 	    "courier", "Courier",					\
    105 	    "cour", "Courier",						\
    106 	    "co", "Courier",						\
    107 	    NULL, NULL							\
    108 	}
    109 
    110 /*
    111  *
    112  * Some of the non-integer functions in postdaisy.c.
    113  *
    114  */
    115 
    116 char	*get_font();
    117 
    118