MHEG5  18.9.0
MHEG5 Documentation
Classes | Macros | Typedefs | Functions
mg_drawtext.h File Reference

Interface to the MHEG text render that uses Freetype font library. More...

#include "mg_osd.h"
#include "mg_fontapi.h"
#include "dtvstring.h"

Go to the source code of this file.

Classes

struct  VRect
 
struct  _TextString
 
struct  _HyperAttribs
 
struct  s_FontProp
 
struct  _DrawTextAttrib
 

Macros

#define FONT_STYLE_PLAIN   0x00
 
#define FONT_STYLE_SQUARE   0x10
 
#define FONT_STYLE_NO_SCALE   0x80
 
#define JUSTIFY_H_START   0x00
 
#define JUSTIFY_H_END   0x01
 
#define JUSTIFY_H_CENTRE   0x02
 
#define JUSTIFY_H_JUSTIFIED   0x03
 
#define WRAP_WORDS   0x04
 
#define WRAP_VERTICAL   0x08
 
#define JFY_HZ_MASK   0x03
 
#define JFY_WRAP_MASK   0x0c
 
#define JFY_HZ_WRAP_MASK   0x0f
 
#define JUSTIFY_V_START   0x00
 
#define JUSTIFY_V_END   0x10
 
#define JUSTIFY_V_CENTRE   0x20
 
#define JUSTIFY_V_JUSTIFIED   0x30
 
#define JUSTIFY_VERTI_MASK   0x30
 
#define OBSCURED_INPUT_CHAR   ('*')
 
#define ENTRY_INSERT_CHAR   ('_')
 
#define ENTRY_OVERWRITE_CHAR   ('<')
 
#define HK_FNT_MAGIC   0xFEFF
 

Typedefs

typedef struct VRectpVRect
 
typedef struct _TextString TextString
 
typedef struct _TextStringpTextString
 
typedef struct _HyperAttribs HyperAttribs
 
typedef struct _HyperAttribspHyperAttribs
 
typedef struct s_FontProp S_FontProp
 
typedef struct _DrawTextAttrib DrawTextAttrib
 
typedef struct _DrawTextAttribpDrawTextAttrib
 

Functions

void * MG_DrawText (const TextString unistr, pDrawTextAttrib attrib, const VRect txt_box)
 Create Surface and draw text string on it and terminate freetype library. More...
 
S16BIT MG_TextWidth (const TextString unistr, pDrawTextAttrib attrib)
 
void MG_DrawScreenText (const TextString unistr, pDrawTextAttrib attrib, S_SURFACE *canvas)
 Single line text string drawn on existing Surface. More...
 

Detailed Description

Interface to the MHEG text render that uses Freetype font library.

Date
28/05/2008
Author
Adam Sturtridge

Definition in file mg_drawtext.h.

Macro Definition Documentation

#define ENTRY_INSERT_CHAR   ('_')

Definition at line 60 of file mg_drawtext.h.

#define ENTRY_OVERWRITE_CHAR   ('<')

Definition at line 61 of file mg_drawtext.h.

#define FONT_STYLE_NO_SCALE   0x80

Definition at line 34 of file mg_drawtext.h.

#define FONT_STYLE_PLAIN   0x00

Definition at line 32 of file mg_drawtext.h.

#define FONT_STYLE_SQUARE   0x10

Definition at line 33 of file mg_drawtext.h.

#define HK_FNT_MAGIC   0xFEFF

Definition at line 63 of file mg_drawtext.h.

#define JFY_HZ_MASK   0x03

Definition at line 46 of file mg_drawtext.h.

#define JFY_HZ_WRAP_MASK   0x0f

Definition at line 48 of file mg_drawtext.h.

#define JFY_WRAP_MASK   0x0c

Definition at line 47 of file mg_drawtext.h.

#define JUSTIFY_H_CENTRE   0x02

Definition at line 39 of file mg_drawtext.h.

#define JUSTIFY_H_END   0x01

Definition at line 38 of file mg_drawtext.h.

#define JUSTIFY_H_JUSTIFIED   0x03

Definition at line 40 of file mg_drawtext.h.

#define JUSTIFY_H_START   0x00

Definition at line 37 of file mg_drawtext.h.

#define JUSTIFY_V_CENTRE   0x20

Definition at line 52 of file mg_drawtext.h.

#define JUSTIFY_V_END   0x10

Definition at line 51 of file mg_drawtext.h.

#define JUSTIFY_V_JUSTIFIED   0x30

Definition at line 53 of file mg_drawtext.h.

#define JUSTIFY_V_START   0x00

Definition at line 50 of file mg_drawtext.h.

#define JUSTIFY_VERTI_MASK   0x30

Definition at line 54 of file mg_drawtext.h.

#define OBSCURED_INPUT_CHAR   ('*')

Definition at line 59 of file mg_drawtext.h.

#define WRAP_VERTICAL   0x08

Definition at line 44 of file mg_drawtext.h.

#define WRAP_WORDS   0x04

Definition at line 42 of file mg_drawtext.h.

Typedef Documentation

typedef struct _HyperAttribs HyperAttribs
typedef struct _DrawTextAttrib * pDrawTextAttrib
typedef struct _HyperAttribs * pHyperAttribs
typedef struct _TextString * pTextString
typedef struct VRect * pVRect
typedef struct s_FontProp S_FontProp
typedef struct _TextString TextString

Function Documentation

void MG_DrawScreenText ( const TextString  unistr,
pDrawTextAttrib  attrib,
S_SURFACE canvas 
)

Single line text string drawn on existing Surface.

Parameters
unistrUnicode String
attribAttributes on the string (including font data)
canvasSurface
Returns
n/a

Definition at line 2178 of file mg_drawtext.c.

void* MG_DrawText ( const TextString  unistr,
pDrawTextAttrib  attrib,
const VRect  txt_box 
)

Create Surface and draw text string on it and terminate freetype library.

Parameters
unistrUnicode String to display
attribAttributes on the string (including font data)
txt_boxRectangle in SD pixel size
Returns
handle to surface, NULL if no text can be drawn in box
Parameters
unistrUnicode String
attribAttributes on the string (including font data)
txt_boxRectangle in SD pixel size
Returns
pointer to surface, NULL if no text can be drawn in box

Definition at line 2275 of file mg_drawtext.c.

S16BIT MG_TextWidth ( const TextString  unistr,
pDrawTextAttrib  attrib 
)
Parameters
unistrUnicode String
attribAttributes on the string (including font data)
f_szPointer to font size data
Returns
pointer to surface, NULL if no text can be drawn in box
Parameters
unistrUnicode String
attribAttributes on the string (including font data)
Returns
width of text in pixels

Definition at line 2124 of file mg_drawtext.c.