summaryrefslogtreecommitdiff
path: root/dviware/umddvi/previewers/dvistuff.h
blob: b7da1bd3b7b0ca7ab42265360e99086a57a7097d (plain)
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
/*
 *	This program is Copyright (C) 1987 by the Board of Trustees of the
 *	University of Illinois, and by the author Dirk Grunwald.
 *
 *	This program may be freely copied, as long as this copyright
 *	message remaines affixed. It may not be sold, altough it may
 *	be distributed with other software which is sold. If the
 *	software is distributed, the source code must be made available.
 *
 *	No warrenty, expressed or implied, is given with this software.
 *	It is presented in the hope that it will prove useful.
 */

/*
 *	Include the following from the CTex distribution
 */

#include <stdio.h>

#include "types.h"
#include "font.h"

/*
 *	We use the following flags to keep track of shrunk fonts
 */

#define	GF_SHRUNK	GF_USR0

#define	GLYPH_SHRUNK(g) ((g) -> g_flags & GF_SHRUNK)

#define SHRUNK_GLYPH_BYTES_WIDE(g) ((((g) -> g_width + 15) >> 4) * 2)

typedef struct font DviFont;
typedef struct glyph DviGlyph;

#define MAX_GLYPH	128
#define MAX_FONTFAMILY	128

#define DEFAULT_DPI	300
#define DEFAULT_HHMARGIN	DEFAULT_DPI
#define DEFAULT_VVMARGIN	DEFAULT_DPI

#define DEFAULT_BLACKNESS 3


struct fontinfo {
	struct font *f;		/* the font */
	i32 pspace;		/* boundary between `small & `large spaces
				   (for positive horizontal motion) */
	i32 nspace;		/* -4 * pspace, for negative motion */
	i32 vspace;		/* 5 * pspace, for vertical motion */
	int family;		/* Imagen family number (we pick one) */
};

typedef struct fontinfo DviFontInfo;

extern int	dviHH;		/* current horizontal position, in DEVs */
extern int	dviVV;		/* current vertical position, in DEVs */
extern int	dviHHMargin;
extern int	dviVVMargin;
extern int	dviDPI;
extern int	dviTallestPage;
extern int	dviWidestPage;
extern int	dviTotalPages;
extern int	dviCurrentPage;
extern int	dviMaxDrift;
extern char 	*dviPrintEngine;
extern int      dviBlackness;

extern DviFontInfo *dviCurrentFont;
extern FILE	*dviFile;				/* user's file */
extern char	*ProgName;

extern void dviInit();
extern void dviPreparePage( /* int */ );
extern struct glyph *dviShrinkGlyph();

void applicationLoadGlyph( /* charCode, glyph */ );
void applicationPutChar( /* hh, vv, charCode */ );
DviFont *applicationNewFont( /* font structure */);
void applicationResetFont(/* font info, key */);
void applicationSetRule( /* hh, vv, height, width  : long*/ );
void applicationDoSpecial();