Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

FTFace Class Reference

#include <FTFace.h>


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.

Public Member Functions

 FTFace (const char *fontFilePath)
 Opens and reads a face file.

 FTFace (const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
 Read face data from an in-memory buffer.

virtual ~FTFace ()
 Destructor.

bool Attach (const char *fontFilePath)
 Attach auxilliary file to font (e.g., font metrics).

bool Attach (const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
 Attach auxilliary data to font (e.g., font metrics) from memory.

FT_Face * Face () const
 Get the freetype face object..

const FTSizeSize (const unsigned int size, const unsigned int res)
 Sets the char size for the current face.

unsigned int CharMapCount ()
 Get the number of character maps in this face.

FT_Encoding * CharMapList ()
 Get a list of character maps in this face.

FTPoint KernAdvance (unsigned int index1, unsigned int index2)
 Gets the kerning vector between two glyphs.

FT_GlyphSlot Glyph (unsigned int index, FT_Int load_flags)
 Loads and creates a Freetype glyph.

unsigned int GlyphCount () const
 Gets the number of glyphs in the current face.

FT_Error Error () const
 Queries for errors.


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.cpp.

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 29 of file FTFace.cpp.

FTFace::~FTFace  )  [virtual]
 

Destructor.

Disposes of the current Freetype Face.

Definition at line 50 of file FTFace.cpp.


Member Function Documentation

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 68 of file FTFace.cpp.

References FT_OPEN_MEMORY.

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 61 of file FTFace.cpp.

Referenced by FTFont::Attach().

unsigned int FTFace::CharMapCount  ) 
 

Get the number of character maps in this face.

Returns:
character map count.

Definition at line 90 of file FTFace.cpp.

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 96 of file FTFace.cpp.

References CharMapCount().

Referenced by FTFont::CharMapList().

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(), and FTGlyphContainer::Render().

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.

FT_GlyphSlot FTFace::Glyph unsigned int  index,
FT_Int  load_flags
 

Loads and creates a Freetype glyph.

Definition at line 133 of file FTFace.cpp.

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().

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

Gets the kerning vector between two glyphs.

Definition at line 111 of file FTFace.cpp.

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

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 81 of file FTFace.cpp.

References FTSize::CharSize(), and FTSize::Error().

Referenced by FTFont::FaceSize().


The documentation for this class was generated from the following files:
Generated on Sun Dec 5 22:24:06 2004 for FTGL by doxygen 1.3.6