MGD::FONT Class Reference

Font definition and implementation. More...

#include <mi32/mgd2.h>

List of all members.

Public Types

enum  FONTTYPE { FONTTYPE_OF, FONTTYPE_TTF }
enum  MODE { MODE_UNICODE, MODE_RAWGID, MODE_GID }

Public Member Functions

virtual int DrawGlyph (MGD::CONTEXT *context, double dx, double dy, double baseangle, const STRINGDATA &string, int n)=0
virtual int DrawGlyph (MGD::CONTEXT *context, double dx, double dy, double baseangle, const UNICODE *ucstr, MGD::FONT::MODE mode)=0
 FONT ()
virtual int GetFontMetrics (MGD::CONTEXT *context, MGD::FONTINFO &fontinfo)=0
const UNICODEGetFontName () const
virtual MGD::FONT::FONTTYPE GetFontType () const =0
virtual int GetGlyphExtents (MGD::CONTEXT *context, const double &dx, const double &dy, const double &baseangle, UNICODE ch, DRECT2D &extents, MGD::FONT::MODE mode)=0
virtual int GetGlyphMetrics (MGD::CONTEXT *context, UNICODE ch, MGD::GLYPHINFO &glyphinfo, MGD::FONT::MODE mode)=0
virtual ERRVALUE GetGlyphOutline (UINT16 GlyphIndex, INT32 *NumContours, LPOLYGON **Def, UINT32 FontFlags)
UNICODE GetInitChar () const
UNICODE GetLastChar () const
UNICODE GetNULLChar () const
UNICODE GetNumGlyphs () const
virtual bool IsEmbeddable () const =0
virtual double NextPosition (MGD::CONTEXT *context, double *retx, double *rety, double baseangle, const STRINGDATA &string, int n, double SpaceExtra=0.0, double GlyphExtra=0.0)=0
virtual int UCtoGID (MGD::CONTEXT *context, const UNICODE *uc, MGD::STRINGDATA &strdata)=0
virtual ~FONT ()

Static Public Member Functions

ERRVALUE ReadTTF (const UNICODE *name, SIMPLE_ARRAY< UINT8 > &data)

Protected Attributes

UNICODE m_filename [FILENAME_MAX]
UNICODE m_fontname [32]
UNICODE m_InitChar
UNICODE m_LastChar
UNICODE m_NullChar
UINT16 m_NumGlyphs


Detailed Description

Font definition and implementation.

Definition at line 606 of file mgd2.h.


Member Enumeration Documentation

enum MGD::FONT::FONTTYPE
 

Enumeration values:
FONTTYPE_OF 
FONTTYPE_TTF 

Definition at line 615 of file mgd2.h.

enum MGD::FONT::MODE
 

Enumeration values:
MODE_UNICODE  Using Unicode.
MODE_RAWGID  Glyph IDs instead of Unicode.
MODE_GID  Glyph IDs encoded by UCtoGID member function.

Definition at line 609 of file mgd2.h.


Constructor & Destructor Documentation

MGD::FONT::FONT  ) 
 

virtual MGD::FONT::~FONT  )  [virtual]
 


Member Function Documentation

virtual int MGD::FONT::DrawGlyph MGD::CONTEXT context,
double  dx,
double  dy,
double  baseangle,
const STRINGDATA string,
int  n
[pure virtual]
 

virtual int MGD::FONT::DrawGlyph MGD::CONTEXT context,
double  dx,
double  dy,
double  baseangle,
const UNICODE ucstr,
MGD::FONT::MODE  mode
[pure virtual]
 

virtual int MGD::FONT::GetFontMetrics MGD::CONTEXT context,
MGD::FONTINFO fontinfo
[pure virtual]
 

const UNICODE* MGD::FONT::GetFontName  )  const [inline]
 

Definition at line 699 of file mgd2.h.

virtual MGD::FONT::FONTTYPE MGD::FONT::GetFontType  )  const [pure virtual]
 

virtual int MGD::FONT::GetGlyphExtents MGD::CONTEXT context,
const double &  dx,
const double &  dy,
const double &  baseangle,
UNICODE  ch,
DRECT2D extents,
MGD::FONT::MODE  mode
[pure virtual]
 

virtual int MGD::FONT::GetGlyphMetrics MGD::CONTEXT context,
UNICODE  ch,
MGD::GLYPHINFO glyphinfo,
MGD::FONT::MODE  mode
[pure virtual]
 

virtual ERRVALUE MGD::FONT::GetGlyphOutline UINT16  GlyphIndex,
INT32 NumContours,
LPOLYGON **  Def,
UINT32  FontFlags
[inline, virtual]
 

Get the outline of a glyph.

This only works for TrueType fonts, but the caller won't have access to the TrueType-derived MGD::FONT_TTF. So we make it virtual and let it return an error by default. We could easily implement it for OF fonts too if it was ever needed.

Definition at line 713 of file mgd2.h.

UNICODE MGD::FONT::GetInitChar  )  const [inline]
 

Definition at line 722 of file mgd2.h.

UNICODE MGD::FONT::GetLastChar  )  const [inline]
 

Definition at line 727 of file mgd2.h.

UNICODE MGD::FONT::GetNULLChar  )  const [inline]
 

Definition at line 732 of file mgd2.h.

UNICODE MGD::FONT::GetNumGlyphs  )  const [inline]
 

Definition at line 737 of file mgd2.h.

virtual bool MGD::FONT::IsEmbeddable  )  const [pure virtual]
 

virtual double MGD::FONT::NextPosition MGD::CONTEXT context,
double *  retx,
double *  rety,
double  baseangle,
const STRINGDATA string,
int  n,
double  SpaceExtra = 0.0,
double  GlyphExtra = 0.0
[pure virtual]
 

Parameters:
SpaceExtra  Extra pixels per space to insert

ERRVALUE MGD::FONT::ReadTTF const UNICODE name,
SIMPLE_ARRAY< UINT8 > &  data
[static]
 

Read a TrueType font into memory.

The "name" parameter is expected to be the filename, minus the path or extention.

The FaceNum parameter is for TrueType Collections (ttc). A ttc file contains multiple ttfs Since TrueType fonts are embeded in resource files on the Macintosh (even in OS X), a simple "filename" isn't all that useful. This function handles reading the whole thing.

virtual int MGD::FONT::UCtoGID MGD::CONTEXT context,
const UNICODE uc,
MGD::STRINGDATA strdata
[pure virtual]
 


Member Data Documentation

UNICODE MGD::FONT::m_filename[FILENAME_MAX] [protected]
 

Definition at line 744 of file mgd2.h.

UNICODE MGD::FONT::m_fontname[32] [protected]
 

Definition at line 743 of file mgd2.h.

UNICODE MGD::FONT::m_InitChar [protected]
 

Initial character having glyph defined.

Definition at line 746 of file mgd2.h.

UNICODE MGD::FONT::m_LastChar [protected]
 

Last character having glyph defined.

Definition at line 747 of file mgd2.h.

UNICODE MGD::FONT::m_NullChar [protected]
 

Character to user for undefined glyphs.

Definition at line 748 of file mgd2.h.

UINT16 MGD::FONT::m_NumGlyphs [protected]
 

Number of glyphs in font.

Definition at line 745 of file mgd2.h.


The documentation for this class was generated from the following file:
Generated on Tue Dec 14 13:20:41 2004 for TNTsdk by  doxygen 1.3.8-20040913