30 #include "../cl_shared.h"
31 #include "../../shared/parse.h"
32 #include "../renderer/r_font.h"
54 const char* path =
_(font->
path);
70 const char* errhead =
"UI_ParseFont: unexpected end of file (font";
74 Com_Printf(
"UI_ParseFont: font \"%s\" with same name found, second ignored\n", name);
79 Com_Printf(
"UI_ParseFont: Max fonts reached\n");
94 if (!*text || *token !=
'{') {
95 Com_Printf(
"UI_ParseFont: font \"%s\" without body ignored\n", name);
110 for (v = fontValues; v->
string; v++)
133 Com_Printf(
"UI_ParseFont: unknown token \"%s\" ignored (font %s)\n", token, name);
147 if (node && node->
font) {
int FS_CheckFile(const char *fmt,...)
Just returns the filelength and -1 if the file wasn't found.
void Com_Printf(const char *const fmt,...)
void UI_FontShutdown(void)
#define Mem_PoolStrDupTo(in, out, pool, tagNum)
Internal data use by the UI package.
void Com_Error(int code, const char *fmt,...)
font_t * R_GetFont(const char *name)
Searches the array of available fonts (see fonts.ufo)
const char * Com_EParse(const char **text, const char *errhead, const char *errinfo, char *target, size_t size)
Parsing function that prints an error message when there is no text in the buffer.
static void UI_RegisterFont(const uiFont_t *font)
Registers a new TTF font.
static const value_t fontValues[]
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
const char * UI_GetReferenceString(const uiNode_t *const node, const char *ref)
const uiFont_t * UI_GetFontByID(const char *name)
Return the font for a specific id.
Atomic structure used to define most of the UI.
int Com_EParseValue(void *base, const char *token, valueTypes_t type, int ofs, size_t size)
const char * Com_Parse(const char *data_p[], char *target, size_t size, bool replaceWhitespaces)
Parse a token out of a string.
const char * UI_GetFontFromNode(const uiNode_t *const node)
Return the font for a specific node or default font.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
int UI_FontGetHeight(const char *fontID)
#define MEMBER_SIZEOF(TYPE, MEMBER)
static uiFont_t fonts[MAX_FONTS]
void R_FontRegister(const char *name, int size, const char *path, const char *style)
#define Mem_PoolStrDup(in, pool, tagNum)
QGL_EXTERN int GLboolean GLfloat * v
bool UI_ParseFont(const char *name, const char **text)
void UI_InitFonts(void)
after a video restart we have to reinitialize the fonts