The problem is that the generated texture should be able to fit all of the glyphs on a single 1024x1024 texture, which is what I want. However it's creating a 2048x1024 texture and unnecessarily wasting the majority of the texture space, which is actually empty. If I make the font size smaller, the texture is reduced to a 1024x1024, but the font resolution is not quite large enough for my purposes.
Below is the code that is creating the unnecessarily large (wasted) texture:
Code: Select all
Ogre::FontPtr font = Ogre::FontManager::getSingletonPtr()->create("MyFont", "General");
font->setType( Ogre::FT_TRUETYPE );
font->setSource( "my_font.ttf" );
font->setTrueTypeSize(15);
font->setTrueTypeResolution(400); // this should be able to fit on a 1024x1024!
font->load();
Ogre::String texname = font->getMaterial()->getTechnique(0)->getPass(0)->getTextureUnitState(0)->getTextureName();
Ogre::TexturePtr fontTexture = Ogre::TextureManager::getSingleton().getByName(texname);
Ogre::HardwarePixelBufferSharedPtr fontBuffer = fontTexture->getBuffer();