*** empty log message ***
[h316.git] / pc-tools / fontgen / src / charset6.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 ** charset6.h HP-GL character set 6, JIS ASCII
27 ** According to the 1987 HP Draftmaster manual, this is identical to
28 ** charset0 except for the yen sign instead of the backslash in
29 ** position 92. MK February 1999
30 **/
31
32 /**
33 ** This file defines a standard character set by elementary
34 ** "draw" & "move" commands. The format is a very compact one from
35 ** the old days where every byte was still appreciated.
36 **
37 ** A font or character set is an array of strings. Each character
38 ** corresponds to one of these strings, which is addressed by its ASCII code.
39 **
40 ** A character is a (NULL-terminated) string of bytes. Each byte
41 ** codes for a draw or move action according to the code below:
42 **
43 ** Bit: 7 6 5 4 3 2 1 0
44 ** p x x x y y y y
45 **
46 ** p: Plot flag. If set, "draw to" new point, else "move to" it.
47 ** xxx: 3-bit unsigned integer (0...7). X coordinate of new point.
48 ** yyyy: 4-bit unsigned integer (0..15). Y coordinate of new point.
49 **
50 ** The baseline is y = 4 instead of y = 0, so characters with parts
51 ** below it can be drawn properly without a need for sign bits.
52 ** Function "code_to_ucoord()" transforms these coordinates into
53 ** actual user coordinates.
54 **
55 ** Example: code for character 'L': "\032\224\324" translates to:
56 ** moveto(1,10); drawto(1,4); drawto(5,4);
57 **
58 ** From the example you can conclude that the font below essentially is
59 ** defined on a 5x7 grid:
60 **
61 ** 0 1 2 3 4 5 6 7
62 ** 15 . . . . . . . . . : unused
63 ** 14 . . . . . . . . * : always used
64 ** 13 . . . . . . . . o : sometimes used
65 ** 12 . . . . . . . .
66 ** 11 . . . . . . . .
67 ** 10 o * * * * * . .
68 ** 9 o * * * * * . .
69 ** 8 o * * * * * . .
70 ** 7 o * * * * * . .
71 ** 6 o * * * * * . .
72 ** 5 o * * * * * . .
73 ** 4 o * * * * * . .
74 ** 3 o o o o o o . .
75 ** 2 o o o o o o . .
76 ** 1 o o o o o o . .
77 ** 0 o o o o o o . .
78 **/
79
80
81 /**
82 ** The following array of strings contains the basic character set (set 0).
83 **
84 ** NOTE: A nice way to add a new charset would be, e. g., to introduce a
85 ** ``charset1[]'' as the "alternate" charset and implement the HP-GL
86 ** commands needed for switching from one to the other.
87 **/
88
89 char *charset6[128] = {
90 /* 0x00 ... 0x1f */
91
92 /**
93 ** Some control codes are valid in HPGL. These are handled elsewhere
94 ** in a font-independent manner, so following codes are dummies:
95 **/
96 "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
97 "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
98
99 /**
100 ** Unfortunately, some compilers do not process \xNN properly,
101 ** so I changed all hex codes (\xNN) into octal codes (\NNN),
102 ** thereby losing readability but gaining portability.
103 **/
104
105 /* 0x20 ... 0x2f */
106 "",
107 "\064\265\066\272",
108 "\051\252\111\312",
109 "\044\252\104\312\026\326\030\330",
110 "\064\272\131\251\230\247\307\326\305\225",
111 "\024\332\051\250\270\271\251\066\265\305\306\266",
112 "\124\230\231\252\271\270\226\225\244\264\326",
113 "\071\312",
114 "\132\270\266\324",
115 "\024\266\270\232",
116 "\005\351\145\211\072\264",
117 "\065\271\027\327",
118 "\064\244\245\265\263\242",
119 "\027\327",
120 "\064\244\245\265\264",
121 "\352",
122
123 /* 0x30 ... 0x3f */
124 /*
125 "\025\244\304\325\331\312\252\231\225\331", ** Zero including `/' **
126 */
127 "\025\244\304\325\331\312\252\231\225",
128 "\044\304\064\272\251",
129 "\031\252\312\331\330\225\224\324",
130 "\025\244\304\325\326\307\267\332\232",
131 "\112\227\226\326\107\304",
132 "\132\232\230\310\327\325\304\244\225",
133 "\132\272\230\225\244\304\325\326\307\227",
134 "\032\332\331\226\224",
135 "\107\330\331\312\252\231\230\247\307\326\325\304\244\225\226\247",
136 "\044\264\326\331\312\252\231\230\247\327",
137 "\047\250\270\267\247\045\265\264\244\245",
138 "\046\247\267\266\246\064\244\245\265\263\242",
139 "\112\227\304",
140 "\030\330\026\326",
141 "\032\307\224",
142 "\031\252\312\331\330\307\267\266\065\264",
143
144 /* 0x40 ... 0x4f */
145 "\103\243\224\230\252\312\331\326\305\266\267\310\330",
146 "\024\231\252\312\331\324\026\326",
147 "\024\232\312\331\330\307\227\024\304\325\326\307",
148 "\125\304\244\225\231\252\312\331",
149 "\024\232\312\331\325\304\224",
150 "\124\224\232\332\027\307",
151 "\024\232\332\027\307",
152 "\131\312\252\231\225\244\304\325\327\247",
153 "\024\232\124\332\027\327",
154 "\024\324\064\272\032\332",
155 "\025\244\304\325\332\232",
156 "\024\232\027\247\324\047\332",
157 "\032\224\324",
158 "\024\232\270\332\324",
159 "\024\232\324\332",
160 "\044\225\231\252\312\331\325\304\244",
161
162 /* 0x50 ... 0x5f */
163 "\024\232\312\331\330\307\227",
164 "\044\225\231\252\312\331\326\264\244\066\324",
165 "\024\232\312\331\330\307\227\247\324",
166 "\025\244\304\325\326\307\247\230\231\252\312\331",
167 "\064\272\232\332",
168 "\032\225\244\304\325\332",
169 "\032\230\264\330\332",
170 "\032\224\267\324\332",
171 "\024\332\124\232",
172 "\032\231\266\264\066\331\332",
173 "\032\332\224\324",
174 "\124\264\272\332",
175 "\032\270\264\070\332\050\310\047\307", /* yen sign */
176 "\024\264\272\232",
177 "\030\272\330",
178 "\023\323",
179
180 /* 0x60 ... 0x6f */
181 "\053\310",
182 "\124\244\225\227\250\310\304",
183 "\024\304\325\327\310\250\052\244",
184 "\125\304\264\245\247\270\310\327",
185 "\112\304\244\225\227\250\310\104\324",
186 "\026\306\327\310\250\227\225\244\324",
187 "\064\271\312\332\047\307",
188 "\022\262\303\310\250\227\225\244\304",
189 "\032\224\030\270\307\304",
190 "\072\271\050\270\264\044\304",
191 "\072\271\050\270\263\242\222",
192 "\024\232\104\226\310",
193 "\052\272\264\044\304",
194 "\024\230\027\250\267\264\067\310\327\324",
195 "\024\230\027\250\270\307\304",
196 "\044\225\227\250\270\307\305\264\244",
197
198 /* 0x70 ... 0x7f */
199 "\022\230\270\307\305\264\224",
200 "\104\244\225\227\250\310\302",
201 "\030\224\026\270\310",
202 "\110\250\227\246\266\305\264\224",
203 "\052\244\304\030\310",
204 "\030\225\244\304\310",
205 "\030\226\264\326\330",
206 "\030\225\244\265\267\065\304\325\330",
207 "\030\324\024\330",
208 "\022\326\330\030\226\264",
209 "\030\310\224\304",
210 "\113\273\252\250\227\246\244\263\303",
211 "\073\263",
212 "\053\273\312\310\327\306\304\263\243",
213 "\031\252\310\331",
214 ""
215 };