13
* FTFace class provides an abstraction layer for the Freetype Face.
15
* @see "Freetype 2 Documentation"
18
class FTGL_EXPORT FTFace
22
* Opens and reads a face file. Error is set.
24
* @param filename font file name.
26
FTFace( const char* filename);
29
* Read face data from an in-memory buffer. Error is set.
31
* @param pBufferBytes the in-memory buffer
32
* @param bufferSizeInBytes the length of the buffer in bytes
34
FTFace( const unsigned char *pBufferBytes, size_t bufferSizeInBytes );
39
* Disposes of the current Freetype Face.
44
* Attach auxilliary file to font (e.g., font metrics).
46
* @param filename auxilliary font file name.
47
* @return <code>true</code> if file has opened
50
bool Attach( const char* filename);
53
* Attach auxilliary data to font (e.g., font metrics) from memory
55
* @param pBufferBytes the in-memory buffer
56
* @param bufferSizeInBytes the length of the buffer in bytes
57
* @return <code>true</code> if file has opened
60
bool Attach( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
63
* Disposes of the face
68
* Get the freetype face object..
70
* @return pointer to an FT_Face.
72
FT_Face* Face() const { return ftFace;}
75
* Sets the char size for the current face.
77
* This doesn't guarantee that the size was set correctly. Clients
78
* should check errors.
80
* @param size the face size in points (1/72 inch)
81
* @param res the resolution of the target device.
82
* @return <code>FTSize</code> object
84
const FTSize& Size( const unsigned int size, const unsigned int res);
86
unsigned int UnitsPerEM() const;
89
* Get the number of character maps in this face.
91
* @return character map count.
93
unsigned int CharMapCount();
96
* Get a list of character maps in this face.
98
* @return pointer to the first encoding.
100
FT_Encoding* CharMapList();
103
* Gets the kerning vector between two glyphs
105
FTPoint KernAdvance( unsigned int index1, unsigned int index2);
108
* Loads and creates a Freetype glyph.
110
FT_GlyphSlot Glyph( unsigned int index, FT_Int load_flags);
113
* Gets the number of glyphs in the current face.
115
unsigned int GlyphCount() const { return numGlyphs;}
118
* Queries for errors.
120
* @return The current error code.
122
FT_Error Error() const { return err; }
131
* The size object associated with this face
136
* The number of glyphs in this face
140
FT_Encoding* fontEncodingList;
143
* Current error code. Zero means no error.