Added command line support for specifying "default" for osgText::DefaultFont

This commit is contained in:
Robert Osfield 2017-09-29 10:20:59 +01:00
parent 726bb13e9a
commit 468d6d8eea

View File

@ -152,7 +152,11 @@ struct TextSettings
{ {
OSG_NOTICE<<"Settings::setText()"<<std::endl; OSG_NOTICE<<"Settings::setText()"<<std::endl;
osg::ref_ptr<osgText::Font> font = osgText::readRefFontFile(fontFilename); osg::ref_ptr<osgText::Font> font;
if (fontFilename!="default") font = osgText::readRefFontFile(fontFilename);
if (!font) font = osgText::Font::getDefaultFont();
font->setGlyphImageMargin(glyphImageMargin); font->setGlyphImageMargin(glyphImageMargin);
font->setGlyphImageMarginRatio(glyphImageMarginRatio); font->setGlyphImageMarginRatio(glyphImageMarginRatio);