| 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 | /** charset7.h HP-GL character set 7, Roman Extensions |
| 26 | ** MK February 1999 |
| 27 | **/ |
| 28 | /** |
| 29 | ** This file defines the HP Roman8 character set(#7) 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 *charset7[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 | "\024\231\252\312\331\324\026\326\055\312", /* A grave */ |
| 104 | "\024\231\252\312\331\324\026\326\032\274\332", /* A circumflex */ |
| 105 | "\124\224\232\332\027\307\055\312", /*E grave */ |
| 106 | "\124\224\232\332\027\307\032\274\332", /* E circumflex */ |
| 107 | "\124\224\232\332\027\307\054\253\114\313", /* E diaresis */ |
| 108 | "\024\324\064\272\032\332\032\274\332", /* I circumflex */ |
| 109 | "\024\324\064\272\032\332\054\253\114\313", /* I diaresis */ |
| 110 | "\052\315", /* acute */ |
| 111 | "\055\312", /* grave */ |
| 112 | "\032\274\332", /* circumflex */ |
| 113 | "\054\253\114\313", /*diaresis */ |
| 114 | "\032\253\311\332", /*tilde */ |
| 115 | "\032\225\244\304\325\332\055\312", /*U grave */ |
| 116 | "\032\225\244\304\325\332\033\275\333", /*U circumflex */ |
| 117 | "\131\332\312\270\265\244\224\225\246\304\325\050\310\047\307", /*poundsign */ |
| 118 | |
| 119 | /* 0x30 ... 0x3f */ |
| 120 | "\033\333", /*overbar */ |
| 121 | "\032\231\266\264\066\331\332\052\315", /*Y acute */ |
| 122 | "\022\326\330\030\226\264\052\315", /*y acute */ |
| 123 | "\050\251\272\311\310\267\250", /* degree sign */ |
| 124 | "\125\304\244\225\231\252\312\331\064\243", /*C cedilla */ |
| 125 | "\125\304\264\245\247\270\310\327\064\243", /* c cedilla */ |
| 126 | "\024\232\324\332\033\254\312\333", /* N tilde */ |
| 127 | "\024\230\027\250\270\307\304\032\253\311\332", /* n tilde */ |
| 128 | "\072\271\070\264", /*upsidedown exclam */ |
| 129 | "\072\271\070\267\247\226\225\244\304\325", /*upsidedown questionmark */ |
| 130 | "\045\226\230\251\311\330\326\305\245\032\251\132\311\024\245\124\305", /* box O */ |
| 131 | "\131\332\312\270\265\244\224\225\246\304\325\050\310", /*singlebar poundsign */ |
| 132 | "\032\270\264\070\332\050\310\047\307", /* yensign */ |
| 133 | "\111\272\251\250\270\307\306\304\263\243\244\105\265\246\250", /* paragraph */ |
| 134 | "\131\332\312\270\265\244\224\225\050\310", /* franc sign */ |
| 135 | "\125\304\264\245\247\270\310\327\063\271", /* cent sign */ |
| 136 | |
| 137 | /* 0x40 ... 0x4f */ |
| 138 | "\124\244\225\227\250\310\304\051\272\311", /* a circumflex */ |
| 139 | "\026\306\327\310\250\227\225\244\324\051\272\311", /* e circumflex */ |
| 140 | "\044\225\227\250\270\307\305\264\244\051\272\311", /* o circumflex */ |
| 141 | "\030\225\244\304\310\051\272\311", /* u circumflex */ |
| 142 | "\124\244\225\227\250\310\304\051\313", /* a acute */ |
| 143 | "\026\306\327\310\250\227\225\244\324\051\313", /* e acute */ |
| 144 | "\044\225\227\250\270\307\305\264\244\051\313", /* o acute */ |
| 145 | "\030\225\244\304\310\051\313", /* u acute */ |
| 146 | "\124\244\225\227\250\310\304\053\311", /* a grave */ |
| 147 | "\026\306\327\310\250\227\225\244\324\053\311", /* e grave */ |
| 148 | "\044\225\227\250\270\307\305\264\244\053\311", /* o grave */ |
| 149 | "\030\225\244\304\310\053\311", /* u grave */ |
| 150 | "\124\244\225\227\250\310\304\052\251\112\311", /* a diaresis */ |
| 151 | "\026\306\327\310\250\227\225\244\324\052\251\112\311", /* e diaresis */ |
| 152 | "\044\225\227\250\270\307\305\264\244\052\251\112\311", /* o diaresis */ |
| 153 | "\030\225\244\304\310\052\251\112\311", /* u diaresis */ |
| 154 | |
| 155 | /* 0x50 ... 0x5f */ |
| 156 | "\024\231\252\312\331\324\026\326\072\253\274\313\272", /* A ring */ |
| 157 | "\050\270\264\044\304\051\272\311", /* i circumflex */ |
| 158 | "\025\244\304\325\331\312\252\231\225\331", /* slashed zero */ |
| 159 | "\132\272\264\324\127\247\072\224", /* AE ligature */ |
| 160 | "\124\244\225\227\250\310\304\70\251\272\311\270", /* a ring */ |
| 161 | "\050\270\264\044\304\051\313", /* i acute */ |
| 162 | "\044\225\227\250\270\307\305\264\244\024\310", /* o slash */ |
| 163 | "\125\304\265\267\310\327\306\246\225\244\265\067\250\227", /* ae ligature */ |
| 164 | "\024\231\252\312\331\324\026\326\054\253\114\313", /* A diaresis */ |
| 165 | "\050\270\264\044\304\053\311", /* i grave */ |
| 166 | "\044\225\231\252\312\331\325\304\244\054\253\114\313", /* O diaresis */ |
| 167 | "\032\225\244\304\325\332\054\253\114\313", /* U diaresis */ |
| 168 | "\124\224\232\332\027\307\052\315", /* E acute */ |
| 169 | "\050\270\264\044\304\052\251\112\311", /* i diaresis */ |
| 170 | "\044\251\272\311\310\267\306\304\264\245", /* sharp s */ |
| 171 | "\044\225\231\252\312\331\325\304\244\033\275\333", /* O circumflex */ |
| 172 | |
| 173 | /* 0x60 ... 0x6f */ |
| 174 | "\024\231\252\312\331\324\026\326\052\315", /* A acute */ |
| 175 | "\024\231\252\312\331\324\026\326\033\254\312\333", /* A tilde */ |
| 176 | "\124\244\225\227\250\310\304\033\254\312\333", /* a tilde */ |
| 177 | "\024\232\312\331\325\304\224\027\267", /* Eth */ |
| 178 | "\044\225\226\247\307\326\325\304\244\032\307\030\272", /* eth */ |
| 179 | "\024\324\064\272\032\332\052\315", /* I acute */ |
| 180 | "\024\324\064\272\032\332\055\312", /* I grave */ |
| 181 | "\044\225\231\252\312\331\325\304\244\052\315", /* O acute */ |
| 182 | "\044\225\231\252\312\331\325\304\244\055\312", /* O grave */ |
| 183 | "\044\225\231\252\312\331\325\304\244\033\254\312\333", /* O tilde */ |
| 184 | "\044\225\227\250\270\307\305\264\244\032\253\311\332", /* o tilde */ |
| 185 | "\025\244\304\325\326\307\247\230\231\252\312\331\034\272\334", /* czech S */ |
| 186 | "\110\250\227\246\266\305\264\224\052\270\312", /* czech s */ |
| 187 | "\032\225\244\304\325\332\052\315", /* U acute */ |
| 188 | "\032\231\266\264\066\331\332\054\253\114\313", /* Y diaresis */ |
| 189 | "\022\326\330\030\226\264\052\251\112\311", /* y diaresis */ |
| 190 | |
| 191 | |
| 192 | |
| 193 | /* 0x70 ... 0x7f */ |
| 194 | "\024\264\044\252\032\272\046\306\327\310\250", /* Thorn */ |
| 195 | "\024\264\044\252\032\272\045\306\310\271\251", /* thorn */ |
| 196 | "\067\267", /*centered dot */ |
| 197 | "\024\250\246\265\306\310\106\325", /* mu */ |
| 198 | "\064\272\104\312\252\231\250\270", /* section */ |
| 199 | "\052\272\271\270\250\051\271\047\307\066\245\305\066\264", /* three quarters */ |
| 200 | "\047\307", /* dash */ |
| 201 | "\051\272\270\047\307\066\245\305\066\264", /* one quarter */ |
| 202 | "\051\272\270\047\307\046\266\265\244\264", /* one half */ |
| 203 | "\052\312\310\250\251\311\047\307", /* _a */ |
| 204 | "\051\272\311\270\251\047\307", /* _o */ |
| 205 | "\071\227\265\131\267\325", /* much less than */ |
| 206 | "\045\250\330\325\245", /* square */ |
| 207 | "\031\267\225\071\327\265", /* much greater than */ |
| 208 | "\065\271\027\327\025\325", /* plusminus */ |
| 209 | "" |
| 210 | }; |