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