summaryrefslogtreecommitdiff
path: root/apps/examples/nxtext/nxtext_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/examples/nxtext/nxtext_main.c')
-rw-r--r--apps/examples/nxtext/nxtext_main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/examples/nxtext/nxtext_main.c b/apps/examples/nxtext/nxtext_main.c
index 6a53f9d2c..a9d9207e6 100644
--- a/apps/examples/nxtext/nxtext_main.c
+++ b/apps/examples/nxtext/nxtext_main.c
@@ -61,6 +61,7 @@
#include <nuttx/arch.h>
#include <nuttx/nx.h>
#include <nuttx/nxglib.h>
+#include <nuttx/nxfonts.h>
#include "nxtext_internal.h"
@@ -134,6 +135,10 @@ static const char *g_bgmsg[BGMSG_LINES] =
NXHANDLE g_hnx = NULL;
+/* The font handle */
+
+NXHANDLE g_fonthandle = NULL;
+
/* The screen resolution */
nxgl_coord_t g_xres;
@@ -366,6 +371,16 @@ int user_start(int argc, char *argv[])
goto errout;
}
+ /* Get the default font handle */
+
+ g_fonthandle = nxf_getfonthandle(NXFONT_DEFAULT);
+ if (!g_fonthandle)
+ {
+ message("user_start: Failed to get font handle: %d\n", errno);
+ g_exitcode = NXEXIT_FONTOPEN;
+ goto errout;
+ }
+
/* Set the background to the configured background color */
message("user_start: Set background color=%d\n", CONFIG_EXAMPLES_NXTEXT_BGCOLOR);