aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/ginput_touch_driver_test
diff options
context:
space:
mode:
Diffstat (limited to 'demos/modules/ginput_touch_driver_test')
-rw-r--r--demos/modules/ginput_touch_driver_test/gfxconf.h8
-rw-r--r--demos/modules/ginput_touch_driver_test/main.c12
2 files changed, 15 insertions, 5 deletions
diff --git a/demos/modules/ginput_touch_driver_test/gfxconf.h b/demos/modules/ginput_touch_driver_test/gfxconf.h
index a6d40f06..7be662b5 100644
--- a/demos/modules/ginput_touch_driver_test/gfxconf.h
+++ b/demos/modules/ginput_touch_driver_test/gfxconf.h
@@ -30,6 +30,14 @@
#define GDISP_NEED_ASYNC FALSE
#define GDISP_NEED_MSGAPI FALSE
+/* Builtin Fonts */
+#define GDISP_OLD_FONT_DEFINITIONS FALSE
+#define GDISP_INCLUDE_FONT_SMALL FALSE
+#define GDISP_INCLUDE_FONT_LARGER FALSE
+#define GDISP_INCLUDE_FONT_UI1 FALSE
+#define GDISP_INCLUDE_FONT_UI2 TRUE
+#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE
+
/* Features for the GWIN sub-system. */
#define GWIN_NEED_BUTTON TRUE
#define GWIN_NEED_CONSOLE TRUE
diff --git a/demos/modules/ginput_touch_driver_test/main.c b/demos/modules/ginput_touch_driver_test/main.c
index d8fe1739..a77e0b3f 100644
--- a/demos/modules/ginput_touch_driver_test/main.c
+++ b/demos/modules/ginput_touch_driver_test/main.c
@@ -40,6 +40,7 @@ int main(void) {
GHandle ghc, ghNext, ghPrev;
BaseSequentialStream *gp;
GEventType deviceType;
+ font_t font;
halInit(); // Initialise the Hardware
chSysInit(); // Initialize the OS
@@ -51,10 +52,11 @@ int main(void) {
ghNext = ghPrev = 0;
// Create our title
- gdispFillStringBox(0, 0, swidth, 20, "Touch Calibration", &fontUI2, Red, White, justifyLeft);
+ font = gdispOpenFont("UI2");
+ gdispFillStringBox(0, 0, swidth, 20, "Touch Calibration", font, Red, White, justifyLeft);
// Create our main display window
- ghc = gwinCreateConsole(&gc, 0, 20, swidth, sheight-20, &fontUI2);
+ ghc = gwinCreateConsole(&gc, 0, 20, swidth, sheight-20, font);
gwinClear(ghc);
gp = gwinGetConsoleStream(ghc);
@@ -195,13 +197,13 @@ StepCalibrate:
/* From now on we can use Next and Previous Buttons */
if (!ghNext) {
- ghNext = gwinCreateButton(&gNext, swidth-50, 0, 50, 20, &fontUI2, GBTN_NORMAL);
+ ghNext = gwinCreateButton(&gNext, swidth-50, 0, 50, 20, font, GBTN_NORMAL);
gwinSetButtonText(ghNext, "Next", FALSE);
gsNext = gwinGetButtonSource(ghNext);
geventAttachSource(&gl, gsNext, 0);
gwinAttachButtonMouseSource(ghNext, gs);
- ghPrev = gwinCreateButton(&gPrev, swidth-100, 0, 50, 20, &fontUI2, GBTN_NORMAL);
+ ghPrev = gwinCreateButton(&gPrev, swidth-100, 0, 50, 20, font, GBTN_NORMAL);
gwinSetButtonText(ghPrev, "Back", FALSE);
gsPrev = gwinGetButtonSource(ghPrev);
geventAttachSource(&gl, gsPrev, 0);
@@ -226,7 +228,7 @@ StepCalibrate:
}
// Calibration used the whole screen - re-establish our title
- gdispFillStringBox(0, 0, swidth, 20, "Touch Calibration", &fontUI2, Green, White, justifyLeft);
+ gdispFillStringBox(0, 0, swidth, 20, "Touch Calibration", font, Green, White, justifyLeft);
gwinButtonDraw(ghNext);
gwinButtonDraw(ghPrev);