// Font character handling data and methods
charDef_t *_userChars; // the root of the list of user defined characters
uint8_t _cBuf[15]; // buffer for loading character font
uint8_t _charSpacing; // spacing in columns between characters
uint8_t _charCols; // number of columns for this character
int16_t _countCols; // count of number of columns already shown
MD_MAX72XX::fontType_t *_fontDef; // font for this zone
cBuf [15] seems a bit risky. Would not it be better to ask the font which is its maximum width ???
In my case I use 22 pixels wide fonts ... and strange things happened before identifying this array of uint8_t .....
uint8_t MD_MAX72XX::getMaxFontWidth(void)
{
uint8_t max = 0, charWidth;
uint16_t offset = 1;
if (_fontIndex == NULL)
return 0;
PRINTS("\nFinding max font width");
for (int16_t i=0; i<FONT_INDEX_SIZE; i++)
{
charWidth = pgm_read_byte(_fontData+offset);
PRINT("\nASCII '", i);
PRINT("' offset ", offset);
PRINT("' max width ", max);
if (charWidth > max)
charWidth = max;
offset += charWidth;
offset++;
}
return max;
}
in MD_Parola.h
cBuf [15] seems a bit risky. Would not it be better to ask the font which is its maximum width ???
In my case I use 22 pixels wide fonts ... and strange things happened before identifying this array of uint8_t .....