#include "ui_main.h"
#include "ui_internal.h"
#include "ui_font.h"
#include "ui_parse.h"
#include "../client.h"
#include "../../shared/parse.h"
#include "../renderer/r_font.h"
Go to the source code of this file.
Defines | |
#define | MAX_FONTS 16 |
Functions | |
static void | UI_RegisterFont (const uiFont_t *font) |
Registers a new TTF font. | |
void | UI_ParseFont (const char *name, const char **text) |
const char * | UI_GetFontFromNode (const uiNode_t *const node) |
Return the font for a specific node or default font. | |
const uiFont_t * | UI_GetFontByID (const char *name) |
Return the font for a specific id. | |
int | UI_FontGetHeight (const char *fontID) |
void | UI_InitFonts (void) |
after a video restart we have to reinitialize the fonts | |
Variables | |
static int | numFonts = 0 |
static uiFont_t | fonts [MAX_FONTS] |
static const value_t | fontValues [] |
Definition in file ui_font.c.
int UI_FontGetHeight | ( | const char * | fontID | ) |
Definition at line 167 of file ui_font.c.
References uiNode_s::font, font_s::height, and R_GetFont().
Referenced by UI_ButtonNodeLoaded(), UI_DrawString(), UI_OptionListNodeDraw(), UI_OptionListNodeGetOptionAtPosition(), UI_OptionListNodeUpdateScroll(), UI_OptionTreeNodeDraw(), UI_OptionTreeNodeGetOptionAtPosition(), UI_OptionTreeNodeUpdateScroll(), UI_TextLineNodeDrawText(), UI_TextListNodeGetLine(), UI_TextNodeDrawText(), UI_TextNodeGetLine(), and UI_TextNodeLoaded().
const uiFont_t* UI_GetFontByID | ( | const char * | name | ) |
Return the font for a specific id.
Definition at line 156 of file ui_font.c.
Referenced by UI_DrawString(), and UI_ParseFont().
const char* UI_GetFontFromNode | ( | const uiNode_t *const | node | ) |
Return the font for a specific node or default font.
[in] | node | Context node |
Definition at line 144 of file ui_font.c.
References uiNode_s::font, and UI_GetReferenceString().
Referenced by MAP_DrawMapMarkers(), UI_ButtonNodeDraw(), UI_ButtonNodeLoaded(), UI_CustomButtonNodeDraw(), UI_KeyBindingNodeDraw(), UI_MessageListNodeDraw(), UI_OptionListNodeDraw(), UI_OptionListNodeGetOptionAtPosition(), UI_OptionListNodeUpdateScroll(), UI_OptionTreeNodeDraw(), UI_OptionTreeNodeGetOptionAtPosition(), UI_OptionTreeNodeUpdateScroll(), UI_SelectBoxNodeDraw(), UI_SelectBoxNodeDrawOverWindow(), UI_StringNodeDraw(), UI_StringNodeDrawTooltip(), UI_TabNodeDraw(), UI_TabNodeTabAtPosition(), UI_TextEntryNodeDraw(), UI_TextLineNodeDrawText(), UI_TextListNodeGetLine(), UI_TextNodeDrawText(), UI_TextNodeGetLine(), UI_TextNodeLoaded(), and UI_WindowNodeDraw().
void UI_InitFonts | ( | void | ) |
after a video restart we have to reinitialize the fonts
Definition at line 178 of file ui_font.c.
References Com_Printf(), i, numFonts, and UI_RegisterFont().
Referenced by CL_NewLanguage(), and UI_Reinit().
void UI_ParseFont | ( | const char * | name, | |
const char ** | text | |||
) |
Definition at line 68 of file ui_font.c.
References Com_DPrintf(), Com_EParse(), Com_EParseValue(), Com_Parse(), Com_Printf(), DEBUG_CLIENT, uiNode_s::font, MAX_FONTS, Mem_PoolStrDup, Mem_PoolStrDupTo, uiFont_s::name, numFonts, value_s::ofs, value_s::size, value_s::string, value_s::type, UI_GetFontByID(), UI_RegisterFont(), ui_sysPool, V_CLIENT_HUNK_STRING, and V_TRANSLATION_STRING.
Referenced by CL_ParseClientData().
static void UI_RegisterFont | ( | const uiFont_t * | font | ) | [static] |
Registers a new TTF font.
[in] | font |
Definition at line 52 of file ui_font.c.
References _, Com_Error(), ERR_FATAL, FS_CheckFile(), uiFont_s::name, uiFont_s::path, R_FontRegister(), uiFont_s::size, and uiFont_s::style.
Referenced by UI_InitFonts(), and UI_ParseFont().
const value_t fontValues[] [static] |
{ {"font", V_TRANSLATION_STRING, offsetof(uiFont_t, path), 0}, {"size", V_INT, offsetof(uiFont_t, size), MEMBER_SIZEOF(uiFont_t, size)}, {"style", V_CLIENT_HUNK_STRING, offsetof(uiFont_t, style), 0}, {NULL, V_NULL, 0, 0} }
int numFonts = 0 [static] |
Definition at line 35 of file ui_font.c.
Referenced by UI_GetFontByID(), UI_InitFonts(), and UI_ParseFont().