#include <Wire.h> #include <Adafruit_SSD1306.h> #include "arial_black_16.h" // Your custom library If you are using Adafruit_GFX, you need a custom print class. However, if you use U8g2 , the process is much easier because U8g2 accepts these headers natively:
void setup() { u8g2.begin(); u8g2.setFont(arial_black_16); // Note: The variable name inside your .h file } arial black 16.h library
static const u8g2_font_info_t arial_black_16_info = { "Arial Black 16", 16, // Height 8, // Width // ... Bounding box data ... }; #include <Wire
// arial_black_16.h - Generated by U8g2 #ifndef ARIAL_BLACK_16_H #define ARIAL_BLACK_16_H #include <U8g2lib.h> }; // arial_black_16
By understanding that this keyword points to a generated C-header file containing a bitmap array, you unlock the ability to put professional-looking, bold typography onto any screen, from an SPI OLED to a parallel TFT.