[osg-users] TextBase::setCharacterSize

Sergey Vla vlaserg at mail.ru
Mon Oct 29 12:08:28 PDT 2018


Hi,

My code:
  osg::ref_ptr<osgText::Font> font_ = new osgText::Font( new osgQt::QFontImplementation(QFont("Arial", 14) );
  osgText::Text* text = new osgText::Text;
  text->setAxisAlignment(osgText::Text::SCREEN);
  text->setAlignment(osgText::Text::CENTER_CENTER);
  text->setColor(color);
  text->setFont( font_ );
  float h = ???;
  text->setCharacterSize( h );

My question. 
What value should be assigned to "h", so that the image text in size would correspond to the parameters QFont ("Arial", 14) and display it using QPainter on the screen for a given dpiY?

Thank you!

Cheers,
Sergey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75148#75148







More information about the osg-users mailing list