Skip to content

Commit

Permalink
feat: custom font
Browse files Browse the repository at this point in the history
  • Loading branch information
xtruan committed Aug 16, 2023
1 parent cad1750 commit c340eb5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ App(
fap_category="Games",
fap_author="Struan Clark (xtruan)",
fap_weburl="https://github.com/xtruan/flipper-chess",
fap_version=(1, 8),
fap_version=(1, 9),
fap_description="Chess for Flipper",
)
)
2 changes: 1 addition & 1 deletion flipchess.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "views/flipchess_startscreen.h"
#include "views/flipchess_scene_1.h"

#define FLIPCHESS_VERSION "v1.8.0"
#define FLIPCHESS_VERSION "v1.9.0"

#define TEXT_BUFFER_SIZE 96
#define TEXT_SIZE (TEXT_BUFFER_SIZE - 1)
Expand Down
12 changes: 10 additions & 2 deletions views/flipchess_startscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,18 @@ void flipchess_startscreen_draw(Canvas* canvas, FlipChessStartscreenModel* model

canvas_draw_icon(canvas, 0, 0, &I_FLIPR_128x64);

#ifdef CANVAS_HAS_FONT_SCUMM_ROMAN_OUTLINE
const uint8_t text_x_pos = 2;
const uint8_t text_y_pos = 12;
canvas_set_font(canvas, FontScummRomanOutline);
#else
const uint8_t text_x_pos = 4;
const uint8_t text_y_pos = 11;
canvas_set_font(canvas, FontPrimary);
canvas_draw_str(canvas, 4, 11, "Chess");
#endif
canvas_draw_str(canvas, text_x_pos, text_y_pos, "Chess");
canvas_set_font(canvas, FontSecondary);
canvas_draw_str(canvas, 62, 11, FLIPCHESS_VERSION);
canvas_draw_str(canvas, 62, text_y_pos, FLIPCHESS_VERSION);

//canvas_set_font(canvas, FontSecondary);
//canvas_draw_str(canvas, 10, 11, "How about a nice game of...");
Expand Down

0 comments on commit c340eb5

Please sign in to comment.