From b896f16bcf9206d8ed37f5775992a7488c81bdfd Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 20 Jul 2011 02:13:08 +0000 Subject: [PATCH] Use a handle instead of an ID in each font lookup; this saves doing the font set lookup each time git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3802 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog | 5 ++ Documentation/NXGraphicsSubsystem.html | 95 +++++++++++++++------ graphics/nxfonts/nxfonts_bitmaps.c | 45 ++++------ graphics/nxfonts/nxfonts_getfont.c | 110 +++++++++++++------------ include/nuttx/nxfonts.h | 36 +++++--- 5 files changed, 176 insertions(+), 115 deletions(-) diff --git a/ChangeLog b/ChangeLog index 36c6d86415..be575b565d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1928,3 +1928,8 @@ not being coordinated correctly. * configs/stm3210e-eval/nsh2: Enable FAT long file name support * sched/sem_timedwait.c: Add the standard sem_timedwait() interface. + * graphics/nxfonts/nxfonts_getfont.c, nxfonts_bitmap.c, + Makefile.source, and include/nuttx/nxfonts.h: Support for multiple + fonts included. A new interface, nxf_getfonthandle() takes a font + ID and returns a handle that is now used at all other font interfaces + to specify which of the multiple fonts to use. diff --git a/Documentation/NXGraphicsSubsystem.html b/Documentation/NXGraphicsSubsystem.html index 9342552663..dd206ed04c 100644 --- a/Documentation/NXGraphicsSubsystem.html +++ b/Documentation/NXGraphicsSubsystem.html @@ -153,9 +153,10 @@

@@ -2365,7 +2366,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 */ }; @@ -2396,13 +2397,36 @@ struct nx_font_s }; -

2.5.2 nxf_getfontset()

+

2.5.2 nxf_getfonthandle()

+

Function Prototype:

+ +

+ Description: + Given a numeric font ID, return a handle that may be subsequently be used to access the font data sets. +

+

+ Input Parameters: +

+

+

+ Returned Value: + A handle that may be subsequently be used to access the font data sets. +

+ +

2.5.3 nxf_getfontset()

Function Prototype:

Description: @@ -2411,8 +2435,8 @@ FAR const struct nx_font_s *nxf_getfontset(enum nx_fontid_e fontid);

Input Parameters:

@@ -2420,13 +2444,13 @@ FAR const struct nx_font_s *nxf_getfontset(enum nx_fontid_e fontid); An instance of struct nx_font_s describing the font set.

-

2.5.3 nxf_getbitmap()

+

2.5.4 nxf_getbitmap()

Function Prototype:

Description: @@ -2436,9 +2460,9 @@ FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch, enum nx_fontid_e fo Input Parameters:

@@ -2446,7 +2470,7 @@ FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch, enum nx_fontid_e fo An instance of struct nx_fontbitmap_s describing the glyph.

-

2.5.4 nxf_convert_*bpp()

+

2.5.5 nxf_convert_*bpp()

Function Prototype: