0

我需要在 中显示UTF-8字符osg,但text->setText( test,osgText::String::ENCODING_UTF8 );无法显示,就像?在场景中一样。有没有人有同样的问题或知道怎么做?

代码片段

osg::ref_ptr<osg::Geode> geode = new osg::Geode;
{
    osg::ref_ptr<osgText::Text> text = new osgText::Text; 
    text->setFont( "CAMBRIA.TTC" );
    //text->setFont( font.get() );
    text->setColor( white );
    text->setCharacterSize( characterSize );
    text->setPosition( OsgFunc::arrowArcTextPosition( centerPoint, centerPoint + osg::Vec3( -30, 0, 0 ), centerPoint + v ) + osg::Vec3d( 0, -5, 1 ) );
    text->setAxisAlignment( osgText::Text::SCREEN );
    text->setText( "\u03b2",osgText::String::ENCODING_UTF8 );
    geode->addDrawable( text.get() );
}
4

0 回答 0