5x5 Font for LED Matrix

rendering vector font files or using bitmap font files on the processor. Probably would require external memory.

halley:

I'd probably work up a perl script and use ImageMagick libraries to chop up the bitmaps and output C source code.

That sounds like a lot of hard work.
Maybe a script to generate C code from BDF would be easier.
I think most if not all font formats can be converted to BDF.

marser, where did you buy that resistive touchscreen, if you don't mind? The only 5-wire ones I saw by googling around are pretty expensive (>$50).
Thanks.

where did you buy that resistive touchscreen

From Farnell UK, try search for touchscreen+higgstec.
Under £20 for the smaller ones, and very good quality from my experience.
I've ordered a bunch of them directly from Higgstec for the BlipBox kit which will be coming out soonish.

hth,

/m

Thanks.

It just happened that the touchscreen fits perfectly your 10x8 LED matrix (this is how it looks in the video anyway)? Or can you cut it ???

As it happens the matrix and screen are very well matched, to a few millimeters. However the screen only has to fit in the enclosure, which then has a cut-out the size that you want to use.
It's made on a glass base and can't be cut.

Here's a simple perl script to convert BDF fonts to C structs:

#!/usr/bin/perl -n
$FONTNAME = "typeface";
sub pad {
    my $count = shift;
    while($count-- >= 0) { print ", 0x00"; }
}
if (/^FONTBOUNDINGBOX\s+(\d+)\s+(\d+)/) { $HEIGHT = $2; printf("struct glyph {char c; uint8_t d[%d];};\n", $HEIGHT); printf("glyph %s[] = {\n", $FONTNAME); }
elsif (/^STARTCHAR\s+(.)$/) { $INCHAR=1; printf("    '%s', ", $1); }
elsif (/^BITMAP/ && $INCHAR) { $BITMAP=1; }
elsif (/^ENDCHAR/ && $INCHAR) { pad($HEIGHT - $BITMAP); print " },\n"; $BITMAP=0; $INCHAR=0; }
elsif (/^ENDFONT/) { print "    '\\0', { 0x00"; pad($HEIGHT-2); print " }\n"; print "};\n"; }
elsif ($BITMAP) { s/(.+)\n$//; printf($BITMAP++ == 1 ? "{ 0x%s" : ", 0x%s", $1); }

I'm not really a perl coder, but it works and produces output such as this (from the X11 5x3 'micro' font):
struct glyph {char c; uint8_t d[5];};
glyph micro_font[] = {
'0', { 0x40, 0xa0, 0xa0, 0xa0, 0x40 },
'1', { 0x40, 0xc0, 0x40, 0x40, 0x40 },
...
'\0', { 0x00, 0x00, 0x00, 0x00, 0x00 }
};

The array is terminated with a null character so that it can be iterated/searched through.

The bitmaps in BDF format are done one byte per line.
It would probably be better to use one byte per column - since fonts are generally higher than they are wide, a 5x3 font could be represented with 3 data bytes instead of 5.
It would also make horizontal scrolling easier, and proportional print possible: store the width of a character and only print that many columns of pixel data.

I hope I'm not flogging a dead horse with this thread...

In case anyone is interested, here's a video on vimeo of a public domain font from the X11 project scrolling across an 8x10 LED matrix.

And in case anyone is curious and didn't already know, you can retrieve any font (I think) from an X11 server as a BDF file with 'fstobdf', and you can list available fonts with 'fslsfonts'.

@Shutter - let me know if you still want to do a marquee library.