![]() |
![]() |
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) |
| #define ABSENT_CHAR_REPLACEMENT '.' |
Referenced by GrStringDraw(), and GrStringWidthGet().
| int NumLeadingZeros | ( | long | x) |
Referenced by GrStringDraw().
| long GrStringWidthGet | ( | const tContext * | pContext, |
| const char * | pcString, | ||
| long | lLength | ||
| ) |
Determines the width of a string.
| pContext | is a pointer to the drawing context to use. |
| pcString | is the string in question. |
| lLength | is 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.
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.
| pContext | is a pointer to the drawing context to use. |
| pcString | is a pointer to the string to be drawn. |
| lLength | is the number of characters from the string that should be drawn on the screen. |
| lX | is the X coordinate of the upper left corner of the string position on the screen. |
| lY | is the Y coordinate of the upper left corner of the string position on the screen. |
| bOpaque | is 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).
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.