displaying Sinclair Basic in Unicode environments: the ZX82 System font
what’s this then?
This project is an attempt to make it possible to represent Sinclair Basic, the programming language of the 1982 Sinclair ZX Spectrum home computer, on modern day operating systems. To achieve this, I’ve developed a TrueType font that contains all the characters of the Spectrum characterset.
who needs this actually?
Erm, not a lot of people I guess! However, on forums – like on the World of Spectrum website – there are postings with Basic listings. This font can be used to represent those listings accurately, for instance.
What’s so special about this - a font is a font, right?
There are already a number of downloadable fonts out there that are based on the Spectrum characterset, but none of these can represent Sinclair Basic 100% accurately. The problem lies mainly in the Block Graphic characters and the characters for User Defined Graphics. The first 127 positions in the ZX Spectrum characterset are ascii compatible (mostly), but the remaining positions 128-255 are occupied by non-standard characters. The ZX82 System font incorporates all the non-standard characters and they are given unique Unicode values: 0xf100 to 0xf17f.
100 REM ########################
120 REM example listing
130 REM ########################
140 REM
150 REM * block graphics *
160 PRINT " ▝ ▘ ▀ ▗ ▐ ▚ ▜ ▖ ▞ ▌ ▛ ▄ ▟ ▙ █"
170 REM
180 REM * UDGs *
190 PRINT " "
200 REM
210 REM * keywords *
220 PRINT " "
why not put these non-standard characters on positions 128-255 of a normal font?
Because there is no such thing as a ‘normal font’. There are not only differences in layouts between Macintosh and Windows fonts, but also between western european and eastern european keyboard layouts. And then I’m not talking about other platforms like Linux, or the plethoria of other keyboard layouts used on this planet.
so, how can I use the font?
Just download the ZX82 System v1.1 TrueType font and install it the font folder of your system. If everything has gone well you will see ‘ZX82 System’ in the font menus of your applications. Then view this page again and check whether in the example above the text looks similar to the image.
can you show me a table with all the non-standard glyphs and their respective unicode values?
Sure! Here is the full characterset overview:
unicode | chr$ | character |
---|---|---|
0x0020 | 32 | |
0x0021 | 33 | ! |
0x0022 | 34 | " |
0x0023 | 35 | # |
0x0024 | 36 | $ |
0x0025 | 37 | % |
0x0026 | 38 | & |
0x0027 | 39 | ' |
0x0028 | 40 | ( |
0x0029 | 41 | ) |
0x002a | 42 | * |
0x002b | 43 | + |
0x002c | 44 | , |
0x002d | 45 | - |
0x002e | 46 | . |
0x002f | 47 | / |
0x0030 | 48 | 0 |
0x0031 | 49 | 1 |
0x0032 | 50 | 2 |
0x0033 | 51 | 3 |
0x0034 | 52 | 4 |
0x0035 | 53 | 5 |
0x0036 | 54 | 6 |
0x0037 | 55 | 7 |
0x0038 | 56 | 8 |
0x0039 | 57 | 9 |
0x003a | 58 | : |
0x003b | 59 | ; |
0x003c | 60 | < |
0x003d | 61 | = |
0x003e | 62 | > |
0x003f | 63 | ? |
0x0040 | 64 | @ |
0x0041 | 65 | A |
0x0042 | 66 | B |
0x0043 | 67 | C |
0x0044 | 68 | D |
0x0045 | 69 | E |
0x0046 | 70 | F |
0x0047 | 71 | G |
0x0048 | 72 | H |
0x0049 | 73 | I |
0x004a | 74 | J |
0x004b | 75 | K |
0x004c | 76 | L |
0x004d | 77 | M |
0x004e | 78 | N |
0x004f | 79 | O |
0x0050 | 80 | P |
0x0051 | 81 | Q |
0x0052 | 82 | R |
0x0053 | 83 | S |
0x0054 | 84 | T |
0x0055 | 85 | U |
0x0056 | 86 | V |
0x0057 | 87 | W |
0x0058 | 88 | X |
0x0059 | 89 | Y |
0x005a | 90 | Z |
0x005b | 91 | [ |
0x005c | 92 | \ |
0x005d | 93 | ] |
0x005e | 94 | ^ |
0x005f | 95 | _ |
0x00a3 | 96 | £ |
0x0061 | 97 | a |
0x0062 | 98 | b |
0x0063 | 99 | c |
0x0064 | 100 | d |
0x0065 | 101 | e |
0x0066 | 102 | f |
0x0067 | 103 | g |
0x0068 | 104 | h |
0x0069 | 105 | i |
0x006a | 106 | j |
0x006b | 107 | k |
0x006c | 108 | l |
0x006d | 109 | m |
0x006e | 110 | n |
0x006f | 111 | o |
0x0070 | 112 | p |
0x0071 | 113 | q |
0x0072 | 114 | r |
0x0073 | 115 | s |
0x0074 | 116 | t |
0x0075 | 117 | u |
0x0076 | 118 | v |
0x0077 | 119 | w |
0x0078 | 120 | x |
0x0079 | 121 | y |
0x007a | 122 | z |
0x007b | 123 | { |
0x007c | 124 | | |
0x007d | 125 | } |
0x007e | 126 | ~ |
0x00a9 | 127 | © |
0x00a0 | 128 | graph-8 |
0x259d | 129 | graph-1 |
0x2598 | 130 | graph-2 |
0x2580 | 131 | graph-3 |
0x2597 | 132 | graph-4 |
0x2590 | 133 | graph-5 |
0x259a | 134 | graph-6 |
0x259c | 135 | graph-7 |
0x2596 | 136 | graph-shift-7 |
0x259e | 137 | graph-shift-6 |
0x258c | 138 | graph-shift-5 |
0x259b | 139 | graph-shift-4 |
0x2584 | 140 | graph-shift-3 |
0x259f | 141 | graph-shift-2 |
0x2599 | 142 | graph-shift-1 |
0x2588 | 143 | graph-shift-8 |
0xf110 | 144 | graph-a |
0xf111 | 145 | graph-b |
0xf112 | 146 | graph-c |
0xf113 | 147 | graph-d |
0xf114 | 148 | graph-e |
0xf115 | 149 | graph-f |
0xf116 | 150 | graph-g |
0xf117 | 151 | graph-h |
0xf118 | 152 | graph-i |
0xf119 | 153 | graph-j |
0xf11a | 154 | graph-k |
0xf11b | 155 | graph-l |
0xf11c | 156 | graph-m |
0xf11d | 157 | graph-n |
0xf11e | 158 | graph-o |
0xf11f | 159 | graph-p |
0xf120 | 160 | graph-q |
0xf121 | 161 | graph-r |
0xf122 | 162 | graph-s |
0xf123 | 163 | graph-t |
0xf124 | 164 | graph-u |
0xf125 | 165 | RND |
0xf126 | 166 | INKEY$ |
0xf127 | 167 | PI |
0xf128 | 168 | FN |
0xf129 | 169 | POINT |
0xf12a | 170 | SCREEN$ |
0xf12b | 171 | ATTR |
0xf12c | 172 | AT |
0xf12d | 173 | TAB |
0xf12e | 174 | VAL$ |
0xf12f | 175 | CODE |
0xf130 | 176 | VAL |
0xf131 | 177 | LEN |
0xf132 | 178 | SIN |
0xf133 | 179 | COS |
0xf134 | 180 | TAN |
0xf135 | 181 | ASN |
0xf136 | 182 | ACS |
0xf137 | 183 | ATN |
0xf138 | 184 | LN |
0xf139 | 185 | EXP |
0xf13a | 186 | INT |
0xf13b | 187 | SQR |
0xf13c | 188 | SGN |
0xf13d | 189 | ABS |
0xf13e | 190 | PEEK |
0xf13f | 191 | IN |
0xf140 | 192 | USR |
0xf141 | 193 | STR$ |
0xf142 | 194 | CHR$ |
0xf143 | 195 | NOT |
0xf144 | 196 | BIN |
0xf145 | 197 | OR |
0xf146 | 198 | AND |
0xf147 | 199 | <= |
0xf148 | 200 | >= |
0xf149 | 201 | <> |
0xf14a | 202 | LINE |
0xf14b | 203 | THEN |
0xf14c | 204 | TO |
0xf14d | 205 | STEP |
0xf14e | 206 | DEFFN |
0xf14f | 207 | CAT |
0xf150 | 208 | FORMAT |
0xf151 | 209 | MOVE |
0xf152 | 210 | ERASE |
0xf153 | 211 | OPEN# |
0xf154 | 212 | CLOSE# |
0xf155 | 213 | MERGE |
0xf156 | 214 | VERIFY |
0xf157 | 215 | BEEP |
0xf158 | 216 | CIRCLE |
0xf159 | 217 | INK |
0xf15a | 218 | PAPER |
0xf15b | 219 | FLASH |
0xf15c | 220 | BRIGHT |
0xf15d | 221 | INVERSE |
0xf15e | 222 | OVER |
0xf15f | 223 | OUT |
0xf160 | 224 | LPRINT |
0xf161 | 225 | LLIST |
0xf162 | 226 | STOP |
0xf163 | 227 | READ |
0xf164 | 228 | DATA |
0xf165 | 229 | RESTORE |
0xf166 | 230 | NEW |
0xf167 | 231 | BORDER |
0xf168 | 232 | CONTINUE |
0xf169 | 233 | DIM |
0xf16a | 234 | REM |
0xf16b | 235 | FOR |
0xf16c | 236 | GOTO |
0xf16d | 237 | GOSUB |
0xf16e | 238 | INPUT |
0xf16f | 239 | LOAD |
0xf170 | 240 | LIST |
0xf171 | 241 | LET |
0xf172 | 242 | PAUSE |
0xf173 | 243 | NEXT |
0xf174 | 244 | POKE |
0xf175 | 245 | |
0xf176 | 246 | PLOT |
0xf177 | 247 | RUN |
0xf178 | 248 | SAVE |
0xf179 | 249 | RANDOMIZE |
0xf17a | 250 | IF |
0xf17b | 251 | CLS |
0xf17c | 252 | DRAW |
0xf17d | 253 | CLEAR |
0xf17e | 254 | RETURN |
0xf17f | 255 | COPY |
what has changed in the last version?
The Unicode values for the Block Graphics have changed. Matt Westcott pointed out that the Unicode range 0x2580–0x259F is the proper place for these characters. Cheers!