Bitmap fonts

Bauhaus2015 sampler

I used to love making fonts – even back in the 1980s I made bitmap fonts for the ZX Spectrum. This is a homage to the font I made for my mid-80s A-Level Computer Science project, which did on-screen graphics and titles for home videos. That font was called Bauhaus, this one is (I think) a bit taller and spindlier, so I’ve called it Bauhaus2015. I must dig out my notes from the loft and recreate the original one.

lower case letters

quick brown fox

special characters

Download Bauhaus2015 here.

Sir Clive font

Oh and here’s a font I just made based on the Sinclair logo! Use lower case only for best results. Named after Sinclair Research’s founder, ‘Uncle’ Clive Sinclair. Sir Clive to you. Download here and I’ve also made a bold version called Sir Clive the Bold:

sir clive the bold

Sir Clive the Bold font

These were all made with the rather fabulous (and free) BitFontMaker2 web site. It’s a really easy way to make your own bitmap TrueType fonts:

BitFontMaker2

Ages ago I also made a Type1 font called Punchie, after looking at punch tape at the Porthcurno Museum of Submarine Telegraphy. I must try & make a TrueType version of it…

Punchie font demo

Posted in Uncategorized | Tagged , , | Leave a comment

Windbreaks

Windbreaks
Windbreak slideshow – click on arrows either side of image to view the set.

The British seem to love windbreaks.

I got a bit obsessed about them yesterday, on that rare thing: a windless, hot summer day on the beach in Cornwall, and yet we were surrounded by windbreaks.

Some people were sitting on the sea-side, some on the land-side, suggesting that windbreaks are as much about territory and privacy as keeping warm. Why would you block yourself off from a stunning view of St Ives Bay with Godrevy Lighthouse perched on its rocky island a short distance away? You could look at stripy nylon fabric in your own back yard.

windbreak 13

One family had joined 4 or 5 long windbreaks together to create a windbreak city. Inside, all mod cons. Books, beer, barbecue.

windbreak 16

Some favour the single short line, others pen themselves into a U shape. I’ve not seen anyone boxing themselves into a square, surrounded on all sides by windbreak, but it’s only a matter of time.

windbreak 12

Occasionally you will see novelty fabric: boulders, a floral pattern, Cath Kidston fabric. These are mere interlopers. Everyone knows a true windbreak must have brightly-coloured horizontal stripes.

windbreak 14

Me? I never take a windbreak, except occasionally on a sunset beach barbecue. But I do take a pop-up tent. Which I suppose is the same as fencing yourself in.

windbreak 15

An Englishman’s home is his patch of sand demarcated with a windbreak, with tents, with towels – or as I saw yesterday – a large circle carved in the sand. I presume it was enchanted. If a non-family member stepped inside, they would turn to sand.

windbreak 10

Update: happy to spot this colourful alternative to a windbreak – at least as far as providing shade is concerned – on Porthminster Beach:

colourful windbreak alternative

You can view my complete set of windbreak photos here.

Posted in Uncategorized | Tagged , | Leave a comment

Hop Stuff Brewery – podcast

After a bit of a hiatus, the new Last Orders podcast is here:

Today I visited the brewery that links South and North London, Hop Stuff, where I was showed round by the lovely founder James Yeomans. Listen to the podcast to find out more, and while you’re listening, scroll down to see what it looks like. Radio with pictures. It’ll never catch on.

Hop Stuff brewery

Their award-winning porter, which I can’t wait to try.

Hop Stuff brewery

A small part of James’s ‘research wall’. Happy to see a bottle of Wu Gang Chops the Tree up there, among a myriad of other yeasty treats.

Hop Stuff brewery

The hole in the upstairs floor, showing the fermentation vessels below. It really, really reminds me of Mr Blint’s Attic! (See my other web site for details).

Hop Stuff brewery

Hop Stuff brewery

The fermentation vessel that wouldn’t fit.

Hop Stuff brewery

Bottled beer is a relatively new venture for them.

