I'm using the small 128x64 OLED's. I have the small 5x7 font (one line/page in height) and a large 16x32 font (four lines in height), which both work well, but currently I'm in need of a font that is 24 pixels high (three lines in height). Anyone know of one? I didn't find anything.
I just typed "128x64 font" in google and found this within two seconds
Great. Thank you both. I was looking for "Arduino 24pt font".
I'm trying to make sense of the code from the Font Converter. I'm using this for something other than Arduino. If I have to transpose it I will.
The first two columns of the jump table obviously make up the offset to the character's data. The third column is how many bytes of data for that character. But what is the fourth column? Here's a sample of the data for "0" and "1".
const char Open_Sans_SemiBold_16[] PROGMEM = {
0x0F, // Width: 15
0x17, // Height: 23
0x20, // First Char: 32
0xE0, // Numbers of Chars: 224
// Jump Table:
...
0x01, 0x11, 0x17, 0x09, // 48:273
0x01, 0x28, 0x12, 0x09, // 49:296
// Font Data:
...
0x00,0x00,0x00,0x00,0xFF,0x00,0x80,0xFF,0x01,0xC0,0x00,0x03,0xC0,0x00,0x03,0xC0,0x00,0x03,0x80,0xFF,0x01,0x00,0xFF, // 48
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x03,0x00,0x80,0x01,0x00,0xC0,0xFF,0x03,0xC0,0xFF,0x03, // 49
It seems to be the width of the character
This generated font is meant to be used with this library GitHub - ThingPulse/esp8266-oled-ssd1306: Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
In the converter, at the bottom you can change to Adafruit_GFX library
Yeah, you beat me to it. At first it looked like one more than the number of columns of data, but then it occurred to me that it is probably the number of columns and the code must fill in with blanks until it reaches the end, to save codespace.
If we talking about Adafruit fonts - the structure of standard font (for example 5x7 font) is defined as
The font data are defined as
*
* struct _FONT_ {
* uint16_t font_Size_in_Bytes_over_all_included_Size_it_self;
* uint8_t font_Width_in_Pixel_for_fixed_drawing;
* uint8_t font_Height_in_Pixel_for_all_characters;
* unit8_t font_First_Char;
* uint8_t font_Char_Count;
*
* uint8_t font_Char_Widths[font_Last_Char - font_First_Char +1];
* // for each character the separate width in pixels,
* // characters < 128 have an implicit virtual right empty row
*
* uint8_t font_data[];
* // bit field of all characters
*/
Format for newer Adafruit GFX font structure is defined in the file gfxfont.h in the root folder of the library.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.