# Vault 7: Projects

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

### Protego

# MLA -- Graphics Library

- 1
- 2
…
- 105
- 106
- 107
- 108
- 109
…
- 373
- 374

Example
// assume pMyFont is a pointer initialized to a valid font
uint16_t height, x, y;
// center the text on the screen
height = GFX_TextStringHeightGet(pMyFont);
width = GFX_TextStringWidthGet ( (GFX_XCHAR *)"Hello World",
pMyFont
);
y = (GFX_MaxYGet() - height) >> 1;
x = (GFX_MaxXGet() - width) >> 1;
GFX_TextStringDraw(x, y, (GFX_XCHAR *)"Hello World");
GFX_TextStringDraw(x, y, (GFX_XCHAR *)"Hello World");
Parameters
Parameters Description
pFont Pointer to the specified font.
Function
uint16_t GFX_TextStringHeightGet(
GFX_RESOURCE_HDR *pFont);
1.6.1.1.6.12 GFX_TextStringWidthGet Function
This function returns the width of the given string using the given font.
File
gfx_primitive.h
Syntax
uint16_t GFX_TextStringWidthGet(GFX_XCHAR * textString, GFX_RESOURCE_HDR * pFont);
Returns
The width of the specified string using the specified font in pixels.
Description
This function returns the width of the given string using the given font in pixels. The given font must be present in the system.
The pixel length is measured from the first printable character until the last printable character. This means that if the string
is composed of multiple lines, the length returned is only valid for the first line of characters.
This function return value is undefined if the given pointer does not point to a valid font or one or more characters in the
given string does not exist on the given font.
Preconditions
None.
Example
// assume pMyFont is a pointer initialized to a valid font
uint16_t height, x, y;
// center the text on the screen
height = GFX_TextStringHeightGet(pMyFont);
width = GFX_TextStringWidthGet ( (GFX_XCHAR *)"Hello World",
pMyFont
);
y = (GFX_MaxYGet() - height) >> 1;
x = (GFX_MaxXGet() - width) >> 1;
GFX_TextStringDraw(x, y, (GFX_XCHAR *)"Hello World");
1.6 Library Interface MLA - Graphics Library Help Graphics Primitive Layer
107

- 1
- 2
…
- 105
- 106
- 107
- 108
- 109
…
- 373
- 374