Hi Robert,

The freetype plugin currently forces the use of the first font within a 
truetype collection (.ttc index 0). I made a slight modification such that 
users can specify any font index via the userOptions input to 
osgText::readFontFile(). Specifically, the freetype plugin now accepts a new 
string option of the format "index=< unsigned int >". Example usage:


Code:
// Chooses the second font within the Menlo font collection
osg::ref_ptr<osgDB::Options> fontOptions = new osgDB::Options;
fontOptions->setObjectCacheHint(osgDB::Options::CACHE_OBJECTS);
fontOptions->setOptionString("index=1");
text->setFont(osgText::readFontFile("Menlo.ttc", fontOptions));




The updated freetype/ReaderWriterFreeType.cpp file is attached to this forum 
post. I hope it is helpful to others, and let me know if I should modify it in 
any way.

Ravi

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



Attachment: ReaderWriterFreeType.cpp
Description: Binary data

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to