I'm currently trying to iterate over all loaded fonts to add the missing umlaut glyphs to each font.
So i tried the following:
Code: Select all
FontManager* fmgr = FontManager::getSingletonPtr();
String new_glyphs = "äöüÄÖÜ";
for( FontManager::FontIterator it = fmgr->getIterator(); !it.isAtEnd(); it++ )
{
Font* font = *it;
String glyphset( font->getAvailableGlyphs() );
for( int i = 0; i < new_glyphs.length(); i++ )
{
if( glyphset.find( new_glyphs[i] ) == String::npos )
{
glyphset += new_glyphs[i];
}
}
font->defineFontGlyphs( glyphset );
}
In my scheme file I have loaded 4 different font files. But the above code only seems to find one of them. After the first loop, dereferencing the iterator yields 0xcdcdcdcd and therefore usage of the font pointer throws an exception.
Am I using the iterator in a wrong way or is this a bug?
thx
