summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-27 14:43:45 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-27 14:43:45 +0000
commit99ffb319c5af373ef135c2a3e73bf1171e55559e (patch)
tree7aa08fa81a006d354469de2652043ab969d8a3c4
parentce09509ff8c3127b4cc07ebcaae78229d5b2d90a (diff)
downloadnuttx-99ffb319c5af373ef135c2a3e73bf1171e55559e.tar.gz
nuttx-99ffb319c5af373ef135c2a3e73bf1171e55559e.tar.bz2
nuttx-99ffb319c5af373ef135c2a3e73bf1171e55559e.zip
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
-rwxr-xr-xapps/ChangeLog.txt3
-rw-r--r--apps/examples/README.txt8
-rw-r--r--apps/examples/nx/nx_internal.h6
-rw-r--r--apps/examples/nx/nx_main.c2
-rw-r--r--apps/examples/nxhello/nxhello.h7
-rw-r--r--apps/examples/nxhello/nxhello_bkgd.c14
-rw-r--r--apps/examples/nxhello/nxhello_main.c2
-rw-r--r--apps/examples/nxtext/nxtext_bkgd.c8
-rw-r--r--apps/examples/nxtext/nxtext_internal.h19
-rw-r--r--apps/examples/nxtext/nxtext_main.c21
-rw-r--r--apps/examples/nxtext/nxtext_popup.c6
-rw-r--r--apps/examples/nxtext/nxtext_putc.c24
-rw-r--r--nuttx/Documentation/NXGraphicsSubsystem.html18
-rw-r--r--nuttx/Documentation/NuttxPortingGuide.html27
-rw-r--r--nuttx/configs/README.txt19
-rw-r--r--nuttx/configs/stm3210e-eval/nsh2/defconfig26
-rw-r--r--nuttx/configs/stm3210e-eval/nx/defconfig23
-rw-r--r--nuttx/configs/stm3210e-eval/nxtext/defconfig29
-rw-r--r--nuttx/graphics/README.txt18
19 files changed, 227 insertions, 53 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt
index 658d99ecc..5e16125e5 100755
--- a/apps/ChangeLog.txt
+++ b/apps/ChangeLog.txt
@@ -89,3 +89,6 @@
nuttx/include/nuttx/nx.
* apps/examples/usbstorage: Added instrumentation to monitor memory usage
to check for memory leaks in the USB storage driver.
+ * apps/examples/nxhello/nxhello_bkgd.c: Fix handling of allocated glyph
+ memory.
+
diff --git a/apps/examples/README.txt b/apps/examples/README.txt
index ba04e216f..06e84ce45 100644
--- a/apps/examples/README.txt
+++ b/apps/examples/README.txt
@@ -269,6 +269,8 @@ examples/nx
CONFIG_EXAMPLES_NX_BPP.
CONFIG_EXAMPLES_NX_TBCOLOR -- The color of the toolbar. Default depends on
CONFIG_EXAMPLES_NX_BPP.
+ CONFIG_EXAMPLES_NX_FONTID - Selects the font (see font ID numbers in
+ include/nuttx/nx/nxfonts.h)
CONFIG_EXAMPLES_NX_FONTCOLOR -- The color of the fonts. Default depends on
CONFIG_EXAMPLES_NX_BPP.
CONFIG_EXAMPLES_NX_BPP -- Pixels per pixel to use. Valid options
@@ -341,6 +343,8 @@ examplex/nxhello
driver for use in the test: Default: 0
CONFIG_EXAMPLES_NXHELLO_BGCOLOR -- The color of the background. Default
depends on CONFIG_EXAMPLES_NXHELLO_BPP.
+ CONFIG_EXAMPLES_NXHELLO_FONTID - Selects the font (see font ID numbers in
+ include/nuttx/nx/nxfonts.h)
CONFIG_EXAMPLES_NXHELLO_FONTCOLOR -- The color of the fonts used in the
background window. Default depends on CONFIG_EXAMPLES_NXHELLO_BPP.
CONFIG_EXAMPLES_NXHELLO_BPP -- Pixels per pixel to use. Valid options
@@ -427,10 +431,14 @@ examples/nxtext
driver for use in the test: Default: 0
CONFIG_EXAMPLES_NXTEXT_BGCOLOR -- The color of the background. Default
depends on CONFIG_EXAMPLES_NXTEXT_BPP.
+ CONFIG_EXAMPLES_NXTEXT_BGFONTID - Selects the font to use in the
+ background text (see font ID numbers in include/nuttx/nx/nxfonts.h)
CONFIG_EXAMPLES_NXTEXT_BGFONTCOLOR -- The color of the fonts used in the
background window. Default depends on CONFIG_EXAMPLES_NXTEXT_BPP.
CONFIG_EXAMPLES_NXTEXT_PUCOLOR -- The color of the pop-up window. Default
depends on CONFIG_EXAMPLES_NXTEXT_BPP.
+ CONFIG_EXAMPLES_NXTEXT_PUFONTID - Selects the font to use in the pop-up
+ windows (see font ID numbers in include/nuttx/nx/nxfonts.h)
CONFIG_EXAMPLES_NXTEXT_PUFONTCOLOR -- The color of the fonts used in the
background window. Default depends on CONFIG_EXAMPLES_NXTEXT_BPP.
CONFIG_EXAMPLES_NXTEXT_BPP -- Pixels per pixel to use. Valid options
diff --git a/apps/examples/nx/nx_internal.h b/apps/examples/nx/nx_internal.h
index b733a185f..a0fae77a9 100644
--- a/apps/examples/nx/nx_internal.h
+++ b/apps/examples/nx/nx_internal.h
@@ -45,8 +45,10 @@
#include <stdint.h>
#include <stdbool.h>
#include <semaphore.h>
+
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
+#include <nuttx/nx/nxfonts.h>
/****************************************************************************
* Definitions
@@ -106,6 +108,10 @@
# endif
#endif
+#ifndef CONFIG_EXAMPLES_NX_FONTID
+# define CONFIG_EXAMPLES_NX_FONTID NXFONT_DEFAULT
+#endif
+
#ifndef CONFIG_EXAMPLES_NX_FONTCOLOR
# if CONFIG_EXAMPLES_NX_BPP == 24 || CONFIG_EXAMPLES_NX_BPP == 32
# define CONFIG_EXAMPLES_NX_FONTCOLOR 0x00000000
diff --git a/apps/examples/nx/nx_main.c b/apps/examples/nx/nx_main.c
index d0beda92e..db17ea2f2 100644
--- a/apps/examples/nx/nx_main.c
+++ b/apps/examples/nx/nx_main.c
@@ -647,7 +647,7 @@ int MAIN_NAME(int argc, char *argv[])
/* Get the default font handle */
- g_fonthandle = nxf_getfonthandle(NXFONT_DEFAULT);
+ g_fonthandle = nxf_getfonthandle(CONFIG_EXAMPLES_NX_FONTID);
if (!g_fonthandle)
{
message(MAIN_NAME_STRING ": Failed to get font handle: %d\n", errno);
diff --git a/apps/examples/nxhello/nxhello.h b/apps/examples/nxhello/nxhello.h
index 93c6d8fac..169285856 100644
--- a/apps/examples/nxhello/nxhello.h
+++ b/apps/examples/nxhello/nxhello.h
@@ -46,8 +46,9 @@
#include <stdbool.h>
#include <semaphore.h>
-#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxglib.h>
+#include <nuttx/nx/nx.h>
+#include <nuttx/nx/nxfonts.h>
/****************************************************************************
* Definitions
@@ -77,6 +78,10 @@
# endif
#endif
+#ifndef CONFIG_EXAMPLES_NXHELLO_FONTID
+# define CONFIG_EXAMPLES_NXHELLO_FONTID NXFONT_DEFAULT
+#endif
+
#ifndef CONFIG_EXAMPLES_NXHELLO_FONTCOLOR
# if CONFIG_EXAMPLES_NXHELLO_BPP == 24 || CONFIG_EXAMPLES_NXHELLO_BPP == 32
# define CONFIG_EXAMPLES_NXHELLO_FONTCOLOR 0x00000000
diff --git a/apps/examples/nxhello/nxhello_bkgd.c b/apps/examples/nxhello/nxhello_bkgd.c
index 43bfc0516..93b7798e1 100644
--- a/apps/examples/nxhello/nxhello_bkgd.c
+++ b/apps/examples/nxhello/nxhello_bkgd.c
@@ -233,7 +233,7 @@ static void nxhello_center(FAR struct nxgl_point_s *pos,
{
/* Add the font size */
- width += fbm->metric.width;
+ width += fbm->metric.width + fbm->metric.xoffset;
}
else
{
@@ -349,6 +349,7 @@ void nxhello_hello(NXWINDOW hwnd)
FAR struct nxgl_rect_s dest;
FAR const void *src[CONFIG_NX_NPLANES];
unsigned int glyphsize;
+ unsigned int mxstride;
int ret;
/* Get information about the font we are going to use */
@@ -357,8 +358,9 @@ void nxhello_hello(NXWINDOW hwnd)
/* Allocate a bit of memory to hold the largest rendered font */
- glyphsize = (unsigned int)fontset->mxheight * (unsigned int)fontset->mxwidth;
- glyph = (FAR uint8_t*)malloc(glyphsize);
+ mxstride = (fontset->mxwidth * CONFIG_EXAMPLES_NXHELLO_BPP + 7) >> 3;
+ glyphsize = (unsigned int)fontset->mxheight * mxstride;
+ glyph = (FAR uint8_t*)malloc(glyphsize);
/* NOTE: no check for failure to allocate the memory. In a real application
* you would need to handle that event.
@@ -388,7 +390,7 @@ void nxhello_hello(NXWINDOW hwnd)
fwidth = fbm->metric.width + fbm->metric.xoffset;
fheight = fbm->metric.height + fbm->metric.yoffset;
- fstride = (fwidth * CONFIG_EXAMPLES_NXHELLO_BPP + 7) / 8;
+ fstride = (fwidth * CONFIG_EXAMPLES_NXHELLO_BPP + 7) >> 3;
/* Initialize the glyph memory to the background color */
@@ -434,4 +436,8 @@ void nxhello_hello(NXWINDOW hwnd)
pos.x += fontset->spwidth;
}
}
+
+ /* Free the allocated glyph */
+
+ free(glyph);
}
diff --git a/apps/examples/nxhello/nxhello_main.c b/apps/examples/nxhello/nxhello_main.c
index d83b354d7..e71df98d1 100644
--- a/apps/examples/nxhello/nxhello_main.c
+++ b/apps/examples/nxhello/nxhello_main.c
@@ -232,7 +232,7 @@ int MAIN_NAME(int argc, char *argv[])
/* Get the default font handle */
- g_nxhello.hfont = nxf_getfonthandle(NXFONT_DEFAULT);
+ g_nxhello.hfont = nxf_getfonthandle(CONFIG_EXAMPLES_NXHELLO_FONTID);
if (!g_nxhello.hfont)
{
message(MAIN_NAME_STRING ": Failed to get font handle: %d\n", errno);
diff --git a/apps/examples/nxtext/nxtext_bkgd.c b/apps/examples/nxtext/nxtext_bkgd.c
index a87425112..90cc19165 100644
--- a/apps/examples/nxtext/nxtext_bkgd.c
+++ b/apps/examples/nxtext/nxtext_bkgd.c
@@ -136,7 +136,7 @@ static void nxbg_redrawrect(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect)
for (i = 0; i < g_bgstate.nchars; i++)
{
- nxtext_fillchar(hwnd, rect, &g_bgstate, &g_bgstate.bm[i]);
+ nxtext_fillchar(hwnd, rect, &g_bgstate, g_bghfont, &g_bgstate.bm[i]);
}
}
@@ -271,7 +271,7 @@ static inline void nxbg_movedisplay(NXWINDOW hwnd, int bottom, int lineheight)
bm = &g_bgstate.bm[i];
if (bm->pos.y <= rect.pt2.y && bm->pos.y + g_bgstate.fheight >= rect.pt1.y)
{
- nxtext_fillchar(hwnd, &rect, &g_bgstate, bm);
+ nxtext_fillchar(hwnd, &rect, &g_bgstate, g_bghfont, bm);
}
}
}
@@ -402,7 +402,7 @@ FAR struct nxtext_state_s *nxbg_getstate(void)
* state structure
*/
- fontset = nxf_getfontset(g_fonthandle);
+ fontset = nxf_getfontset(g_bghfont);
g_bgstate.fheight = fontset->mxheight;
g_bgstate.fwidth = fontset->mxwidth;
g_bgstate.spwidth = fontset->spwidth;
@@ -462,6 +462,6 @@ void nxbg_write(NXWINDOW hwnd, FAR const uint8_t *buffer, size_t buflen)
/* Finally, we can output the character */
- nxtext_putc(hwnd, &g_bgstate, (uint8_t)*buffer++);
+ nxtext_putc(hwnd, &g_bgstate, g_bghfont, (uint8_t)*buffer++);
}
}
diff --git a/apps/examples/nxtext/nxtext_internal.h b/apps/examples/nxtext/nxtext_internal.h
index 98579ffdf..caf8cd9fc 100644
--- a/apps/examples/nxtext/nxtext_internal.h
+++ b/apps/examples/nxtext/nxtext_internal.h
@@ -45,8 +45,10 @@
#include <stdint.h>
#include <stdbool.h>
#include <semaphore.h>
+
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
+#include <nuttx/nx/nxfonts.h>
/****************************************************************************
* Definitions
@@ -76,6 +78,10 @@
# endif
#endif
+#ifndef CONFIG_EXAMPLES_NXTEXT_PUFONTID
+# define CONFIG_EXAMPLES_NXTEXT_PUFONTID NXFONT_DEFAULT
+#endif
+
#ifndef CONFIG_EXAMPLES_NXTEXT_PUCOLOR
# if CONFIG_EXAMPLES_NXTEXT_BPP == 24 || CONFIG_EXAMPLES_NXTEXT_BPP == 32
# define CONFIG_EXAMPLES_NXTEXT_PUCOLOR 0x00dcdcdc
@@ -86,6 +92,10 @@
# endif
#endif
+#ifndef CONFIG_EXAMPLES_NXTEXT_BGFONTID
+# define CONFIG_EXAMPLES_NXTEXT_BGFONTID NXFONT_DEFAULT
+#endif
+
#ifndef CONFIG_EXAMPLES_NXTEXT_BGFONTCOLOR
# if CONFIG_EXAMPLES_NXTEXT_BPP == 24 || CONFIG_EXAMPLES_NXTEXT_BPP == 32
# define CONFIG_EXAMPLES_NXTEXT_BGFONTCOLOR 0x00000000
@@ -263,9 +273,10 @@ extern NXHANDLE g_hnx;
extern NXHANDLE g_bgwnd;
-/* The font handle */
+/* The font handlse */
-extern NXHANDLE g_fonthandle;
+extern NXHANDLE g_bghfont;
+extern NXHANDLE g_puhfont;
/* NX callback vtables */
@@ -311,9 +322,9 @@ extern int nxpu_close(NXWINDOW hwnd);
extern void nxtext_home(FAR struct nxtext_state_s *st);
extern void nxtext_newline(FAR struct nxtext_state_s *st);
extern void nxtext_putc(NXWINDOW hwnd, FAR struct nxtext_state_s *st,
- uint8_t ch);
+ NXHANDLE hfont, uint8_t ch);
extern void nxtext_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
- FAR struct nxtext_state_s *st,
+ FAR struct nxtext_state_s *st, NXHANDLE hfont,
FAR const struct nxtext_bitmap_s *bm);
#endif /* __EXAMPLES_NXTEXT_NXTEXT_INTERNAL_H */
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;
}
diff --git a/apps/examples/nxtext/nxtext_popup.c b/apps/examples/nxtext/nxtext_popup.c
index c0c66f4ef..f00f6a040 100644
--- a/apps/examples/nxtext/nxtext_popup.c
+++ b/apps/examples/nxtext/nxtext_popup.c
@@ -196,7 +196,7 @@ static inline void nxpu_fillwindow(NXWINDOW hwnd,
nxtext_home(st);
for (i = 0; i < st->nchars; i++)
{
- nxtext_fillchar(hwnd, rect, st, &st->bm[i]);
+ nxtext_fillchar(hwnd, rect, st, g_puhfont, &st->bm[i]);
}
#endif
}
@@ -265,7 +265,7 @@ static inline void nxpu_puts(NXWINDOW hwnd, FAR struct nxtext_state_s *st,
nxtext_home(st);
while (nch--)
{
- nxtext_putc(hwnd, st, *ch++);
+ nxtext_putc(hwnd, st, g_puhfont, *ch++);
}
}
@@ -304,7 +304,7 @@ static inline void nxpu_initstate(void)
*/
#ifdef CONFIG_NX_KBD
- fontset = nxf_getfontset(g_fonthandle);
+ fontset = nxf_getfontset(g_puhfont);
g_pustate.fheight = fontset->mxheight;
g_pustate.fwidth = fontset->mxwidth;
g_pustate.spwidth = fontset->spwidth;
diff --git a/apps/examples/nxtext/nxtext_putc.c b/apps/examples/nxtext/nxtext_putc.c
index 5c1749269..dfecfe33f 100644
--- a/apps/examples/nxtext/nxtext_putc.c
+++ b/apps/examples/nxtext/nxtext_putc.c
@@ -326,13 +326,13 @@ nxtext_renderglyph(FAR struct nxtext_state_s *st,
* Name: nxtext_fontsize
****************************************************************************/
-static int nxtext_fontsize(uint8_t ch, FAR struct nxgl_size_s *size)
+static int nxtext_fontsize(NXHANDLE hfont, uint8_t ch, FAR struct nxgl_size_s *size)
{
FAR const struct nx_fontbitmap_s *fbm;
/* No, it is not cached... Does the code map to a font? */
- fbm = nxf_getbitmap(g_fonthandle, ch);
+ fbm = nxf_getbitmap(hfont, ch);
if (fbm)
{
/* Yes.. return the font size */
@@ -350,7 +350,7 @@ static int nxtext_fontsize(uint8_t ch, FAR struct nxgl_size_s *size)
****************************************************************************/
static FAR struct nxtext_glyph_s *
-nxtext_getglyph(FAR struct nxtext_state_s *st, uint8_t ch)
+nxtext_getglyph(NXHANDLE hfont, FAR struct nxtext_state_s *st, uint8_t ch)
{
FAR struct nxtext_glyph_s *glyph;
FAR const struct nx_fontbitmap_s *fbm;
@@ -362,7 +362,7 @@ nxtext_getglyph(FAR struct nxtext_state_s *st, uint8_t ch)
{
/* No, it is not cached... Does the code map to a font? */
- fbm = nxf_getbitmap(g_fonthandle, ch);
+ fbm = nxf_getbitmap(hfont, ch);
if (fbm)
{
/* Yes.. render the glyph */
@@ -384,7 +384,7 @@ nxtext_getglyph(FAR struct nxtext_state_s *st, uint8_t ch)
****************************************************************************/
static FAR const struct nxtext_bitmap_s *
-nxtext_addchar(FAR struct nxtext_state_s *st, uint8_t ch)
+nxtext_addchar(NXHANDLE hfont, FAR struct nxtext_state_s *st, uint8_t ch)
{
FAR struct nxtext_bitmap_s *bm = NULL;
FAR struct nxtext_glyph_s *glyph;
@@ -403,7 +403,7 @@ nxtext_addchar(FAR struct nxtext_state_s *st, uint8_t ch)
/* Find (or create) the matching glyph */
- glyph = nxtext_getglyph(st, ch);
+ glyph = nxtext_getglyph(hfont, st, ch);
if (!glyph)
{
/* No, there is no font for this code. Just mark this as a space. */
@@ -479,7 +479,7 @@ void nxtext_newline(FAR struct nxtext_state_s *st)
*
****************************************************************************/
-void nxtext_putc(NXWINDOW hwnd, FAR struct nxtext_state_s *st, uint8_t ch)
+void nxtext_putc(NXWINDOW hwnd, FAR struct nxtext_state_s *st, NXHANDLE hfont, uint8_t ch)
{
FAR const struct nxtext_bitmap_s *bm;
@@ -498,10 +498,10 @@ void nxtext_putc(NXWINDOW hwnd, FAR struct nxtext_state_s *st, uint8_t ch)
else
{
- bm = nxtext_addchar(st, ch);
+ bm = nxtext_addchar(hfont, st, ch);
if (bm)
{
- nxtext_fillchar(hwnd, NULL, st, bm);
+ nxtext_fillchar(hwnd, NULL, st, hfont, bm);
}
}
}
@@ -517,7 +517,7 @@ void nxtext_putc(NXWINDOW hwnd, FAR struct nxtext_state_s *st, uint8_t ch)
void nxtext_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
FAR struct nxtext_state_s *st,
- FAR const struct nxtext_bitmap_s *bm)
+ NXHANDLE hfont, FAR const struct nxtext_bitmap_s *bm)
{
FAR struct nxtext_glyph_s *glyph;
struct nxgl_rect_s bounds;
@@ -534,7 +534,7 @@ void nxtext_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
/* Get the size of the font glyph (which may not have been created yet) */
- ret = nxtext_fontsize(bm->code, &fsize);
+ ret = nxtext_fontsize(hfont, bm->code, &fsize);
if (ret < 0)
{
/* This would mean that there is no bitmap for the character code and
@@ -576,7 +576,7 @@ void nxtext_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
/* Find (or create) the glyph that goes with this font */
- glyph = nxtext_getglyph(st, bm->code);
+ glyph = nxtext_getglyph(hfont, st, bm->code);
if (!glyph)
{
/* Shouldn't happen */
diff --git a/nuttx/Documentation/NXGraphicsSubsystem.html b/nuttx/Documentation/NXGraphicsSubsystem.html
index 56da66b9b..eb2247fe5 100644
--- a/nuttx/Documentation/NXGraphicsSubsystem.html
+++ b/nuttx/Documentation/NXGraphicsSubsystem.html
@@ -12,7 +12,7 @@
<h1><big><font color="#3c34ec">
<i>NX Graphics Subsystem</i>
</font></big></h1>
- <p>Last Updated: July 24, 2011</p>
+ <p>Last Updated: July 27 2011</p>
</td>
</tr>
</table>
@@ -2724,8 +2724,20 @@ int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height,
<dd>The number of bits in the character set. Current options are
only 7 and 8. The default is 7.
<dt><code>CONFIG_NXFONT_SANS23X27</code>:
- <dd>At present, there is only one font, a 23x27 san serif font.
- But if there were were more, then this option would select that sans serif font.
+ <dd>This option enables support for a small, 23x27 san serif font
+ (font ID <code>FONTID_SANS23X27</code> == 1)
+ <dt><code>CONFIG_NXFONT_SANS28X37B</code>:
+ <dd>This option enables support for a medium, 28x37 san serif bold font
+ (font ID <code>FONTID_SANS28X37B</code> == 2)
+ <dt><code>CONFIG_NXFONT_SANS40X49B</code>:
+ <dd>This option enables support for a large, 40x49 san serif bold font
+ (font ID <code>FONTID_SANS40X49B</code> == 3)
+ <dt><code>CONFIG_NXFONT_SERIF27X38B</code>:
+ <dd>This option enables support for a medium, 27x38 bold font (with serifs)
+ (font ID <code>FONTID_SERIF27X38B</code> == 4)
+ <dt><code>CONFIG_NXFONT_SERIF29X37</code>:
+ <dd>This option enables support for a medium, 29x37 font (with serifs)
+ (font ID <code>FONTID_SERIF29X37</code> == 5)
</dl>
</ul>
diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
index 22dfbb1f6..0260e0f22 100644
--- a/nuttx/Documentation/NuttxPortingGuide.html
+++ b/nuttx/Documentation/NuttxPortingGuide.html
@@ -12,7 +12,7 @@
<h1><big><font color="#3c34ec">
<i>NuttX RTOS Porting Guide</i>
</font></big></h1>
- <p>Last Updated: July 13, 2011</p>
+ <p>Last Updated: July 27, 2011</p>
</td>
</tr>
</table>
@@ -4480,6 +4480,31 @@ build
At present, there is only one font, a 23x27 sans serif font.
But if there were were more, then this option would select that sans serif font.
</li>
+ <li>
+ <code>CONFIG_NXFONT_SANS23X27</code>:
+ This option enables support for a small, 23x27 san serif font
+ (font <code>ID FONTID_SANS23X27</code> == 1).
+ </li>
+ <li>
+ <code>CONFIG_NXFONT_SANS28X37B</code>:
+ This option enables support for a medium, 28x37 san serif bold font
+ (font ID <code>FONTID_SANS28X37B</code> == 2).
+ </li>
+ <li>
+ <code>CONFIG_NXFONT_SANS40X49B</code>:
+ This option enables support for a large, 40x49 san serif bold font
+ (font ID <code>FONTID_SANS40X49B</code> == 3).
+ </li>
+ <li>
+ <code>CONFIG_NXFONT_SERIF27X38B</code>:
+ This option enables support for a medium, 27x38 bold font (with serifs)
+ (font ID <code>FONTID_SERIF27X38B</code> == 4).
+ </li>
+ <li>
+ <code>CONFIG_NXFONT_SERIF29X37</code>:
+ This option enables support for a medium, 29x37 font (with serifs)
+ (font ID <code>FONTID_SERIF29X37</code> == 5).
+ </li>
</ul>
<h3>NX Multi-user only options</h3>
diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt
index 57c74babd..b4d8097c2 100644
--- a/nuttx/configs/README.txt
+++ b/nuttx/configs/README.txt
@@ -973,10 +973,21 @@ defconfig -- This is a configuration file similar to the Linux
CONFIG_NXFONTS_CHARBITS
The number of bits in the character set. Current options are
only 7 and 8. The default is 7.
- CONFIG_NXFONT_SANS23X27
- At present, there is only one font, a 23x27 sans serif font. But
- if there were were more, then this option would select that sans serif
- font.
+ CONFIG_NXFONT_SANS23X27:
+ This option enables support for a small, 23x27 san serif font
+ (font ID FONTID_SANS23X27 == 1)
+ CONFIG_NXFONT_SANS28X37B:
+ This option enables support for a medium, 28x37 san serif bold font
+ (font ID FONTID_SANS28X37B == 2)
+ CONFIG_NXFONT_SANS40X49B:
+ This option enables support for a large, 40x49 san serif bold font
+ (font ID FONTID_SANS40X49B == 3)
+ CONFIG_NXFONT_SERIF27X38B:
+ This option enables support for a medium, 27x38 bold font (with serifs)
+ (font ID FONTID_SERIF27X38B == 4)
+ CONFIG_NXFONT_SERIF29X37:
+ This option enables support for a medium, 29x37 font (with serifs)
+ (font ID FONTID_SERIF29X37 == 5)
NX Multi-user only options:
diff --git a/nuttx/configs/stm3210e-eval/nsh2/defconfig b/nuttx/configs/stm3210e-eval/nsh2/defconfig
index 0a6bc8ab3..ae66ef7cc 100644
--- a/nuttx/configs/stm3210e-eval/nsh2/defconfig
+++ b/nuttx/configs/stm3210e-eval/nsh2/defconfig
@@ -781,8 +781,20 @@ CONFIG_USBSTRG_REMOVABLE=y
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
# CONFIG_NXFONT_SANS23X27
-# At present, there is only one font. But if there were were more,
-# then this option would select the sans serif font.
+# This option enables support for a small, 23x27 san serif font
+# (font ID FONTID_SANS23X27 == 1)
+# CONFIG_NXFONT_SANS28X37B
+# This option enables support for a medium, 28x37 san serif bold font
+# (font ID FONTID_SANS28X37B == 2)
+# CONFIG_NXFONT_SANS40X49B
+# This option enables support for a large, 40x49 san serif bold font
+# (font ID FONTID_SANS40X49B == 3)
+# CONFIG_NXFONT_SERIF27X38B
+# This option enables support for a medium, 27x38 bold font (with serifs)
+# (font ID FONTID_SERIF27X38B == 4)
+# CONFIG_NXFONT_SERIF29X37
+# This option enables support for a medium, 29x37 font (with serifs)
+# (font ID FONTID_SERIF29X37 == 5)
#
# NX Multi-user only options:
#
@@ -817,6 +829,10 @@ CONFIG_NXTK_BORDERCOLOR1=0xd69a
CONFIG_NXTK_BORDERCOLOR2=0xad55
CONFIG_NXTK_AUTORAISE=n
CONFIG_NXFONT_SANS23X27=y
+CONFIG_NXFONT_SANS28X37B=y
+CONFIG_NXFONT_SANS40X49B=n
+CONFIG_NXFONT_SERIF27X38B=n
+CONFIG_NXFONT_SERIF29X37=n
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
@@ -984,6 +1000,8 @@ CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n
# CONFIG_EXAMPLES_NX_BPP.
# CONFIG_EXAMPLES_NX_TBCOLOR -- The color of the toolbar. Default depends on
# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_FONTID - Selects the font (see font ID numbers in
+# include/nuttx/nx/nxfonts.h)
# CONFIG_EXAMPLES_NX_FONTCOLOR -- The color of the toolbar. Default depends on
# CONFIG_EXAMPLES_NX_BPP.
# CONFIG_EXAMPLES_NX_BPP -- Pixels per pixel to use. Valid options
@@ -1004,6 +1022,7 @@ CONFIG_EXAMPLES_NX_BGCOLOR=0x0011
CONFIG_EXAMPLES_NX_COLOR1=0xaedc
CONFIG_EXAMPLES_NX_COLOR2=0xe7ff
CONFIG_EXAMPLES_NX_TBCOLOR=0xd69a
+CONFIG_EXAMPLES_NX_FONTID=0
CONFIG_EXAMPLES_NX_FONTCOLOR=0x0000
CONFIG_EXAMPLES_NX_BPP=16
CONFIG_EXAMPLES_NX_RAWWINDOWS=n
@@ -1024,6 +1043,8 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=n
# driver for use in the test: Default: 0
# CONFIG_EXAMPLES_NXHELLO_BGCOLOR -- The color of the background. Default
# depends on CONFIG_EXAMPLES_NXHELLO_BPP.
+# CONFIG_EXAMPLES_NXHELLO_FONTID - Selects the font (see font ID numbers in
+# include/nuttx/nx/nxfonts.h)
# CONFIG_EXAMPLES_NXHELLO_FONTCOLOR -- The color of the fonts used in the
# background window. Default depends on CONFIG_EXAMPLES_NXHELLO_BPP.
# CONFIG_EXAMPLES_NXHELLO_BPP -- Pixels per pixel to use. Valid options
@@ -1038,6 +1059,7 @@ CONFIG_EXAMPLES_NXHELLO_BUILTIN=y
CONFIG_EXAMPLES_NXHELLO_VPLANE=0
CONFIG_EXAMPLES_NXHELLO_DEVNO=0
CONFIG_EXAMPLES_NXHELLO_BGCOLOR=0x0011
+CONFIG_EXAMPLES_NXHELLO_FONTID=2
CONFIG_EXAMPLES_NXHELLO_FONTCOLOR=0xffdf
CONFIG_EXAMPLES_NXHELLO_BPP=16
CONFIG_EXAMPLES_NXHELLO_EXTERNINIT=n
diff --git a/nuttx/configs/stm3210e-eval/nx/defconfig b/nuttx/configs/stm3210e-eval/nx/defconfig
index 354e72e34..c32779fce 100644
--- a/nuttx/configs/stm3210e-eval/nx/defconfig
+++ b/nuttx/configs/stm3210e-eval/nx/defconfig
@@ -768,8 +768,20 @@ CONFIG_USBSTRG_REMOVABLE=y
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
# CONFIG_NXFONT_SANS23X27
-# At present, there is only one font. But if there were were more,
-# then this option would select the sans serif font.
+# This option enables support for a small, 23x27 san serif font
+# (font ID FONTID_SANS23X27 == 1)
+# CONFIG_NXFONT_SANS28X37B
+# This option enables support for a medium, 28x37 san serif bold font
+# (font ID FONTID_SANS28X37B == 2)
+# CONFIG_NXFONT_SANS40X49B
+# This option enables support for a large, 40x49 san serif bold font
+# (font ID FONTID_SANS40X49B == 3)
+# CONFIG_NXFONT_SERIF27X38B
+# This option enables support for a medium, 27x38 bold font (with serifs)
+# (font ID FONTID_SERIF27X38B == 4)
+# CONFIG_NXFONT_SERIF29X37
+# This option enables support for a medium, 29x37 font (with serifs)
+# (font ID FONTID_SERIF29X37 == 5)
#
# NX Multi-user only options:
#
@@ -804,6 +816,10 @@ CONFIG_NXTK_BORDERCOLOR1=0xd69a
CONFIG_NXTK_BORDERCOLOR2=0xad55
CONFIG_NXTK_AUTORAISE=n
CONFIG_NXFONT_SANS23X27=y
+CONFIG_NXFONT_SANS28X37B=n
+CONFIG_NXFONT_SANS40X49B=n
+CONFIG_NXFONT_SERIF27X38B=n
+CONFIG_NXFONT_SERIF29X37=n
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
@@ -967,6 +983,8 @@ CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n
# CONFIG_EXAMPLES_NX_BPP.
# CONFIG_EXAMPLES_NX_TBCOLOR -- The color of the toolbar. Default depends on
# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_FONTID - Selects the font (see font ID numbers in
+# include/nuttx/nx/nxfonts.h)
# CONFIG_EXAMPLES_NX_FONTCOLOR -- The color of the toolbar. Default depends on
# CONFIG_EXAMPLES_NX_BPP.
# CONFIG_EXAMPLES_NX_BPP -- Pixels per pixel to use. Valid options
@@ -987,6 +1005,7 @@ CONFIG_EXAMPLES_NX_BGCOLOR=0x0011
CONFIG_EXAMPLES_NX_COLOR1=0xaedc
CONFIG_EXAMPLES_NX_COLOR2=0xe7ff
CONFIG_EXAMPLES_NX_TBCOLOR=0xd69a
+CONFIG_EXAMPLES_NX_FONTID=0
CONFIG_EXAMPLES_NX_FONTCOLOR=0x0000
CONFIG_EXAMPLES_NX_BPP=16
CONFIG_EXAMPLES_NX_RAWWINDOWS=n
diff --git a/nuttx/configs/stm3210e-eval/nxtext/defconfig b/nuttx/configs/stm3210e-eval/nxtext/defconfig
index 3d9548b70..a65e884b7 100644
--- a/nuttx/configs/stm3210e-eval/nxtext/defconfig
+++ b/nuttx/configs/stm3210e-eval/nxtext/defconfig
@@ -768,8 +768,20 @@ CONFIG_USBSTRG_REMOVABLE=y
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
# CONFIG_NXFONT_SANS23X27
-# At present, there is only one font. But if there were were more,
-# then this option would select the sans serif font.
+# This option enables support for a small, 23x27 san serif font
+# (font ID FONTID_SANS23X27 == 1)
+# CONFIG_NXFONT_SANS28X37B
+# This option enables support for a medium, 28x37 san serif bold font
+# (font ID FONTID_SANS28X37B == 2)
+# CONFIG_NXFONT_SANS40X49B
+# This option enables support for a large, 40x49 san serif bold font
+# (font ID FONTID_SANS40X49B == 3)
+# CONFIG_NXFONT_SERIF27X38B
+# This option enables support for a medium, 27x38 bold font (with serifs)
+# (font ID FONTID_SERIF27X38B == 4)
+# CONFIG_NXFONT_SERIF29X37
+# This option enables support for a medium, 29x37 font (with serifs)
+# (font ID FONTID_SERIF29X37 == 5)
#
# NX Multi-user only options:
#
@@ -804,6 +816,10 @@ CONFIG_NXTK_BORDERCOLOR1=0xd69a
CONFIG_NXTK_BORDERCOLOR2=0xad55
CONFIG_NXTK_AUTORAISE=n
CONFIG_NXFONT_SANS23X27=y
+CONFIG_NXFONT_SANS28X37B=y
+CONFIG_NXFONT_SANS40X49B=n
+CONFIG_NXFONT_SERIF27X38B=n
+CONFIG_NXFONT_SERIF29X37=n
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
@@ -967,6 +983,8 @@ CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n
# CONFIG_EXAMPLES_NX_BPP.
# CONFIG_EXAMPLES_NX_TBCOLOR -- The color of the toolbar. Default depends on
# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_FONTID - Selects the font (see font ID numbers in
+# include/nuttx/nx/nxfonts.h)
# CONFIG_EXAMPLES_NX_FONTCOLOR -- The color of the toolbar. Default depends on
# CONFIG_EXAMPLES_NX_BPP.
# CONFIG_EXAMPLES_NX_BPP -- Pixels per pixel to use. Valid options
@@ -987,6 +1005,7 @@ CONFIG_EXAMPLES_NX_BGCOLOR=0x0011
CONFIG_EXAMPLES_NX_COLOR1=0xaedc
CONFIG_EXAMPLES_NX_COLOR2=0xe7ff
CONFIG_EXAMPLES_NX_TBCOLOR=0xd69a
+CONFIG_EXAMPLES_NX_FONTID=0
CONFIG_EXAMPLES_NX_FONTCOLOR=0x0000
CONFIG_EXAMPLES_NX_BPP=16
CONFIG_EXAMPLES_NX_RAWWINDOWS=n
@@ -1007,10 +1026,14 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=n
# driver for use in the test: Default: 0
# CONFIG_EXAMPLES_NXTEXT_BGCOLOR -- The color of the background. Default
# depends on CONFIG_EXAMPLES_NXTEXT_BPP.
+# CONFIG_EXAMPLES_NXTEXT_BGFONTID - Selects the font to use in the
+# background text (see font ID numbers in include/nuttx/nx/nxfonts.h)
# CONFIG_EXAMPLES_NXTEXT_BGFONTCOLOR -- The color of the fonts used in the
# background window. Default depends on CONFIG_EXAMPLES_NXTEXT_BPP.
# CONFIG_EXAMPLES_NXTEXT_PUCOLOR -- The color of the pop-up window. Default
# depends on CONFIG_EXAMPLES_NXTEXT_BPP.
+# CONFIG_EXAMPLES_NXTEXT_PUFONTID - Selects the font to use in the pop-up
+# windows (see font ID numbers in include/nuttx/nx/nxfonts.h)
# CONFIG_EXAMPLES_NXTEXT_PUFONTCOLOR -- The color of the fonts used in the
# background window. Default depends on CONFIG_EXAMPLES_NXTEXT_BPP.
# CONFIG_EXAMPLES_NXTEXT_BPP -- Pixels per pixel to use. Valid options
@@ -1038,8 +1061,10 @@ CONFIG_EXAMPLES_NXTEXT_BUILTIN=n
CONFIG_EXAMPLES_NXTEXT_VPLANE=0
CONFIG_EXAMPLES_NXTEXT_DEVNO=0
CONFIG_EXAMPLES_NXTEXT_BGCOLOR=0x0011
+CONFIG_EXAMPLES_NXTEXT_BGFONTID=2
CONFIG_EXAMPLES_NXTEXT_BGFONTCOLOR=0xffdf
CONFIG_EXAMPLES_NXTEXT_PUCOLOR=0xfd20
+CONFIG_EXAMPLES_NXTEXT_PUFONTID=1
CONFIG_EXAMPLES_NXTEXT_PUFONTCOLOR=0x001f
CONFIG_EXAMPLES_NXTEXT_BPP=16
CONFIG_EXAMPLES_NXTEXT_NOGETRUN=y
diff --git a/nuttx/graphics/README.txt b/nuttx/graphics/README.txt
index 7cbf095e0..027bfd396 100644
--- a/nuttx/graphics/README.txt
+++ b/nuttx/graphics/README.txt
@@ -262,9 +262,21 @@ CONFIG_NXTK_AUTORAISE
CONFIG_NXFONTS_CHARBITS
The number of bits in the character set. Current options are only 7 and 8.
The default is 7.
-CONFIG_NXFONT_SANS23X27
- At present, there is only one font, a 23x27 sans serif fount. But if
- there were were more, then this option would select that sans serif font.
+CONFIG_NXFONT_SANS23X27:
+ This option enables support for a small, 23x27 san serif font
+ (font ID FONTID_SANS23X27 == 1)
+CONFIG_NXFONT_SANS28X37B:
+ This option enables support for a medium, 28x37 san serif bold font
+ (font ID FONTID_SANS28X37B == 2)
+CONFIG_NXFONT_SANS40X49B:
+ This option enables support for a large, 40x49 san serif bold font
+ (font ID FONTID_SANS40X49B == 3)
+CONFIG_NXFONT_SERIF27X38B:
+ This option enables support for a medium, 27x38 bold font (with serifs)
+ (font ID FONTID_SERIF27X38B == 4)
+CONFIG_NXFONT_SERIF29X37:
+ This option enables support for a medium, 29x37 font (with serifs)
+ (font ID FONTID_SERIF29X37 == 5)
NX Multi-user only options: