MHEG5  15.3.0
source/graphics/src/mg_font.c File Reference

Font file handling with the Freetype. More...

#include "glue_assert.h"
#include "glue_memory.h"
#include "glue_debug.h"
#include "mh5profile.h"
#include "mh5support.h"
#include "mg_ctxt.h"
#include "mg_drawtext.h"
#include "mg_fontapi.h"
#include "mg_font.h"
#include "Tires-o_751nz_pfr.h"

Defines

#define FONTS_CACHE_MAX   0x00020000
#define MAX_FONT_OBJECTS   16

Functions

BOOLEAN MG_FontInit (BOOLEAN isHD)
 Initialise freetype library and load "built-in" font.
void MG_SetMaxFonts (U16BIT max)
 Set Max allowable fonts for profile.
void MG_FontExit (void)
 Free all data associated with built-in font and terminate freetype library.
S16BIT MG_FontLoadFile (const U8BIT *data, U32BIT length)
 Load font data file into memory for freetype.
void MG_FontFreeFile (S16BIT font_index)
 free memory associated with file
S_FontDetailsMG_GetFontPtr (S16BIT font_index)
 Get Pointer to Font.
void MG_ReleaseFontPtr (S_FontDetails *fp)
 
H_FontSize MG_AllocateFont (S16BIT fnt_index, U8BIT fnt_size, U8BIT fnt_style)
 Allocate font of particular size from font file.
void MG_ReleaseFont (H_FontSize f_sz)
 Allocate font of particular size from font file.
S_FontDetailsMG_FindFont (H_FontSize f_sz)
 Get font from size.
void MG_GetFontMetrics (H_FontSize f_sz, S_FontMetrics *pMetrics)
 Get font Metrics.
S_FontSizeMG_GetFontSize (U16BIT fnt_index, U8BIT fnt_size, U8BIT fnt_style)
 
void MG_CheckCache (S_FontSize *f_szdata)
 

Variables

E_HDMode mg_hd_mode = NORMAL_SD

Detailed Description

Font file handling with the Freetype.

Date:
15/04/2010
Author:
Adam Sturtridge

Function Documentation

H_FontSize MG_AllocateFont ( S16BIT  fnt_index,
U8BIT  fnt_size,
U8BIT  fnt_style 
)

Allocate font of particular size from font file.

Parameters:
font_indexindex into MG's font array - from MG_FontLoadFile()
font_sizesize in points
Returns:
Handle to font size
void MG_CheckCache ( S_FontSize f_szdata)

Parameters:
.
Returns:
.

Get font from size.

Parameters:
f_szPointer to size data
Returns:
n/a
void MG_FontExit ( void  )

Free all data associated with built-in font and terminate freetype library.

Parameters:
n/a
Returns:
n/a
void MG_FontFreeFile ( S16BIT  font_index)

free memory associated with file

Parameters:
font_indexindex into MG's font array - from MG_FontLoadFile()
Returns:
n/a
BOOLEAN MG_FontInit ( BOOLEAN  isHD)

Initialise freetype library and load "built-in" font.

Parameters:
isHDindicate whether supporting MHEG HD extension
Returns:
TRUE - success, FALSE - failure
S16BIT MG_FontLoadFile ( const U8BIT *  data,
U32BIT  length 
)

Load font data file into memory for freetype.

Parameters:
datafont file data
lengthlength of font file data
Returns:
index into the MG's font array (on failure this is -1)
void MG_GetFontMetrics ( H_FontSize  f_sz,
S_FontMetrics pMetrics 
)

Get font Metrics.

Parameters:
font_indexindex into MG's font array - from MG_FontLoadFile()
Returns:
n/a
S_FontDetails* MG_GetFontPtr ( S16BIT  font_index)

Get Pointer to Font.

Parameters:
font_index- as returned by MG_LoadFontFile().
Returns:
Pointer to font details
S_FontSize* MG_GetFontSize ( U16BIT  fnt_index,
U8BIT  fnt_size,
U8BIT  fnt_style 
)

Parameters:
.
Returns:
.
void MG_ReleaseFont ( H_FontSize  f_sz)

Allocate font of particular size from font file.

Parameters:
font_indexindex into MG's font array - from MG_FontLoadFile()
font_sizesize in points
Returns:
n/a

Parameters:
.
Returns:
.
void MG_SetMaxFonts ( U16BIT  max)

Set Max allowable fonts for profile.

Parameters:
n/a
Returns:
n/a
 All Data Structures Files Functions Variables Typedefs Defines