Canvas graphics library
0.1.0
This library is developed to perform canvas graphics in memory buffers
|
#include <font.h>
Public Member Functions | |
NanoFont () | |
NanoFont (const uint8_t *progmemFont) | |
void | loadFixedFont (const uint8_t *progmemFont) |
void | loadFreeFont (const uint8_t *progmemFont) |
void | loadSecondaryFont (const uint8_t *progmemUnicode) |
void | getCharBitmap (uint16_t ch, SCharInfo *info) |
returns char data for currently set (active) font. More... | |
lcduint_t | getTextSize (const char *text, lcduint_t *height=nullptr) |
returns text width in pixels (and its height if height is requested) More... | |
const SFontHeaderRecord & | getHeader () |
uint8_t | getPages () |
Static Public Member Functions | |
static uint16_t | unicode16FromUtf8 (uint8_t ch) |
NanoFont class implements work with fonts provided by the library: loading fonts, providing their parameters
|
inline |
Creates empty NanoFont object. Please, use loadFixedFont(), loadFreeFont(), loadSecondaryFont() functions after creating the object.
|
inline |
void NanoFont::getCharBitmap | ( | uint16_t | ch, |
SCharInfo * | info | ||
) |
returns char data for currently set (active) font.
Function returns char data for currently set font: pointer to progmem data for specified char, and width, height of the char. You can use these data to draw char manually using NanoDisplayOps1::drawBitmap1(), NanoDisplayOps8::drawBitmap1(), NanoDisplayOps16::drawBitmap1() or NanoCanvasOps::drawBitmap1().
ch | char to read from set font |
info | pointer to SCharInfo structure to fill with char data |
|
inline |
Returns reference to SFontHeaderRecord. This record contains some useful information on font like width, height, etc.
|
inline |
returns text width in pixels (and its height if height is requested)
Returns text width in pixels (and its height if height is requested)
text | pointer to null-terminated string |
height | pointer to lcduint_t variable to store height to. nullptr if height is not required |
void NanoFont::loadFixedFont | ( | const uint8_t * | progmemFont | ) |
Function allows to set another fixed font for the library. By default, the font supports only first 128 - 32 ascii chars. Please refer to github wiki on how to generate new fonts.
progmemFont | - font to setup located in Flash area |
void NanoFont::loadFreeFont | ( | const uint8_t * | progmemFont | ) |
Function allows to set another free font for the library. By default, the font supports only first 128 - 32 ascii chars. Please refer to github wiki on how to generate new fonts.
progmemFont | - font to setup located in Flash area |
void NanoFont::loadSecondaryFont | ( | const uint8_t * | progmemUnicode | ) |
Function allows sets secondary font for specific language. Use it if you want to use additional font to combine capabilities of ascii fonts and language specific font.
progmemUnicode | font containing unicode table (refer to ssd1306xled_font6x8_German as example). |
|
static |
Returns 16-bit unicode char, encoded in utf8 SSD1306_MORE_CHARS_REQUIRED if more characters is expected
ch | character byte to decode |