Improving fonts

I made it work by following the instructions:

1

I’ve replaced the line from

if (font->Bitmap[(location * font->Height) + y] & (0x80 >> x))

to

if (font->Bitmap[(location * font->Height * ((font->Width + 4) / 8)) + (y*((font->Width + 4) / 8)) + (x >> 3)] & (0x80 >> (x&7)))

2

I’ve added void setBitmapFont(bitmap_font *newFont); to Layer_Background.h

3

Added

template <typename RGB, unsigned int optionFlags>
 void SMLayerBackground<RGB, optionFlags>::setBitmapFont(bitmap_font *newFont) {
     font = (bitmap_font *)newFont;
 }

to Layer_Background_Impl.h

4

I’ve made a calibri21x28b.c file inside src/ and copied all of the example font.

5

I’ve added #include <calibri21x28b.c> to my code.

6

I’ve called it using backgroundLayer.setBitmapFont((bitmap_font *)&calibri21x28b);

And it works just fine for now. I will test it more.