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