Hop Stuff brewery

Where the magic happens.

Hop Stuff brewery

The brewery is at the heart of the Royal Arsenal development. Berkeley Homes have bought a huge swathe of the old munitions factory land stretching to the River Thames. Some of the old buildings are being renovated, and new some 5000 new flats are sprinkled in between.

The Luxury of Choice

Berkley Homes

The brewery and its forthcoming bar & restaurant The Taproom are right in the heart of this development, with a new Crossrail station being built offering fast transport links to central and west London.

Hop Stuff brewery

I’m not sure what I think about this development. I used to travel through Woolwich on the bus every day on my way to work in Thamesmead, and I could sense the odd juxtaposition of the old and the new buildings, as well as the well-healed professionals hurrying from their newly-developed flats into jobs in the city, alongside the folk who have lived in the area much longer.

Hopping in Blackheath

How many locals can afford flats starting at £367,500? Not many, I suspect. The new Woolwich Arsenal development on the left comes hard up against ‘old’ Woolwich on the right of Plumstead Road, marking a bit of a dividing line (though there are other new flats further afield):

New Woolwich left, old right

Is there a Plan B for the less well-off residents of Woolwich, or will they be priced out of the area?

Plan B

The old covered market directly faces a parade of brand new, and as yet unoccupied, units that are covered with hoardings selling an upmarket urban lifestyle dream of Sunday brunch in a café bar with artfully distressed brickwork.

Plumstead Road Covered Market

But I digress.

Hop Stuff is a very interesting brewery, run by a thoughtful and very friendly team. I look forward to drinking some more locally-produced beer (especially that porter when they release another keg), and the Taproom sounds like it will be worth a visit. They may be about to out-Zero Degrees Zero Degrees.

Posted in beer, drink | Tagged , , , , | Leave a comment

Tomorrow Never Knows, chapter 1

Instead of finishing the various stories I have have hanging around (including the one that’s The History Boys meets An Education meets Doctor Who, that one is a doozie) I started a new one. I’m stumbling after 4 chapters so I offer up the first draft of the opening to shame me into either finishing it or shutting up.


Monday evening

Tomorrow Never Knows coverUp here in the attic I can only hear my alarm clock ticking softly and the distant sound of a train chugging along the main line. I expect it’ll pass the house soon and I’ll see its smoke rising from behind the trees. It’s been raining all day and I’m bored. There was nothing on the wireless. Nothing I wanted to listen to, anyway. Just the usual boring old music dad likes and tedious talks about rationing and keeping the enemy at bay. It’s always the same.

It’s lucky my room has a good view or I’d just go totally insane. On a clear day I can see the sea, and the castle on the island. Today wasn’t a clear day.

Even though it’s almost August, I’m frozen. This morning I tiptoed downstairs and asked dad for some coal for my room and he almost bit my head off. He threw the newspaper at me. The headline was about coal shortages.

“You should read the news sometimes, Kim, instead of just reading old novels.”

This is a bit rich coming from him. He’s the town bookseller, you see. My reading of the old books tells me that once upon a time that would have been a lowly job. Not any more. He’s one of the most important people in the parish.

He was sitting in the old waiting room eating toast and writing a letter. He had a small fire going. He saw me enviously eyeing the warm coals.

“It’s for the customers. And we’ve got to keep the damp away from the stock. And Mrs Hopper. She’ll be in soon; she feels the cold at her age.”

I snorted and took the paper back upstairs with me. I’m supposed to help out in the shop in the summer holidays, but I’ve had a bad cold and I’m using it as an excuse. Got to admit I’m bored though, even after a week. I’ve already read both the Dodie Smith books we have in the shop, carefully so they can still be sold, and Emma for probably the ninth time. We’ve got loads of Jane Austen so I could read that anywhere and not worry about damaging the stock. I might read To the Lighthouse next. Dad says I’m not old enough, but Miss Danks put it on her reading list. Both of these facts make me want to read it very much.

