Skip to content

Commit

Permalink
feat: allow checking for new fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
xtruan committed Aug 16, 2023
1 parent fab74b5 commit fa78a7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions applications/services/gui/canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ typedef enum {
ColorXOR = 0x02,
} Color;

/** Provide defines to permit checking if new are fonts available*/
#define CANVAS_HAS_FONT_SCUMM_ROMAN_OUTLINE = 1
#define CANVAS_HAS_FONT_SCUMM_ROMAN = 1
#define CANVAS_HAS_FONT_EUROCORP = 1

/** Fonts enumeration */
typedef enum {
FontPrimary,
Expand Down
4 changes: 4 additions & 0 deletions applications/services/gui/modules/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,11 @@ static void menu_draw_callback(Canvas* canvas, void* _model) {
case MenuStyleEurocorp: {
for(uint8_t i = 0; i < 3; i++) {
canvas_set_color(canvas, ColorBlack);
#ifdef CANVAS_HAS_FONT_EUROCORP
canvas_set_font(canvas, FontEurocorp);
#else
canvas_set_font(canvas, FontPrimary);
#endif
shift_position = (position + items_count + i - 1) % items_count;
item = MenuItemArray_get(model->items, shift_position);
menu_short_name(item, name);
Expand Down

0 comments on commit fa78a7f

Please sign in to comment.