From Tree, support for encoded text added into osgText.

This commit is contained in:
Robert Osfield
2003-01-08 15:22:17 +00:00
parent ba34880464
commit c5d3c860d8
14 changed files with 495 additions and 98 deletions

View File

@@ -14,6 +14,7 @@
#include <osgText/Font>
#include <osgText/EncodedText>
#include <osg/Notify>
#include <osgDB/FileUtils>
@@ -174,10 +175,10 @@ bool Font::create(osg::State& state)
return false;
}
void Font::output(osg::State& state,const char* text) const
void Font::output(osg::State& state, const EncodedText* text) const
{
if(_created)
_font->render(text,state.getContextID());
_font->render(text->getUnicodeText(),state.getContextID());
else
{
// ahhhh, this is bit doddy, the draw is potentially
@@ -201,10 +202,10 @@ void Font::clear()
}
float Font::
getWidth(const char* text) const
getWidth(const EncodedText* text) const
{
if(_init && _created)
return _font->Advance(text);
return _font->Advance(text->getUnicodeText());
else
return -1;
}
@@ -236,7 +237,6 @@ getAscender() const
return -1;
}
// Font
///////////////////////////////////////////////////////////////////////////////