Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

Parameters
Parameters Description
pFont pointer to the font to be used.
Function
GFX_STATUS GFX_FontSet(GFX_RESOURCE_HDR *pFont)
1.6.1.1.6.5 GFX_TextCharDraw Function
This function renders the given character using the currently set color using the currently set font.
File
gfx_primitive.h
Syntax
GFX_STATUS GFX_TextCharDraw(GFX_XCHAR ch);
Returns
The status of the character rendering. GFX_STATUS_SUCCESS - the character was rendered GFX_STATUS_FAILURE -
the character was not rendered, function must be called again to render the character. GFX_STATUS_ERROR - the
character ID passed is not a valid or points to the character glyph that does does not exist on the font table.
Description
This function renders the given character using the currently set font, and color to the location defined by the text cursor
position. The color is set by GFX_ColorSet() while the font is set by GFX_FontSet(). The text cursor position is set by
GFX_TextCursorPositionSet()
The rendering of the character becomes undefined when any one of the following is true:
Text cursor position is set to locations outside the frame buffer.
Color is not set, before this function is called.
Font is not set, before this function is called.
Preconditions
Color must be set by GFX_ColorSet(). Font must be set by GFX_FontSet(). Text cursor position must be set by
GFX_TextCursorPositionSet().
Example
// assume textString is a string of characters
// assume WHITE is a valid GFX_COLOR data
// assume pMyFont is a valid initialized font resource pointer
static uint16_t counter = 0;
GFX_XCHAR ch;
GFX_STATUS status;
GFX_ColorSet(WHITE);
GFX_FontSet(pMyFont);
// render characters until null character
while((GFX_XCHAR)(ch = *(textString + counter)) != 0)
{
status = GFX_TextCharDraw(ch);
if (status != GFX_STATUS_SUCCESS)
return (GFX_STATUS_FAILURE);
counter++;
}
Parameters
Parameters Description
ch character ID that of the character that will be rendered.
1.6 Library Interface MLA - Graphics Library Help Graphics Primitive Layer
101

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh