Discussion:
[osg-users] osgshxtext
c***@sina.com
2018-10-08 03:14:59 UTC
Permalink
Hi OSG developers,
OSG is a great library, and I really like it.I have written a osg Node class which support display text in AutoCAD shape file.The source code is attached.I hope some developer can merge it into OSG after extending it to other platform than Windows.class ShxText's usage is like this:
osg::Geode* geode = new osg::Geode();
ShxText* pText = new ShxText(); pText->setCharacterSize(10); pText->SetText(L"Hello, Öйú"); pText->SetFontFile("txt.shx", "THFont.SHX");//THFont.shx pText->SetColor(osg::Vec3f(i / 100.f, j / 100.f, 1.f)); pText->build();
//auto pText = new osgText::Text; //pText->setText(L"Hello, Öйú"); //pText->setCharacterSize(10); //pText->setFont(font);
geode->addDrawable(pText);
Thanks,Deping Chen
Robert Osfield
2018-10-08 07:50:54 UTC
Permalink
HI Deping,

This seems like quite a niche feature so not appropriate for the core
OpenSceneGraph. I would recommend create a small project for it on
github then others can pull it down and help develop it further

Cheers,
Robert.
Post by c***@sina.com
Hi OSG developers,
OSG is a great library, and I really like it.
I have written a osg Node class which support display text in AutoCAD shape file.
The source code is attached.
I hope some developer can merge it into OSG after extending it to other platform than Windows.
osg::Geode* geode = new osg::Geode();
ShxText* pText = new ShxText();
pText->setCharacterSize(10);
pText->SetText(L"Hello, 中国");
pText->SetFontFile("txt.shx", "THFont.SHX");//THFont.shx
pText->SetColor(osg::Vec3f(i / 100.f, j / 100.f, 1.f));
pText->build();
//auto pText = new osgText::Text;
//pText->setText(L"Hello, 中国");
//pText->setCharacterSize(10);
//pText->setFont(font);
geode->addDrawable(pText);
Thanks,
Deping Chen
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Loading...