oled 1.0
OLED Graphics Control Library
|
Header file for font handling and character bitmap retrieval. More...
#include <ctype.h>
#include <avr/io.h>
#include <avr/eeprom.h>
Go to the source code of this file.
Macros | |
#define | FONT_WIDTH 5 |
Defines the width in pixels of each character in the font. | |
#define | FONT_HEIGHT 7 |
Defines the height in pixels of each character in the font. | |
#define | FONT_ASCII_START_CHAR ' ' |
Specifies the starting ASCII character for the font. | |
#define | FONT_ASCII_END_CHAR '~' |
Specifies the ending ASCII character for the font. | |
#define | FONT_IGNORE_LOWER_CASE |
Converts all lowercase letters to uppercase to save memory in PROGMEM or EEPROM. | |
#define | FONT_STORE_IN_EEPROM |
Stores the font data in EEPROM memory. |
Functions | |
unsigned char * | font_getchararray (const char character) |
Retrieves the bitmap array for a given ASCII character from the font table. |
Header file for font handling and character bitmap retrieval.
This file defines macros for font dimensions, ASCII character range, and configuration options such as storing fonts in EEPROM or ignoring lower case characters. It provides the prototype for font_getchararray, a function that returns the bitmap data of a given ASCII character. The font data supports rendering text on graphical displays like OLED by converting characters into pixel patterns. Configuration macros allow customization of font size and storage.
#define FONT_ASCII_END_CHAR '~' |
Specifies the ending ASCII character for the font.
This macro defines the last ASCII character that the font supports or displays. It is used to set the ending character code when mapping font glyphs.
#define FONT_ASCII_START_CHAR ' ' |
Specifies the starting ASCII character for the font.
This macro defines the first ASCII character that the font supports or displays. It is used to set the beginning character code when mapping font glyphs.
#define FONT_HEIGHT 7 |
Defines the height in pixels of each character in the font.
This macro sets the vertical size of a single character glyph in pixels. It is used to define the font height for rendering text on graphical displays.
#define FONT_IGNORE_LOWER_CASE |
Converts all lowercase letters to uppercase to save memory in PROGMEM or EEPROM.
When this macro is defined, only uppercase letters are displayed by converting any lowercase letters to their uppercase equivalents. This helps reduce memory usage in program memory (PROGMEM) or EEPROM by avoiding the storage of separate lowercase glyphs.
#define FONT_STORE_IN_EEPROM |
Stores the font data in EEPROM memory.
When this macro is defined, font data is saved in the EEPROM memory instead of PROGMEM, which helps reduce PROGMEM usage. The amount of EEPROM required depends on the character set:
#define FONT_WIDTH 5 |
Defines the width in pixels of each character in the font.
This macro sets the horizontal size of a single character glyph in pixels. It is used to calculate spacing and positioning when rendering text on graphical displays.
unsigned char * font_getchararray | ( | char | character | ) |
Retrieves the bitmap array for a given ASCII character from the font table.
character | The ASCII character to retrieve the bitmap for. |
This function maps an input ASCII character to its corresponding bitmap pattern stored in the font table. If the character is outside the supported ASCII range defined by FONT_ASCII_START_CHAR and FONT_ASCII_END_CHAR, it defaults is the '?' character. When the macro FONT_IGNORE_LOWER_CASE is defined, lowercase letters are converted to uppercase to save memory, and adjustments are made to the character code accordingly.