Macros | Functions
String_api

Macros

#define ABSENT_CHAR_REPLACEMENT   '.'
 

Functions

int NumLeadingZeros (long x)
 
long GrStringWidthGet (const tContext *pContext, const char *pcString, long lLength)
 
void GrStringDraw (const tContext *pContext, const char *pcString, long lLength, long lX, long lY, unsigned long bOpaque)
 

Detailed Description

Macro Definition Documentation

#define ABSENT_CHAR_REPLACEMENT   '.'

Referenced by GrStringDraw(), and GrStringWidthGet().

Function Documentation

int NumLeadingZeros ( long  x)

Referenced by GrStringDraw().

long GrStringWidthGet ( const tContext pContext,
const char *  pcString,
long  lLength 
)

Determines the width of a string.

Parameters
pContextis a pointer to the drawing context to use.
pcStringis the string in question.
lLengthis the length of the string.

This function determines the width of a string (or portion of the string) when drawn with a particular font. The lLength parameter allows a portion of the string to be examined without having to insert a NULL character at the stopping point (would not be possible if the string was located in flash); specifying a length of -1 will cause the width of the entire string to be computed.

Returns
Returns the width of the string in pixels.

References ABSENT_CHAR_REPLACEMENT, FONT_EX_MARKER, tContext::pFont, tFont::pucData, tFontEx::pucData, tFont::pusOffset, tFontEx::pusOffset, tFontEx::ucFirst, tFont::ucFormat, and tFontEx::ucLast.

void GrStringDraw ( const tContext pContext,
const char *  pcString,
long  lLength,
long  lX,
long  lY,
unsigned long  bOpaque 
)

Draws a string.

Parameters
pContextis a pointer to the drawing context to use.
pcStringis a pointer to the string to be drawn.
lLengthis the number of characters from the string that should be drawn on the screen.
lXis the X coordinate of the upper left corner of the string position on the screen.
lYis the Y coordinate of the upper left corner of the string position on the screen.
bOpaqueis true of the background of each character should be drawn and false if it should not (leaving the background as is).

This function draws a string of test on the screen. The lLength parameter allows a portion of the string to be examined without having to insert a NULL character at the stopping point (which would not be possible if the string was located in flash); specifying a length of -1 will cause the entire string to be rendered (subject to clipping).

Returns
None.

References ABSENT_CHAR_REPLACEMENT, DpyPixelDraw, FONT_EX_MARKER, FONT_FMT_UNCOMPRESSED, GrLineDrawH(), NumLeadingZeros(), tContext::pDisplay, tContext::pFont, tFont::pucData, tFontEx::pucData, tFont::pusOffset, tFontEx::pusOffset, tContext::sClipRegion, tRectangle::sXMax, tRectangle::sXMin, tRectangle::sYMax, tRectangle::sYMin, tFontEx::ucFirst, tFont::ucFormat, tFontEx::ucLast, tContext::ulBackground, and tContext::ulForeground.


Copyright 2013, Texas Instruments Incorporated