Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

FTFace Class Reference

FTFace class provides an abstraction layer for the Freetype Face. More...

#include <FTFace.h>

List of all members.

Public Member Functions

 FTFace (const char *filename)
 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 *filename)
 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.

void Close ()
 Disposes of the face.

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

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

FT_Glyph * 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.


Detailed Description

FTFace class provides an abstraction layer for the Freetype Face.

See also:
"Freetype 2 Documentation"

Definition at line 19 of file FTFace.h.


Constructor & Destructor Documentation

FTFace::FTFace const char *  filename  ) 
 

Opens and reads a face file.

Error is set.

Parameters:
filename font file name.

Definition at line 6 of file FTFace.cpp.

References FTLibrary::Instance().

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

References FTLibrary::Instance().

FTFace::~FTFace  )  [virtual]
 

Destructor.

Disposes of the current Freetype Face.

Definition at line 48 of file FTFace.cpp.

References Close().


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

bool FTFace::Attach const char *  filename  ) 
 

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

Parameters:
filename auxilliary font file name.
Returns:
true if file has opened successfully.

Definition at line 54 of file FTFace.cpp.

Referenced by FTFont::Attach().

void FTFace::Close  ) 
 

Disposes of the face.

Definition at line 74 of file FTFace.cpp.

Referenced by ~FTFace().

FT_Error FTFace::Error  )  const [inline]
 

Queries for errors.

Returns:
The current error code.

Definition at line 106 of file FTFace.h.

Referenced by FTFont::Attach(), FTFont::FaceSize(), FTFont::FTFont(), and FTGlyphContainer::Render().

FT_Face* FTFace::Face  )  const [inline]
 

Definition at line 68 of file FTFace.h.

FT_Glyph * FTFace::Glyph unsigned int  index,
FT_Int  load_flags
 

Loads and creates a Freetype glyph.

Definition at line 122 of file FTFace.cpp.

unsigned int FTFace::GlyphCount  )  const [inline]
 

Gets the number of glyphs in the current face.

Definition at line 99 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 100 of file FTFace.cpp.

References FTPoint::x.

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

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

Referenced by FTFont::FaceSize().

unsigned int FTFace::UnitsPerEM  )  const
 

Definition at line 94 of file FTFace.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Aug 25 15:16:39 2003 for FTGL by doxygen 1.3.3