From Max, fixes to UniCode support for bitmap fonts.

This commit is contained in:
Robert Osfield
2003-01-30 01:31:22 +00:00
parent 8422040e97
commit 787bbef714
3 changed files with 95 additions and 56 deletions

View File

@@ -65,10 +65,33 @@ void FTGLBitmapFont::render( const wchar_t* string,unsigned int renderContext)
glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE);
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0);
#if (FREETYPE_MAJOR >= 2) && (FREETYPE_MINOR>=1)
glPixelStorei( GL_UNPACK_ALIGNMENT, 2);
#else
glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
#endif
FTFont::render( string,renderContext);
glPopClientAttrib();
}
// mrn@changes
void FTGLBitmapFont::render( std::vector<int>::const_iterator first,
std::vector<int>::const_iterator last,
unsigned int renderContext)
{
glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE);
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0);
#if (FREETYPE_MAJOR >= 2) && (FREETYPE_MINOR>=1)
glPixelStorei( GL_UNPACK_ALIGNMENT, 2);
#else
glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
#endif
FTFont::render( first,last,renderContext);
glPopClientAttrib();
}

View File

@@ -43,6 +43,15 @@ class FTGL_EXPORT FTGLBitmapFont : public FTFont
// mrn@changes
void render( const wchar_t* string, unsigned int renderContext=0);
/**
* Renders a string of characters
*
* @param string unicode string to be output.
*/
// mrn@changes
void render( std::vector<int>::const_iterator first,
std::vector<int>::const_iterator last,
unsigned int renderContext=0);
// attributes
private: