Added resetting of the freetype size when getting Glyph3D glyph's as otherwise use of 2D and 3D Text would cause incorrect text sizing.

This commit is contained in:
Robert Osfield
2010-11-18 17:18:31 +00:00
parent 265673bacc
commit a5b83edc76

View File

@@ -78,7 +78,7 @@ struct Char3DInfo
}
if (!(_currentPrimitiveSet->empty()) &&
(*_verts)[(*_currentPrimitiveSet)[0]] == pos)
(*_verts)[(*+_currentPrimitiveSet)[0]] == pos)
{
_currentPrimitiveSet->push_back( (*_currentPrimitiveSet)[0] );
}
@@ -249,14 +249,15 @@ FreeTypeFont::~FreeTypeFont()
void FreeTypeFont::init()
{
FT_Error _error = FT_Set_Pixel_Sizes(_face, 32, 32);
FT_Error _error;
#if 0
_error = FT_Set_Pixel_Sizes(_face, 32, 32);
if (_error)
{
OSG_NOTICE << "FreeTypeFont3D: set pixel sizes failed ..." << std::endl;
return;
}
#endif
FT_Set_Char_Size( _face, 64*64, 64*64, 600, 600);
int glyphIndex = FT_Get_Char_Index( _face, 'M' );
@@ -452,6 +453,9 @@ osgText::Glyph3D * FreeTypeFont::getGlyph3D(unsigned int charcode)
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(FreeTypeLibrary::instance()->getMutex());
FT_Set_Char_Size( _face, 64*64, 64*64, 600, 600);
_currentRes = osgText::FontResolution(0,0);
//
// GT: fix for symbol fonts (i.e. the Webdings font) as the wrong character are being
// returned, for symbol fonts in windows (FT_ENCONDING_MS_SYMBOL in freetype) the correct