#include <FTFont.h>
Inheritance diagram for FTFont:
Public Member Functions | |
FTFont (const char *fontname) | |
Open and read a font file. | |
FTFont (const unsigned char *pBufferBytes, size_t bufferSizeInBytes) | |
Open and read a font from a buffer in memory. | |
virtual | ~FTFont () |
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. | |
bool | CharMap (FT_Encoding encoding) |
Set the character map for the face. | |
virtual bool | FaceSize (const unsigned int size, const unsigned int res=72) |
Set the char size for the current face. | |
unsigned int | FaceSize () const |
Get the current face size in points. | |
virtual void | Depth (float d) |
Set the extrusion distance for the font. | |
float | Ascender () const |
Get the global ascender height for the face. | |
float | Descender () const |
Gets the global descender height for the face. | |
void | BBox (const char *string, float &llx, float &lly, float &llz, float &urx, float &ury, float &urz) |
Get the bounding box for a string. | |
void | BBox (const wchar_t *string, float &llx, float &lly, float &llz, float &urx, float &ury, float &urz) |
Get the bounding box for a string. | |
float | Advance (const wchar_t *string) |
Get the advance width for a string. | |
float | Advance (const char *string) |
Get the advance width for a string. | |
virtual void | Render (const char *string) |
Render a string of characters. | |
virtual void | Render (const wchar_t *string) |
Render a string of characters. | |
FT_Error | Error () const |
Queries the Font for errors. | |
Protected Member Functions | |
virtual FTGlyph * | MakeGlyph (unsigned int g)=0 |
Construct a glyph of the correct type. | |
Protected Attributes | |
FTFace | face |
Current face object. | |
FTSize | charSize |
Current size object. | |
FT_Error | err |
Current error code. |
Specific font classes are derived from this class. It uses the helper classes FTFace and FTSize to access the Freetype library. This class is abstract and deriving classes must implement the protected MakeGlyph
function to create glyphs of the appropriate type.
It is good practice after using these functions to test the error code returned. FT_Error Error()
Definition at line 31 of file FTFont.h.
|
Open and read a font file. Sets Error flag.
Definition at line 7 of file FTFont.cpp. References err, FTFace::Error(), and face. |
|
Open and read a font from a buffer in memory. Sets Error flag.
Definition at line 19 of file FTFont.cpp. References err, FTFace::Error(), and face. |
|
Destructor.
Definition at line 31 of file FTFont.cpp. |
|
Get the advance width for a string.
Definition at line 198 of file FTFont.cpp. References FTGlyphContainer::Advance(). |
|
Get the advance width for a string.
Definition at line 182 of file FTFont.cpp. References FTGlyphContainer::Advance(). |
|
Get the global ascender height for the face.
Definition at line 100 of file FTFont.cpp. References FTSize::Ascender(), and charSize. |
|
Attach auxilliary data to font e.g font metrics, from memory. Note: not all font formats implement this function.
Definition at line 52 of file FTFont.cpp. References FTFace::Attach(), err, FTFace::Error(), and face. |
|
Attach auxilliary file to font e.g font metrics. Note: not all font formats implement this function.
Definition at line 37 of file FTFont.cpp. References FTFace::Attach(), err, FTFace::Error(), and face. |
|
Get the bounding box for a string.
Definition at line 147 of file FTFont.cpp. References FTGlyphContainer::Advance(), FTGlyphContainer::BBox(), FTBBox::lowerX, FTBBox::lowerY, FTBBox::lowerZ, FTBBox::Move(), FTBBox::upperX, FTBBox::upperY, and FTBBox::upperZ. |
|
Get the bounding box for a string.
Definition at line 112 of file FTFont.cpp. References FTGlyphContainer::Advance(), FTGlyphContainer::BBox(), FTBBox::lowerX, FTBBox::lowerY, FTBBox::lowerZ, FTBBox::Move(), FTBBox::upperX, FTBBox::upperY, and FTBBox::upperZ. |
|
Set the character map for the face.
Definition at line 92 of file FTFont.cpp. References FTGlyphContainer::CharMap(), err, and FTGlyphContainer::Error(). |
|
Set the extrusion distance for the font. Only implemented by FTGLExtrdFont
Reimplemented in FTGLExtrdFont. |
|
Gets the global descender height for the face.
Definition at line 106 of file FTFont.cpp. References charSize, and FTSize::Descender(). |
|
Queries the Font for errors.
|
|
Get the current face size in points.
Definition at line 86 of file FTFont.cpp. References FTSize::CharSize(), and charSize. Referenced by FTGLTextureFont::FaceSize(). |
|
Set the char size for the current face.
Reimplemented in FTGLTextureFont. Definition at line 67 of file FTFont.cpp. References charSize, FTFace::Error(), face, and FTFace::Size(). |
|
Construct a glyph of the correct type. Clients must overide the function and return their specialised FTGlyph.
|
|
Render a string of characters.
Reimplemented in FTGLBitmapFont, FTGLOutlineFont, FTGLPixmapFont, and FTGLTextureFont. Definition at line 227 of file FTFont.cpp. References FTPoint::x, and FTPoint::y. |
|
Render a string of characters.
Reimplemented in FTGLBitmapFont, FTGLOutlineFont, FTGLPixmapFont, and FTGLTextureFont. Definition at line 214 of file FTFont.cpp. References FTPoint::x, and FTPoint::y. Referenced by FTGLTextureFont::Render(), FTGLPixmapFont::Render(), FTGLOutlineFont::Render(), and FTGLBitmapFont::Render(). |
|
Current size object.
Definition at line 207 of file FTFont.h. Referenced by Ascender(), Descender(), and FaceSize(). |
|
Current error code. Zero means no error. |
|
Current face object.
Definition at line 202 of file FTFont.h. Referenced by Attach(), FTGLTextureFont::FaceSize(), FaceSize(), FTFont(), and FTGLTextureFont::FTGLTextureFont(). |