#include <Face.hh>
a font face is a font with a specified font size. this class is used to wrap up freetype operations to get metrics of a font face, and create glyph objects.
|
construct a font face.
00081 : m_pimpl( new CBody ) 00082 { 00083 // assert parameters 00084 assert( lib != 0 ) ; 00085 assert( lib->Pimpl( ) != 0 ) ; 00086 assert( lib->Pimpl( )->Body( ) != 0 ) ; 00087 assert( !filename.empty( ) ) ; 00088 assert( index >= 0 ) ; 00089 00090 FT_Error error = ::FT_New_Face( lib->Pimpl( )->Body( ), 00091 filename.c_str( ), 00092 index, &m_pimpl->m_face ) ; 00093 00094 // should throw something better later 00095 if ( error ) 00096 throw CError( ) ; 00097 00098 assert( IsValid( ) ) ; 00099 } |
|
set font face size. see FT_Set_Char_Size() for details.
00209 { 00210 assert( IsValid( ) ) ; 00211 00212 FT_Error result = FT_Set_Char_Size( m_pimpl->m_face, 00213 static_cast<FT_F26Dot6>( width * 64.0 ), 00214 static_cast<FT_F26Dot6>( height * 64.0), 00215 hres, vres ) ; 00216 if ( result != 0 ) 00217 throw CError( ) ; 00218 } |
|
pointer to implementation. the actual freetype data structure is hided behind this pointer. |