setSupportedCodePoints

magistr

23-01-2008 21:09:51

Why I am must manualy add all used codepoints to QuickGUI.
It may need to add some code to automate the following additions:
std::set<Ogre::UTFString::code_point> code_points;

Ogre::FontManager::ResourceMapIterator it = Ogre::FontManager::getSingleton().getResourceIterator();
while (it.hasMoreElements())
{
Ogre::FontPtr res= it.getNext();
Ogre::Font::CodePointRangeList range = res->getCodePointRangeList();
Ogre::Font::CodePointRangeList::iterator it;
for(it=range.begin(); it!=range.end();it++)
{
int start = (*it).first;
int end = (*it).second;
for(int code=start;code<=end;code++)
{
if (code_points.find(code)==code_points.end())
code_points.insert(code);
}
}
}
Manager->setSupportedCodePoints(code_points);

kungfoomasta

23-01-2008 21:27:27

What happens when you try to render a glyph that is not defined? :wink:

If you can tell me what to draw when I press Space, Enter, Escape, Tab, Backspace, Shift, Ctrl, Alt, etc then we can have code to add all code points.