FTFace Class Reference

#include <FTFace.h>

List of all members.

Public Member Functions

 FTFace (const char *fontFilePath)
 FTFace (const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
virtual ~FTFace ()
bool Attach (const char *fontFilePath)
bool Attach (const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
FT_FaceFace () const
const FTSizeSize (const unsigned int size, const unsigned int res)
unsigned int CharMapCount ()
FT_EncodingCharMapList ()
FTPoint KernAdvance (unsigned int index1, unsigned int index2)
FT_GlyphSlot Glyph (unsigned int index, FT_Int load_flags)
unsigned int GlyphCount () const
FT_Error Error () const
 FTFace (const char *fontFilePath)
 FTFace (const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
virtual ~FTFace ()
bool Attach (const char *fontFilePath)
bool Attach (const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
FT_FaceFace () const
const FTSizeSize (const unsigned int size, const unsigned int res)
unsigned int CharMapCount ()
FT_EncodingCharMapList ()
FTPoint KernAdvance (unsigned int index1, unsigned int index2)
FT_GlyphSlot Glyph (unsigned int index, FT_Int load_flags)
unsigned int GlyphCount () const
FT_Error Error () const

Private Attributes

FT_FaceftFace
FTSize charSize
int numGlyphs
FT_EncodingfontEncodingList
bool hasKerningTable
FT_Error err
FT_FaceftFace
FT_EncodingfontEncodingList


Detailed Description

FTFace class provides an abstraction layer for the Freetype Face.

See also:
"Freetype 2 Documentation"

Definition at line 18 of file FTFace.h.


Constructor & Destructor Documentation

FTFace::FTFace ( const char *  fontFilePath  ) 

Opens and reads a face file. Error is set.

Parameters:
fontFilePath font file path.

Definition at line 6 of file FTFace.cxx.

References err, FT_HAS_KERNING, FT_New_Face(), ftFace, hasKerningTable, FTLibrary::Instance(), and numGlyphs.

FTFace::FTFace ( const unsigned char *  pBufferBytes,
size_t  bufferSizeInBytes 
)

Read face data from an in-memory buffer. Error is set.

Parameters:
pBufferBytes the in-memory buffer
bufferSizeInBytes the length of the buffer in bytes

Definition at line 25 of file FTFace.cxx.

References err, FT_New_Memory_Face(), ftFace, FTLibrary::Instance(), and numGlyphs.

FTFace::~FTFace (  )  [virtual]

Destructor

Disposes of the current Freetype Face.

Definition at line 43 of file FTFace.cxx.

References FT_Done_Face(), and ftFace.

FTFace::FTFace ( const char *  fontFilePath  ) 

Opens and reads a face file. Error is set.

Parameters:
fontFilePath font file path.

FTFace::FTFace ( const unsigned char *  pBufferBytes,
size_t  bufferSizeInBytes 
)

Read face data from an in-memory buffer. Error is set.

Parameters:
pBufferBytes the in-memory buffer
bufferSizeInBytes the length of the buffer in bytes

virtual FTFace::~FTFace (  )  [virtual]

Destructor

Disposes of the current Freetype Face.


Member Function Documentation

bool FTFace::Attach ( const char *  fontFilePath  ) 

Attach auxilliary file to font (e.g., font metrics).

Parameters:
fontFilePath auxilliary font file path.
Returns:
true if file has opened successfully.

Definition at line 53 of file FTFace.cxx.

References err, FT_Attach_File(), and ftFace.

Referenced by FTFont::Attach().

bool FTFace::Attach ( const unsigned char *  pBufferBytes,
size_t  bufferSizeInBytes 
)

Attach auxilliary data to font (e.g., font metrics) from memory

Parameters:
pBufferBytes the in-memory buffer
bufferSizeInBytes the length of the buffer in bytes
Returns:
true if file has opened successfully.

Definition at line 60 of file FTFace.cxx.

References err, FT_Attach_Stream(), FT_OPEN_MEMORY, ftFace, and open.

FT_Face* FTFace::Face (  )  const [inline]

Get the freetype face object..

Returns:
pointer to an FT_Face.

Definition at line 67 of file FTFace.h.

const FTSize & FTFace::Size ( const unsigned int  size,
const unsigned int  res 
)

Sets the char size for the current face.

This doesn't guarantee that the size was set correctly. Clients should check errors.

Parameters:
size the face size in points (1/72 inch)
res the resolution of the target device.
Returns:
FTSize object

Definition at line 73 of file FTFace.cxx.

References charSize, FTSize::CharSize(), err, FTSize::Error(), and ftFace.

Referenced by FTFont::FaceSize().

unsigned int FTFace::CharMapCount (  ) 

Get the number of character maps in this face.

Returns:
character map count.

Definition at line 82 of file FTFace.cxx.

Referenced by FTFont::CharMapCount(), and CharMapList().

FT_Encoding * FTFace::CharMapList (  ) 

Get a list of character maps in this face.

Returns:
pointer to the first encoding.

Definition at line 88 of file FTFace.cxx.

References CharMapCount(), fontEncodingList, and size_t.

Referenced by FTFont::CharMapList().

FTPoint FTFace::KernAdvance ( unsigned int  index1,
unsigned int  index2 
)

Gets the kerning vector between two glyphs

Definition at line 101 of file FTFace.cxx.

References err, FT_Get_Kerning(), ft_kerning_unfitted, ftFace, hasKerningTable, FT_Vector_::x, x, FT_Vector_::y, and y.

Referenced by FTGlyphContainer::Advance(), and FTGlyphContainer::Render().

FT_GlyphSlot FTFace::Glyph ( unsigned int  index,
FT_Int  load_flags 
)

Loads and creates a Freetype glyph.

Definition at line 121 of file FTFace.cxx.

References err, FT_Load_Glyph(), ftFace, and NULL.

Referenced by FTGLBitmapFont::MakeGlyph(), FTGLPixmapFont::MakeGlyph(), FTGLExtrdFont::MakeGlyph(), FTGLPolygonFont::MakeGlyph(), FTGLTextureFont::MakeGlyph(), and FTGLOutlineFont::MakeGlyph().

unsigned int FTFace::GlyphCount (  )  const [inline]

Gets the number of glyphs in the current face.

Definition at line 108 of file FTFace.h.

Referenced by FTGLTextureFont::FaceSize(), and FTGLTextureFont::FTGLTextureFont().

FT_Error FTFace::Error (  )  const [inline]

Queries for errors.

Returns:
The current error code.

Definition at line 115 of file FTFace.h.

Referenced by FTFont::Attach(), FTFont::FaceSize(), FTFont::FTFont(), FTGLBitmapFont::MakeGlyph(), FTGLPixmapFont::MakeGlyph(), FTGLExtrdFont::MakeGlyph(), FTGLPolygonFont::MakeGlyph(), FTGLTextureFont::MakeGlyph(), FTGLOutlineFont::MakeGlyph(), and FTGlyphContainer::Render().

bool FTFace::Attach ( const char *  fontFilePath  ) 

Attach auxilliary file to font (e.g., font metrics).

Parameters:
fontFilePath auxilliary font file path.
Returns:
true if file has opened successfully.

bool FTFace::Attach ( const unsigned char *  pBufferBytes,
size_t  bufferSizeInBytes 
)

Attach auxilliary data to font (e.g., font metrics) from memory

Parameters:
pBufferBytes the in-memory buffer
bufferSizeInBytes the length of the buffer in bytes
Returns:
true if file has opened successfully.

FT_Face* FTFace::Face (  )  const [inline]

Get the freetype face object..

Returns:
pointer to an FT_Face.

Definition at line 67 of file FTFace.h.

const FTSize& FTFace::Size ( const unsigned int  size,
const unsigned int  res 
)

Sets the char size for the current face.

This doesn't guarantee that the size was set correctly. Clients should check errors.

Parameters:
size the face size in points (1/72 inch)
res the resolution of the target device.
Returns:
FTSize object

unsigned int FTFace::CharMapCount (  ) 

Get the number of character maps in this face.

Returns:
character map count.

FT_Encoding* FTFace::CharMapList (  ) 

Get a list of character maps in this face.

Returns:
pointer to the first encoding.

FTPoint FTFace::KernAdvance ( unsigned int  index1,
unsigned int  index2 
)

Gets the kerning vector between two glyphs

FT_GlyphSlot FTFace::Glyph ( unsigned int  index,
FT_Int  load_flags 
)

Loads and creates a Freetype glyph.

unsigned int FTFace::GlyphCount (  )  const [inline]

Gets the number of glyphs in the current face.

Definition at line 108 of file FTFace.h.

FT_Error FTFace::Error (  )  const [inline]

Queries for errors.

Returns:
The current error code.

Definition at line 115 of file FTFace.h.


Member Data Documentation

FT_Face* FTFace::ftFace [private]

The Freetype face

Definition at line 121 of file FTFace.h.

Referenced by Attach(), FTFace(), Glyph(), KernAdvance(), Size(), and ~FTFace().

FTSize FTFace::charSize [private]

The size object associated with this face

Definition at line 126 of file FTFace.h.

Referenced by Size().

int FTFace::numGlyphs [private]

The number of glyphs in this face

Definition at line 131 of file FTFace.h.

Referenced by FTFace().

FT_Encoding* FTFace::fontEncodingList [private]

Definition at line 133 of file FTFace.h.

Referenced by CharMapList().

bool FTFace::hasKerningTable [private]

This face has kerning tables

Definition at line 138 of file FTFace.h.

Referenced by FTFace(), and KernAdvance().

FT_Error FTFace::err [private]

Current error code. Zero means no error.

Definition at line 143 of file FTFace.h.

Referenced by Attach(), FTFace(), Glyph(), KernAdvance(), and Size().

FT_Face* FTFace::ftFace [private]

The Freetype face

Definition at line 121 of file FTFace.h.

FT_Encoding* FTFace::fontEncodingList [private]

Definition at line 133 of file FTFace.h.


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:25:32 2011 for ROOT_528-00b_version by  doxygen 1.5.1