aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/postscript/tr2post/tr2post.h
blob: 3f557b947715276aea0d856be779b84e83b80f01 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#define MAXSPECHARS 	512
#define MAXTOKENSIZE	128
#define CHARLIB	"#9/troff/font/devutf/charlib"

/* devname clashes with libc on *BSD */
#define devname		troff_devname

extern int debug;
extern int fontsize;
extern int fontpos;
extern int resolution;	/* device resolution, goobies per inch */
extern int minx;		/* minimum x motion */
extern int miny;		/* minimum y motion */
extern char devname[];
extern int devres;
extern int unitwidth;
extern char *printdesclang;
extern char *encoding;
extern int fontmnt;
extern char **fontmtab;

extern int curtrofffontid;	/* index into trofftab of current troff font */
extern int troffontcnt;

extern BOOLEAN drawflag;

struct specname {
	char *str;
	struct specname *next;
};

/* character entries for special characters (those pointed
 * to by multiple character names, e.g. \(mu for multiply.
 */
struct charent {
	char postfontid;	/* index into pfnamtab */
	char postcharid;	/* e.g., 0x00 */
	short troffcharwidth;
	char *name;
	struct charent *next;
};

extern struct charent **build_char_list;
extern int build_char_cnt;

struct pfnament {
	char *str;
	int used;
};

/* these entries map troff character code ranges to
 * postscript font and character ranges.
 */
struct psfent {
	int start;
	int end;
	int offset;
	int psftid;
};

struct troffont {
	char *trfontid;		/* the common troff font name e.g., `R' */
	BOOLEAN special;	/* flag says this is a special font. */
	int spacewidth;
	int psfmapsize;
	struct psfent *psfmap;
	struct charent *charent[NUMOFONTS][FONTSIZE];
};

extern struct troffont *troffontab;
extern struct charent spechars[];

/** prototypes **/
void initialize(void);
void mountfont(int, char*);
int findtfn(char *, int);
void runeout(Rune);
void specialout(char *);
long nametorune(char *);
void conv(Biobuf *);
void hgoto(int);
void vgoto(int);
void hmot(int);
void vmot(int);
void draw(Biobuf *);
void devcntl(Biobuf *);
void notavail(char *);
void error(int, char *, ...);
void loadfont(int, char *);
void flushtext(void);
void t_charht(int);
void t_slant(int);
void startstring(void);
void endstring(void);
BOOLEAN pageon(void);
void setpsfont(int, int);
void settrfont(void);
int hash(char *, int);
BOOLEAN readDESC(void);
void finish(void);
void ps_include(Biobuf *, Biobuf *, int, int,
	int, int, double, double, double, double,
	double, double, double);
void picture(Biobuf *, char *);
void beginpath(char*, int);
void drawpath(char*, int);