File: defs.h

package info (click to toggle)
vftool 2.0alpha-4.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 388 kB
  • ctags: 769
  • sloc: ansic: 2,748; makefile: 190; sh: 79
file content (142 lines) | stat: -rw-r--r-- 4,037 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/**********************************************************************/
/************************  Global Definitions  ************************/
/**********************************************************************/

/* This version purports to drive a PostScript device (slowly) */


#define DEBUG				/* for massive printing of input */
					/* trace information; select by -d */

#define STATS		/* to enable statistics reporting via -s option */

#define BINARYOPEN	fopen		/* byte-oriented host version */

/* ARITHRSHIFT not used */
#define ARITHRSHIFT			/* define if ">>" operator is a */
					/* sign-propagating arithmetic  */
					/*   right shift */
#define USEGLOBALMAG			/* when defined, the dvi global */
					/*   magnification is applied   */
      
/* We can leave USEGLOBALMAG undefined when we have a limited
   number of font magnifications (at 300dpi) available.  Otherwise, we
   will simply complain about missing PXL files
 */
/* #undef USEGLOBALMAG */

/* define for enabling of -c option (create output file) */
/* #define CREOPT */

#define	DVI2LIBENV	"DVI2PSLIB"
#ifndef DVI2LIB
#define	DVI2LIB		"/usr/local/lib/dvi2ps"
#endif
#define	FONTDESCENV	"FONTDESC"
#ifndef FONTDESC
#define	FONTDESC	"fontdesc"
#endif

#ifndef HDRFILE
#define	HDRFILE		"/usr/local/lib/dvi2ps/tex.ps"
#endif

#define	MAXOPEN		12	/* limit on number of open PXL files */

#define	DVIFORMAT	2

#define	STACKSIZE	100
#define	STRSIZE		257
#define	PATHLEN		1024
#define	NO_FILE		(FILE *)-1

#define	NEW(A,e)	((A *)alloc_check(malloc(sizeof(A)), e))
#define	NEWTAB(A,n,e)	((A *)alloc_check(malloc(sizeof(A)*n), e))
#define	MAGSIZE(f)	((unsigned int)(1000.0*(f) + 0.5))
#define	ROUND(f)	((int)((f) + 0.5))
#define	STREQ(s,t)	(strcmp(s,t) == 0)

typedef unsigned char byte;

typedef float SCALED;
#define	scale(x,s)	(int)((SCALED)(x)*(SCALED)(s)/(1<<20))
/*
typedef int SCALED;
#define	scale(x,s)	scale_exact(x,s)
*/

typedef int BOOLEAN;
#define	TRUE		1
#define	FALSE		0


/**********************************************************************/
/***********************  Font Data Structures  ***********************/
/**********************************************************************/

struct font_index {	/* pointer to font entry */
    int k;
    struct font_entry *fent;
    struct font_index *next;
};

typedef int DEV_FONT;
#define	DEV_NULLFONT	(DEV_FONT)(-1)

struct font_entry {	/* font entry */
    int k;			/* unique id	*/
    int c, s, d, a, l;
    char n[STRSIZE];		/* FNT_DEF command parameters		*/
    void (*fnt_readfontinfo)();
    void (*rvf_setchar)();
    void (*rvf_setstring)();
    DEV_FONT (*dev_fontdict)();	/* returns the font in device		*/
    int (*dev_setchar)();	/* device dependent part of setchar	*/
    int (*dev_setstring)();	/* device dependent part of setstring	*/
    struct finfo *finfo;	/* font/device dependent information	*/
    struct font_entry *next;
    char name[PATHLEN];		/* full name of font file		*/
    FILE *openfile;		/* file stream (NO_FILE if none)	*/
    struct openfont_list *openlist;
    int ncdl;			/* # of different chars actually downloaded */
#ifdef STATS
    int nbpxl;			/* # of bytes of PXL data downloaded	*/
    int ncts;			/* total # of characters typeset	*/
#endif
};

#define	setcurfont(fe)	curfontent = fe
#define	fnt_markchar	dev_setchar
#define	FNT_markchar	DEV_setchar
#define	DEV_fontdict	(*(curfontent->dev_fontdict))
#define	DEV_setchar	(*(curfontent->dev_setchar))
#define	DEV_setstring	(*(curfontent->dev_setstring))


struct fontop {
    char *fo_type;
    int (*fo_access)();
    void (*fo_initfontinfo)();
};

#define	FDQUO	'"'
struct confop {
    char *co_name;
    void (*co_get)();
};

#define	ACC_EXACT	0
#define	ACC_SUBST	1
#define	ACC_MAGSTEP	2
struct accarg {
    int acc_mode;
    float rawmagfact;
    float actmagfact;
    int submag, reqmag;
    float stepmagfact;
    char *pv_name;	/* font name */
    int pv_mag;		/* magnification */
    char *pv_fam;	/* family */
    int pv_ds;		/* design size */
    char *pv_jsub;	/* jsubfont name */
};