Generating fonts (glyphs) for LED matrices and POV

Hello All,

I began working on a POV project recently and realized there were limited glyph (colloquially known as fonts) resources, especially for custom sizes.

I began looking for solutions. I found a very nice program for Windows written in .Net to convert system fonts to C data structures. I do not recall the name or URL, but since it converts Windows fonts, the licensing/copyrights of conversion is dubious anyway.

I also found BDF (Glyph Bitmap Distribution Format) glyph files in almost every size imaginable. These are also commonly distributed under open-source terms (GPL, MIT, etc). Perfect…

I have written a perl program to convert these BDF glyphs into C data structures. It will automatically detect the appropriate data size to store the resulting data and rotates the glyph 90 degrees clockwise. ie A 5x7 glyph requires one byte per data line (uint8_t), but a 10x20 requires 4 bytes per line (uint32_t). A nice preview of the glyphs are also generated.

An example of the 5x10 glyphs I generated:

const uint16_t my_fontdata_5x10[256][5] = {
...
    {                    //  char 64
              0x007c,    //           *****
              0x0092,    //          *  *  *
              0x00aa,    //          * * * *
              0x00aa,    //          * * * *
              0x003c,    //            ****
    },
    {                    //  char 65
              0x00f8,    //          *****
              0x0024,    //            *  *
              0x0024,    //            *  *
              0x00f8,    //          *****
              0x0000,    //
    },
    {                    //  char 66
              0x00fc,    //          ******
              0x0094,    //          *  * *
              0x0094,    //          *  * *
              0x0068,    //           ** *
              0x0000,    //
    },

...
  • Note: Most of the BDF glyphs are conveniently ordered so they match the ASCII/HEX codes for most characters.

bdf2c.pl (6.32 KB)

Good Stuff,

I too have been playing around with POV and fonts

I have created some processing code that converts truetype fonts to glyphs and arrays for POV in a very similar way. Its designed for 16 channels/leds etc so it creates 16bit numbers (shorts) and uses any 16 pixel size lettering. I haven't yet tried to incorporate it into arduino code, but I'm sure it can be very easily adapted for 8bit.

so it creates 16bit numbers (shorts) and uses any 16 pixel size lettering. I haven't yet tried to incorporate it into arduino code, but I'm sure it can be very easily adapted for 8bit.

When (if) you do, keep in mind that a 16 bit number is not a short on the Arduino.

Thanks for tip - How does Arduino code save 16bit numbers? Would it save them automatically over two bytes?

Is it better if I make my code produce pairs of bytes rather than a 16bit number?

Cheers

How does Arduino code save 16bit numbers?

As an int.

Is it better if I make my code produce pairs of bytes rather than a 16bit number?

That would make using it much harder, in my opinion.