diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-06 13:45:05 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-06 13:45:05 +0000 |
commit | 3df1d5fd1bbb583c3bd44a24939e49fa0d52c161 (patch) | |
tree | 885d99188138df23399a9c3238bffc75c5677802 /nuttx/graphics/nxfonts/nxfonts_convert.c | |
parent | 577e371190dfd26667149dbbf66d49c7c1374243 (diff) | |
download | px4-nuttx-3df1d5fd1bbb583c3bd44a24939e49fa0d52c161.tar.gz px4-nuttx-3df1d5fd1bbb583c3bd44a24939e49fa0d52c161.tar.bz2 px4-nuttx-3df1d5fd1bbb583c3bd44a24939e49fa0d52c161.zip |
Allocate smaller buffers for glyphs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1422 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/graphics/nxfonts/nxfonts_convert.c')
-rw-r--r-- | nuttx/graphics/nxfonts/nxfonts_convert.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/nuttx/graphics/nxfonts/nxfonts_convert.c b/nuttx/graphics/nxfonts/nxfonts_convert.c index f58add4c6..7e80565f9 100644 --- a/nuttx/graphics/nxfonts/nxfonts_convert.c +++ b/nuttx/graphics/nxfonts/nxfonts_convert.c @@ -126,21 +126,20 @@ * height - The max height of the returned char in rows * width - The max width of the returned char in pixels * stride - The width of the destination buffer in bytes - * ch - The character code to convert + * bm - Describes the character glyph to convert * color - The color to use for '1' bits in the font bitmap * (0 bits are transparent) * * Returned Value: - * On Success, this function returns the actual width of the font in bytes. - * on failed, a negated errno is retured. + * OK on Success, ERROR: on failure with errno set appropriately. + * (never fails) * ****************************************************************************/ int NXF_FUNCNAME(nxf_convert,NXFONTS_SUFFIX) (FAR NXF_PIXEL_T *dest, uint16 height, uint16 width, uint16 stride, - uint16 ch, nxgl_mxpixel_t color) + FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color) { - FAR const struct nx_fontbitmap_s *bm; FAR ubyte *line; FAR NXF_PIXEL_T *dptr; FAR const ubyte *sptr; @@ -157,16 +156,6 @@ int NXF_FUNCNAME(nxf_convert,NXFONTS_SUFFIX) int nbits; #endif - /* Map the character code to a bitmap font */ - - bm = nxf_getbitmap(ch); - if (!bm) - { - /* No character? Nothing to rend, return the width of a space */ - - return g_fonts.spwidth; - } - /* Get the starting position */ line = (ubyte*)dest + bm->metric.yoffset * stride + NXF_SCALEX(bm->metric.xoffset); @@ -276,5 +265,5 @@ int NXF_FUNCNAME(nxf_convert,NXFONTS_SUFFIX) } } #endif - return bm->metric.width + bm->metric.xoffset; + return OK; } |