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