summaryrefslogtreecommitdiff
path: root/nuttx/graphics
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-19 20:08:28 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-19 20:08:28 +0000
commite22652b8670c85c11bed70615d97273d455d58a9 (patch)
treeafb799c4411fe56a1af05c4e25d5f44453691cbe /nuttx/graphics
parent40e9e372738c38180562ab1ff3b1f91d42c14cdd (diff)
downloadpx4-nuttx-e22652b8670c85c11bed70615d97273d455d58a9.tar.gz
px4-nuttx-e22652b8670c85c11bed70615d97273d455d58a9.tar.bz2
px4-nuttx-e22652b8670c85c11bed70615d97273d455d58a9.zip
Setup environment to support multiple fonts
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3799 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/graphics')
-rw-r--r--nuttx/graphics/README.txt6
-rw-r--r--nuttx/graphics/nxfonts/nxfonts_bitmaps.c8
-rw-r--r--nuttx/graphics/nxfonts/nxfonts_getfont.c18
-rw-r--r--nuttx/graphics/nxfonts/nxfonts_internal.h4
-rw-r--r--nuttx/graphics/nxfonts/nxfonts_sans23x27.h (renamed from nuttx/graphics/nxfonts/nxfonts_sans.h)26
5 files changed, 36 insertions, 26 deletions
diff --git a/nuttx/graphics/README.txt b/nuttx/graphics/README.txt
index 1822067ad..c99a72809 100644
--- a/nuttx/graphics/README.txt
+++ b/nuttx/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/nuttx/graphics/nxfonts/nxfonts_bitmaps.c b/nuttx/graphics/nxfonts/nxfonts_bitmaps.c
index f215260cf..622c4c0f3 100644
--- a/nuttx/graphics/nxfonts/nxfonts_bitmaps.c
+++ b/nuttx/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 <spudmonkey@racsa.co.cr>
*
* 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/nuttx/graphics/nxfonts/nxfonts_getfont.c b/nuttx/graphics/nxfonts/nxfonts_getfont.c
index 3c53cae7f..52b7774a8 100644
--- a/nuttx/graphics/nxfonts/nxfonts_getfont.c
+++ b/nuttx/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 <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -52,6 +52,10 @@
****************************************************************************/
/****************************************************************************
+ * 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/nuttx/graphics/nxfonts/nxfonts_internal.h b/nuttx/graphics/nxfonts/nxfonts_internal.h
index c8118d169..54c574fdc 100644
--- a/nuttx/graphics/nxfonts/nxfonts_internal.h
+++ b/nuttx/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 <spudmonkey@racsa.co.cr>
*
* 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/nuttx/graphics/nxfonts/nxfonts_sans.h b/nuttx/graphics/nxfonts/nxfonts_sans23x27.h
index 963587fd9..998eb862f 100644
--- a/nuttx/graphics/nxfonts/nxfonts_sans.h
+++ b/nuttx/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 <spudmonkey@racsa.co.cr>
*
* 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 */