Category Archives: computers suck

TwentyfourSixteen – a 17-segment alpha LCD font



Made in 2016 by Stewart C. Russell –

A mono-spaced font family derived from the HPDL-2416 17-segment alphanumeric 17 segment LED display matrix.

Design size: appx 19 pt

For maximum fidelity, should be displayed/printed red to match the original’s ~640 nm wavelength. This corresponds to RGB #ff2100


Regular only.

Note that this has a very slight skew (5°) built in.


ASCII only, upper case.


Stewart C. Russell –


Dual-licensed CC0/WTFPL (srsly)

All of the segments. I've stashed this glyph at character code U+007f so you can make up new ones.
All of the segments. I’ve stashed this glyph at character code U+007f so you can make up new ones.

also: — just 00-99 as PNG images, after this, made with Pango, like this:

for f in {00..99}
 pango-view --no-display --background=black --dpi=112 --align=right --foreground='#ff2100' --font='TwentyfourSixteen Regular 48' --hinting=full --output="$f.png" -t "$f"

Pen plotters: not just output devices …

Pen plotters were pretty expensive and complex pieces of electromechanical equipment. While they often earned their keep in the CAD office, they also had a function that’s almost forgotten: they could be used as input devices, too.

As a kid, we sometimes used to drive past the office of Ferranti-Cetec in Edinburgh. They specialized in digitizers: great big desk or wall mounted devices for capturing points from maps and drawings. Here’s one of their 1973 models:

Ferranti EP210 Freescan Digitiser. Source: Grace's Guide,
Ferranti EP210 Freescan Digitiser. Source: Grace’s Guide,

While the technology and size have changed a bit, these huge bits of engineering kit are the ancestors of today’s track pads and touch screens.

Realizing that their plotters had very precise X-Y indexing and that they had two-way communications to a computer, HP made a drafting sight that fitted in place of a pen on their plotters:

HP drafting sight, part no 09872-60066
HP drafting sight, part no 09872-60066

This is a very pleasing piece of kit, all metal, thick plastic and polished optical glass. They show up on eBay occasionally, and aren’t cheap. With a bit of coercion, it fits into my HP plotter like this:

Drafting sight in HP7470A plotter
Drafting sight in HP7470A plotter

The image is very bright and clear:

Drafting sight near an axis label
Drafting sight near an axis label
Drafting sight over a point
Drafting sight over a point, showing cursor dot

If one has a digitizing sight, one needs to find something to digitize post haste … I’m sure everyone can sense the urgency in that. So I found this, a scan from my undergraduate project writeup (centrifugal pump impeller design ftw, or something), which was probably made on an Amiga or Atari ST:

It's a graph, with pointy bits on it
It’s a graph, with pointy bits on it

I printed this as large as I could on Letter paper, as it’s the only size my HP7470A plotter can take. Now all it needed was a small matter of programming to get the data from the plotter. Here’s a minimally-useful digitizer for HP and compatible serial plotters. Although I ran it on my little HP grit wheel plotter attached to a Raspberry Pi, I developed it with my larger Roland plotter. The only fancy module it needs is pySerial.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# a really crap HP-GL point digitizer
#  scruss - 2016

from time import sleep
from string import strip
import serial

ser = serial.Serial(port='/dev/ttyUSB1', baudrate=9600, timeout=0.5)
lbl = ''
points = []
labels = []
k = 0
retval = 0

ser.write('DP;')                # put in digitizing mode
while lbl != 'quit':
    ret = strip(, chr(13))
    print ('Retval: ', ret)
    if ret != '':
        retval = int(ret)
    if retval & 4:              # bit 2 is set; we have a point!
        print ('Have Point! Retval: ', retval)
        retval = 0
        pt = strip(, chr(13))
        print ('OD point: ', pt)
        lbl = raw_input('Input label [quit to end]: ')
        k = k + 1
        ser.write('DP;')        # put in digitizing mode again

f = open('digit.dat', 'w')
for i in range(k):

In the unlikely event that anyone actually uses this, they’ll need to change the serial port details near the top of the program.

