|
|
1.1 root 1: /*
2: *
3: * DEVNAME should be the name of a device whose font files accurately describe
4: * what's available on the target printer. It's a string that's combined with
5: * "/usr/lib/font/dev" to locate the final font directory. It can be changed
6: * using the -T option, but you may end up getting garbage - the character code
7: * field must agree with PostScript's character encoding scheme for each font and
8: * troff's one or two character font names must be mapped into the appropriate
9: * PostScript font names (typically in the prologue)
10: *
11: *
12: */
13:
14: #define DEVNAME "post" /* name of the target printer */
15:
16: /*
17: *
18: * SLOP controls how much horizontal positioning error we'll accept and primarily
19: * helps when we're emulating another device. It's used when we output characters
20: * in oput() to check if troff and the printer have gotten too far out of sync.
21: * Given in units of points and can be changed using the -S option. Converted to
22: * machine units in t_init() after the resolution is known.
23: *
24: */
25:
26: #define SLOP .2 /* horizontal error - in points */
27:
28: /*
29: *
30: * Several different text line encoding schemes are supported. Print time should
31: * decrease as the value assigned to encoding (in dpost.c) increases, although the
32: * only encoding that's well tested is the lowest level one, which produces output
33: * essentially identical to the original version of dpost. Setting DFLTENCODING to
34: * 0 will give you the most stable (but slowest) encoding. The encoding scheme can
35: * also be set on the command line using the -e option. Faster methods are based
36: * on widthshow and may not place words exactly where troff wanted, but errors will
37: * usually not be noticeable.
38: *
39: */
40:
41: #define MAXENCODING 3
42:
43: #ifndef DFLTENCODING
44: #define DFLTENCODING 2
45: #endif
46:
47: /*
48: *
49: * The encoding scheme controls how lines of text are output. In the lower level
50: * schemes words and horizontal positions are put on the stack as they're read and
51: * when they're printed it's done in reverse order - the first string printed is
52: * the one on top of the stack and it's the last one on the line. Faster methods
53: * may be forced to reverse the order of strings on the stack, making the top one
54: * the first string on the line. STRINGSPACE sets the size of a character array
55: * that's used to save the strings that make up a line of text so they can be
56: * output in reverse order or perhaps combined in groups for widthshow.
57: *
58: * MAXSTACK controls how far we let PostScript's operand stack grow and determines
59: * the number of strings we'll save before printing all or part of a line of text.
60: * The internal limit in PostScript printers built by Adobe is 500, so MAXSTACK
61: * should never be bigger than about 240!
62: *
63: * Line is a structure used to keep track of the words (or rather strings) on the
64: * current line that have been read but not printed. dx is the width troff wants
65: * to use for a space in the current string. start is where the string began, width
66: * is the total width of the string, and spaces is the number of space characters
67: * in the current string. *str points to the start of the string in the strings[]
68: * array. The Line structure is only used in the higher level encoding schemes.
69: *
70: */
71:
72: #define MAXSTACK 50 /* most strings we'll save at once */
73: #define STRINGSPACE 2000 /* bytes available for string storage */
74:
75: typedef struct {
76: char *str; /* where the string is stored */
77: int dx; /* width of a space */
78: int spaces; /* number of space characters */
79: int start; /* horizontal starting position */
80: int width; /* and its total width */
81: } Line;
82:
83: /*
84: *
85: * Simple stuff used to map unrecognized font names into something reasonable. The
86: * mapping array is initialized using FONTMAP and used in loadfont() whenever the
87: * job tries to use a font that we don't recognize. Normally only needed when we're
88: * emulating another device.
89: *
90: */
91:
92: typedef struct {
93: char *name; /* font name we're looking for */
94: char *use; /* and this is what we should use */
95: } Fontmap;
96:
97: #define FONTMAP \
98: \
99: { \
100: "G", "H", \
101: "LO", "S", \
102: "S2", "S", \
103: "GI", "HI", \
104: "HM", "H", \
105: "HK", "H", \
106: "HL", "H", \
107: "PA", "R", \
108: "PI", "I", \
109: "PB", "B", \
110: "PX", "BI", \
111: NULL, NULL, \
112: }
113:
114: /*
115: *
116: * Non-integer valued functions.
117: *
118: */
119:
120: extern char *mapfont();
121:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.