oled 1.0
OLED Graphics Control Library
|
Source file containing the ASCII font table data and character lookup function for text rendering. More...
#include "font.h"
Functions | |
unsigned char * | font_getchararray (char character) |
Retrieves the bitmap array for a given ASCII character from the font table. |
Variables | |
const unsigned char font_ascii_table[][5] | EEMEM |
Source file containing the ASCII font table data and character lookup function for text rendering.
This file defines the font data table for ASCII characters, supporting both uppercase and lowercase (unless excluded by macros). The font table can be located either in EEPROM or program memory (PROGMEM), depending on compile-time options. The character table entries represent the bitmap patterns for individual characters, which are selected by the lookup function font_getchararray(). This function handles bounds checking and optional conversion of lowercase to uppercase letters when enabled, to optimize memory usage. The table and accessor function are designed for use in embedded systems with constrained storage, such as microcontrollers, where font data is read for graphical text displays.
The configuration macros allow customization:
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.
const unsigned char font_ascii_table [][ 5 ] EEMEM |