00001 #include "FTGLOutlineFont.h" 00002 #include "FTOutlineGlyph.h" 00003 00004 00005 FTGLOutlineFont::FTGLOutlineFont( const char* fontFilePath) 00006 : FTFont( fontFilePath) 00007 {} 00008 00009 00010 FTGLOutlineFont::FTGLOutlineFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes) 00011 : FTFont( pBufferBytes, bufferSizeInBytes) 00012 {} 00013 00014 00015 FTGLOutlineFont::~FTGLOutlineFont() 00016 {} 00017 00018 00019 FTGlyph* FTGLOutlineFont::MakeGlyph( unsigned int g) 00020 { 00021 FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_NO_HINTING); 00022 00023 if( ftGlyph) 00024 { 00025 FTOutlineGlyph* tempGlyph = new FTOutlineGlyph( ftGlyph, useDisplayLists); 00026 return tempGlyph; 00027 } 00028 00029 err = face.Error(); 00030 return NULL; 00031 } 00032 00033 00034 void FTGLOutlineFont::PreRender() 00035 { 00036 FTFont::PreRender(); 00037 glPushAttrib( GL_ENABLE_BIT | GL_HINT_BIT | GL_LINE_BIT | GL_COLOR_BUFFER_BIT); 00038 00039 glDisable( GL_TEXTURE_2D); 00040 00041 glEnable( GL_LINE_SMOOTH); 00042 glHint( GL_LINE_SMOOTH_HINT, GL_DONT_CARE); 00043 glEnable(GL_BLEND); 00044 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE 00045 } 00046 00047 00048 void FTGLOutlineFont::PostRender() 00049 { 00050 glPopAttrib(); 00051 FTFont::PostRender(); 00052 }