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.

the non-standard characters of the ZX Spectrum

example of ZX82 System font

if you have succesfully installed the font, the text below will look similar to the image above

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:

unicodechr$character
0x002032
0x002133!
0x002234"
0x002335#
0x002436$
0x002537%
0x002638&
0x002739'
0x002840(
0x002941)
0x002a42*
0x002b43+
0x002c44,
0x002d45-
0x002e46.
0x002f47/
0x0030480
0x0031491
0x0032502
0x0033513
0x0034524
0x0035535
0x0036546
0x0037557
0x0038568
0x0039579
0x003a58:
0x003b59;
0x003c60<
0x003d61=
0x003e62>
0x003f63?
0x004064@
0x004165A
0x004266B
0x004367C
0x004468D
0x004569E
0x004670F
0x004771G
0x004872H
0x004973I
0x004a74J
0x004b75K
0x004c76L
0x004d77M
0x004e78N
0x004f79O
0x005080P
0x005181Q
0x005282R
0x005383S
0x005484T
0x005585U
0x005686V
0x005787W
0x005888X
0x005989Y
0x005a90Z
0x005b91[
0x005c92\
0x005d93]
0x005e94^
0x005f95_
0x00a396£
0x006197a
0x006298b
0x006399c
0x0064100d
0x0065101e
0x0066102f
0x0067103g
0x0068104h
0x0069105i
0x006a106j
0x006b107k
0x006c108l
0x006d109m
0x006e110n
0x006f111o
0x0070112p
0x0071113q
0x0072114r
0x0073115s
0x0074116t
0x0075117u
0x0076118v
0x0077119w
0x0078120x
0x0079121y
0x007a122z
0x007b123{
0x007c124|
0x007d125}
0x007e126~
0x00a9127©
0x00a0128graph-8
0x259d129graph-1
0x2598130graph-2
0x2580131graph-3
0x2597132graph-4
0x2590133graph-5
0x259a134graph-6
0x259c135graph-7
0x2596136graph-shift-7
0x259e137graph-shift-6
0x258c138graph-shift-5
0x259b139graph-shift-4
0x2584140graph-shift-3
0x259f141graph-shift-2
0x2599142graph-shift-1
0x2588143graph-shift-8
0xf110144graph-a
0xf111145graph-b
0xf112146graph-c
0xf113147graph-d
0xf114148graph-e
0xf115149graph-f
0xf116150graph-g
0xf117151graph-h
0xf118152graph-i
0xf119153graph-j
0xf11a154graph-k
0xf11b155graph-l
0xf11c156graph-m
0xf11d157graph-n
0xf11e158graph-o
0xf11f159graph-p
0xf120160graph-q
0xf121161graph-r
0xf122162graph-s
0xf123163graph-t
0xf124164graph-u
0xf125165RND
0xf126166INKEY$
0xf127167PI
0xf128168FN
0xf129169POINT
0xf12a170SCREEN$
0xf12b171ATTR
0xf12c172AT
0xf12d173TAB
0xf12e174VAL$
0xf12f175CODE
0xf130176VAL
0xf131177LEN
0xf132178SIN
0xf133179COS
0xf134180TAN
0xf135181ASN
0xf136182ACS
0xf137183ATN
0xf138184LN
0xf139185EXP
0xf13a186INT
0xf13b187SQR
0xf13c188SGN
0xf13d189ABS
0xf13e190PEEK
0xf13f191IN
0xf140192USR
0xf141193STR$
0xf142194CHR$
0xf143195NOT
0xf144196BIN
0xf145197OR
0xf146198AND
0xf147199<=
0xf148200>=
0xf149201<>
0xf14a202LINE
0xf14b203THEN
0xf14c204TO
0xf14d205STEP
0xf14e206DEFFN
0xf14f207CAT
0xf150208FORMAT
0xf151209MOVE
0xf152210ERASE
0xf153211OPEN#
0xf154212CLOSE#
0xf155213MERGE
0xf156214VERIFY
0xf157215BEEP
0xf158216CIRCLE
0xf159217INK
0xf15a218PAPER
0xf15b219FLASH
0xf15c220BRIGHT
0xf15d221INVERSE
0xf15e222OVER
0xf15f223OUT
0xf160224LPRINT
0xf161225LLIST
0xf162226STOP
0xf163227READ
0xf164228DATA
0xf165229RESTORE
0xf166230NEW
0xf167231BORDER
0xf168232CONTINUE
0xf169233DIM
0xf16a234REM
0xf16b235FOR
0xf16c236GOTO
0xf16d237GOSUB
0xf16e238INPUT
0xf16f239LOAD
0xf170240LIST
0xf171241LET
0xf172242PAUSE
0xf173243NEXT
0xf174244POKE
0xf175245PRINT
0xf176246PLOT
0xf177247RUN
0xf178248SAVE
0xf179249RANDOMIZE
0xf17a250IF
0xf17b251CLS
0xf17c252DRAW
0xf17d253CLEAR
0xf17e254RETURN
0xf17f255COPY

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!