The program works like this:

  1. Move the drafting sight to the point you want to capture using the plotter’s cursor keys, and hit the plotter’s ENTER key
  2. Your computer will prompt you for a label. This can be anything except quit, that ends the program
  3. When you have digitized all the points you want and entered quit as the last label, the program writes the points to the file digit.dat

I didn’t implement any flow control or other buffer management, so it can crash in a variety of hilarious ways. I did manage to get it to work on the lower trace of that graph, and got these data:


The first two columns are X and Y, in HP-GL units — that’s 1/40 mm, or 1/1016 inches. The third column will always be 1 if you have the sight down. The last columns are the label; if you put commas in them, opening the file as CSV will split the label into columns. I used it to fudge axis points. You’ll also note that the last three lines of data are my valiant attempts to quit the program …

Assuming the axes are not skewed (they are, very slightly, but shhh) some simple linear interpolation gives you the results below:

 12.1    0.086
 15.1    0.093
 19.7    0.104
 24.7    0.114
 30.1    0.122
 39.7    0.145
 49.5    0.162
 60.0    0.182
 70.0    0.203
 79.8    0.221
 89.9    0.232
100.0    0.262
120.1    0.293
150.2    0.351
199.7    0.442
248.9    0.516
270.7    0.597

Good enough for a demo.

(For prettier things to do with plotter digitizing commands, Ed Nisley KE4ZNU has made some rather lovely Superformula patterns)

If you don’t have a plotter, or even if you do and you don’t have hours to waste mucking about with Python, obsolete optics and serial connections, Ankit Rohatgi’s excellent WebPlotDigitizer gets numbers out of graphs quickly. It handles all sorts of graphs rather well.

Scripting Inkscape – kinda

A couple of months back at the GTALUG Graphics session, someone asked if Inkscape – the 2D vector graphics workhorse that everyone seems to use – could be scripted. We pretty much said that it couldn’t. Recently, I found out that it does support a limited form of scripting, and wish to pass this on.

The key to it is understanding Inkscape’s command verbs. These can be listed using:

inkscape --verb-list

These verbs map to Inkscape commands, and often have names linked to the menu they live in (such as “FileQuit” doing what you’d expect).

I had a task I had to repeat on many files: convert all the stroked lines to filled paths. You’d need to do this if you are laser engraving a simple drawing, but there are other applications for this too. Here’s a command that would do this for all objects in a drawing, and overwrite the input file:

inkscape --verb EditSelectAll --verb SelectionUnGroup \
        --verb EditSelectAll --verb SelectionUnGroup \
        --verb EditSelectAll --verb SelectionUnGroup \
        --verb EditSelectAll --verb ObjectToPath \
        --verb EditSelectAll --verb SelectionCombine \
        --verb EditSelectAll --verb StrokeToPath \
        --verb FileSave --verb FileClose \
        --verb FileQuit input.svg

What this does:

  1. Selects everything, and ungroups all objects (×3, to break up most nested groups);
  2. Selects everything, and converts all objects to paths (so text, circles, polygons, spirals become paths, the lowest-level SVG object);
  3. Selects everything, and combines everything into one path;
  4. Selects everything, and converts all strokes to filled paths (so a two node straight line 1 mm wide would become a four node filled rectangle 1 mm thick);
  5. Overwrite the input file, close it, and quit.

The process has some disadvantages:

  1. It opens a window every time. You can’t execute verbs without the GUI opening.
  2. You can’t have another copy of Inkscape open while you do this.
  3. Realistically, you can’t really do anything at your computer until this is done, as it’s popping up windows and shifting focus like crazy. (ssh types can say “heh!” in a smug manner now)
  4. You can’t set parameters to verbs.
  5. It will overwrite the input file.
  6. It clogs up your “File / Recent” menu with all of the files you scripted.

FifteenTwenty: now on Fontlibrary and github


Use it / download it here: FifteenTwenty on
Download it / fork it here: scruss/FifteenTwenty on github
Local copy: (268K; includes FontForge sources)

FifteenTwenty UltraLight: single-stroke OTF for CNC/plotting