The newspaper was pathetic. Eight badly-printed pages, tissue paper with type all smudged and misaligned, not like some of the beautiful books we’ve got downstairs in the shop which have lovely creamy, thick paper and beautiful letters. It was mostly news from London, boring stuff about the governments and telling us how everything is better than it really is. Hardly any pictures, except some adverts. Someone’s making a new wireless with shortwave and a record player built in. I’d love one of those. Might ask dad about my birthday present I never got. This year. Or last.

I was right. There goes the steam from the express train, heading North up the coast. A strip of sky has appeared just above the horizon in time for me to see the setting sun. The bright orange light is dazzling me. It’s painful, but it’s been so damp and dark today, I want to drink it in forever. Dad says sunsets make him feel sad. He’s crazy. The castle looks beautiful in silhouette. I think this a sign.

I wish we had a camera. Dad says we might get one next year. Like everything else I’m promised next year. If all our ships come in, what an amazing year 2035 will be.

Posted in fiction, literature | Tagged , , , | Leave a comment

Code making and breaking activities in Scratch – part 1

When I was a kid I loved making codes and still vividly remember my brother teaching me about simple substitution cyphers; I’d write messages and he’d then try to break them by looking for patterns and common letters like E to guess what offset I’d used. These were Ceasar Cyphers, or what in later life I would know as ROT13, where you shift each letter of the alphabet along by a certain number of letters. Both the sender and the recipient need to be using the same offset number, so some sort of prior communication is needed.

An offset of 3 would look like this:

ABCDEFGHIJ
DEFGHIJKLM

So A becomes encoded as D, B becomes E, C becomes F and so on.

I learned a hard lesson when my brother decoded one of my messages almost instantly. It turned out I’d left the plaintext message on the bottom of my code paper and hadn’t crossed it out well enough. He could still read it. ‘That’s not fair!’ I cried. ‘All’s fair in love and war’ came the reply. And indeed it was human errors like that that helped codebreakers in Bletchley Park break German World War 2 codes like Enigma. Many, many years later I taught a Year 5 lesson on the anniversary of D-Day in 2014 about codes and other things, and the same thing happened. One child caught another reading her plaintext. ‘That’s not fair!’ – which led to a discussion about the ethics of espionage in wartime.

So, everyone loves codes and cyphers, right? They make great coding activities as pairs of children can encode and decode secret messages whilst at the same time learning a bit of computer code, including how arrays, or ‘lists’, work in Scratch

My first project is a really simple substitution cypher, a bit like ROT13, only you can choose any offset, not just 13. You click on a sprite and it asks you for the secret number – this is the offset, or how many letters along the alphabet each letter is going to be shifted.

Here’s how to use it: you click on Scratch cat to make a simple cypher that reverses your plaintext. You can use this a back slang generator (or decoder) – discover where the word ‘yob’ comes from!

Click on Nano on the top right to encode your plaintext message. You’ll be asked for the offset value (the ‘secret number’) and Nano will give you an encoded version of your message. You decode a message by giving it to Pico, in the middle. Note that if the offset is 13 you can use either Pico or Nano for encoding or decoding, but if you use any other number you’ll need to pick the right sprite for the job. (It doesn’t handle spaces or numbers – you might want to do that as an extension activity. If you do, you may think about whether spaces make your cypher easier to crack).

This is the code for the encoder:

Blocks for encoding

This is how it works.

First it asks you what numerical offset you’d like to use, and puts this in a variable called offset. (There’s no error handling here if you type in 0 or letters – you might want to add that as an extension).

It then asks you for your plaintext message – the text you want to encode to keep it safe from prying eyes before sending it on. It puts your unencoded in a variable called plaintext.

You’ll then see a nested loop (a repeat loop within a repeat loop). The outer one repeats for the length of the message and keeps track of how far through the message it’s got using a variable called offsetcounter (which is a confusing name, I really need to change it). It does this to step through each character of the plaintext to analyse and encode it.

