From Tree, added support for using wchar_t strings with osg::Text/EncodedText.

This commit is contained in:
Robert Osfield
2003-02-10 15:01:27 +00:00
parent ebb31fb339
commit 1b08b02df2
4 changed files with 43 additions and 4 deletions

View File

@@ -33,10 +33,10 @@
#define OSGTEXT_ENCODEDTEXT 1
#include <osg/Referenced>
#include <osgText/Export>
#include <vector>
#include <osgText/Export>
#include <string>
namespace osgText {
@@ -67,13 +67,16 @@ class OSGTEXT_EXPORT EncodedText : public osg::Referenced
Encoding getOverrideEncoding() const { return _overrideEncoding; }
Encoding getEncoding() const { return _encoding; }
void setText(const unsigned char* text, int length = -1);
std::vector<int>::const_iterator begin() const { return _unicodeText.begin(); }
std::vector<int>::const_iterator end() const { return _unicodeText.end(); }
protected:
friend class Text;
std::string convertWideString(const char* text);
std::string convertWideString(const wchar_t* text);
void setText(const unsigned char* text, int length = -1);
int getNextCharacter(const unsigned char*& charString) const;
/// This method will extract any ZWNBSP signature at the start of the string

View File

@@ -123,6 +123,7 @@ class OSGTEXT_EXPORT Text : public osg::Drawable
void setText(const char* text);
void setText(const std::string& text);
const std::string& getText() const { return _text; }
void setText(const wchar_t* text);
virtual bool supports(PrimitiveFunctor& pf) const;
virtual void accept(PrimitiveFunctor& pf) const;