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

FTFace Class Reference

#include <FTFace.h>

List of all members.


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 *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
 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 UnitsPerEM () const
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 *  filename  ) 
 

Opens and reads a face file.

Error is set.

Parameters:
filename font file name.

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

FTFace::~FTFace  )  [virtual]
 

Destructor.

Disposes of the current Freetype Face.

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

References FT_OPEN_MEMORY.

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 55 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 95 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 101 of file FTFace.cpp.

References CharMapCount().

Referenced by FTFont::CharMapList().

void FTFace::Close  ) 
 

Disposes of the face.

Definition at line 75 of file FTFace.cpp.

Referenced by ~FTFace().

FT_Error FTFace::Error  )  const [inline]
 

Queries for errors.

Returns:
The current error code.

Definition at line 122 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 72 of file FTFace.h.

FT_GlyphSlot FTFace::Glyph unsigned int  index,
FT_Int  load_flags
 

Loads and creates a Freetype glyph.

Definition at line 144 of file FTFace.cpp.

unsigned int FTFace::GlyphCount  )  const [inline]
 

Gets the number of glyphs in the current face.

Definition at line 115 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 122 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 86 of file FTFace.cpp.

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

Referenced by FTFont::FaceSize().

unsigned int FTFace::UnitsPerEM  )  const
 

Definition at line 116 of file FTFace.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Aug 16 18:47:20 2004 for FTGL by doxygen 1.3.6