1 /* predefined array limits */
2 #define PATHLEN 1024 /* path length */
3 #define NFONTS 32 /* number of fonts */
4 #define FNLEN 32 /* font name length */
5 #define NGLYPHS 512 /* glyphs in fonts */
6 #define GNLEN 32 /* glyph name length */
7 #define ILNLEN 1000 /* line limit of input files */
8 #define LNLEN 4000 /* line buffer length (ren.c/out.c) */
10 #define MIN(a, b) ((a) < (b) ? (a) : (b))
11 #define MAX(a, b) ((a) < (b) ? (b) : (a))
12 #define LEN(a) (sizeof(a) / sizeof((a)[0]))
14 /* device related variables */
21 char name
[FNLEN
]; /* name of the glyph */
22 char id
[FNLEN
]; /* device-dependent glyph identifier */
23 struct font
*font
; /* glyph font */
24 int wid
; /* character width */
25 int type
; /* character type; ascender/descender */
31 struct glyph glyphs
[NGLYPHS
];
35 char c
[NGLYPHS
][FNLEN
]; /* character names in charset */
36 struct glyph
*g
[NGLYPHS
]; /* character glyphs in charset */
37 int n
; /* number of characters in charset */
40 /* output device functions */
41 int dev_open(char *path
);
43 int dev_mnt(int pos
, char *id
, char *name
);
44 struct font
*dev_font(int fn
);
45 int dev_fontid(struct font
*fn
);
46 int charwid(int wid
, int sz
);
47 struct glyph
*dev_glyph(char *c
, int fn
);
48 struct glyph
*dev_glyph_byid(char *id
, int fn
);
50 /* font-related functions */
51 struct font
*font_open(char *path
);
52 void font_close(struct font
*fn
);
53 struct glyph
*font_glyph(struct font
*fn
, char *id
);
54 struct glyph
*font_find(struct font
*fn
, char *name
);
56 /* output functions */
57 void out(char *s
, ...);
61 void outrel(int h
, int v
);
65 extern char o_fonts
[];
67 void drawbeg(char *s
);
68 void drawend(char *s
);
69 void drawl(int h
, int v
);
71 void drawe(int h
, int v
);
72 void drawa(int h1
, int v1
, int h2
, int v2
);
73 void draws(int h1
, int v1
, int h2
, int v2
);
75 /* postscript functions */
77 void ps_trailer(int pages
, char *fonts
);
78 void ps_pagebeg(int n
);
79 void ps_pageend(int n
);