The inner loop runs 26 times (the length of the alphabet) for every character of the message. Each letter of the alphabet is held in a list (or array) called alphabet. It has to do this because, unlike some programming languages, I don’t think Scratch has an inbuilt way of turning text into numerical values. Nor do I think Scratch has a block that will find the numerical position of a given string in a list (though I may be wrong), which is why it has to test every character in the plaintext against the alphabet list to find that character’s numerical position in the alphabet, which is put in the alphacounter variable.

Each letter of the message is, in turn, put in a variable called temp. The code then runs through all 26 letters of the alphabet until it finds a match for the letter:

if (temp) = letter (offsetcounter) of (plaintext) then...

If this is true, we can get encoding!

The next line of code is quite complex, so let’s break it down.

Scratch blocks that do the encoding

We use the join block here. This is a string-handling block that allows you to glue text variables together. Our coded message is stored in a string (text variable) called code. Each time we encode a new letter we set the code string to be the message we’ve encoded so far, plus the new encoded character. That’s what the outer green join block does – look carefully how the colours overlap!

Let’s zoom in on the bit we’re adding each time:

Adding encoded text

item () of alphabet

is picking the coded letter from the alphabet, moving it on by the offset by picking item number alphacounter + offset. It’s a bit hard to see but there are two overlapping green blocks, one to do that adding, and another mod block.

Mod is short for modulo, or modular arithmetic. There’s an article on Nrich (that goes into way too much detail later on), and this really good article by Kalid Azad shows some great examples of why modular arithmetic is a useful trick to have up your sleeve: http://betterexplained.com/articles/fun-with-modular-arithmetic/

We need to use modular arithmetic for a couple of reasons. It’s best to think of our encoding not as sliding two lines of the alphabet along side each other (like I did at the top of the page), but as a circle (thank you tef):

Explaining modulo arithemtic to KS2 kids

This better shows what happens when you get to Z. What happens if I want to shift Z on by 3 letters? We cycle back round to the start again, so

TUVWXYZ
WXYZABC

So, with an offset of 3, Z in the plaintext becomes C in the encoded message.

Modular arithmetic also useful because I think it allows you to use offset numbers bigger than 26 – though they will be just the same as smaller numbers, but it helps avoid errors. Note that a secret number of 52 gives you the plaintext back again – why is this? Because 52 is twice 26. 52 mod 26 is zero, so you’re not doing any encoding at all!

The Scratch code is further complicated by the fact that there’s a special case when the encoded letter is Z. I’ll be honest, this was a bug I only spotted just as I was about to publish this and I ran the whole alphabet through it and noticed Z was missing from the coded message. If you encode WILL with an offset of 3, you should get ZLOO, but I was only getting LOO.

Useful debugging tips: display all your variables, add sounds like a drum and pauses inside loops to track what is going wrong. I found that the problem was caused when I was at the 26th letter of the alphabet (Z). 26 in modulo 26 is ZERO! And there’s no zeroth letter of the alphabet, so I catch this with

if alphacounter + offset = 26 then...

and manually set the encoded letter to z.

This is annoying because I had some reasonably elegant code, and now I have to test for a clunky exception right in the middle of it. Welcome to coding!

The decoder does the same process but in reverse.

Now this is fun, but it’s not a great cypher. It’s very easy to crack, partly because each letter is always encoded as the same letter making it possible to do frequency analysis if you have enough text to work on. The letter E is the most common letter in the English language, so if the most common letter in the coded text is J, you can be fairly sure that J is really E. That may suggest an offset of 5, you shunt all the other letters of the message back 5 places in the alphabet and see if the message makes sense.

Another flaw with substitution cyphers is that they allow you to spot patterns like double letters. If I encode the word HELLO using different offsets I get YVCCF or EBIIL or OLSSV. If you have an idea what the word may be, say a greeting at the start of a message, then that gives you a way in to breaking the code.

Which is why in the next session, we will make our code more cunning and harder to break by building a very simple Enigma machine in Scratch.

Posted in computers | Tagged , , | Leave a comment