MHVLib
20111011
An efficiency oriented runtime library for AVR microcontrollers
|
00001 #ifndef MHV_FONT_H 00002 #define MHV_FONT_H 00003 00004 #include <inttypes.h> 00005 #include <avr/pgmspace.h> 00006 00007 /* Font layout for use with display classes 00008 * A font contains a table font data, stored in program memory 00009 * Seperate tables contain information regarding widths & offsets into the table for each character 00010 * 00011 * The font data is stored MSB first (big endian) for multibyte fonts. The most significant bit is 00012 * at the bottom of the character, while the least significant is at the top 00013 */ 00014 00015 struct mhv_font { 00016 uint8_t maxWidth; // maximum width of a character 00017 uint8_t maxHeight; // maximum height of a character 00018 char firstChar; // the first character in the font 00019 uint8_t charCount; // the number of characters in the font 00020 char unknown; // which character to render unknowns to 00021 uint8_t columnBytes; // the number of bytes used for a column 00022 const uint8_t *widths; 00023 const uint16_t *offsets; 00024 const uint8_t *fontData; // most significant bit at the bottom 00025 }; 00026 typedef struct mhv_font MHV_FONT; 00027 00028 #endif /* MHV_FONT_H */