*** empty log message ***
[h316.git] / pc-tools / fontgen / src / charset1.h
1 /*
2 Copyright (c) 1992 - 1994 Heinz W. Werntges. All rights reserved.
3 Parts Copyright (c) 1999 Martin Kroeker All rights reserved.
4
5 Distributed by Free Software Foundation, Inc.
6
7 This file is part of HP2xx.
8
9 HP2xx is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
11 to anyone for the consequences of using it or for whether it serves any
12 particular purpose or works at all, unless he says so in writing. Refer
13 to the GNU General Public License, Version 2 or later, for full details.
14
15 Everyone is granted permission to copy, modify and redistribute
16 HP2xx, but only under the conditions described in the GNU General Public
17 License. A copy of this license is supposed to have been
18 given to you along with HP2xx so you can know your rights and
19 responsibilities. It should be in a file named COPYING. Among other
20 things, the copyright notice and this notice must be preserved on all
21 copies.
22
23 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
24 */
25 /**
26 ** charset1.h HP-GL character set 1, 9825 character set
27 ** According to the 1987 HP Draftmaster manual, this is identical to
28 ** charset0 except for the root sign instead of the backslash in
29 ** position 92,the uparrow instead of the hat accent in 94, pi, vdash
30 ** and rightarrow (123-125) instead of curly braces and vline.
31 ** Characters 95,96 and 126 should backspace (but do not).
32 ** MK February 1999
33 **/
34
35
36 /**
37 ** This file defines a standard character set by elementary
38 ** "draw" & "move" commands. The format is a very compact one from
39 ** the old days where every byte was still appreciated.
40 **
41 ** A font or character set is an array of strings. Each character
42 ** corresponds to one of these strings, which is addressed by its ASCII code.
43 **
44 ** A character is a (NULL-terminated) string of bytes. Each byte
45 ** codes for a draw or move action according to the code below:
46 **
47 ** Bit: 7 6 5 4 3 2 1 0
48 ** p x x x y y y y
49 **
50 ** p: Plot flag. If set, "draw to" new point, else "move to" it.
51 ** xxx: 3-bit unsigned integer (0...7). X coordinate of new point.
52 ** yyyy: 4-bit unsigned integer (0..15). Y coordinate of new point.
53 **
54 ** The baseline is y = 4 instead of y = 0, so characters with parts
55 ** below it can be drawn properly without a need for sign bits.
56 ** Function "code_to_ucoord()" transforms these coordinates into
57 ** actual user coordinates.
58 **
59 ** Example: code for character 'L': "\032\224\324" translates to:
60 ** moveto(1,10); drawto(1,4); drawto(5,4);
61 **
62 ** From the example you can conclude that the font below essentially is
63 ** defined on a 5x7 grid:
64 **
65 ** 0 1 2 3 4 5 6 7
66 ** 15 . . . . . . . . . : unused
67 ** 14 . . . . . . . . * : always used
68 ** 13 . . . . . . . . o : sometimes used
69 ** 12 . . . . . . . .
70 ** 11 . . . . . . . .
71 ** 10 o * * * * * . .
72 ** 9 o * * * * * . .
73 ** 8 o * * * * * . .
74 ** 7 o * * * * * . .
75 ** 6 o * * * * * . .
76 ** 5 o * * * * * . .
77 ** 4 o * * * * * . .
78 ** 3 o o o o o o . .
79 ** 2 o o o o o o . .
80 ** 1 o o o o o o . .
81 ** 0 o o o o o o . .
82 **/
83
84
85 /**
86 ** The following array of strings contains the basic character set (set 0).
87 **
88 ** NOTE: A nice way to add a new charset would be, e. g., to introduce a
89 ** ``charset1[]'' as the "alternate" charset and implement the HP-GL
90 ** commands needed for switching from one to the other.
91 **/
92
93 char *charset1[128] = {
94 /* 0x00 ... 0x1f */
95
96 /**
97 ** Some control codes are valid in HPGL. These are handled elsewhere
98 ** in a font-independent manner, so following codes are dummies:
99 **/
100 "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
101 "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
102
103 /**
104 ** Unfortunately, some compilers do not process \xNN properly,
105 ** so I changed all hex codes (\xNN) into octal codes (\NNN),
106 ** thereby losing readability but gaining portability.
107 **/
108
109 /* 0x20 ... 0x2f */
110 "",
111 "\064\265\066\272",
112 "\051\252\111\312",
113 "\044\252\104\312\026\326\030\330",
114 "\064\272\131\251\230\247\307\326\305\225",
115 "\024\332\051\250\270\271\251\066\265\305\306\266",
116 "\124\230\231\252\271\270\226\225\244\264\326",
117 "\071\312",
118 "\132\270\266\324",
119 "\024\266\270\232",
120 "\005\351\145\211\072\264",
121 "\065\271\027\327",
122 "\064\244\245\265\263\242",
123 "\027\327",
124 "\064\244\245\265\264",
125 "\352",
126
127 /* 0x30 ... 0x3f */
128 /*
129 "\025\244\304\325\331\312\252\231\225\331", ** Zero including `/' **
130 */
131 "\025\244\304\325\331\312\252\231\225",
132 "\044\304\064\272\251",
133 "\031\252\312\331\330\225\224\324",
134 "\025\244\304\325\326\307\267\332\232",
135 "\112\227\226\326\107\304",
136 "\132\232\230\310\327\325\304\244\225",
137 "\132\272\230\225\244\304\325\326\307\227",
138 "\032\332\331\226\224",
139 "\107\330\331\312\252\231\230\247\307\326\325\304\244\225\226\247",
140 "\044\264\326\331\312\252\231\230\247\327",
141 "\047\250\270\267\247\045\265\264\244\245",
142 "\046\247\267\266\246\064\244\245\265\263\242",
143 "\112\227\304",
144 "\030\330\026\326",
145 "\032\307\224",
146 "\031\252\312\331\330\307\267\266\065\264",
147
148 /* 0x40 ... 0x4f */
149 "\103\243\224\230\252\312\331\326\305\266\267\310\330",
150 "\024\231\252\312\331\324\026\326",
151 "\024\232\312\331\330\307\227\024\304\325\326\307",
152 "\125\304\244\225\231\252\312\331",
153 "\024\232\312\331\325\304\224",
154 "\124\224\232\332\027\307",
155 "\024\232\332\027\307",
156 "\131\312\252\231\225\244\304\325\327\247",
157 "\024\232\124\332\027\327",
158 "\024\324\064\272\032\332",
159 "\025\244\304\325\332\232",
160 "\024\232\027\247\324\047\332",
161 "\032\224\324",
162 "\024\232\270\332\324",
163 "\024\232\324\332",
164 "\044\225\231\252\312\331\325\304\244",
165
166 /* 0x50 ... 0x5f */
167 "\024\232\312\331\330\307\227",
168 "\044\225\231\252\312\331\326\264\244\066\324",
169 "\024\232\312\331\330\307\227\247\324",
170 "\025\244\304\325\326\307\247\230\231\252\312\331",
171 "\064\272\232\332",
172 "\032\225\244\304\325\332",
173 "\032\230\264\330\332",
174 "\032\224\267\324\332",
175 "\024\332\124\232",
176 "\032\231\266\264\066\331\332",
177 "\032\332\224\324",
178 "\124\264\272\332",
179 "\026\246\264\311\331", /* root */
180 "\024\264\272\232",
181 "\072\264\030\272\330", /*uparrow */
182 "\023\323",
183
184 /* 0x60 ... 0x6f */
185 "\053\310",
186 "\124\244\225\227\250\310\304",
187 "\024\304\325\327\310\250\052\244",
188 "\125\304\264\245\247\270\310\327",
189 "\112\304\244\225\227\250\310\104\324",
190 "\026\306\327\310\250\227\225\244\324",
191 "\064\271\312\332\047\307",
192 "\022\262\303\310\250\227\225\244\304",
193 "\032\224\030\270\307\304",
194 "\072\271\050\270\264\044\304",
195 "\072\271\050\270\263\242\222",
196 "\024\232\104\226\310",
197 "\052\272\264\044\304",
198 "\024\230\027\250\267\264\067\310\327\324",
199 "\024\230\027\250\270\307\304",
200 "\044\225\227\250\270\307\305\264\244",
201
202 /* 0x70 ... 0x7f */
203 "\022\230\270\307\305\264\224",
204 "\104\244\225\227\250\310\302",
205 "\030\224\026\270\310",
206 "\110\250\227\246\266\305\264\224",
207 "\052\244\304\030\310",
208 "\030\225\244\304\310",
209 "\030\226\264\326\330",
210 "\030\225\244\265\267\065\304\325\330",
211 "\030\324\024\330",
212 "\022\326\330\030\226\264",
213 "\030\310\224\304",
214 "\033\254\312\333\044\247\104\307", /* pi */
215 "\073\263\027\327", /* vdash */
216 "\027\327\106\327\310", /* rightarrow */
217 "\031\252\310\331", /* (BS) tilde */
218 ""
219 };