ソースを参照

feat: custom font

Struan Clark 2 年 前
コミット
c340eb5ec6
3 ファイル変更13 行追加5 行削除
  1. 2 2
      application.fam
  2. 1 1
      flipchess.h
  3. 10 2
      views/flipchess_startscreen.c

+ 2 - 2
application.fam

@@ -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",
-)
+)

+ 1 - 1
flipchess.h

@@ -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)

+ 10 - 2
views/flipchess_startscreen.c

@@ -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...");