From 99ffb319c5af373ef135c2a3e73bf1171e55559e Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 27 Jul 2011 14:43:45 +0000 Subject: Incorporated new fonts into examples; fix glyph allocation bug in nxhello git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3822 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/nxtext/nxtext_main.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'apps/examples/nxtext/nxtext_main.c') diff --git a/apps/examples/nxtext/nxtext_main.c b/apps/examples/nxtext/nxtext_main.c index 2ff941d0c..b7e2a3356 100644 --- a/apps/examples/nxtext/nxtext_main.c +++ b/apps/examples/nxtext/nxtext_main.c @@ -135,9 +135,10 @@ static const char *g_bgmsg[BGMSG_LINES] = NXHANDLE g_hnx = NULL; -/* The font handle */ +/* The font handles */ -NXHANDLE g_fonthandle = NULL; +NXHANDLE g_bghfont = NULL; +NXHANDLE g_puhfont = NULL; /* The screen resolution */ @@ -375,12 +376,20 @@ int MAIN_NAME(int argc, char **argv) goto errout; } - /* Get the default font handle */ + /* Get the configured font handles */ - g_fonthandle = nxf_getfonthandle(NXFONT_DEFAULT); - if (!g_fonthandle) + g_bghfont = nxf_getfonthandle(CONFIG_EXAMPLES_NXTEXT_BGFONTID); + if (!g_bghfont) { - message(MAIN_NAME_STRING ": Failed to get font handle: %d\n", errno); + message(MAIN_NAME_STRING ": Failed to get background font handle: %d\n", errno); + g_exitcode = NXEXIT_FONTOPEN; + goto errout; + } + + g_puhfont = nxf_getfonthandle(CONFIG_EXAMPLES_NXTEXT_PUFONTID); + if (!g_puhfont) + { + message(MAIN_NAME_STRING ": Failed to get pop-up font handle: %d\n", errno); g_exitcode = NXEXIT_FONTOPEN; goto errout; } -- cgit v1.2.3