[osg-users] Fonts again: ugly default font

Michele Bosi michele.bosi at gmail.com
Mon Jan 7 06:13:57 PST 2008


As you might have guessed m lately very much involved in font
rendering with OSG...
As you can se from the small image attached I get quite ugly font
rendering using the default font.
The font you see drawn comes from a very simple piece of code, that is:

  osgText::Text* text = new osgText::Text;
  text->setText("Ciao");
  text->setAlignment(osgText::Text::CENTER_BASE_LINE);
  text->setColor(osg::Vec4(1,1,1,1));
  text->setCharacterSize( 20 );
  text->setPosition( ... );
  text->setAutoRotateToScreen(true);
  text->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);

Is there something wrong with the code I produced or are there hidden
options to make the text look nicer?

Playing around with the texture font it looks like the text is
rendered using texture mapping but without bilinear filtering, that
is, font rendering seems to use "nearest point" sampled texture mapped
quads, but it's just a guess.

Thanks,
Michele
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ugly-fonts.PNG
Type: image/png
Size: 17399 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080107/16942040/attachment-0001.png 


More information about the osg-users mailing list