Custom font set function (#2261)
* custom font set function * update API symbols * add example of custom font usage * delete u8g2 dependency in example custom font * rename to canvas_set_custom_u8g2_font * now change the name in ALL places Co-authored-by: あく <alleteam@gmail.com> Co-authored-by: hedger <hedger@users.noreply.github.com>
This commit is contained in:
@@ -137,6 +137,12 @@ void canvas_set_font(Canvas* canvas, Font font) {
|
||||
}
|
||||
}
|
||||
|
||||
void canvas_set_custom_u8g2_font(Canvas* canvas, const uint8_t* font) {
|
||||
furi_assert(canvas);
|
||||
u8g2_SetFontMode(&canvas->fb, 1);
|
||||
u8g2_SetFont(&canvas->fb, font);
|
||||
}
|
||||
|
||||
void canvas_draw_str(Canvas* canvas, uint8_t x, uint8_t y, const char* str) {
|
||||
furi_assert(canvas);
|
||||
if(!str) return;
|
||||
|
@@ -146,6 +146,13 @@ void canvas_invert_color(Canvas* canvas);
|
||||
*/
|
||||
void canvas_set_font(Canvas* canvas, Font font);
|
||||
|
||||
/** Set custom drawing font
|
||||
*
|
||||
* @param canvas Canvas instance
|
||||
* @param font Pointer to u8g2 const uint8_t* font array
|
||||
*/
|
||||
void canvas_set_custom_u8g2_font(Canvas* canvas, const uint8_t* font);
|
||||
|
||||
/** Draw string at position of baseline defined by x, y.
|
||||
*
|
||||
* @param canvas Canvas instance
|
||||
|
Reference in New Issue
Block a user