MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Macros | Functions | Variables
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"

Macros

#define FONTS_CACHE_MAX   0x00020000
 
#define MAX_FONT_OBJECTS   16
 

Functions

BOOLEAN MG_FontInit (BOOLEAN isHD)
 Initialise freetype library and load "built-in" font. More...
 
void MG_SetMaxFonts (U16BIT max)
 Set Max allowable fonts for profile. More...
 
void MG_FontExit (void)
 Free all data associated with built-in font and terminate freetype library. More...
 
S16BIT MG_FontLoadFile (const U8BIT *data, U32BIT length)
 Load font data file into memory for freetype. More...
 
void MG_FontFreeFile (S16BIT font_index)
 free memory associated with file More...
 
S_FontDetailsMG_GetFontPtr (S16BIT font_index)
 Get Pointer to Font. More...
 
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. More...
 
void MG_ReleaseFont (H_FontSize f_sz)
 Allocate font of particular size from font file. More...
 
S_FontDetailsMG_FindFont (H_FontSize f_sz)
 Get font from size. More...
 
void MG_GetFontMetrics (H_FontSize f_sz, S_FontMetrics *pMetrics)
 Get font Metrics. More...
 
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
.
S_FontDetails* MG_FindFont ( H_FontSize  f_sz)

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
void MG_ReleaseFontPtr ( S_FontDetails fp)

Parameters
.
Returns
.
void MG_SetMaxFonts ( U16BIT  max)

Set Max allowable fonts for profile.

Parameters
n/a
Returns
n/a