stm32_graphics_display_drivers
stm32_graphics_display_drivers copied to clipboard
Add font?
Hi. Thanks for your hard work on this library. I want to ask on how can we add a custom font and font size.
- copy one of the C files to the font folder, give it your own name (eg copy font24.c myfont24.c)
- open the myfont24.c file
- modify: const uint8_t Font24_Table -> const uint8_t MyFont24_Table
- modify: sFONT Font24 = {Font24_Table -> sFONT MyFont24 = {MyFont24_Table,
- modify the character bitmap patterns
- Open the fonts.h file
- add the following: extern sFONT MyFont24;
- use it You can also change the font size in the c file: sFONT MyFont24 = { Font24_Table, 17, / * Width * / 24, / * Height * / };
Hi Roberto. Thank you so much for writing the library. I checked adding new fonts and everything works for a 16x32 pixel font, but when I wanted to insert a larger 32x48 font, it was no longer displayed. I did everything as described above and I also found this piece of code in stm32_adafruit_lcd.c, `#define MAX_HEIGHT_FONT 48 #define MAX_WIDTH_FONT 32 #define OFFSET_BITMAP 54
/* Max size of bitmap will based on a font24 (17x24) */ static uint8_t bitmap[MAX_HEIGHT_FONT * MAX_WIDTH_FONT * 2 + OFFSET_BITMAP] = {0};` I didn't quite understand what it does and set the maximum font sizes, but it still didn't work.
Can you put an example project somewhere with such a large character set?
Can you put an example project somewhere with such a large character set? < I wanted to make something like this screen.
Is there a character set file that didn't work well? Can you share it?
