pin
11-05-2007 17:06:19
I found a page in Ogre help forum explaining how to do it but It's C++ code that I can't figure out how to port:
http://www.ogre3d.org/phpBB2/viewtopic. ... 1af3ffb756
the code
Any ideas?
http://www.ogre3d.org/phpBB2/viewtopic. ... 1af3ffb756
the code
float textWidth = 0;
for(unsigned int i=0; i < text.length();i++) {
if (text[i] == 0x0020)
textWidth += f->getGlyphAspectRatio(0x0030);
else
textWidth += (f->getGlyphAspectRatio(text[i]));
}
textWidth *= fontSize;
Any ideas?