ui_font.c File Reference

#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"
Include dependency graph for ui_font.c:

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_tUI_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 []

Detailed Description

Definition in file ui_font.c.


Define Documentation

#define MAX_FONTS   16

Definition at line 34 of file ui_font.c.


Function Documentation

int UI_FontGetHeight ( const char *  fontID  ) 
const uiFont_t* UI_GetFontByID ( const char *  name  ) 

Return the font for a specific id.

Definition at line 156 of file ui_font.c.

References i, and numFonts.

Referenced by UI_DrawString(), and UI_ParseFont().

const char* UI_GetFontFromNode ( const uiNode_t *const   node  ) 
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 
)
static void UI_RegisterFont ( const uiFont_t font  )  [static]

Registers a new TTF font.

Note:
The TTF font path is translated via gettext to be able to use different fonts for every translation
Parameters:
[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().


Variable Documentation

uiFont_t fonts[MAX_FONTS] [static]

Definition at line 36 of file ui_font.c.

const value_t fontValues[] [static]
Initial value:
 {
    {"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}
}

Definition at line 38 of file ui_font.c.

int numFonts = 0 [static]

Definition at line 35 of file ui_font.c.

Referenced by UI_GetFontByID(), UI_InitFonts(), and UI_ParseFont().


Generated by  doxygen 1.6.2