DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
ft2_fontdefs.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  font_incmap_t
 
struct  ft2_attachment_t
 
struct  ft2_font_map_t
 
struct  glyph_slot_t
 

Macros

#define FONT_CHAR_LINES   16
 
#define FONT_CHARS_PER_LINE   16
 
#define FONT_CHARS_PER_MAP   (FONT_CHARS_PER_LINE * FONT_CHAR_LINES)
 
#define INCMAP_START   0x110000
 

Functions

qbool Font_LoadMapForIndex (ft2_font_t *font, int map_index, Uchar _ch, ft2_font_map_t **outmap)
 
void font_newmap (void)
 
void font_shutdown (void)
 
void font_start (void)
 

Macro Definition Documentation

◆ FONT_CHAR_LINES

#define FONT_CHAR_LINES   16

Definition at line 7 of file ft2_fontdefs.h.

Referenced by Font_LoadMap(), and UnloadMapChain().

◆ FONT_CHARS_PER_LINE

#define FONT_CHARS_PER_LINE   16

Definition at line 6 of file ft2_fontdefs.h.

Referenced by Font_LoadMap(), incmap_post_process(), and UnloadMapChain().

◆ FONT_CHARS_PER_MAP

◆ INCMAP_START

#define INCMAP_START   0x110000

Definition at line 11 of file ft2_fontdefs.h.

Referenced by Font_LoadMap(), and incmap_post_process().

Function Documentation

◆ Font_LoadMapForIndex()

qbool Font_LoadMapForIndex ( ft2_font_t * font,
int map_index,
Uchar _ch,
ft2_font_map_t ** outmap )

Definition at line 1899 of file ft2.c.

1900{
1901 if (map_index < 0 || map_index >= MAX_FONT_SIZES)
1902 return false;
1903 // the first map must have been loaded already
1904 if (!font->font_maps[map_index])
1905 return false;
1906 alert_legacy_font_api("Font_LoadMapForIndex");
1907 return Font_LoadMap(font, font->font_maps[map_index], ch, outmap, NULL, false);
1908}
#define MAX_FONT_SIZES
Definition draw.h:94
static qbool Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _ch, ft2_font_map_t **outmap, int *outmapch, qbool incmap_ok)
Definition ft2.c:1385
static void alert_legacy_font_api(const char *name)
Definition ft2.c:1889
#define NULL
Definition qtypes.h:12
ft2_font_map_t * font_maps[MAX_FONT_SIZES]
Definition ft2.h:57

References alert_legacy_font_api(), Font_LoadMap(), ft2_font_t::font_maps, MAX_FONT_SIZES, and NULL.

◆ font_newmap()

void font_newmap ( void )

Definition at line 439 of file ft2.c.

440{
441}

Referenced by gl_draw_newmap().

◆ font_shutdown()

void font_shutdown ( void )

Definition at line 425 of file ft2.c.

426{
427 int i;
428 for (i = 0; i < dp_fonts.maxsize; ++i)
429 {
430 if (dp_fonts.f[i].ft2)
431 {
433 dp_fonts.f[i].ft2 = NULL;
434 }
435 }
437}
dp_fonts_t dp_fonts
Definition gl_draw.c:50
void Font_CloseLibrary(void)
Definition ft2.c:339
void Font_UnloadFont(ft2_font_t *font)
Definition ft2.c:1184
int i
struct ft2_font_s * ft2
Definition draw.h:110
int maxsize
Definition draw.h:121
dp_font_t * f
Definition draw.h:120

References dp_fonts, dp_fonts_t::f, Font_CloseLibrary(), Font_UnloadFont(), dp_font_t::ft2, i, dp_fonts_t::maxsize, and NULL.

Referenced by gl_draw_shutdown().

◆ font_start()

void font_start ( void )

Definition at line 404 of file ft2.c.

405{
406 if (!Font_OpenLibrary())
407 return;
408
410 {
411 Con_Print(CON_ERROR "ERROR: Failed to initialize the FreeType2 library!\n");
413 return;
414 }
415
416 font_mempool = Mem_AllocPool("FONT", 0, NULL);
417 if (!font_mempool)
418 {
419 Con_Print(CON_ERROR "ERROR: Failed to allocate FONT memory pool!\n");
421 return;
422 }
423}
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
Definition console.c:1504
#define CON_ERROR
Definition console.h:102
qbool Font_OpenLibrary(void)
Definition ft2.c:362
static FT_Library font_ft2lib
FreeType library handle.
Definition ft2.c:244
(* qFT_Init_FreeType)(FT_Library *alibrary)
Definition ft2.c:75
static mempool_t * font_mempool
Memory pool for fonts.
Definition ft2.c:241
#define Mem_AllocPool(name, flags, parent)
Definition zone.h:104

References CON_ERROR, Con_Print(), Font_CloseLibrary(), font_ft2lib, font_mempool, Font_OpenLibrary(), Mem_AllocPool, NULL, and qFT_Init_FreeType.

Referenced by gl_draw_start().