MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Font_GetStringWidth

Function Font_GetStringWidth

src/gui/font.c:40–51  ·  view source on GitHub ↗

* Get the width of the string in pixels. * * @param string The string to get the width of. * @return The width of the string in pixels. */

Source from the content-addressed store, hash-verified

38 * @return The width of the string in pixels.
39 */
40uint16 Font_GetStringWidth(const char *string)
41{
42 uint16 width = 0;
43
44 if (string == NULL) return 0;
45
46 while (*string != '\0') {
47 width += Font_GetCharWidth(*string++);
48 }
49
50 return width;
51}
52
53/**
54 * Load a font file.

Callers 8

GameCredits_PlayFunction · 0.85
GUI_DrawText_WrapperFunction · 0.85
GUI_EndStats_ShowFunction · 0.85
GUI_HallOfFame_DrawDataFunction · 0.85

Calls 1

Font_GetCharWidthFunction · 0.85

Tested by

no test coverage detected