MAX7219 CP437 Font

I have created a font file for use with the MD_MAX72xx and MD_Parola libraries. It implements the old DOS CP437 font and looks quite well on the MAX7219 8x8 matrix. The source code file is: parola_cp437_font.h and is shown below.

Usage:

[code]
#include <Arduino.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include parola_cp437_font.h

MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
P.begin();
P.setFont(_cp437font);
[/code]

========================================================
File parola_cp437_font.h:

[code]
#ifndef PAROLA_CP437_FONT_H
#define PAROLA_CP437_FONT_H

#include <MD_MAX72xx.h>

// Font properties info
// 'F' = FONT_FILE_INDICATOR;
// 2 = version number;
// 0, 0 = first ascii character code;
// 0, 255 = last ascii character code;
// 8 = font height in pixels

// CP437 font definition
MD_MAX72XX::fontType_t PROGMEM cp437font[] =
{
'F', 2, 0, 0, 0, 255, 8,
1,0, // nul
8,126,129,149,177,177,149,129,126, // smiley face
8,126,255,235,207,207,235,255,126, // reverse smiley face
7,14,31,63,126,63,31,14, // heart
7,8,28,62,127,62,28,8, // diamond
7,24,186,255,255,255,186,24, // club
7,16,184,252,255,252,184,16, // spade
5,0,24,60,60,24, // bullet
8,255,255,231,195,195,231,255,255, // square bullet
6,60,102,66,66,102,60, // circle
8,255,195,153,189,189,153,195,255, // reverse circle
8,112,248,136,136,253,127,7,15, // female
6,78,95,241,241,95,78, // male
8,192,224,255,127,5,5,7,7, // music sign
8,192,255,127,5,5,101,127,63, // music sign double
8,153,90,60,231,231,60,90,153, // sun
7,127,62,62,28,28,8,8, // right triangle
7,8,8,28,28,62,62,127, // left triangle
6,36,102,255,255,102,36, // up down arrow
6,95,95,0,0,95,95, // double exclamation
8,6,15,9,127,127,1,127,127, // paragraph
8,64,218,191,165,253,89,3,2, // medical
6,112,112,112,112,112,112, // bold dash
8,128,148,182,255,255,182,148,128, // up down arrow
6,4,6,127,127,6,4, // up arrow
6,16,48,127,127,48,16, // down arrow
7,8,8,8,42,62,28,8, // right arrow
7,8,28,62,42,8,8,8, // left arrow
7,60,60,32,32,32,32,32, // corner
8,8,28,62,8,8,62,28,8, // double arrow
8,48,56,60,62,62,60,56,48, // up triangle
8,6,14,30,62,62,30,14,6, // down triangle
2,0,0, // ' '
4,6,95,95,6, // '!'
5,7,7,0,7,7, // '"'
7,20,127,127,20,127,127,20, // '#'
6,36,46,107,107,58,18, // '$'
7,70,102,48,24,12,102,98, // '%'
7,48,122,79,93,55,122,72, // '&'
3,4,7,3, // '''
4,28,62,99,65, // '('
4,65,99,62,28, // ')'
8,8,42,62,28,28,62,42,8, // '*'
6,8,8,62,62,8,8, // '+'
3,128,224,96, // ','
6,8,8,8,8,8,8, // '-'
3,0,96,96, // '.'
7,96,48,24,12,6,3,1, // '/'
7,62,127,113,89,77,127,62, // '0'
6,64,66,127,127,64,64, // '1'
6,98,115,89,73,111,102, // '2'
6,34,99,73,73,127,54, // '3'
7,24,28,22,83,127,127,80, // '4'
6,39,103,69,69,125,57, // '5'
6,60,126,75,73,121,48, // '6'
6,3,3,113,121,15,7, // '7'
6,54,127,73,73,127,54, // '8'
6,6,79,73,105,63,30, // '9'
3,0,102,102, // ':'
3,128,230,102, // ';'
5,8,28,54,99,65, // '<'
6,36,36,36,36,36,36, // '='
5,65,99,54,28,8, // '>'
6,2,3,81,89,15,6, // '?'
7,62,127,65,93,93,31,30, // '@'
6,124,126,19,19,126,124, // 'A'
7,65,127,127,73,73,127,54, // 'B'
7,28,62,99,65,65,99,34, // 'C'
7,65,127,127,65,99,62,28, // 'D'
7,65,127,127,73,93,65,99, // 'E'
7,65,127,127,73,29,1,3, // 'F'
7,28,62,99,65,81,115,114, // 'G'
6,127,127,8,8,127,127, // 'H'
4,65,127,127,65, // 'I'
7,48,112,64,65,127,63,1, // 'J'
7,65,127,127,8,28,119,99, // 'K'
7,65,127,127,65,64,96,112, // 'L'
7,127,127,14,28,14,127,127, // 'M'
7,127,127,6,12,24,127,127, // 'N'
7,28,62,99,65,99,62,28, // 'O'
7,65,127,127,73,9,15,6, // 'P'
6,30,63,33,113,127,94, // 'Q'
7,65,127,127,9,25,127,102, // 'R'
6,38,111,77,89,115,50, // 'S'
6,3,65,127,127,65,3, // 'T'
6,127,127,64,64,127,127, // 'U'
6,31,63,96,96,63,31, // 'V'
7,127,127,48,24,48,127,127, // 'W'
7,67,103,60,24,60,103,67, // 'X'
6,7,79,120,120,79,7, // 'Y'
7,71,99,113,89,77,103,115, // 'Z'
4,127,127,65,65, // '['
7,1,3,6,12,24,48,96, // ''
4,65,65,127,127, // ']'
7,8,12,6,3,6,12,8, // '^'
8,128,128,128,128,128,128,128,128, // ''
4,0,3,7,4, // '`'
7,32,116,84,84,60,120,64, // 'a'
7,65,127,63,72,72,120,48, // 'b'
6,56,124,68,68,108,40, // 'c'
7,48,120,72,73,63,127,64, // 'd'
6,56,124,84,84,92,24, // 'e'
6,72,126,127,73,3,2, // 'f'
7,152,188,164,164,248,124,4, // 'g'
7,65,127,127,8,4,124,120, // 'h'
4,68,125,125,64, // 'i'
6,96,224,128,128,253,125, // 'j'
7,65,127,127,16,56,108,68, // 'k'
4,65,127,127,64, // 'l'
7,124,124,24,56,28,124,120, // 'm'
6,124,124,4,4,124,120, // 'n'
6,56,124,68,68,124,56, // 'o'
7,132,252,248,164,36,60,24, // 'p'
7,24,60,36,164,248,252,132, // 'q'
7,68,124,120,76,4,28,24, // 'r'
6,72,92,84,84,116,36, // 's'
5,4,62,127,68,36, // 't'
7,60,124,64,64,60,124,64, // 'u'
6,28,60,96,96,60,28, // 'v'
7,60,124,112,56,112,124,60, // 'w'
7,68,108,56,16,56,108,68, // 'x'
6,156,188,160,160,252,124, // 'y'
6,76,100,116,92,76,100, // 'z'
6,8,8,62,119,65,65, // '{'
4,0,0,119,119, // '|'
6,65,65,119,62,8,8, // '}'
7,2,3,1,3,2,3,1, // '~'
7,112,120,76,70,76,120,112,
6,14,159,145,177,251,74,
7,58,122,64,64,122,122,64,
6,56,124,84,85,93,25,
8,2,35,117,85,85,125,123,66,
7,33,117,84,84,125,121,64,
7,33,117,85,84,124,120,64,
7,32,116,87,87,124,120,64,
6,24,60,164,164,228,64,
8,2,59,125,85,85,93,27,2,
6,57,125,84,84,93,25,
6,57,125,85,84,92,24,
6,1,69,124,124,65,1,
7,2,3,69,125,125,67,2,
5,1,69,125,124,64,
7,121,125,22,18,22,125,121,
6,112,120,43,43,120,112,
6,68,124,124,85,85,69,
8,32,116,84,84,124,124,84,84,
7,124,126,11,9,127,127,73,
6,50,123,73,73,123,50,
6,50,122,72,72,122,50,
6,50,122,74,72,120,48,
7,58,123,65,65,123,122,64,
7,58,122,66,64,120,120,64,
6,154,186,160,160,250,122,
8,1,25,60,102,102,60,25,1,
6,61,125,64,64,125,61,
7,24,60,36,231,231,36,36,
7,104,126,127,73,67,102,32,
6,43,47,252,252,47,43,
8,255,255,9,9,47,246,248,160,
8,64,192,136,254,127,9,3,2,
7,32,116,84,85,125,121,64,
4,68,125,125,65,
6,48,120,72,74,122,50,
7,56,120,64,66,122,122,64,
6,122,122,10,10,122,112,
6,125,125,25,49,125,125,
6,38,47,41,47,47,40,
5,38,47,41,47,38,
6,48,120,77,69,96,32,
6,56,56,8,8,8,8,
6,8,8,8,8,56,56,
8,79,111,48,24,204,238,187,145,
8,79,111,48,24,108,118,251,249,
4,0,0,123,123,
8,8,28,54,34,8,28,54,34,
8,34,54,28,8,34,54,28,8,
7,170,0,85,0,170,0,85,
8,170,85,170,85,170,85,170,85,
8,221,255,170,119,221,170,255,119,
4,0,0,255,255,
5,16,16,16,255,255,
5,20,20,20,255,255,
7,16,16,255,255,0,255,255,
7,16,16,240,240,16,240,240,
5,20,20,20,252,252,
7,20,20,247,247,0,255,255,
6,0,255,255,0,255,255,
7,20,20,244,244,4,252,252,
7,20,20,23,23,16,31,31,
7,16,16,31,31,16,31,31,
5,20,20,20,31,31,
5,16,16,16,240,240,
7,0,0,31,31,16,16,16,
8,16,16,16,31,31,16,16,16,
8,16,16,16,240,240,16,16,16,
7,0,0,255,255,16,16,16,
8,16,16,16,16,16,16,16,16,
8,16,16,16,255,255,16,16,16,
7,0,0,255,255,20,20,20,
7,0,255,255,0,255,255,16,
7,0,31,31,16,23,23,20,
7,0,252,252,4,244,244,20,
8,20,20,23,23,16,23,23,20,
8,20,20,244,244,4,244,244,20,
7,0,255,255,0,247,247,20,
8,20,20,20,20,20,20,20,20,
8,20,20,247,247,0,247,247,20,
8,20,20,20,23,23,20,20,20,
8,16,16,31,31,16,31,31,16,
8,20,20,20,244,244,20,20,20,
8,16,16,240,240,16,240,240,16,
7,0,31,31,16,31,31,16,
7,0,0,31,31,20,20,20,
7,0,0,252,252,20,20,20,
7,0,240,240,16,240,240,16,
8,16,16,255,255,16,255,255,16,
8,20,20,20,255,255,20,20,20,
5,16,16,16,31,31,
7,0,0,240,240,16,16,16,
8,255,255,255,255,255,255,255,255,
8,240,240,240,240,240,240,240,240,
4,255,255,255,255,
7,0,0,0,255,255,255,255,
8,15,15,15,15,15,15,15,15,
7,56,124,68,108,56,108,68,
6,252,254,42,42,62,20,
6,126,126,2,2,6,6,
7,2,126,126,2,126,126,2,
6,99,119,93,73,99,99,
7,56,124,68,124,60,4,4,
7,128,254,126,32,32,62,30,
7,4,6,2,126,124,6,2,
6,153,189,231,231,189,153,
7,28,62,107,73,107,62,28,
7,76,126,115,1,115,126,76,
6,48,120,74,79,125,57,
8,24,60,36,60,60,36,60,24,
8,152,252,100,60,62,39,61,24,
5,28,62,107,73,73,
6,126,127,1,1,127,126,
6,42,42,42,42,42,42, // equivalent
6,68,68,95,95,68,68, // plus minus
6,64,81,91,78,68,64, // greater than equal
6,64,68,78,91,81,64, // less than equal
7,0,0,254,255,1,7,6, // j bar
5,96,224,128,255,127, // j bar
6,8,8,107,107,8,8, // divide
7,36,54,18,54,36,54,18, // approx
5,6,15,9,15,6, // degree
4,0,0,24,24, // dot
4,0,0,16,16, // dot
8,16,48,112,192,255,255,1,1, // square root
5,31,31,1,31,30, // superscript n
4,25,29,23,18, // superscript 2
5,0,60,60,60,60, // square
1,0, // NBSP
};

#endif
[/code]
3 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.