diff options
Diffstat (limited to 'apps/examples/nxhello/nxhello_main.c')
-rw-r--r-- | apps/examples/nxhello/nxhello_main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/examples/nxhello/nxhello_main.c b/apps/examples/nxhello/nxhello_main.c index 02b2f17a2..98b16bb1d 100644 --- a/apps/examples/nxhello/nxhello_main.c +++ b/apps/examples/nxhello/nxhello_main.c @@ -61,6 +61,7 @@ #include <nuttx/arch.h> #include <nuttx/nx.h> #include <nuttx/nxglib.h> +#include <nuttx/nxfonts.h> #include "nxhello.h" @@ -101,6 +102,7 @@ struct nxhello_data_s g_nxhello = { NULL, /* hnx */ NULL, /* hbkgd */ + NULL, /* hfont */ 0, /* xres */ 0, /* yres */ false, /* havpos */ @@ -228,6 +230,16 @@ int MAIN_NAME(int argc, char *argv[]) goto errout; } + /* Get the default font handle */ + + g_nxhello.hfont = nxf_getfonthandle(NXFONT_DEFAULT); + if (!g_nxhello.hfont) + { + message("user_start: Failed to get font handle: %d\n", errno); + g_nxhello.code = NXEXIT_FONTOPEN; + goto errout; + } + /* Set the background to the configured background color */ message(MAIN_NAME_STRING ": Set background color=%d\n", |