Screenshot from 2016-05-08 17-18-31Following on from FifteenTwenty, I made a hairline/single stroke version of the font especially for CNC use. This is a slight misuse of the OpenType format, but if you’re plotting/CNCing/laser cutting, the filled paths of standard fonts don’t work so well. Single-line (or stroke) fonts used to be possible in PostScript — the version of Courier shipped with early Apple LaserWriter printers was composed of strokes, rather than filled paths — but have fallen out of favour. If you have a device with a defined tool width, it’s better to let the tool make the width of the mark/cut. Here’s the hairline font plotted with a 0.7 mm pen to illustrate what I mean:

1520hairlineThis font is almost invisible on screen or on a regular printer, so I don’t recommend installing it unless you have specific CNC/plotting needs. Please note that the font will cause your device to follow the tool path of each letter twice.

Download: (or more options …)

FifteenTwenty: Commodore 1520 plotter font

FifteenTwentyFor the impatient: download (or more options …)
Updated: now with all ASCII glyphs!

The Commodore 1520 was a tiny pen plotter sold for the Commodore 64 home computer. It looked like this:

Commodore 1520 printer plotter (adjusted).jpg
Commodore 1520 printer plotter — by Oguenther (Dr.Guenther). – This file was derived from Cbm1520-2.jpg: , Public Domain,

I never owned one, but it seems it was more of a curiosity than a useful product.

From a nerdy point of view, however, this device was rather clever in that it packed a whole plotter command language, including a usable font, into 2048 bytes of ROM. Nothing is that small any more.

Thanks to the epic efforts of Jim Brain and others, this ROM is now archived on Project 64 Reloaded. Looking at the code, I was struck by the elegance of the encoding: it packs a full X-Y plot instruction in one byte.

Based on my work with the Hershey font collection, I thought it would be fun to extract the coordinates and make a real OpenType font from these data. I’m sure others would sense the urgency in this task, too.

Since Commodore computers used a subset of ASCII, there’s a barely-usable set of characters in this first release. Notable missing characters include:

U+0060    `    GRAVE ACCENT
U+007C    |    VERTICAL LINE
U+007E    ~    TILDE

I’ll get to those later, perhaps.

Huge thanks to all who helped get the data, and make the bits of software I used to make this outline font.

(Note: although the Project 64 Reloaded contains some extraction code to nominally produce an SVG font, it doesn’t work properly — and SVG fonts are pretty much dead anyway. I didn’t base any of my work on their Ruby code.)

Work-in-progress: Sayso Globord audio decoding

You may still be able to get surplus Sayso Globord programmable LED signs in surplus stores. It’s a 7×24 LED scrolling sign that you can program with a lightpen or with audio input.

sayso-001The unit comes with no software, but has a link to printed on the box. It’s an archive of the programming software, manual, and canned audio files for a whole bunch of standard messages. Here’s an archive if the dropbox link goes away:

The audio files used for programming the display are clearly FSK-encoded, but I haven’t quite worked out the relationship between the tones and the display bits. Here’s what I’ve worked out so far:

  • Files are made up of 12 audio blocks, each about 0.9 seconds long. Each block appears to correspond to one 7×24 display screen.
  • Mark (1 bit): Three cycles, 96 samples at 44100 Hz: 1378.125 Hz
  • Space (0 bit): Four cycles, 256 samples at 44100 Hz:  689.0625 Hz

The editor runs nicely under DOSBox, so you can experiment and save samples as WAV files. Here’s a sample display with its corresponding audio linked underneath:

sayed1_0_003I’m not sure how much extra work I have time or inclination to put in on getting this working, but I hope that my preliminary work will be useful to someone (maybe this person).

Building the Stick of Joy

Not-even-remotely over-engineered retrogaming joystick


Tracking down old Atari-style joysticks is expensive, and you don’t know if you’ll get something reliable. So I built one, using Protolab‘s laser cutter.

The guts of the unit comprise:

The case is made from 6.4 mm high quality plywood, using a template generated by BoxMaker.  The external dimensions of the box are 163.05 mm x 143.05 mm x 83.05 mm, including kerf.


I might recommend just nabbing the top plate dimensions from the above drawing, as I made a couple of rookie mistakes in the design:

  1. I overcompensated for the laser kerf, so had to spend several hours sanding the box down to size to make it fit together. You might want to set it to zero to leave room for glue.
  2. I flipped one of the box sides to compact the cutting job. While this might’ve saved a small amount of wood, it means that the grain matches on three of the sides, but not for the fourth.

You’ll also need M4 screws to secure the joystick and stacks of washers to space the dust washer correctly. The connection is made with a couple of metres of 8-core stranded signal cable and a 9-pin female D plug. You should refer to digital joystick connector pinouts for the wiring.

Parts and materials for this joystick cost less than a used stick shipped from eBay.  It works well, and its probably the only gaming device ever to have a logo written in Akzidenz-Grotesk.

Broken Pen Girih

broken_pen_girihWell, I didn’t expect that to happen. I was plotting this simple girih frame when something went wrong, and the plotter slammed the (new-old stock, almost unused … sniff) HP drafting pen into the side of the thick watercolour paper, breaking off the tip.

I didn’t notice the damage, so I restarted the plot, and the above smeary and uncertain lines came out. It’s certainly more organic than a mechanical plot would tend to be …

[tɒk bɒks] — a tiny hardware speech synthesizer/TTS

[tɒk bɒks]: case
[tɒk bɒks]: case
[tɒk bɒks]: inside
[tɒk bɒks]: inside. The observant amongst you will notice that the speech board is 1/10″ further in than it should be for ideal alignment with the USB serial adapter.
Back in the 1980s, the now-defunct Digital Equipment Corporation (“DEC”) sold a hardware speech synthesizer based on Dennis Klatt’s research at MIT.  These DECTalk boxes were compact and robust, and — despite not having the greatest speech quality — gave valuable speech, telephone and reading accessibility to many people. Stephen Hawking’s distinctive voice is from a pre-DEC version of the MIT hardware.

DEC is long gone, and the licensing of DECTalk has wandered off into mostly software. Much to the annoyance of those in earshot, I’ve always enjoyed dabbling in speech synthesis. DECTalk hardware remains expensive, partly because of demand from electronic music producers (its vocoder-like burr is on countless tracks), but also because there are still many people who rely on it for daily life. I couldn’t justify buying a real DECTalk, but I found this: the Parallax Emic 2 Text-to-Speech Module.  For about $80, this stamp-sized board brings a hardware DECTalk implementation to embedded projects.

The Emic 2 is really marketed to microcontroller hobbyists: Make Your Arduino Speak! sorta thing. But I wanted to make a DECTalk-ish hardware box, with serial input, a speaker, and switchable headphone/line jack.  [tɒk bɒks] (a fair approximation of how I pronounce “Talk Box”) is the result.


  • Parallax Emic 2 Text-to-Speech Module
  • OSEPP FTDI USB-Serial Breakout — there are many USB-Serial boards that would do this, but two points in this one’s favour are: i) it has header pins for breadboard use, and ii) I had a spare one.
  • Small 8Ω speaker element — the one I used is most likely a headphone element, bought from Active Surplus (RIP). This should be as small as you can get away with (and still hear) as the USB-Serial connection isn’t designed to supply audio power.
  • Header pins and sockets
  • Toggle switch
  • Small project box with perfboard
  • Jumper wires and solder


Emic 2             Serial
======             ======
 GND                GND
 5V                 Vcc
 SOUT               RXD
 SIN                TXD

Emic 2             Speaker
======             =======
 SP-                -
 SP+  (via switch)  +

Using it

You’ll need some kind of serial terminal connection. In a pinch, you can use the serial monitor that is in the Arduino development environment. Either way, identify your serial port (/dev/ttyUSBN, COMN:, or /dev/tty-usbserialNNNN) and find a way to send 9600 baud, 8N1 characters to it. Hit Return, and you should be greeted by the Emic 2’s : prompt (or a ?, followed by :). Whether you get the prompt or not depends on whether local echo is set or not. Either way, try sending this line:

SAll watched over by machines of loving grace.

You should hear a voice say the title of Richard Brautigan’s lovely poem All Watched Over by Machines of Loving Grace (caution: video link contains nekkid hippies). You should get the : prompt back once the the speech has stopped. And that’s all there is to it: send an S, followed by up to 1023 bytes of (basically ASCII) text, followed by a newline, and it will be spoken. There’s more detail, of course, in the Emic 2 documentation and the Emic 2 Epson/Fonix DECTalk 501 User’s Guide for changing voices, etc. Yes, you can make it sing. No, you probably shouldn’t, though.


  1. The Emic 2 has no serial flow control, so you have to wait until the module stops speaking (or you send it the stop command) before you can send more. The easiest way is to poll the serial port and see if there’s the : prompt waiting. Until you see the prompt, any text you send it may be lost.
  2. The Emic 2 is an embedded device; Unicode is a bit of a stretch. It’s supposed to accept ISO Latin-1 8-bit characters (handy for Spanish mode), though.
  3. Starting every speech line with S may make this board incompatible with assistive technology software such as the JAWS screen reader. I don’t think that this was the goal for Emic 2’s designers (Grand Idea Studio), however.
  4. The output from the audio jack has a fair bit of noise on it, and you need to set the volume quite low to avoid hiss and hum. Your experience may be different, as I may have accidentally made a ground loop. There is a faintly  audible click at the start and end of the text, too.
  5. The Emic 2 uses DECTalk v5 commands and phonemes. Many DECTalk resources on the web (like these songs) use v4 or older, which are subtly incompatible. I haven’t found a reliable conversion protocol yet.

To end, here’s the Emic 2’s “Dennis” voice reading all of Brautigan’s All Watched Over By Machines of Loving Grace:

(plain link: molg-dennis-140wpm-16khz.mp3)

(recorded and edited for length with Audacity. No hippies — nekkid, or otherwise — were harmed in the making of this recording.)

Hershey Complex font – works (mostly)

hershey sampleI’m pretty happy with this still-early version of AVHershey Complex Medium. There’s a PDF type sample embedded underneath the image. It’s from Augustus Carp, Esq., a book (and epub) that is now really and truly in the public domain in Canada.

There’s still a lot to do. Even the regular Complex font (which has the best glyph coverage of all of the styles in the Hershey font collection) is needing more work:

  1. No pair kerning
  2. Weak currency character support; only $, when it really should have ¢, €, £ and ¥ too
  3. Not-very-complete Western European accents and regional characters
  4. Some frankly ropey decisions were made in filling in missing characters from composites/modifications of other glyphs.

And now I’ve got to do the same for two other weights of Complex Roman — and then think about all the other variants! I’m not going to touch the Japanese glyphs, by the way; given how limited my knowledge of even Western typography, I doubt I’d be able to advance the representation of Kanji in any useful way.

Considering that the glyphs are made up only of straight line segments, they look not bad in print. Sensitive typographers look away now; here are the control points for ‘g’:


Hershey Writes Again

Update: very preliminary OTF font files are available here: scruss/AVHershey-OTF. These don’t yet even encode all of ASCII, so aren’t yet generally useful.

Major breakthrough: yesterday (Feb 5th), I got the old Hershey fonts outlined properly, and today I have compiled them (sorta) into vector fonts. They’re not yet ready for release, as they have no metadata and are missing some key characters (even for ASCII).

I based the line thicknesses for the fonts as if I were drawing a 16 pt character, and using a plotter with a 0.3 mm (light), 0.7 mm (medium) and 1.0 mm (heavy) pen. You can see in the individual characters from the Hershey Complex font shown below, that the double hairline strokes merge into thicker single strokes. The same effect occurs on a real plotter, too:


Here are some preliminary bitmap samples:

Complex Heavy
Complex Heavy
Complex Light
Complex Light
Complex Medium
Complex Medium
Simplex Heavy
Simplex Heavy
Simplex Light
Simplex Light
Simplex Medium
Simplex Medium

q absolves data sins and makes CSV queries easy

The cryptically-named q (it also bills itself as being able to “Run SQL directly on CSV files | Text as Data”) is very nifty indeed. It allows you to run SQL queries on delimited text files. It seems to support the full SQLite SQL dialect, too.

I used to frequently query the IESO‘s Hourly Wind Generator Output report (which now hides behind a JS link to obscure the source URL,  Now that the file has nearly 10 years of hourly data and many (but not all) wind projects, it may have outlived its usefulness. But it does allow me to show off some mad SQLite skills …

The first problem is that the file uses nasty date formats. Today would be 23-Jan-16 in the report’s Date field, which is filled with the ugh. You can fix that, though, with a fragment of SQL modified from here:

printf("%4d-%02d-%02d", substr(Date, 8,2)+2000, (instr("---JanFebMarAprMayJunJulAugSepOctNovDec", substr(Date, 4,3))-1)/3, substr(Date, 1, 2)) as isodate

The above data definition sets the isodate column to be in the familiar and useful YYYY-MM-DD ISO format.

A related example would be to query the whole CSV file for monthly mean generation from Kingsbridge and K2 Wind projects (they’re next to one another) for months after K2’s commissioning in March 2015. Here’s what I did in q:

q -T -O -H -d, 'select printf("%4d-%02d", substr(Date, 8,2)+2000, (instr("---JanFebMarAprMayJunJulAugSepOctNovDec", substr(Date, 4,3))-1)/3) as isomonth, avg(KINGSBRIDGE) as kavg, avg(K2WIND) as k2avg from Downloads/HourlyWindFarmGen_20160122.csv where isomonth>"2015-03" group by isomonth'

which gave the results:

isomonth    kavg    k2avg
2015-04    12.7277777778    37.4569444444
2015-05    8.94623655914    67.6747311828
2015-06    6.05833333333    66.6847222222
2015-07    3.96370967742    45.372311828
2015-08    6.34811827957    67.436827957
2015-09    7.29027777778    79.7194444444
2015-10    14.5658602151    128.037634409
2015-11    15.9944444444    130.729166667
2015-12    17.6075268817    152.422043011
2016-01    19.6408730159    163.013888889

Neat! (or at least, I think so.)

Self-similar petals

Self-similar petals

Original drawn in hand-coded PostScript from a path worked out using InkScape. Translating from InkScape’s SVG paths to PostScript is slightly annoying: PS uses Cartesian conventions, while SVG inverts the Y-axis. At least the SVG path commands map well to PostScript: mmoveto, ccurveto, Zclosepath, Sstroke.

There’s no magic to this figure. Each row of petals is half the length of the row outside it. As there are 6 petals arranged in a circle, each petal is 60° of arc. To make the half-step between rows, the petals are rotated 30°, so the rows have to be scaled by sin 30°, or ½.

Instagram filter used: Normal

View in Instagram ⇒

GTALUG Lightning Talk(s): Mostly Searchable and Mini Printers

My lightning talk for GTALUG seemed to go down quite well. Here are the slides. It’s mostly based on experience gleaned from My bank broke PDF … and how I used PDFBeads to fix it. I really must write this up properly.

I also prepared — but didn’t get to use — notes on using Mini Printers and Linux. Again, this is from Thermal Printer driver for CUPS, Linux, and Raspberry Pi: zj-58 and Notes on mini-printers and Linux.

svgo: silently destroying creators’ rights since whenever

svgo is, on the face of it, pretty neat: it takes those huge vector graphic files and squozes them down to something more acceptable. Unfortunately, though, the authors have seen too many files with junk machine-generated <metadata> sections, and decided that it’s all worthless.

Metadata isn’t junk; it’s provenance. Your RDF? Gone. Your diligently researched and carefully crafted Dublin Core entries? Blown away. The licence you agonized over? teh g0ne, man. svgo does this by default. It would be very easy to use this tool to take someone else’s graphic, strip out the ownership information, and claim it as your own. It would be wrong to do that, but the original creator would have to find your rip-off and go to the effort of challenging your use of it. All so much work, all so easily avoided.

You can make svgo do the right thing by calling it this way:

svgo  --disable=removeMetadata -i infile.svg -o outfile.svg

There’s apparently a config option to make this permanent, but the combination of javascript, no docs and YAML brings me out in hives. Given that the metadata section of a complex file is typically a couple of percent of the total, it’s worth keeping. Software passes; but data lives forever, so be kind to it.