From 118a2dd458332cf4cc4f93be275fc15d19e8167f Mon Sep 17 00:00:00 2001
From: patacongo
Date: Tue, 19 Jul 2011 20:08:28 +0000
Subject: [PATCH] Setup environment to support multiple fonts
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3799 42af7a65-404d-4744-a932-0658087f49c3
---
Documentation/NXGraphicsSubsystem.html | 22 ++++---
Documentation/NuttxPortingGuide.html | 6 +-
configs/README.txt | 7 +-
configs/ez80f910200kitg/ostest/defconfig | 4 +-
configs/ez80f910200zco/dhcpd/defconfig | 4 +-
configs/ez80f910200zco/httpd/defconfig | 4 +-
configs/ez80f910200zco/nettest/defconfig | 4 +-
configs/ez80f910200zco/nsh/defconfig | 4 +-
configs/ez80f910200zco/ostest/defconfig | 4 +-
configs/ez80f910200zco/poll/defconfig | 4 +-
configs/lm3s6965-ek/nx/defconfig | 4 +-
configs/lm3s8962-ek/nx/defconfig | 4 +-
configs/lpcxpresso-lpc1768/nx/defconfig | 4 +-
configs/olimex-lpc1766stk/nx/defconfig | 4 +-
configs/sam3u-ek/knsh/defconfig | 4 +-
configs/sam3u-ek/nsh/defconfig | 4 +-
configs/sam3u-ek/nx/defconfig | 4 +-
configs/sim/nx/defconfig | 4 +-
configs/sim/nx/defconfig-x11 | 4 +-
configs/stm3210e-eval/nsh2/defconfig | 4 +-
configs/stm3210e-eval/nx/defconfig | 4 +-
configs/stm3210e-eval/nxtext/defconfig | 4 +-
graphics/README.txt | 6 +-
graphics/nxfonts/nxfonts_bitmaps.c | 8 +--
graphics/nxfonts/nxfonts_getfont.c | 18 +++--
graphics/nxfonts/nxfonts_internal.h | 4 +-
.../{nxfonts_sans.h => nxfonts_sans23x27.h} | 26 ++++----
include/nuttx/nxfonts.h | 65 ++++++++++++++-----
include/nuttx/sched.h | 2 +-
sched/sem_timedwait.c | 4 +-
30 files changed, 147 insertions(+), 97 deletions(-)
rename graphics/nxfonts/{nxfonts_sans.h => nxfonts_sans23x27.h} (98%)
diff --git a/Documentation/NXGraphicsSubsystem.html b/Documentation/NXGraphicsSubsystem.html
index 065f00b7a23..93425526639 100644
--- a/Documentation/NXGraphicsSubsystem.html
+++ b/Documentation/NXGraphicsSubsystem.html
@@ -12,7 +12,7 @@
NX Graphics Subsystem
- Last Updated: July 10, 2011
+ Last Updated: July 19, 2011
@@ -2402,14 +2402,18 @@ struct nx_font_s
#include <nuttx/nxglib.h>
#include <nuttx/nxfonts.h>
-FAR const struct nx_font_s *nxf_getfontset(void);
+FAR const struct nx_font_s *nxf_getfontset(enum nx_fontid_e fontid);
Description:
Return information about the current font set.
- Input Parameters: None
+ Input Parameters:
+
+ fontid
+ - Identifies the font set to get
+
Returned Value:
@@ -2422,7 +2426,7 @@ FAR const struct nx_font_s *nxf_getfontset(void);
#include <nuttx/nxglib.h>
#include <nuttx/nxfonts.h>
-FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch);
+FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch, enum nx_fontid_e fontid);
Description:
@@ -2431,8 +2435,10 @@ FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch);
Input Parameters:
-
+ ch
-
+
fontid
+ - Identifies the font set to use
@@ -2676,9 +2682,9 @@ int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height,
CONFIG_NXFONTS_CHARBITS:
The number of bits in the character set. Current options are
only 7 and 8. The default is 7.
- CONFIG_NXFONT_SANS:
- At present, there is only one font. But if there were were more,
- then this option would select the sans serif font.
+ CONFIG_NXFONT_SANS23X27:
+ 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.
diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html
index ba2c65402ec..22dfbb1f621 100644
--- a/Documentation/NuttxPortingGuide.html
+++ b/Documentation/NuttxPortingGuide.html
@@ -4476,9 +4476,9 @@ build
only 7 and 8. The default is 7.
- CONFIG_NXFONT_SANS:
- At present, there is only one font. But if there were were more,
- then this option would select the sans serif font.
+ 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.
diff --git a/configs/README.txt b/configs/README.txt
index 95ff0f7b825..57c74babdcb 100644
--- a/configs/README.txt
+++ b/configs/README.txt
@@ -973,9 +973,10 @@ 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_SANS
- At present, there is only one font. But if there were were more,
- then this option would select the sans serif font.
+ 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.
NX Multi-user only options:
diff --git a/configs/ez80f910200kitg/ostest/defconfig b/configs/ez80f910200kitg/ostest/defconfig
index 886533daa41..5fea9f7a4f2 100644
--- a/configs/ez80f910200kitg/ostest/defconfig
+++ b/configs/ez80f910200kitg/ostest/defconfig
@@ -572,7 +572,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -605,7 +605,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/ez80f910200zco/dhcpd/defconfig b/configs/ez80f910200zco/dhcpd/defconfig
index ca499c9a48e..40cbb674a21 100644
--- a/configs/ez80f910200zco/dhcpd/defconfig
+++ b/configs/ez80f910200zco/dhcpd/defconfig
@@ -580,7 +580,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -613,7 +613,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/ez80f910200zco/httpd/defconfig b/configs/ez80f910200zco/httpd/defconfig
index 09acb43f3ca..5e2801348e9 100644
--- a/configs/ez80f910200zco/httpd/defconfig
+++ b/configs/ez80f910200zco/httpd/defconfig
@@ -580,7 +580,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -613,7 +613,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/ez80f910200zco/nettest/defconfig b/configs/ez80f910200zco/nettest/defconfig
index 6923717d48e..9468c7b5b9a 100644
--- a/configs/ez80f910200zco/nettest/defconfig
+++ b/configs/ez80f910200zco/nettest/defconfig
@@ -580,7 +580,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -613,7 +613,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/ez80f910200zco/nsh/defconfig b/configs/ez80f910200zco/nsh/defconfig
index 43c0a3de180..60abb1e7725 100644
--- a/configs/ez80f910200zco/nsh/defconfig
+++ b/configs/ez80f910200zco/nsh/defconfig
@@ -580,7 +580,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -613,7 +613,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/ez80f910200zco/ostest/defconfig b/configs/ez80f910200zco/ostest/defconfig
index 054e9fe0aa0..7649d22bd31 100644
--- a/configs/ez80f910200zco/ostest/defconfig
+++ b/configs/ez80f910200zco/ostest/defconfig
@@ -575,7 +575,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -608,7 +608,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/ez80f910200zco/poll/defconfig b/configs/ez80f910200zco/poll/defconfig
index c2a74015277..133ef6a753d 100644
--- a/configs/ez80f910200zco/poll/defconfig
+++ b/configs/ez80f910200zco/poll/defconfig
@@ -580,7 +580,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -613,7 +613,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/lm3s6965-ek/nx/defconfig b/configs/lm3s6965-ek/nx/defconfig
index 759c14d3a79..2a8bb6e990d 100755
--- a/configs/lm3s6965-ek/nx/defconfig
+++ b/configs/lm3s6965-ek/nx/defconfig
@@ -548,7 +548,7 @@ CONFIG_NET_RESOLV_ENTRIES=4
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -584,7 +584,7 @@ CONFIG_NX_KBD=y
CONFIG_NXTK_BORDERCOLOR1=8
CONFIG_NXTK_BORDERCOLOR2=4
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/lm3s8962-ek/nx/defconfig b/configs/lm3s8962-ek/nx/defconfig
index e76f69a9e53..0ccbe5e023f 100755
--- a/configs/lm3s8962-ek/nx/defconfig
+++ b/configs/lm3s8962-ek/nx/defconfig
@@ -548,7 +548,7 @@ CONFIG_NET_RESOLV_ENTRIES=4
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -584,7 +584,7 @@ CONFIG_NX_KBD=y
CONFIG_NXTK_BORDERCOLOR1=8
CONFIG_NXTK_BORDERCOLOR2=4
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/lpcxpresso-lpc1768/nx/defconfig b/configs/lpcxpresso-lpc1768/nx/defconfig
index 477ca4ef772..c54eec489c0 100755
--- a/configs/lpcxpresso-lpc1768/nx/defconfig
+++ b/configs/lpcxpresso-lpc1768/nx/defconfig
@@ -759,7 +759,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -795,7 +795,7 @@ CONFIG_NXTK_BORDERWIDTH=2
CONFIG_NXTK_BORDERCOLOR1=1
CONFIG_NXTK_BORDERCOLOR2=0
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/olimex-lpc1766stk/nx/defconfig b/configs/olimex-lpc1766stk/nx/defconfig
index 1ffd9defe88..309bf31acb2 100755
--- a/configs/olimex-lpc1766stk/nx/defconfig
+++ b/configs/olimex-lpc1766stk/nx/defconfig
@@ -739,7 +739,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -775,7 +775,7 @@ CONFIG_NX_KBD=y
CONFIG_NXTK_BORDERCOLOR1=8
CONFIG_NXTK_BORDERCOLOR2=4
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/sam3u-ek/knsh/defconfig b/configs/sam3u-ek/knsh/defconfig
index 51f83efc34e..ddf6a23ff62 100755
--- a/configs/sam3u-ek/knsh/defconfig
+++ b/configs/sam3u-ek/knsh/defconfig
@@ -702,7 +702,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -738,7 +738,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/sam3u-ek/nsh/defconfig b/configs/sam3u-ek/nsh/defconfig
index 9294603f49c..8cbbbdcb1cb 100755
--- a/configs/sam3u-ek/nsh/defconfig
+++ b/configs/sam3u-ek/nsh/defconfig
@@ -672,7 +672,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -708,7 +708,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/sam3u-ek/nx/defconfig b/configs/sam3u-ek/nx/defconfig
index ea1b6093673..c50d242e11a 100755
--- a/configs/sam3u-ek/nx/defconfig
+++ b/configs/sam3u-ek/nx/defconfig
@@ -681,7 +681,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -717,7 +717,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/sim/nx/defconfig b/configs/sim/nx/defconfig
index 2962d6b0bc6..d4688ea4988 100644
--- a/configs/sim/nx/defconfig
+++ b/configs/sim/nx/defconfig
@@ -369,7 +369,7 @@ CONFIG_NET_RESOLV_ENTRIES=4
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -402,7 +402,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/sim/nx/defconfig-x11 b/configs/sim/nx/defconfig-x11
index 27a6a51fa0b..9228786dfea 100644
--- a/configs/sim/nx/defconfig-x11
+++ b/configs/sim/nx/defconfig-x11
@@ -369,7 +369,7 @@ CONFIG_NET_RESOLV_ENTRIES=4
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -402,7 +402,7 @@ CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/stm3210e-eval/nsh2/defconfig b/configs/stm3210e-eval/nsh2/defconfig
index 988d659e4b7..951980caac4 100644
--- a/configs/stm3210e-eval/nsh2/defconfig
+++ b/configs/stm3210e-eval/nsh2/defconfig
@@ -775,7 +775,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -811,7 +811,7 @@ CONFIG_NX_KBD=y
CONFIG_NXTK_BORDERCOLOR1=0xd69a
CONFIG_NXTK_BORDERCOLOR2=0xad55
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/stm3210e-eval/nx/defconfig b/configs/stm3210e-eval/nx/defconfig
index bf6e25e7a61..44633cbc179 100644
--- a/configs/stm3210e-eval/nx/defconfig
+++ b/configs/stm3210e-eval/nx/defconfig
@@ -767,7 +767,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -803,7 +803,7 @@ CONFIG_NX_KBD=y
CONFIG_NXTK_BORDERCOLOR1=0xd69a
CONFIG_NXTK_BORDERCOLOR2=0xad55
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/configs/stm3210e-eval/nxtext/defconfig b/configs/stm3210e-eval/nxtext/defconfig
index 98efcf9a797..5b658f0ad8d 100644
--- a/configs/stm3210e-eval/nxtext/defconfig
+++ b/configs/stm3210e-eval/nxtext/defconfig
@@ -767,7 +767,7 @@ CONFIG_USBSTRG_REMOVABLE=y
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
-# CONFIG_NXFONT_SANS
+# 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.
#
@@ -803,7 +803,7 @@ CONFIG_NX_KBD=y
CONFIG_NXTK_BORDERCOLOR1=0xd69a
CONFIG_NXTK_BORDERCOLOR2=0xad55
CONFIG_NXTK_AUTORAISE=n
-CONFIG_NXFONT_SANS=y
+CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
diff --git a/graphics/README.txt b/graphics/README.txt
index 1822067ade7..c99a72809c2 100644
--- a/graphics/README.txt
+++ b/graphics/README.txt
@@ -118,9 +118,9 @@ 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_SANS
- At present, there is only one font. But if there were were more, then this
- option would select the sans serif font.
+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.
NX Multi-user only options:
diff --git a/graphics/nxfonts/nxfonts_bitmaps.c b/graphics/nxfonts/nxfonts_bitmaps.c
index f215260cfe4..622c4c0f3ec 100644
--- a/graphics/nxfonts/nxfonts_bitmaps.c
+++ b/graphics/nxfonts/nxfonts_bitmaps.c
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxfonts/nxfonts_bitmap.h
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -46,10 +46,10 @@
/* Pick the fontset */
-#ifdef CONFIG_NXFONT_SANS
-# include "nxfonts_sans.h"
+#ifdef CONFIG_NXFONT_SANS23X27
+# include "nxfonts_sans23x27.h"
#else
-# include "nxfonts_sans.h"
+# include "nxfonts_sans23x27.h"
#endif
/****************************************************************************
diff --git a/graphics/nxfonts/nxfonts_getfont.c b/graphics/nxfonts/nxfonts_getfont.c
index 3c53cae7f7f..52b7774a80a 100644
--- a/graphics/nxfonts/nxfonts_getfont.c
+++ b/graphics/nxfonts/nxfonts_getfont.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxfonts/nxfonts_getfont.h
+ * graphics/nxfonts/nxfonts_getfont.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,10 @@
* Pre-Processor Definitions
****************************************************************************/
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
/****************************************************************************
* Private Data
****************************************************************************/
@@ -115,11 +119,11 @@ static inline FAR const struct nx_fontset_s *nxf_getglyphset(uint16_t ch)
* Return information about the current font set
*
* Input Parameters:
- * None
+ * fontid: Identifies the font set to get
*
****************************************************************************/
-FAR const struct nx_font_s *nxf_getfontset(void)
+FAR const struct nx_font_s *nxf_getfontset(enum nx_fontid_e fontid)
{
return &g_fonts;
}
@@ -131,11 +135,13 @@ FAR const struct nx_font_s *nxf_getfontset(void)
* Return font bitmap information for the selected character encoding.
*
* Input Parameters:
- * ch - character code
+ * ch: Character code
+ * fontid: Identifies the font set to use
*
****************************************************************************/
-FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch)
+FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch,
+ enum nx_fontid_e fontid)
{
FAR const struct nx_fontset_s *set = nxf_getglyphset(ch);
FAR const struct nx_fontbitmap_s *bm = NULL;
diff --git a/graphics/nxfonts/nxfonts_internal.h b/graphics/nxfonts/nxfonts_internal.h
index c8118d169a2..54c574fdc18 100644
--- a/graphics/nxfonts/nxfonts_internal.h
+++ b/graphics/nxfonts/nxfonts_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxfonts/nxfonts_internal.h
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -56,7 +56,7 @@
/* Only font supported for now */
-#define CONFIG_NXFONT_SANS 1
+#define CONFIG_NXFONT_SANS23X27 1
/****************************************************************************
* Public Types
diff --git a/graphics/nxfonts/nxfonts_sans.h b/graphics/nxfonts/nxfonts_sans23x27.h
similarity index 98%
rename from graphics/nxfonts/nxfonts_sans.h
rename to graphics/nxfonts/nxfonts_sans23x27.h
index 963587fd99f..998eb862fcd 100644
--- a/graphics/nxfonts/nxfonts_sans.h
+++ b/graphics/nxfonts/nxfonts_sans23x27.h
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxfonts/nxfonts_sans.h
+ * graphics/nxfonts/nxfonts_sans23x27.h
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@
*
****************************************************************************/
-#ifndef __GRAPHICS_NXFONTS_NXFONTS_SANS_H
-#define __GRAPHICS_NXFONTS_NXFONTS_SANS_H
+#ifndef __GRAPHICS_NXFONTS_NXFONTS_SANS23X27_H
+#define __GRAPHICS_NXFONTS_NXFONTS_SANS23X27_H
/****************************************************************************
* Included Files
@@ -44,18 +44,22 @@
* Pre-Processor Definitions
****************************************************************************/
+/* Font ID */
+
+#define NXFONT_ID FONTID_SANS23X27
+
/* Ranges of 7-bit and 8-bit fonts */
-#define NXFONT_MIN7BIT 33
-#define NXFONT_MAX7BIT 126
+#define NXFONT_MIN7BIT 33
+#define NXFONT_MAX7BIT 126
-#define NXFONT_MIN8BIT 161
-#define NXFONT_MAX8BIT 255
+#define NXFONT_MIN8BIT 161
+#define NXFONT_MAX8BIT 255
/* Maximum height and width of any glyph in the set */
-#define NXFONT_MAXHEIGHT 23
-#define NXFONT_MAXWIDTH 27
+#define NXFONT_MAXHEIGHT 23
+#define NXFONT_MAXWIDTH 27
/* The width of a space */
@@ -852,5 +856,5 @@ extern "C" {
}
#endif
-#endif /* __GRAPHICS_NXFONTS_NXFONTS_SANS_H */
+#endif /* __GRAPHICS_NXFONTS_NXFONTS_SANS23X27_H */
diff --git a/include/nuttx/nxfonts.h b/include/nuttx/nxfonts.h
index 8bef4b00a20..5cc715166f8 100644
--- a/include/nuttx/nxfonts.h
+++ b/include/nuttx/nxfonts.h
@@ -48,20 +48,37 @@
/****************************************************************************
* Pre-processor definitions
****************************************************************************/
+/* Select the default font. If no fonts are select, then a compilation error
+ * is likely down the road.
+ */
+
+#ifdef CONFIG_NXFONT_SANS23X27
+# define NXFONT_DEFAULT FONTID_SANS23X27
+#endif
/****************************************************************************
* Public Types
****************************************************************************/
+/* Font IDs */
+
+enum nx_fontid_e
+{
+ FONTID_DEFAULT = 0 /* The default font */
+#ifdef CONFIG_NXFONT_SANS23X27
+ , FONTID_SANS23X27 /* The 23x27 sans serif font */
+#endif
+};
+
/* This structures provides the metrics for one glyph */
struct nx_fontmetric_s
{
- uint32_t stride : 2; /* Width of one font row in bytes */
- uint32_t width : 6; /* Width of the font in bits */
- uint32_t height : 6; /* Height of the font in rows */
- uint32_t xoffset : 6; /* Top, left-hand corner X-offset in pixels */
- uint32_t yoffset : 6; /* Top, left-hand corner y-offset in pixels */
+ uint32_t stride : 2; /* Width of one font row in bytes */
+ uint32_t width : 6; /* Width of the font in bits */
+ uint32_t height : 6; /* Height of the font in rows */
+ uint32_t xoffset : 6; /* Top, left-hand corner X-offset in pixels */
+ uint32_t yoffset : 6; /* Top, left-hand corner y-offset in pixels */
uint32_t unused : 6;
};
@@ -70,7 +87,7 @@ struct nx_fontmetric_s
struct nx_fontbitmap_s
{
struct nx_fontmetric_s metric; /* Character metrics */
- FAR const uint8_t *bitmap; /* Pointer to the character bitmap */
+ FAR const uint8_t *bitmap; /* Pointer to the character bitmap */
};
/* This structure describes one contiguous grouping of glyphs that
@@ -80,19 +97,31 @@ struct nx_fontbitmap_s
struct nx_fontset_s
{
- uint8_t first; /* First bitmap character code */
- uint8_t nchars; /* Number of bitmap character codes */
+ uint8_t first; /* First bitmap character code */
+ uint8_t nchars; /* Number of bitmap character codes */
FAR const struct nx_fontbitmap_s *bitmap;
};
-/* This structure describes the overall fontset */
+/* This structure describes the overall metrics of the fontset */
struct nx_font_s
{
- uint8_t mxheight; /* Max height of one glyph in rows */
- uint8_t mxwidth; /* Max width of any glyph in pixels */
- uint8_t mxbits; /* Max number of bits per character code */
- uint8_t spwidth; /* The width of a space in pixels */
+ uint8_t mxheight; /* Max height of one glyph in rows */
+ uint8_t mxwidth; /* Max width of any glyph in pixels */
+ uint8_t mxbits; /* Max number of bits per character code */
+ uint8_t spwidth; /* The width of a space in pixels */
+};
+
+/* Finally, this structure defines everything about the font set */
+
+struct nx_fontpackage_s
+{
+ uint8_t id; /* The font ID */
+ struct nx_font_s metrics; /* Font set metrics */
+ struct nx_fontset_s font7; /* Fonts for 7-bit encoding */
+#if CONFIG_NXFONTS_CHARBITS >= 8
+ struct nx_fontset_s font8; /* Fonts for 8-bit encoding */
+#endif
};
/****************************************************************************
@@ -118,11 +147,11 @@ extern "C" {
* Return information about the current font set
*
* Input Parameters:
- * An instance of struct nx_font_s describing the font set.
+ * fontid: Identifies the font set to get
*
****************************************************************************/
-EXTERN FAR const struct nx_font_s *nxf_getfontset(void);
+EXTERN FAR const struct nx_font_s *nxf_getfontset(enum nx_fontid_e fontid);
/****************************************************************************
* Name: nxf_getbitmap
@@ -131,14 +160,16 @@ EXTERN FAR const struct nx_font_s *nxf_getfontset(void);
* Return font bitmap information for the selected character encoding.
*
* Input Parameters:
- * ch - character code
+ * ch: Character code
+ * fontid: Identifies the font set to use
*
* Returned Value:
* An instance of struct nx_fontbitmap_s describing the glyph.
*
****************************************************************************/
-EXTERN FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch);
+EXTERN FAR const struct nx_fontbitmap_s *
+ nxf_getbitmap(uint16_t ch, enum nx_fontid_e fontid);
/****************************************************************************
* Name: nxf_convert_*bpp
diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h
index 8256c2d8c87..3fc318a4022 100644
--- a/include/nuttx/sched.h
+++ b/include/nuttx/sched.h
@@ -105,7 +105,7 @@ enum tstate_e
TSTATE_WAIT_MQNOTFULL, /* BLOCKED - Waiting for a MQ to become not full. */
#endif
#ifdef CONFIG_PAGING
- TSTATE_WAIT_PAGEFILL, /* BLOCKED - Waiting for page fill */
+ TSTATE_WAIT_PAGEFILL, /* BLOCKED - Waiting for page fill */
#endif
NUM_TASK_STATES /* Must be last */
};
diff --git a/sched/sem_timedwait.c b/sched/sem_timedwait.c
index c02bc48db56..7b01d22d813 100644
--- a/sched/sem_timedwait.c
+++ b/sched/sem_timedwait.c
@@ -271,7 +271,9 @@ int sem_timedwait(FAR sem_t *sem, FAR const struct timespec *abstime)
wd_delete(wdog);
/* We are either returning success or an error detected by sem_wait()
- * or the timeout detected by sem_timeout().
+ * or the timeout detected by sem_timeout(). The 'errno' value has
+ * been set appropriately by sem_wait() or sem_timeout() in those
+ * cases.
*/
return ret;